Modern IDB: Support IDBDatabase.transaction() (and transaction scheduling in general).
authorbeidson@apple.com <beidson@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 29 Oct 2015 06:16:01 +0000 (06:16 +0000)
committerbeidson@apple.com <beidson@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 29 Oct 2015 06:16:01 +0000 (06:16 +0000)
commit450f09231894a8575943bb0a8d6221d20b748c52
treec565f785977d83eb697f828b4c6fc1569f009349
parent4ec88678b813051d5266952a23473365f0b7edec
Modern IDB: Support IDBDatabase.transaction() (and transaction scheduling in general).
https://bugs.webkit.org/show_bug.cgi?id=150614

Reviewed by Alex Christensen.

LayoutTests/imported/w3c:

* indexeddb/idbdatabase_transaction5-expected.txt: Progression!

Source/WebCore:

Tests: storage/indexeddb/modern/idbdatabase-transaction-failures.html
       storage/indexeddb/modern/transaction-scheduler-1.html
       storage/indexeddb/modern/transaction-scheduler-2.html
       storage/indexeddb/modern/transaction-scheduler-3.html
       storage/indexeddb/modern/transaction-scheduler-4.html
       storage/indexeddb/modern/transaction-scheduler-5.html
       storage/indexeddb/modern/transaction-scheduler-6.html

* Modules/indexeddb/IDBDatabase.idl:

* Modules/indexeddb/IndexedDB.h:

* Modules/indexeddb/client/IDBConnectionToServer.cpp:
(WebCore::IDBClient::IDBConnectionToServer::establishTransaction):
(WebCore::IDBClient::IDBConnectionToServer::didStartTransaction):
(WebCore::IDBClient::IDBConnectionToServer::hasRecordOfTransaction):
* Modules/indexeddb/client/IDBConnectionToServer.h:
* Modules/indexeddb/client/IDBConnectionToServerDelegate.h:

* Modules/indexeddb/client/IDBDatabaseImpl.cpp:
(WebCore::IDBClient::IDBDatabase::transaction):
(WebCore::IDBClient::IDBDatabase::didStartTransaction):
* Modules/indexeddb/client/IDBDatabaseImpl.h:

* Modules/indexeddb/client/IDBTransactionImpl.cpp:
(WebCore::IDBClient::IDBTransaction::IDBTransaction):
(WebCore::IDBClient::IDBTransaction::operationTimerFired):
(WebCore::IDBClient::IDBTransaction::didStart):
(WebCore::IDBClient::IDBTransaction::establishOnServer):
(WebCore::IDBClient::IDBTransaction::activate):
(WebCore::IDBClient::IDBTransaction::deactivate):
* Modules/indexeddb/client/IDBTransactionImpl.h:

* Modules/indexeddb/server/IDBConnectionToClient.cpp:
(WebCore::IDBServer::IDBConnectionToClient::didStartTransaction):
* Modules/indexeddb/server/IDBConnectionToClient.h:
* Modules/indexeddb/server/IDBConnectionToClientDelegate.h:

* Modules/indexeddb/server/IDBServer.cpp:
(WebCore::IDBServer::IDBServer::establishTransaction):
* Modules/indexeddb/server/IDBServer.h:

* Modules/indexeddb/server/MemoryIDBBackingStore.cpp:
(WebCore::IDBServer::MemoryIDBBackingStore::beginTransaction):
(WebCore::IDBServer::MemoryIDBBackingStore::createObjectStore):
(WebCore::IDBServer::MemoryIDBBackingStore::removeObjectStoreForVersionChangeAbort):
(WebCore::IDBServer::MemoryIDBBackingStore::keyExistsInObjectStore):
(WebCore::IDBServer::MemoryIDBBackingStore::deleteRecord):
(WebCore::IDBServer::MemoryIDBBackingStore::putRecord):
(WebCore::IDBServer::MemoryIDBBackingStore::getRecord):
(WebCore::IDBServer::MemoryIDBBackingStore::registerObjectStore):
(WebCore::IDBServer::MemoryIDBBackingStore::unregisterObjectStore):
* Modules/indexeddb/server/MemoryIDBBackingStore.h:

