Bug 150614 - Modern IDB: Support IDBDatabase.transaction() (and transaction scheduling in general)
Summary: Modern IDB: Support IDBDatabase.transaction() (and transaction scheduling in ...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore Misc. (show other bugs)
Version: Safari 9
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Brady Eidson
URL:
Keywords:
Depends on:
Blocks: 149117
  Show dependency treegraph
 
Reported: 2015-10-27 17:13 PDT by Brady Eidson
Modified: 2015-10-28 23:16 PDT (History)
4 users (show)

See Also:


Attachments
Patch v1 (88.48 KB, patch)
2015-10-28 15:21 PDT, Brady Eidson
no flags Details | Formatted Diff | Diff
Patch v2 (88.47 KB, patch)
2015-10-28 15:26 PDT, Brady Eidson
achristensen: review+
buildbot: commit-queue-
Details | Formatted Diff | Diff
Archive of layout-test-results from ews107 for mac-mavericks-wk2 (855.11 KB, application/zip)
2015-10-28 15:56 PDT, Build Bot
no flags Details
Patch v3 - Wild attempt at landable patch before I go home. (99.04 KB, patch)
2015-10-28 17:05 PDT, Brady Eidson
buildbot: commit-queue-
Details | Formatted Diff | Diff
Archive of layout-test-results from ews106 for mac-mavericks-wk2 (677.48 KB, application/zip)
2015-10-28 18:27 PDT, Build Bot
no flags Details
Patch v4 (99.05 KB, patch)
2015-10-28 19:46 PDT, Brady Eidson
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Brady Eidson 2015-10-27 17:13:45 PDT
Modern IDB: Support IDBDatabase.transaction() (and transaction scheduling in general)
Comment 1 Brady Eidson 2015-10-28 15:21:04 PDT
Created attachment 264254 [details]
Patch v1
Comment 2 WebKit Commit Bot 2015-10-28 15:24:04 PDT
Attachment 264254 [details] did not pass style-queue:


ERROR: Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabase.cpp:524:  Place brace on its own line for function definitions.  [whitespace/braces] [4]
Total errors found: 1 in 40 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 3 Brady Eidson 2015-10-28 15:26:52 PDT
Created attachment 264255 [details]
Patch v2
Comment 4 WebKit Commit Bot 2015-10-28 15:29:10 PDT
Attachment 264255 [details] did not pass style-queue:


ERROR: Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabase.cpp:524:  Place brace on its own line for function definitions.  [whitespace/braces] [4]
Total errors found: 1 in 40 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 5 Build Bot 2015-10-28 15:56:25 PDT
Comment on attachment 264255 [details]
Patch v2

Attachment 264255 [details] did not pass mac-wk2-ews (mac-wk2):
Output: http://webkit-queues.webkit.org/results/350329

New failing tests:
imported/w3c/indexeddb/idbdatabase_transaction5.htm
Comment 6 Build Bot 2015-10-28 15:56:28 PDT
Created attachment 264260 [details]
Archive of layout-test-results from ews107 for mac-mavericks-wk2

The attached test failures were seen while running run-webkit-tests on the mac-wk2-ews.
Bot: ews107  Port: mac-mavericks-wk2  Platform: Mac OS X 10.9.5
Comment 7 Alex Christensen 2015-10-28 16:32:13 PDT
Comment on attachment 264255 [details]
Patch v2

View in context: https://bugs.webkit.org/attachment.cgi?id=264255&action=review

Add a test that makes a spinning read-only transaction, another read-only transaction that stops the first one from spinning once it is finished, then a third read-write transaction that has to wait for both transactions to complete before starting.

r=me once these tests are added.

> Source/WebCore/Modules/indexeddb/client/IDBDatabaseImpl.cpp:137
> +    if (m_closePending) {

Test this.

> Source/WebCore/Modules/indexeddb/client/IDBDatabaseImpl.cpp:142
> +    if (objectStores.isEmpty()) {

test this.

> Source/WebCore/Modules/indexeddb/client/IDBDatabaseImpl.cpp:148
> +    IndexedDB::TransactionMode mode = IDBTransaction::stringToMode(modeString, ec);
> +    if (ec)

test this.

> Source/WebCore/Modules/indexeddb/client/IDBDatabaseImpl.cpp:151
> +    if (mode != IndexedDB::TransactionMode::ReadOnly && mode != IndexedDB::TransactionMode::ReadWrite) {

test this.

> Source/WebCore/Modules/indexeddb/client/IDBDatabaseImpl.cpp:156
> +    if (m_versionChangeTransaction) {

test this.

> Source/WebCore/Modules/indexeddb/client/IDBDatabaseImpl.cpp:164
> +    for (auto& objectStoreName : objectStores) {
> +        if (m_info.hasObjectStore(objectStoreName))
> +            continue;
> +        ec = NOT_FOUND_ERR;

test this.

> Source/WebCore/Modules/indexeddb/shared/IDBTransactionInfo.cpp:40
> +    IDBTransactionInfo result((IDBResourceIdentifier(connection)));

That's a lot of parentheses.

> Source/WebCore/Modules/indexeddb/shared/IDBTransactionInfo.cpp:49
>      IDBTransactionInfo result((IDBResourceIdentifier(connection)));

Here, too

> Source/WebCore/bindings/js/JSIDBDatabaseCustom.cpp:101
> +        scope.append(scopeArg.toString(&exec)->value(&exec));

can toString fail?
Comment 8 Brady Eidson 2015-10-28 17:05:40 PDT
Created attachment 264269 [details]
Patch v3 - Wild attempt at landable patch before I go home.
Comment 9 WebKit Commit Bot 2015-10-28 17:07:04 PDT
Attachment 264269 [details] did not pass style-queue:


ERROR: Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabase.cpp:524:  Place brace on its own line for function definitions.  [whitespace/braces] [4]
Total errors found: 1 in 46 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 10 Build Bot 2015-10-28 18:27:46 PDT
Comment on attachment 264269 [details]
Patch v3 - Wild attempt at landable patch before I go home.

Attachment 264269 [details] did not pass mac-wk2-ews (mac-wk2):
Output: http://webkit-queues.webkit.org/results/350925

New failing tests:
imported/w3c/indexeddb/idbdatabase_transaction5.htm
Comment 11 Build Bot 2015-10-28 18:27:48 PDT
Created attachment 264282 [details]
Archive of layout-test-results from ews106 for mac-mavericks-wk2

The attached test failures were seen while running run-webkit-tests on the mac-wk2-ews.
Bot: ews106  Port: mac-mavericks-wk2  Platform: Mac OS X 10.9.5
Comment 12 Brady Eidson 2015-10-28 19:46:02 PDT
Created attachment 264291 [details]
Patch v4
Comment 13 WebKit Commit Bot 2015-10-28 19:48:05 PDT
Attachment 264291 [details] did not pass style-queue:


ERROR: Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabase.cpp:524:  Place brace on its own line for function definitions.  [whitespace/braces] [4]
Total errors found: 1 in 46 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 14 WebKit Commit Bot 2015-10-28 23:16:50 PDT
Comment on attachment 264291 [details]
Patch v4

Clearing flags on attachment: 264291

Committed r191722: <http://trac.webkit.org/changeset/191722>
Comment 15 WebKit Commit Bot 2015-10-28 23:16:54 PDT
All reviewed patches have been landed.  Closing bug.