IndexedDB: One transaction coordinator per database
authorjsbell@chromium.org <jsbell@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 25 Sep 2012 18:51:33 +0000 (18:51 +0000)
committerjsbell@chromium.org <jsbell@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 25 Sep 2012 18:51:33 +0000 (18:51 +0000)
commitc5c3019857dc3a9de99d7cdb04476d5d9acf976b
tree02e5dc9171c34fad45796062c167031b1aab77d5
parentab952f765f5aa756cbb080c14e9e708c57c81ca6
IndexedDB: One transaction coordinator per database
https://bugs.webkit.org/show_bug.cgi?id=97501

Reviewed by Tony Chang.

Source/WebCore:

Per the IDB spec, transactions only need to be sequenced within databases.
The implementation was using one coordinator per factory backend (effectively
a singleton), which would prevent parallel execution of transactions in different
databases. Moved ownership of the transaction coordinator to the database backend.

Tests: storage/indexeddb/transaction-coordination-across-databases.html
       storage/indexeddb/transaction-readwrite-exclusive.html

* Modules/indexeddb/IDBDatabaseBackendImpl.cpp:
(WebCore::IDBDatabaseBackendImpl::create):
(WebCore):
(WebCore::IDBDatabaseBackendImpl::IDBDatabaseBackendImpl):
* Modules/indexeddb/IDBDatabaseBackendImpl.h:
(IDBDatabaseBackendImpl):
* Modules/indexeddb/IDBFactoryBackendImpl.cpp:
(WebCore::IDBFactoryBackendImpl::deleteDatabase):
(WebCore::IDBFactoryBackendImpl::open):
* Modules/indexeddb/IDBFactoryBackendImpl.h:
(WebCore):
(IDBFactoryBackendImpl):
* Modules/indexeddb/IDBTransactionCoordinator.cpp:
(WebCore::IDBTransactionCoordinator::create):
(WebCore::IDBTransactionCoordinator::IDBTransactionCoordinator):
* Modules/indexeddb/IDBTransactionCoordinator.h:
(IDBTransactionCoordinator):

Source/WebKit/chromium:

Remove obsolete argument.

* tests/IDBDatabaseBackendTest.h:

LayoutTests:

Test that transactions can be parallelized across databases, and ensure that
read/write transactions with overlapping scopes are not parallelized within a
database.

* storage/indexeddb/resources/transaction-coordination-across-databases.js: Added.
* storage/indexeddb/resources/transaction-readwrite-exclusive.js: Added.
* storage/indexeddb/transaction-coordination-across-databases-expected.txt: Added.
* storage/indexeddb/transaction-coordination-across-databases.html: Added.
* storage/indexeddb/transaction-readwrite-exclusive-expected.txt: Added.
* storage/indexeddb/transaction-readwrite-exclusive.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@129534 268f45cc-cd09-0410-ab3c-d52691b4dbfc
16 files changed:
LayoutTests/ChangeLog
LayoutTests/storage/indexeddb/resources/transaction-coordination-across-databases.js [new file with mode: 0644]
LayoutTests/storage/indexeddb/resources/transaction-readwrite-exclusive.js [new file with mode: 0644]
LayoutTests/storage/indexeddb/transaction-coordination-across-databases-expected.txt [new file with mode: 0644]
LayoutTests/storage/indexeddb/transaction-coordination-across-databases.html [new file with mode: 0644]
LayoutTests/storage/indexeddb/transaction-readwrite-exclusive-expected.txt [new file with mode: 0644]
LayoutTests/storage/indexeddb/transaction-readwrite-exclusive.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/Modules/indexeddb/IDBDatabaseBackendImpl.cpp
Source/WebCore/Modules/indexeddb/IDBDatabaseBackendImpl.h
Source/WebCore/Modules/indexeddb/IDBFactoryBackendImpl.cpp
Source/WebCore/Modules/indexeddb/IDBFactoryBackendImpl.h
Source/WebCore/Modules/indexeddb/IDBTransactionCoordinator.cpp
Source/WebCore/Modules/indexeddb/IDBTransactionCoordinator.h
Source/WebKit/chromium/ChangeLog
Source/WebKit/chromium/tests/IDBDatabaseBackendTest.cpp