* Modules/indexeddb/server/UniqueIDBDatabase.cpp:
(WebCore::IDBServer::UniqueIDBDatabase::startVersionChangeTransaction):
(WebCore::IDBServer::UniqueIDBDatabase::performCommitTransaction):
(WebCore::IDBServer::UniqueIDBDatabase::didPerformCommitTransaction):
(WebCore::IDBServer::UniqueIDBDatabase::didPerformAbortTransaction):
(WebCore::IDBServer::UniqueIDBDatabase::enqueueTransaction):
(WebCore::IDBServer::UniqueIDBDatabase::transactionSchedulingTimerFired):
(WebCore::IDBServer::UniqueIDBDatabase::activateTransactionInBackingStore):
(WebCore::IDBServer::UniqueIDBDatabase::performActivateTransactionInBackingStore):
(WebCore::IDBServer::UniqueIDBDatabase::didPerformActivateTransactionInBackingStore):
(WebCore::IDBServer::scopesOverlap):
(WebCore::IDBServer::UniqueIDBDatabase::takeNextRunnableTransaction):
(WebCore::IDBServer::UniqueIDBDatabase::inProgressTransactionCompleted):
* Modules/indexeddb/server/UniqueIDBDatabase.h:

* Modules/indexeddb/server/UniqueIDBDatabaseConnection.cpp:
(WebCore::IDBServer::UniqueIDBDatabaseConnection::establishTransaction):
* Modules/indexeddb/server/UniqueIDBDatabaseConnection.h:

* Modules/indexeddb/server/UniqueIDBDatabaseTransaction.cpp:
(WebCore::IDBServer::UniqueIDBDatabaseTransaction::create):
(WebCore::IDBServer::UniqueIDBDatabaseTransaction::UniqueIDBDatabaseTransaction):
(WebCore::IDBServer::UniqueIDBDatabaseTransaction::objectStoreIdentifiers):
(WebCore::IDBServer::UniqueIDBDatabaseTransaction::didActivateInBackingStore):
* Modules/indexeddb/server/UniqueIDBDatabaseTransaction.h:

* Modules/indexeddb/shared/IDBTransactionInfo.cpp:
(WebCore::IDBTransactionInfo::clientTransaction):
(WebCore::IDBTransactionInfo::isolatedCopy):
* Modules/indexeddb/shared/IDBTransactionInfo.h:

* Modules/indexeddb/shared/InProcessIDBServer.cpp:
(WebCore::InProcessIDBServer::establishTransaction):
(WebCore::InProcessIDBServer::didStartTransaction):
* Modules/indexeddb/shared/InProcessIDBServer.h:

* bindings/js/IDBBindingUtilities.cpp:
(WebCore::deserializeIDBValueData):

* bindings/js/JSIDBDatabaseCustom.cpp:
(WebCore::JSIDBDatabase::transaction):

* bindings/js/ScriptState.cpp:
(WebCore::execStateFromPage):

LayoutTests:

