DatabaseProcess: Pipe through object store IDs and transaction mode for "openTransaction"
authorbeidson@apple.com <beidson@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 18 Dec 2013 00:12:50 +0000 (00:12 +0000)
committerbeidson@apple.com <beidson@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 18 Dec 2013 00:12:50 +0000 (00:12 +0000)
commiteeff1ef441aff4db4ff902713cc5d6ee1781e2b4
tree3aaae0e8fa89c110144bdca9b287198b1644a473
parentf6bcec6cff468657dccff1021e0174fb42a42da5
DatabaseProcess: Pipe through object store IDs and transaction mode for "openTransaction"
https://bugs.webkit.org/show_bug.cgi?id=125872

Reviewed by Alexey Proskuryakov.

Source/WebCore:

Make these enums into enum classes.
Add const maximums for each enum class that might be serialized to allow for conversion later:
* Modules/indexeddb/IndexedDB.h:

Add cross-thread copying for these new enum classes.
* platform/CrossThreadCopier.cpp:
(WebCore::::copy):
* platform/CrossThreadCopier.h:

Adopt the new enum classes throughout the rest of WebCore:
* Modules/indexeddb/IDBCursor.cpp:
(WebCore::IDBCursor::continueFunction):
(WebCore::IDBCursor::stringToDirection):
(WebCore::IDBCursor::directionToString):
* Modules/indexeddb/IDBCursor.h:
* Modules/indexeddb/IDBCursorBackend.cpp:
(WebCore::IDBCursorBackend::deleteFunction):
* Modules/indexeddb/IDBCursorBackend.h:
(WebCore::IDBCursorBackend::value):
* Modules/indexeddb/IDBDatabaseBackend.cpp:
(WebCore::IDBDatabaseBackend::createObjectStore):
(WebCore::IDBDatabaseBackend::deleteObjectStore):
(WebCore::IDBDatabaseBackend::createIndex):
(WebCore::IDBDatabaseBackend::deleteIndex):
(WebCore::IDBDatabaseBackend::get):
(WebCore::IDBDatabaseBackend::put):
(WebCore::IDBDatabaseBackend::setIndexKeys):
(WebCore::IDBDatabaseBackend::openCursor):
(WebCore::IDBDatabaseBackend::deleteRange):
(WebCore::IDBDatabaseBackend::clearObjectStore):
(WebCore::IDBDatabaseBackend::transactionStarted):
(WebCore::IDBDatabaseBackend::transactionFinished):
(WebCore::IDBDatabaseBackend::transactionFinishedAndAbortFired):
(WebCore::IDBDatabaseBackend::transactionFinishedAndCompleteFired):
(WebCore::IDBDatabaseBackend::createTransaction):
(WebCore::IDBDatabaseBackend::runIntVersionChangeTransaction):
(WebCore::IDBDatabaseBackend::deleteDatabase):
* Modules/indexeddb/IDBDatabaseBackend.h:
* Modules/indexeddb/IDBFactory.cpp:
(WebCore::IDBFactory::open):
(WebCore::IDBFactory::openInternal):
(WebCore::IDBFactory::deleteDatabase):
* Modules/indexeddb/IDBIndex.cpp:
(WebCore::IDBIndex::openCursor):
(WebCore::IDBIndex::openKeyCursor):
* Modules/indexeddb/IDBObjectStore.cpp:
(WebCore::IDBObjectStore::openCursor):
* Modules/indexeddb/IDBOpenDBRequest.cpp:
(WebCore::IDBOpenDBRequest::onUpgradeNeeded):
* Modules/indexeddb/IDBRequest.cpp:
(WebCore::IDBRequest::IDBRequest):
(WebCore::IDBRequest::setResultCursor):
(WebCore::IDBRequest::onSuccess):
* Modules/indexeddb/IDBTransaction.cpp:
(WebCore::IDBTransaction::create):
(WebCore::IDBTransaction::IDBTransaction):
(WebCore::IDBTransaction::stringToMode):
(WebCore::IDBTransaction::modeToString):
* Modules/indexeddb/IDBTransaction.h:
* Modules/indexeddb/IDBTransactionBackendOperations.cpp:
(WebCore::PutOperation::perform):
* Modules/indexeddb/IDBTransactionCoordinator.cpp:
(WebCore::IDBTransactionCoordinator::processStartedTransactions):
(WebCore::IDBTransactionCoordinator::canRunTransaction):
* Modules/indexeddb/IDBVersionChangeEvent.h:
(WebCore::IDBVersionChangeEvent::create):
(WebCore::IDBVersionChangeEvent::newVersion):
* Modules/indexeddb/leveldb/IDBBackingStoreLevelDB.cpp:
(WebCore::objectStoreCursorOptions):
(WebCore::indexCursorOptions):
* Modules/indexeddb/leveldb/IDBServerConnectionLevelDB.cpp:
(WebCore::IDBServerConnectionLevelDB::get):
(WebCore::IDBServerConnectionLevelDB::openCursor):
(WebCore::IDBServerConnectionLevelDB::count):
(WebCore::IDBServerConnectionLevelDB::deleteRange):
(WebCore::IDBServerConnectionLevelDB::cursorPrefetchIteration):

* WebCore.exp.in:

Source/WebKit2:

Pipe through the objectStoreIDs and mode:
* DatabaseProcess/IndexedDB/DatabaseProcessIDBConnection.cpp:
(WebKit::DatabaseProcessIDBConnection::openTransaction):
* DatabaseProcess/IndexedDB/DatabaseProcessIDBConnection.h:
* DatabaseProcess/IndexedDB/DatabaseProcessIDBConnection.messages.in:

Rework postTransactionOperation to take a pre-made AsyncTask to allow for different
transaction operation function signatures:
* DatabaseProcess/IndexedDB/UniqueIDBDatabase.cpp:
(WebKit::UniqueIDBDatabase::openTransaction): Pipe through the objectStoreIDs and mode:
(WebKit::UniqueIDBDatabase::beginTransaction):
(WebKit::UniqueIDBDatabase::commitTransaction):
(WebKit::UniqueIDBDatabase::resetTransaction):
(WebKit::UniqueIDBDatabase::rollbackTransaction):
(WebKit::UniqueIDBDatabase::postTransactionOperation):
(WebKit::UniqueIDBDatabase::openBackingStoreTransaction):
* DatabaseProcess/IndexedDB/UniqueIDBDatabase.h:

Pipe through the objectStoreIDs and mode:
* DatabaseProcess/IndexedDB/UniqueIDBDatabaseBackingStore.h:
* DatabaseProcess/IndexedDB/sqlite/UniqueIDBDatabaseBackingStoreSQLite.cpp:
(WebKit::UniqueIDBDatabaseBackingStoreSQLite::establishTransaction):
* DatabaseProcess/IndexedDB/sqlite/UniqueIDBDatabaseBackingStoreSQLite.h:

* Platform/Logging.h: Add an IDB logging channel.

* Shared/AsyncTask.h:
(WebKit::createAsyncTask): Add a 3-argument variant.

* Shared/WebCrossThreadCopier.cpp:
(WebCore::::copy): Add a Vector<int64_t> copier.
* Shared/WebCrossThreadCopier.h:

Add logging throughout currently implemented methods:
* WebProcess/Databases/IndexedDB/WebIDBServerConnection.cpp:
(WebKit::WebIDBServerConnection::getOrEstablishIDBDatabaseMetadata):
(WebKit::WebIDBServerConnection::didGetOrEstablishIDBDatabaseMetadata):
(WebKit::WebIDBServerConnection::openTransaction): Pipe through the objectStoreIDs and mode.
(WebKit::WebIDBServerConnection::didOpenTransaction):
(WebKit::WebIDBServerConnection::beginTransaction):
(WebKit::WebIDBServerConnection::didBeginTransaction):
(WebKit::WebIDBServerConnection::commitTransaction):
(WebKit::WebIDBServerConnection::didCommitTransaction):
(WebKit::WebIDBServerConnection::resetTransaction):
(WebKit::WebIDBServerConnection::didResetTransaction):
(WebKit::WebIDBServerConnection::rollbackTransaction):
(WebKit::WebIDBServerConnection::didRollbackTransaction):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@160732 268f45cc-cd09-0410-ab3c-d52691b4dbfc
37 files changed:
Source/WebCore/ChangeLog
Source/WebCore/Modules/indexeddb/IDBCursor.cpp
Source/WebCore/Modules/indexeddb/IDBCursor.h
Source/WebCore/Modules/indexeddb/IDBCursorBackend.cpp
Source/WebCore/Modules/indexeddb/IDBCursorBackend.h
Source/WebCore/Modules/indexeddb/IDBDatabaseBackend.cpp
Source/WebCore/Modules/indexeddb/IDBDatabaseBackend.h
Source/WebCore/Modules/indexeddb/IDBFactory.cpp
Source/WebCore/Modules/indexeddb/IDBIndex.cpp
Source/WebCore/Modules/indexeddb/IDBObjectStore.cpp
Source/WebCore/Modules/indexeddb/IDBOpenDBRequest.cpp
Source/WebCore/Modules/indexeddb/IDBRequest.cpp
Source/WebCore/Modules/indexeddb/IDBTransaction.cpp
Source/WebCore/Modules/indexeddb/IDBTransaction.h
Source/WebCore/Modules/indexeddb/IDBTransactionBackendOperations.cpp
Source/WebCore/Modules/indexeddb/IDBTransactionCoordinator.cpp
Source/WebCore/Modules/indexeddb/IDBVersionChangeEvent.h
Source/WebCore/Modules/indexeddb/IndexedDB.h
Source/WebCore/Modules/indexeddb/leveldb/IDBBackingStoreLevelDB.cpp
Source/WebCore/Modules/indexeddb/leveldb/IDBServerConnectionLevelDB.cpp
Source/WebCore/WebCore.exp.in
Source/WebCore/platform/CrossThreadCopier.cpp
Source/WebCore/platform/CrossThreadCopier.h
Source/WebKit2/ChangeLog
Source/WebKit2/DatabaseProcess/IndexedDB/DatabaseProcessIDBConnection.cpp
Source/WebKit2/DatabaseProcess/IndexedDB/DatabaseProcessIDBConnection.h
Source/WebKit2/DatabaseProcess/IndexedDB/DatabaseProcessIDBConnection.messages.in
Source/WebKit2/DatabaseProcess/IndexedDB/UniqueIDBDatabase.cpp
Source/WebKit2/DatabaseProcess/IndexedDB/UniqueIDBDatabase.h
Source/WebKit2/DatabaseProcess/IndexedDB/UniqueIDBDatabaseBackingStore.h
Source/WebKit2/DatabaseProcess/IndexedDB/sqlite/UniqueIDBDatabaseBackingStoreSQLite.cpp
Source/WebKit2/DatabaseProcess/IndexedDB/sqlite/UniqueIDBDatabaseBackingStoreSQLite.h
Source/WebKit2/Platform/Logging.h
Source/WebKit2/Shared/AsyncTask.h
Source/WebKit2/Shared/WebCrossThreadCopier.cpp
Source/WebKit2/Shared/WebCrossThreadCopier.h
Source/WebKit2/WebProcess/Databases/IndexedDB/WebIDBServerConnection.cpp