* storage/indexeddb/modern/idbdatabase-transaction-failures-expected.txt: Added.
* storage/indexeddb/modern/idbdatabase-transaction-failures.html: Added.
* storage/indexeddb/modern/transaction-scheduler-1-expected.txt: Added.
* storage/indexeddb/modern/transaction-scheduler-1.html: Added.
* storage/indexeddb/modern/transaction-scheduler-2-expected.txt: Added.
* storage/indexeddb/modern/transaction-scheduler-2.html: Added.
* storage/indexeddb/modern/transaction-scheduler-3-expected.txt: Added.
* storage/indexeddb/modern/transaction-scheduler-3.html: Added.
* storage/indexeddb/modern/transaction-scheduler-4-expected.txt: Added.
* storage/indexeddb/modern/transaction-scheduler-4.html: Added.
* storage/indexeddb/modern/transaction-scheduler-5-expected.txt: Added.
* storage/indexeddb/modern/transaction-scheduler-5.html: Added.
* storage/indexeddb/modern/transaction-scheduler-6-expected.txt: Added.
* storage/indexeddb/modern/transaction-scheduler-6.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@191722 268f45cc-cd09-0410-ab3c-d52691b4dbfc
47 files changed:
LayoutTests/ChangeLog
LayoutTests/imported/w3c/ChangeLog
LayoutTests/imported/w3c/indexeddb/idbdatabase_transaction5-expected.txt
LayoutTests/storage/indexeddb/modern/idbdatabase-transaction-failures-expected.txt [new file with mode: 0644]
LayoutTests/storage/indexeddb/modern/idbdatabase-transaction-failures.html [new file with mode: 0644]
LayoutTests/storage/indexeddb/modern/transaction-scheduler-1-expected.txt [new file with mode: 0644]
LayoutTests/storage/indexeddb/modern/transaction-scheduler-1.html [new file with mode: 0644]
LayoutTests/storage/indexeddb/modern/transaction-scheduler-2-expected.txt [new file with mode: 0644]
LayoutTests/storage/indexeddb/modern/transaction-scheduler-2.html [new file with mode: 0644]
LayoutTests/storage/indexeddb/modern/transaction-scheduler-3-expected.txt [new file with mode: 0644]
LayoutTests/storage/indexeddb/modern/transaction-scheduler-3.html [new file with mode: 0644]
LayoutTests/storage/indexeddb/modern/transaction-scheduler-4-expected.txt [new file with mode: 0644]
LayoutTests/storage/indexeddb/modern/transaction-scheduler-4.html [new file with mode: 0644]
LayoutTests/storage/indexeddb/modern/transaction-scheduler-5-expected.txt [new file with mode: 0644]
LayoutTests/storage/indexeddb/modern/transaction-scheduler-5.html [new file with mode: 0644]
LayoutTests/storage/indexeddb/modern/transaction-scheduler-6-expected.txt [new file with mode: 0644]
LayoutTests/storage/indexeddb/modern/transaction-scheduler-6.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/Modules/indexeddb/IDBDatabase.idl
Source/WebCore/Modules/indexeddb/IndexedDB.h
Source/WebCore/Modules/indexeddb/client/IDBConnectionToServer.cpp
Source/WebCore/Modules/indexeddb/client/IDBConnectionToServer.h
Source/WebCore/Modules/indexeddb/client/IDBConnectionToServerDelegate.h
Source/WebCore/Modules/indexeddb/client/IDBDatabaseImpl.cpp
Source/WebCore/Modules/indexeddb/client/IDBDatabaseImpl.h
Source/WebCore/Modules/indexeddb/client/IDBTransactionImpl.cpp
Source/WebCore/Modules/indexeddb/client/IDBTransactionImpl.h
Source/WebCore/Modules/indexeddb/server/IDBConnectionToClient.cpp
Source/WebCore/Modules/indexeddb/server/IDBConnectionToClient.h
Source/WebCore/Modules/indexeddb/server/IDBConnectionToClientDelegate.h
Source/WebCore/Modules/indexeddb/server/IDBServer.cpp
Source/WebCore/Modules/indexeddb/server/IDBServer.h
Source/WebCore/Modules/indexeddb/server/MemoryIDBBackingStore.cpp
Source/WebCore/Modules/indexeddb/server/MemoryIDBBackingStore.h
Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabase.cpp
Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabase.h
Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabaseConnection.cpp
Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabaseConnection.h
Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabaseTransaction.cpp
Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabaseTransaction.h
Source/WebCore/Modules/indexeddb/shared/IDBTransactionInfo.cpp
Source/WebCore/Modules/indexeddb/shared/IDBTransactionInfo.h
Source/WebCore/Modules/indexeddb/shared/InProcessIDBServer.cpp
Source/WebCore/Modules/indexeddb/shared/InProcessIDBServer.h
Source/WebCore/bindings/js/IDBBindingUtilities.cpp
Source/WebCore/bindings/js/JSIDBDatabaseCustom.cpp
Source/WebCore/bindings/js/ScriptState.cpp