Remove LegacyIDB.
authorbeidson@apple.com <beidson@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 25 Feb 2016 22:19:06 +0000 (22:19 +0000)
committerbeidson@apple.com <beidson@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 25 Feb 2016 22:19:06 +0000 (22:19 +0000)
https://bugs.webkit.org/show_bug.cgi?id=150854

Reviewed by Alex Christensen.

Source/WebCore:

No new tests (No change in behavior).

* CMakeLists.txt:
* Modules/indexeddb/DOMWindowIndexedDatabase.cpp:
(WebCore::DOMWindowIndexedDatabase::indexedDB):
* Modules/indexeddb/IDBDatabaseMetadata.cpp: Removed.
* Modules/indexeddb/IDBDatabaseMetadata.h: Removed.
* Modules/indexeddb/IDBFactory.h:
* Modules/indexeddb/IDBIndex.h:
* Modules/indexeddb/IDBIndexMetadata.h: Removed.
* Modules/indexeddb/IDBObjectStoreMetadata.h: Removed.
* Modules/indexeddb/IDBOperation.h: Removed.
* Modules/indexeddb/IDBServerConnection.h: Removed.
* Modules/indexeddb/IDBTransaction.h:
* Modules/indexeddb/WorkerGlobalScopeIndexedDatabase.cpp:
(WebCore::WorkerGlobalScopeIndexedDatabase::indexedDB):
* Modules/indexeddb/WorkerGlobalScopeIndexedDatabase.h:
* Modules/indexeddb/legacy/IDBCallbacks.h: Removed.
* Modules/indexeddb/legacy/IDBCursorBackend.cpp: Removed.
* Modules/indexeddb/legacy/IDBCursorBackend.h: Removed.
* Modules/indexeddb/legacy/IDBCursorBackendOperations.cpp: Removed.
* Modules/indexeddb/legacy/IDBCursorBackendOperations.h: Removed.
* Modules/indexeddb/legacy/IDBDatabaseBackend.cpp: Removed.
* Modules/indexeddb/legacy/IDBDatabaseBackend.h: Removed.
* Modules/indexeddb/legacy/IDBDatabaseCallbacks.h: Removed.
* Modules/indexeddb/legacy/IDBDatabaseCallbacksImpl.cpp: Removed.
* Modules/indexeddb/legacy/IDBDatabaseCallbacksImpl.h: Removed.
* Modules/indexeddb/legacy/IDBFactoryBackendInterface.h: Removed.
* Modules/indexeddb/legacy/IDBPendingDeleteCall.h: Removed.
* Modules/indexeddb/legacy/IDBPendingOpenCall.h: Removed.
* Modules/indexeddb/legacy/IDBPendingTransactionMonitor.cpp: Removed.
* Modules/indexeddb/legacy/IDBPendingTransactionMonitor.h: Removed.
* Modules/indexeddb/legacy/IDBTransactionBackend.cpp: Removed.
* Modules/indexeddb/legacy/IDBTransactionBackend.h: Removed.
* Modules/indexeddb/legacy/IDBTransactionBackendOperations.cpp: Removed.
* Modules/indexeddb/legacy/IDBTransactionBackendOperations.h: Removed.
* Modules/indexeddb/legacy/IDBTransactionCoordinator.cpp: Removed.
* Modules/indexeddb/legacy/IDBTransactionCoordinator.h: Removed.
* Modules/indexeddb/legacy/LegacyAny.cpp: Removed.
* Modules/indexeddb/legacy/LegacyAny.h: Removed.
* Modules/indexeddb/legacy/LegacyCursor.cpp: Removed.
* Modules/indexeddb/legacy/LegacyCursor.h: Removed.
* Modules/indexeddb/legacy/LegacyCursorWithValue.cpp: Removed.
* Modules/indexeddb/legacy/LegacyCursorWithValue.h: Removed.
* Modules/indexeddb/legacy/LegacyDatabase.cpp: Removed.
* Modules/indexeddb/legacy/LegacyDatabase.h: Removed.
* Modules/indexeddb/legacy/LegacyFactory.cpp: Removed.
* Modules/indexeddb/legacy/LegacyFactory.h: Removed.
* Modules/indexeddb/legacy/LegacyIndex.cpp: Removed.
* Modules/indexeddb/legacy/LegacyIndex.h: Removed.
* Modules/indexeddb/legacy/LegacyObjectStore.cpp: Removed.
* Modules/indexeddb/legacy/LegacyObjectStore.h: Removed.
* Modules/indexeddb/legacy/LegacyOpenDBRequest.cpp: Removed.
* Modules/indexeddb/legacy/LegacyOpenDBRequest.h: Removed.
* Modules/indexeddb/legacy/LegacyRequest.cpp: Removed.
* Modules/indexeddb/legacy/LegacyRequest.h: Removed.
* Modules/indexeddb/legacy/LegacyTransaction.cpp: Removed.
* Modules/indexeddb/legacy/LegacyTransaction.h: Removed.
* Modules/indexeddb/legacy/LegacyVersionChangeEvent.cpp: Removed.
* Modules/indexeddb/legacy/LegacyVersionChangeEvent.h: Removed.
* Modules/indexeddb/server/SQLiteIDBCursor.cpp:
(WebCore::IDBServer::SQLiteIDBCursor::SQLiteIDBCursor):
(WebCore::IDBServer::SQLiteIDBCursor::establishStatement):
(WebCore::IDBServer::SQLiteIDBCursor::internalAdvanceOnce):
* Modules/indexeddb/server/SQLiteIDBCursor.h:
* Modules/indexeddb/shared/IDBIndexInfo.h:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/IDBBindingUtilities.cpp:
(WebCore::generateIndexKeysForValue): Deleted.
* bindings/js/IDBBindingUtilities.h:
* bindings/js/JSMainThreadExecState.cpp:
(WebCore::JSMainThreadExecState::didLeaveScriptContext): Deleted.
* inspector/InspectorIndexedDBAgent.cpp:
* loader/EmptyClients.cpp:
* page/DatabaseProvider.cpp:
(WebCore::DatabaseProvider::idbFactoryBackend): Deleted.
* page/DatabaseProvider.h:
* platform/CrossThreadCopier.cpp:
(WebCore::IDBDatabaseMetadata>::copy): Deleted.
(WebCore::IDBIndexMetadata>::copy): Deleted.
(WebCore::IDBObjectStoreMetadata>::copy): Deleted.
* platform/CrossThreadCopier.h:

Source/WebKit:

* Storage/WebDatabaseProvider.cpp:
(WebDatabaseProvider::createIDBFactoryBackend): Deleted.
* Storage/WebDatabaseProvider.h:

Source/WebKit2:

* CMakeLists.txt:
* DatabaseProcess/DatabaseProcess.cpp:
(WebKit::DatabaseProcess::getOrCreateLegacyUniqueIDBDatabase): Deleted.
(WebKit::DatabaseProcess::removeLegacyUniqueIDBDatabase): Deleted.
* DatabaseProcess/DatabaseProcess.h:
* DatabaseProcess/DatabaseToWebProcessConnection.cpp:
(WebKit::DatabaseToWebProcessConnection::didClose):
(WebKit::DatabaseToWebProcessConnection::didReceiveMessage): Deleted.
(WebKit::DatabaseToWebProcessConnection::didReceiveSyncMessage): Deleted.
(WebKit::DatabaseToWebProcessConnection::establishIDBConnection): Deleted.
(WebKit::DatabaseToWebProcessConnection::removeDatabaseProcessIDBConnection): Deleted.
* DatabaseProcess/DatabaseToWebProcessConnection.h:
* DatabaseProcess/DatabaseToWebProcessConnection.messages.in:
* DatabaseProcess/IndexedDB/DatabaseProcessIDBConnection.cpp: Removed.
* DatabaseProcess/IndexedDB/DatabaseProcessIDBConnection.h: Removed.
* DatabaseProcess/IndexedDB/DatabaseProcessIDBConnection.messages.in: Removed.
* DatabaseProcess/IndexedDB/IDBIdentifier.h: Removed.
* DatabaseProcess/IndexedDB/IDBSerialization.cpp: Removed.
* DatabaseProcess/IndexedDB/IDBSerialization.h: Removed.
* DatabaseProcess/IndexedDB/LegacyUniqueIDBDatabase.cpp: Removed.
* DatabaseProcess/IndexedDB/LegacyUniqueIDBDatabase.h: Removed.
* DatabaseProcess/IndexedDB/LegacyUniqueIDBDatabaseIdentifier.cpp: Removed.
* DatabaseProcess/IndexedDB/LegacyUniqueIDBDatabaseIdentifier.h: Removed.
* DatabaseProcess/IndexedDB/UniqueIDBDatabaseBackingStore.h: Removed.
* DatabaseProcess/IndexedDB/WebIDBConnectionToClient.h:
* DatabaseProcess/IndexedDB/sqlite/SQLiteIDBCursor.cpp: Removed.
* DatabaseProcess/IndexedDB/sqlite/SQLiteIDBCursor.h: Removed.
* DatabaseProcess/IndexedDB/sqlite/SQLiteIDBTransaction.cpp: Removed.
* DatabaseProcess/IndexedDB/sqlite/SQLiteIDBTransaction.h: Removed.
* DatabaseProcess/IndexedDB/sqlite/UniqueIDBDatabaseBackingStoreSQLite.cpp: Removed.
* DatabaseProcess/IndexedDB/sqlite/UniqueIDBDatabaseBackingStoreSQLite.h: Removed.
* DerivedSources.make:
* Shared/WebCrossThreadCopier.cpp:
(WebCore::LegacyUniqueIDBDatabaseIdentifier>::copy): Deleted.
(WebCore::IDBIdentifier>::copy): Deleted.
* Shared/WebCrossThreadCopier.h:
* WebKit2.xcodeproj/project.pbxproj:
* WebProcess/Databases/IndexedDB/WebIDBFactoryBackend.cpp: Removed.
* WebProcess/Databases/IndexedDB/WebIDBFactoryBackend.h: Removed.
* WebProcess/Databases/IndexedDB/WebIDBServerConnection.cpp: Removed.
* WebProcess/Databases/IndexedDB/WebIDBServerConnection.h: Removed.
* WebProcess/Databases/IndexedDB/WebIDBServerConnection.messages.in: Removed.
* WebProcess/Databases/WebDatabaseProvider.cpp:
(WebKit::WebDatabaseProvider::createIDBFactoryBackend): Deleted.
* WebProcess/Databases/WebDatabaseProvider.h:
* WebProcess/Databases/WebToDatabaseProcessConnection.cpp:
(WebKit::WebToDatabaseProcessConnection::didReceiveMessage): Deleted.
(WebKit::WebToDatabaseProcessConnection::registerWebIDBServerConnection): Deleted.
(WebKit::WebToDatabaseProcessConnection::removeWebIDBServerConnection): Deleted.
* WebProcess/Databases/WebToDatabaseProcessConnection.h:
* WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@197131 268f45cc-cd09-0410-ab3c-d52691b4dbfc

112 files changed:
Source/WebCore/CMakeLists.txt
Source/WebCore/ChangeLog
Source/WebCore/Modules/indexeddb/DOMWindowIndexedDatabase.cpp
Source/WebCore/Modules/indexeddb/IDBDatabaseMetadata.cpp [deleted file]
Source/WebCore/Modules/indexeddb/IDBDatabaseMetadata.h [deleted file]
Source/WebCore/Modules/indexeddb/IDBFactory.h
Source/WebCore/Modules/indexeddb/IDBIndex.h
Source/WebCore/Modules/indexeddb/IDBIndexMetadata.h [deleted file]
Source/WebCore/Modules/indexeddb/IDBObjectStoreMetadata.h [deleted file]
Source/WebCore/Modules/indexeddb/IDBOperation.h [deleted file]
Source/WebCore/Modules/indexeddb/IDBServerConnection.h [deleted file]
Source/WebCore/Modules/indexeddb/IDBTransaction.h
Source/WebCore/Modules/indexeddb/WorkerGlobalScopeIndexedDatabase.cpp
Source/WebCore/Modules/indexeddb/WorkerGlobalScopeIndexedDatabase.h
Source/WebCore/Modules/indexeddb/legacy/IDBCallbacks.h [deleted file]
Source/WebCore/Modules/indexeddb/legacy/IDBCursorBackend.cpp [deleted file]
Source/WebCore/Modules/indexeddb/legacy/IDBCursorBackend.h [deleted file]
Source/WebCore/Modules/indexeddb/legacy/IDBCursorBackendOperations.cpp [deleted file]
Source/WebCore/Modules/indexeddb/legacy/IDBCursorBackendOperations.h [deleted file]
Source/WebCore/Modules/indexeddb/legacy/IDBDatabaseBackend.cpp [deleted file]
Source/WebCore/Modules/indexeddb/legacy/IDBDatabaseBackend.h [deleted file]
Source/WebCore/Modules/indexeddb/legacy/IDBDatabaseCallbacks.h [deleted file]
Source/WebCore/Modules/indexeddb/legacy/IDBDatabaseCallbacksImpl.cpp [deleted file]
Source/WebCore/Modules/indexeddb/legacy/IDBDatabaseCallbacksImpl.h [deleted file]
Source/WebCore/Modules/indexeddb/legacy/IDBFactoryBackendInterface.h [deleted file]
Source/WebCore/Modules/indexeddb/legacy/IDBPendingDeleteCall.h [deleted file]
Source/WebCore/Modules/indexeddb/legacy/IDBPendingOpenCall.h [deleted file]
Source/WebCore/Modules/indexeddb/legacy/IDBPendingTransactionMonitor.cpp [deleted file]
Source/WebCore/Modules/indexeddb/legacy/IDBPendingTransactionMonitor.h [deleted file]
Source/WebCore/Modules/indexeddb/legacy/IDBTransactionBackend.cpp [deleted file]
Source/WebCore/Modules/indexeddb/legacy/IDBTransactionBackend.h [deleted file]
Source/WebCore/Modules/indexeddb/legacy/IDBTransactionBackendOperations.cpp [deleted file]
Source/WebCore/Modules/indexeddb/legacy/IDBTransactionBackendOperations.h [deleted file]
Source/WebCore/Modules/indexeddb/legacy/IDBTransactionCoordinator.cpp [deleted file]
Source/WebCore/Modules/indexeddb/legacy/IDBTransactionCoordinator.h [deleted file]
Source/WebCore/Modules/indexeddb/legacy/LegacyAny.cpp [deleted file]
Source/WebCore/Modules/indexeddb/legacy/LegacyAny.h [deleted file]
Source/WebCore/Modules/indexeddb/legacy/LegacyCursor.cpp [deleted file]
Source/WebCore/Modules/indexeddb/legacy/LegacyCursor.h [deleted file]
Source/WebCore/Modules/indexeddb/legacy/LegacyCursorWithValue.cpp [deleted file]
Source/WebCore/Modules/indexeddb/legacy/LegacyCursorWithValue.h [deleted file]
Source/WebCore/Modules/indexeddb/legacy/LegacyDatabase.cpp [deleted file]
Source/WebCore/Modules/indexeddb/legacy/LegacyDatabase.h [deleted file]
Source/WebCore/Modules/indexeddb/legacy/LegacyFactory.cpp [deleted file]
Source/WebCore/Modules/indexeddb/legacy/LegacyFactory.h [deleted file]
Source/WebCore/Modules/indexeddb/legacy/LegacyIndex.cpp [deleted file]
Source/WebCore/Modules/indexeddb/legacy/LegacyIndex.h [deleted file]
Source/WebCore/Modules/indexeddb/legacy/LegacyObjectStore.cpp [deleted file]
Source/WebCore/Modules/indexeddb/legacy/LegacyObjectStore.h [deleted file]
Source/WebCore/Modules/indexeddb/legacy/LegacyOpenDBRequest.cpp [deleted file]
Source/WebCore/Modules/indexeddb/legacy/LegacyOpenDBRequest.h [deleted file]
Source/WebCore/Modules/indexeddb/legacy/LegacyRequest.cpp [deleted file]
Source/WebCore/Modules/indexeddb/legacy/LegacyRequest.h [deleted file]
Source/WebCore/Modules/indexeddb/legacy/LegacyTransaction.cpp [deleted file]
Source/WebCore/Modules/indexeddb/legacy/LegacyTransaction.h [deleted file]
Source/WebCore/Modules/indexeddb/legacy/LegacyVersionChangeEvent.cpp [deleted file]
Source/WebCore/Modules/indexeddb/legacy/LegacyVersionChangeEvent.h [deleted file]
Source/WebCore/Modules/indexeddb/server/SQLiteIDBCursor.cpp
Source/WebCore/Modules/indexeddb/server/SQLiteIDBCursor.h
Source/WebCore/Modules/indexeddb/shared/IDBIndexInfo.h
Source/WebCore/WebCore.xcodeproj/project.pbxproj
Source/WebCore/bindings/js/IDBBindingUtilities.cpp
Source/WebCore/bindings/js/IDBBindingUtilities.h
Source/WebCore/bindings/js/JSMainThreadExecState.cpp
Source/WebCore/inspector/InspectorIndexedDBAgent.cpp
Source/WebCore/loader/EmptyClients.cpp
Source/WebCore/page/DatabaseProvider.cpp
Source/WebCore/page/DatabaseProvider.h
Source/WebCore/platform/CrossThreadCopier.cpp
Source/WebCore/platform/CrossThreadCopier.h
Source/WebKit/ChangeLog
Source/WebKit/Storage/WebDatabaseProvider.cpp
Source/WebKit/Storage/WebDatabaseProvider.h
Source/WebKit2/CMakeLists.txt
Source/WebKit2/ChangeLog
Source/WebKit2/DatabaseProcess/DatabaseProcess.cpp
Source/WebKit2/DatabaseProcess/DatabaseProcess.h
Source/WebKit2/DatabaseProcess/DatabaseToWebProcessConnection.cpp
Source/WebKit2/DatabaseProcess/DatabaseToWebProcessConnection.h
Source/WebKit2/DatabaseProcess/DatabaseToWebProcessConnection.messages.in
Source/WebKit2/DatabaseProcess/IndexedDB/DatabaseProcessIDBConnection.cpp [deleted file]
Source/WebKit2/DatabaseProcess/IndexedDB/DatabaseProcessIDBConnection.h [deleted file]
Source/WebKit2/DatabaseProcess/IndexedDB/DatabaseProcessIDBConnection.messages.in [deleted file]
Source/WebKit2/DatabaseProcess/IndexedDB/IDBIdentifier.h [deleted file]
Source/WebKit2/DatabaseProcess/IndexedDB/IDBSerialization.cpp [deleted file]
Source/WebKit2/DatabaseProcess/IndexedDB/IDBSerialization.h [deleted file]
Source/WebKit2/DatabaseProcess/IndexedDB/LegacyUniqueIDBDatabase.cpp [deleted file]
Source/WebKit2/DatabaseProcess/IndexedDB/LegacyUniqueIDBDatabase.h [deleted file]
Source/WebKit2/DatabaseProcess/IndexedDB/LegacyUniqueIDBDatabaseIdentifier.cpp [deleted file]
Source/WebKit2/DatabaseProcess/IndexedDB/LegacyUniqueIDBDatabaseIdentifier.h [deleted file]
Source/WebKit2/DatabaseProcess/IndexedDB/UniqueIDBDatabaseBackingStore.h [deleted file]
Source/WebKit2/DatabaseProcess/IndexedDB/WebIDBConnectionToClient.h
Source/WebKit2/DatabaseProcess/IndexedDB/sqlite/SQLiteIDBCursor.cpp [deleted file]
Source/WebKit2/DatabaseProcess/IndexedDB/sqlite/SQLiteIDBCursor.h [deleted file]
Source/WebKit2/DatabaseProcess/IndexedDB/sqlite/SQLiteIDBTransaction.cpp [deleted file]
Source/WebKit2/DatabaseProcess/IndexedDB/sqlite/SQLiteIDBTransaction.h [deleted file]
Source/WebKit2/DatabaseProcess/IndexedDB/sqlite/UniqueIDBDatabaseBackingStoreSQLite.cpp [deleted file]
Source/WebKit2/DatabaseProcess/IndexedDB/sqlite/UniqueIDBDatabaseBackingStoreSQLite.h [deleted file]
Source/WebKit2/DerivedSources.make
Source/WebKit2/Shared/WebCrossThreadCopier.cpp
Source/WebKit2/Shared/WebCrossThreadCopier.h
Source/WebKit2/WebKit2.xcodeproj/project.pbxproj
Source/WebKit2/WebProcess/Databases/IndexedDB/WebIDBFactoryBackend.cpp [deleted file]
Source/WebKit2/WebProcess/Databases/IndexedDB/WebIDBFactoryBackend.h [deleted file]
Source/WebKit2/WebProcess/Databases/IndexedDB/WebIDBServerConnection.cpp [deleted file]
Source/WebKit2/WebProcess/Databases/IndexedDB/WebIDBServerConnection.h [deleted file]
Source/WebKit2/WebProcess/Databases/IndexedDB/WebIDBServerConnection.messages.in [deleted file]
Source/WebKit2/WebProcess/Databases/WebDatabaseProvider.cpp
Source/WebKit2/WebProcess/Databases/WebDatabaseProvider.h
Source/WebKit2/WebProcess/Databases/WebToDatabaseProcessConnection.cpp
Source/WebKit2/WebProcess/Databases/WebToDatabaseProcessConnection.h
Source/WebKit2/WebProcess/WebCoreSupport/WebPlatformStrategies.cpp

index 9c66d1a..98bf38a 100644 (file)
@@ -10,7 +10,6 @@ set(WebCore_INCLUDE_DIRECTORIES
     "${WEBCORE_DIR}/Modules/geolocation"
     "${WEBCORE_DIR}/Modules/indexeddb"
     "${WEBCORE_DIR}/Modules/indexeddb/client"
-    "${WEBCORE_DIR}/Modules/indexeddb/legacy"
     "${WEBCORE_DIR}/Modules/indexeddb/server"
     "${WEBCORE_DIR}/Modules/indexeddb/shared"
     "${WEBCORE_DIR}/Modules/indieui"
@@ -831,7 +830,6 @@ set(WebCore_SOURCES
     Modules/indexeddb/IDBDatabase.cpp
     Modules/indexeddb/IDBDatabaseException.cpp
     Modules/indexeddb/IDBDatabaseIdentifier.cpp
-    Modules/indexeddb/IDBDatabaseMetadata.cpp
     Modules/indexeddb/IDBEventDispatcher.cpp
     Modules/indexeddb/IDBFactory.cpp
     Modules/indexeddb/IDBGetResult.cpp
@@ -863,26 +861,6 @@ set(WebCore_SOURCES
     Modules/indexeddb/client/IDBVersionChangeEventImpl.cpp
     Modules/indexeddb/client/TransactionOperation.cpp
 
-    Modules/indexeddb/legacy/IDBCursorBackend.cpp
-    Modules/indexeddb/legacy/IDBCursorBackendOperations.cpp
-    Modules/indexeddb/legacy/IDBDatabaseBackend.cpp
-    Modules/indexeddb/legacy/IDBDatabaseCallbacksImpl.cpp
-    Modules/indexeddb/legacy/IDBPendingTransactionMonitor.cpp
-    Modules/indexeddb/legacy/IDBTransactionBackend.cpp
-    Modules/indexeddb/legacy/IDBTransactionBackendOperations.cpp
-    Modules/indexeddb/legacy/IDBTransactionCoordinator.cpp
-    Modules/indexeddb/legacy/LegacyAny.cpp
-    Modules/indexeddb/legacy/LegacyCursor.cpp
-    Modules/indexeddb/legacy/LegacyCursorWithValue.cpp
-    Modules/indexeddb/legacy/LegacyDatabase.cpp
-    Modules/indexeddb/legacy/LegacyFactory.cpp
-    Modules/indexeddb/legacy/LegacyIndex.cpp
-    Modules/indexeddb/legacy/LegacyObjectStore.cpp
-    Modules/indexeddb/legacy/LegacyOpenDBRequest.cpp
-    Modules/indexeddb/legacy/LegacyRequest.cpp
-    Modules/indexeddb/legacy/LegacyTransaction.cpp
-    Modules/indexeddb/legacy/LegacyVersionChangeEvent.cpp
-
     Modules/indexeddb/server/IDBConnectionToClient.cpp
     Modules/indexeddb/server/IDBSerialization.cpp
     Modules/indexeddb/server/IDBServer.cpp
index fe35983..71795d1 100644 (file)
@@ -1,3 +1,93 @@
+2016-02-25  Brady Eidson  <beidson@apple.com>
+
+        Remove LegacyIDB.
+        https://bugs.webkit.org/show_bug.cgi?id=150854
+
+        Reviewed by Alex Christensen.
+
+        No new tests (No change in behavior).
+
+        * CMakeLists.txt:
+        * Modules/indexeddb/DOMWindowIndexedDatabase.cpp:
+        (WebCore::DOMWindowIndexedDatabase::indexedDB):
+        * Modules/indexeddb/IDBDatabaseMetadata.cpp: Removed.
+        * Modules/indexeddb/IDBDatabaseMetadata.h: Removed.
+        * Modules/indexeddb/IDBFactory.h:
+        * Modules/indexeddb/IDBIndex.h:
+        * Modules/indexeddb/IDBIndexMetadata.h: Removed.
+        * Modules/indexeddb/IDBObjectStoreMetadata.h: Removed.
+        * Modules/indexeddb/IDBOperation.h: Removed.
+        * Modules/indexeddb/IDBServerConnection.h: Removed.
+        * Modules/indexeddb/IDBTransaction.h:
+        * Modules/indexeddb/WorkerGlobalScopeIndexedDatabase.cpp:
+        (WebCore::WorkerGlobalScopeIndexedDatabase::indexedDB):
+        * Modules/indexeddb/WorkerGlobalScopeIndexedDatabase.h:
+        * Modules/indexeddb/legacy/IDBCallbacks.h: Removed.
+        * Modules/indexeddb/legacy/IDBCursorBackend.cpp: Removed.
+        * Modules/indexeddb/legacy/IDBCursorBackend.h: Removed.
+        * Modules/indexeddb/legacy/IDBCursorBackendOperations.cpp: Removed.
+        * Modules/indexeddb/legacy/IDBCursorBackendOperations.h: Removed.
+        * Modules/indexeddb/legacy/IDBDatabaseBackend.cpp: Removed.
+        * Modules/indexeddb/legacy/IDBDatabaseBackend.h: Removed.
+        * Modules/indexeddb/legacy/IDBDatabaseCallbacks.h: Removed.
+        * Modules/indexeddb/legacy/IDBDatabaseCallbacksImpl.cpp: Removed.
+        * Modules/indexeddb/legacy/IDBDatabaseCallbacksImpl.h: Removed.
+        * Modules/indexeddb/legacy/IDBFactoryBackendInterface.h: Removed.
+        * Modules/indexeddb/legacy/IDBPendingDeleteCall.h: Removed.
+        * Modules/indexeddb/legacy/IDBPendingOpenCall.h: Removed.
+        * Modules/indexeddb/legacy/IDBPendingTransactionMonitor.cpp: Removed.
+        * Modules/indexeddb/legacy/IDBPendingTransactionMonitor.h: Removed.
+        * Modules/indexeddb/legacy/IDBTransactionBackend.cpp: Removed.
+        * Modules/indexeddb/legacy/IDBTransactionBackend.h: Removed.
+        * Modules/indexeddb/legacy/IDBTransactionBackendOperations.cpp: Removed.
+        * Modules/indexeddb/legacy/IDBTransactionBackendOperations.h: Removed.
+        * Modules/indexeddb/legacy/IDBTransactionCoordinator.cpp: Removed.
+        * Modules/indexeddb/legacy/IDBTransactionCoordinator.h: Removed.
+        * Modules/indexeddb/legacy/LegacyAny.cpp: Removed.
+        * Modules/indexeddb/legacy/LegacyAny.h: Removed.
+        * Modules/indexeddb/legacy/LegacyCursor.cpp: Removed.
+        * Modules/indexeddb/legacy/LegacyCursor.h: Removed.
+        * Modules/indexeddb/legacy/LegacyCursorWithValue.cpp: Removed.
+        * Modules/indexeddb/legacy/LegacyCursorWithValue.h: Removed.
+        * Modules/indexeddb/legacy/LegacyDatabase.cpp: Removed.
+        * Modules/indexeddb/legacy/LegacyDatabase.h: Removed.
+        * Modules/indexeddb/legacy/LegacyFactory.cpp: Removed.
+        * Modules/indexeddb/legacy/LegacyFactory.h: Removed.
+        * Modules/indexeddb/legacy/LegacyIndex.cpp: Removed.
+        * Modules/indexeddb/legacy/LegacyIndex.h: Removed.
+        * Modules/indexeddb/legacy/LegacyObjectStore.cpp: Removed.
+        * Modules/indexeddb/legacy/LegacyObjectStore.h: Removed.
+        * Modules/indexeddb/legacy/LegacyOpenDBRequest.cpp: Removed.
+        * Modules/indexeddb/legacy/LegacyOpenDBRequest.h: Removed.
+        * Modules/indexeddb/legacy/LegacyRequest.cpp: Removed.
+        * Modules/indexeddb/legacy/LegacyRequest.h: Removed.
+        * Modules/indexeddb/legacy/LegacyTransaction.cpp: Removed.
+        * Modules/indexeddb/legacy/LegacyTransaction.h: Removed.
+        * Modules/indexeddb/legacy/LegacyVersionChangeEvent.cpp: Removed.
+        * Modules/indexeddb/legacy/LegacyVersionChangeEvent.h: Removed.
+        * Modules/indexeddb/server/SQLiteIDBCursor.cpp:
+        (WebCore::IDBServer::SQLiteIDBCursor::SQLiteIDBCursor):
+        (WebCore::IDBServer::SQLiteIDBCursor::establishStatement):
+        (WebCore::IDBServer::SQLiteIDBCursor::internalAdvanceOnce):
+        * Modules/indexeddb/server/SQLiteIDBCursor.h:
+        * Modules/indexeddb/shared/IDBIndexInfo.h:
+        * WebCore.xcodeproj/project.pbxproj:
+        * bindings/js/IDBBindingUtilities.cpp:
+        (WebCore::generateIndexKeysForValue): Deleted.
+        * bindings/js/IDBBindingUtilities.h:
+        * bindings/js/JSMainThreadExecState.cpp:
+        (WebCore::JSMainThreadExecState::didLeaveScriptContext): Deleted.
+        * inspector/InspectorIndexedDBAgent.cpp:
+        * loader/EmptyClients.cpp:
+        * page/DatabaseProvider.cpp:
+        (WebCore::DatabaseProvider::idbFactoryBackend): Deleted.
+        * page/DatabaseProvider.h:
+        * platform/CrossThreadCopier.cpp:
+        (WebCore::IDBDatabaseMetadata>::copy): Deleted.
+        (WebCore::IDBIndexMetadata>::copy): Deleted.
+        (WebCore::IDBObjectStoreMetadata>::copy): Deleted.
+        * platform/CrossThreadCopier.h:
+
 2016-02-25  Said Abou-Hallawa  <sabouhallawa@apple.com>
 
         REGRESSION (r196268): Many assertion failures and crashes on SVG path animation tests when JS garbage collection happens quickly
index 50fa440..f5bc6a8 100644 (file)
@@ -32,7 +32,6 @@
 #include "DatabaseProvider.h"
 #include "Document.h"
 #include "IDBFactoryImpl.h"
-#include "LegacyFactory.h"
 #include "Page.h"
 #include "SecurityOrigin.h"
 
@@ -112,12 +111,8 @@ IDBFactory* DOMWindowIndexedDatabase::indexedDB()
     if (!m_window->isCurrentlyDisplayedInFrame())
         return nullptr;
 
-    if (!m_idbFactory) {
-        if (page->databaseProvider().supportsModernIDB())
-            m_idbFactory = IDBClient::IDBFactory::create(page->idbConnection());
-        else
-            m_idbFactory = LegacyFactory::create(page->databaseProvider().idbFactoryBackend());
-    }
+    if (!m_idbFactory)
+        m_idbFactory = IDBClient::IDBFactory::create(page->idbConnection());
 
     return m_idbFactory.get();
 }
diff --git a/Source/WebCore/Modules/indexeddb/IDBDatabaseMetadata.cpp b/Source/WebCore/Modules/indexeddb/IDBDatabaseMetadata.cpp
deleted file mode 100644 (file)
index 3c2b5e0..0000000
+++ /dev/null
@@ -1,79 +0,0 @@
-/*
- * Copyright (C) 2013 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-#include "IDBDatabaseMetadata.h"
-
-#if ENABLE(INDEXED_DATABASE)
-
-namespace WebCore {
-
-IDBDatabaseMetadata IDBDatabaseMetadata::isolatedCopy() const
-{
-    IDBDatabaseMetadata result;
-    result.id = id;
-    result.version = version;
-    result.maxObjectStoreId = maxObjectStoreId;
-
-    result.name = name.isolatedCopy();
-
-    for (auto& objectStore : objectStores)
-        result.objectStores.set(objectStore.key, objectStore.value.isolatedCopy());
-
-    return result;
-}
-
-IDBObjectStoreMetadata IDBObjectStoreMetadata::isolatedCopy() const
-{
-    IDBObjectStoreMetadata result;
-    result.id = id;
-    result.autoIncrement = autoIncrement;
-    result.maxIndexId = maxIndexId;
-
-    result.name = name.isolatedCopy();
-    result.keyPath = keyPath.isolatedCopy();
-
-    for (auto& index : indexes)
-        result.indexes.set(index.key, index.value.isolatedCopy());
-
-    return result;
-}
-
-IDBIndexMetadata IDBIndexMetadata::isolatedCopy() const
-{
-    IDBIndexMetadata result;
-    result.id = id;
-    result.unique = unique;
-    result.multiEntry = multiEntry;
-
-    result.name = name.isolatedCopy();
-    result.keyPath = keyPath.isolatedCopy();
-
-    return result;
-}
-
-} // namespace WebCore
-
-#endif // ENABLE(INDEXED_DATABASE)
diff --git a/Source/WebCore/Modules/indexeddb/IDBDatabaseMetadata.h b/Source/WebCore/Modules/indexeddb/IDBDatabaseMetadata.h
deleted file mode 100644 (file)
index fa43d62..0000000
+++ /dev/null
@@ -1,115 +0,0 @@
-/*
- * Copyright (C) 2012 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1.  Redistributions of source code must retain the above copyright
- *     notice, this list of conditions and the following disclaimer.
- * 2.  Redistributions in binary form must reproduce the above copyright
- *     notice, this list of conditions and the following disclaimer in the
- *     documentation and/or other materials provided with the distribution.
- * 3.  Neither the name of Apple Inc. ("Apple") nor the names of
- *     its contributors may be used to endorse or promote products derived
- *     from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY GOOGLE AND ITS CONTRIBUTORS "AS IS" AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef IDBDatabaseMetadata_h
-#define IDBDatabaseMetadata_h
-
-#include "IDBObjectStoreMetadata.h"
-
-#if ENABLE(INDEXED_DATABASE)
-
-namespace WebCore {
-
-struct IDBDatabaseMetadata {
-
-    // FIXME: These are only here to support the LevelDB backend which incorrectly handles versioning.
-    // Once LevelDB supports a single, uint64_t version and throws out the old string version, these
-    // should be gotten rid of.
-    // Also, "NoIntVersion" used to be a magic number of -1, which doesn't work with the new unsigned type.
-    // Changing the value to INT64_MAX here seems like a reasonable temporary fix as the current LevelDB
-    // already cannot represent valid version numbers between INT64_MAX and UINT64_MAX.
-
-#ifndef INT64_MAX
-#define INT64_MAX 9223372036854775807LL
-#endif
-
-    enum {
-        NoIntVersion = INT64_MAX,
-        DefaultIntVersion = 0
-    };
-
-    IDBDatabaseMetadata()
-        : id(0)
-        , version(0)
-        , maxObjectStoreId(0)
-    {
-    }
-
-    IDBDatabaseMetadata(const String& name, int64_t id, uint64_t version, int64_t maxObjectStoreId)
-        : name(name)
-        , id(id)
-        , version(version)
-        , maxObjectStoreId(maxObjectStoreId)
-    {
-    }
-
-    template<class Encoder> void encode(Encoder&) const;
-    template<class Decoder> static bool decode(Decoder&, IDBDatabaseMetadata&);
-
-    String name;
-    int64_t id;
-    uint64_t version;
-    int64_t maxObjectStoreId;
-
-    typedef HashMap<int64_t, IDBObjectStoreMetadata> ObjectStoreMap;
-    ObjectStoreMap objectStores;
-
-    WEBCORE_EXPORT IDBDatabaseMetadata isolatedCopy() const;
-};
-
-template<class Encoder>
-void IDBDatabaseMetadata::encode(Encoder& encoder) const
-{
-    encoder << name << id << version << maxObjectStoreId << objectStores;
-}
-
-template<class Decoder>
-bool IDBDatabaseMetadata::decode(Decoder& decoder, IDBDatabaseMetadata& metadata)
-{
-    if (!decoder.decode(metadata.name))
-        return false;
-
-    if (!decoder.decode(metadata.id))
-        return false;
-
-    if (!decoder.decode(metadata.version))
-        return false;
-
-    if (!decoder.decode(metadata.maxObjectStoreId))
-        return false;
-
-    if (!decoder.decode(metadata.objectStores))
-        return false;
-
-    return true;
-}
-
-} // namespace WebCore
-
-#endif // ENABLE(INDEXED_DATABASE)
-#endif // IDBDatabaseMetadata_h
index 3afc4ee..99d28f4 100644 (file)
@@ -38,7 +38,6 @@ namespace WebCore {
 
 class IDBKey;
 class IDBKeyRange;
-class IDBFactoryBackendInterface;
 class ScriptExecutionContext;
 
 struct ExceptionCodeWithMessage;
@@ -68,4 +67,4 @@ protected:
 
 #endif
 
-#endif // LegacyFactory_h
+#endif // IDBFactory_h
index f253dc1..525a15a 100644 (file)
@@ -28,7 +28,6 @@
 
 #include "IDBCursor.h"
 #include "IDBDatabase.h"
-#include "IDBDatabaseMetadata.h"
 #include "IDBKeyPath.h"
 #include "IDBKeyRange.h"
 #include "IDBObjectStore.h"
diff --git a/Source/WebCore/Modules/indexeddb/IDBIndexMetadata.h b/Source/WebCore/Modules/indexeddb/IDBIndexMetadata.h
deleted file mode 100644 (file)
index 2f212a4..0000000
+++ /dev/null
@@ -1,98 +0,0 @@
-/*
- * Copyright (C) 2012 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1.  Redistributions of source code must retain the above copyright
- *     notice, this list of conditions and the following disclaimer.
- * 2.  Redistributions in binary form must reproduce the above copyright
- *     notice, this list of conditions and the following disclaimer in the
- *     documentation and/or other materials provided with the distribution.
- * 3.  Neither the name of Apple Inc. ("Apple") nor the names of
- *     its contributors may be used to endorse or promote products derived
- *     from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY GOOGLE AND ITS CONTRIBUTORS "AS IS" AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef IDBIndexMetadata_h
-#define IDBIndexMetadata_h
-
-#include "IDBKeyPath.h"
-#include <wtf/HashMap.h>
-#include <wtf/text/WTFString.h>
-
-#if ENABLE(INDEXED_DATABASE)
-
-namespace WebCore {
-
-struct IDBIndexMetadata {
-    IDBIndexMetadata()
-    {
-    }
-
-    IDBIndexMetadata(const String& name, int64_t id, const IDBKeyPath& keyPath, bool unique, bool multiEntry)
-        : name(name)
-        , id(id)
-        , keyPath(keyPath)
-        , unique(unique)
-        , multiEntry(multiEntry)
-    {
-    }
-    
-    template<class Encoder> void encode(Encoder&) const;
-    template<class Decoder> static bool decode(Decoder&, IDBIndexMetadata&);
-
-    String name;
-    int64_t id;
-    IDBKeyPath keyPath;
-    bool unique;
-    bool multiEntry;
-
-    IDBIndexMetadata isolatedCopy() const;
-
-    static const int64_t InvalidId = -1;
-};
-
-template<class Encoder>
-void IDBIndexMetadata::encode(Encoder& encoder) const
-{
-    encoder << name << id << keyPath << unique << multiEntry;
-}
-
-template<class Decoder>
-bool IDBIndexMetadata::decode(Decoder& decoder, IDBIndexMetadata& metadata)
-{
-    if (!decoder.decode(metadata.name))
-        return false;
-
-    if (!decoder.decode(metadata.id))
-        return false;
-
-    if (!decoder.decode(metadata.keyPath))
-        return false;
-
-    if (!decoder.decode(metadata.unique))
-        return false;
-
-    if (!decoder.decode(metadata.multiEntry))
-        return false;
-
-    return true;
-}
-
-} // namespace WebCore
-
-#endif // ENABLE(INDEXED_DATABASE)
-#endif // IDBIndexMetadata_h
diff --git a/Source/WebCore/Modules/indexeddb/IDBObjectStoreMetadata.h b/Source/WebCore/Modules/indexeddb/IDBObjectStoreMetadata.h
deleted file mode 100644 (file)
index 86b47f1..0000000
+++ /dev/null
@@ -1,102 +0,0 @@
-/*
- * Copyright (C) 2012 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1.  Redistributions of source code must retain the above copyright
- *     notice, this list of conditions and the following disclaimer.
- * 2.  Redistributions in binary form must reproduce the above copyright
- *     notice, this list of conditions and the following disclaimer in the
- *     documentation and/or other materials provided with the distribution.
- * 3.  Neither the name of Apple Inc. ("Apple") nor the names of
- *     its contributors may be used to endorse or promote products derived
- *     from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY GOOGLE AND ITS CONTRIBUTORS "AS IS" AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef IDBObjectStoreMetadata_h
-#define IDBObjectStoreMetadata_h
-
-#include "IDBIndexMetadata.h"
-
-#if ENABLE(INDEXED_DATABASE)
-
-namespace WebCore {
-
-struct IDBObjectStoreMetadata {
-    IDBObjectStoreMetadata()
-    {
-    }
-
-    IDBObjectStoreMetadata(const String& name, int64_t id, const IDBKeyPath& keyPath, bool autoIncrement, int64_t maxIndexId)
-        : name(name)
-        , id(id)
-        , keyPath(keyPath)
-        , autoIncrement(autoIncrement)
-        , maxIndexId(maxIndexId)
-    {
-    }
-
-    template<class Encoder> void encode(Encoder&) const;
-    template<class Decoder> static bool decode(Decoder&, IDBObjectStoreMetadata&);
-    
-    String name;
-    int64_t id;
-    IDBKeyPath keyPath;
-    bool autoIncrement;
-    int64_t maxIndexId;
-
-    static const int64_t InvalidId = -1;
-
-    typedef HashMap<int64_t, IDBIndexMetadata> IndexMap;
-    IndexMap indexes;
-
-    IDBObjectStoreMetadata isolatedCopy() const;
-};
-
-template<class Encoder>
-void IDBObjectStoreMetadata::encode(Encoder& encoder) const
-{
-    encoder << name << id << keyPath << autoIncrement << maxIndexId << indexes;
-}
-
-template<class Decoder>
-bool IDBObjectStoreMetadata::decode(Decoder& decoder, IDBObjectStoreMetadata& metadata)
-{
-    if (!decoder.decode(metadata.name))
-        return false;
-
-    if (!decoder.decode(metadata.id))
-        return false;
-
-    if (!decoder.decode(metadata.keyPath))
-        return false;
-
-    if (!decoder.decode(metadata.autoIncrement))
-        return false;
-
-    if (!decoder.decode(metadata.maxIndexId))
-        return false;
-
-    if (!decoder.decode(metadata.indexes))
-        return false;
-
-    return true;
-}
-
-} // namespace WebCore
-
-#endif // ENABLE(INDEXED_DATABASE)
-#endif // IDBObjectStoreMetadata_h
diff --git a/Source/WebCore/Modules/indexeddb/IDBOperation.h b/Source/WebCore/Modules/indexeddb/IDBOperation.h
deleted file mode 100644 (file)
index d88d2ce..0000000
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * Copyright (C) 2013 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef IDBOperation_h
-#define IDBOperation_h
-
-#include <functional>
-
-#if ENABLE(INDEXED_DATABASE)
-
-namespace WebCore {
-
-class IDBOperation : public RefCounted<IDBOperation> {
-public:
-    virtual ~IDBOperation() { }
-    virtual void perform(std::function<void()> completionCallback) = 0;
-};
-
-class IDBSynchronousOperation : public RefCounted<IDBSynchronousOperation> {
-public:
-    virtual ~IDBSynchronousOperation() { }
-    virtual void perform() = 0;
-};
-
-} // namespace WebCore
-
-#endif // ENABLE(INDEXED_DATABASE)
-#endif // IDBOperation_h
diff --git a/Source/WebCore/Modules/indexeddb/IDBServerConnection.h b/Source/WebCore/Modules/indexeddb/IDBServerConnection.h
deleted file mode 100644 (file)
index 7c764f9..0000000
+++ /dev/null
@@ -1,99 +0,0 @@
-/*
- * Copyright (C) 2013 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef IDBServerConnection_h
-#define IDBServerConnection_h
-
-#include "IDBCursorBackendOperations.h"
-#include "IDBDatabaseMetadata.h"
-#include "IDBGetResult.h"
-#include "IDBTransactionBackendOperations.h"
-#include "IndexedDB.h"
-#include <functional>
-#include <wtf/HashSet.h>
-#include <wtf/RefCounted.h>
-#include <wtf/text/WTFString.h>
-
-#if ENABLE(INDEXED_DATABASE)
-
-namespace WebCore {
-
-class IDBDatabaseError;
-class IDBKey;
-class IDBTransactionBackend;
-
-struct IDBOpenCursorResult;
-struct IDBIndexMetadata;
-struct IDBObjectStoreMetadata;
-
-// This interface provides a single asynchronous layer between the web-facing frontend
-// and the I/O performing backend of IndexedDatabase.
-// If an operation's completion needs to be confirmed that must be done through use of a callback function.
-class IDBServerConnection : public RefCounted<IDBServerConnection> {
-public:
-    virtual ~IDBServerConnection() { }
-
-    virtual bool isClosed() = 0;
-
-    typedef std::function<void (bool success)> BoolCallbackFunction;
-
-    // Database-level operations
-    typedef std::function<void (const IDBDatabaseMetadata&, bool success)> GetIDBDatabaseMetadataFunction;
-    virtual void getOrEstablishIDBDatabaseMetadata(GetIDBDatabaseMetadataFunction) = 0;
-    virtual void close() = 0;
-    virtual void deleteDatabase(const String& name, BoolCallbackFunction successCallback) = 0;
-
-    // Transaction-level operations
-    virtual void openTransaction(int64_t transactionID, const HashSet<int64_t>& objectStoreIds, IndexedDB::TransactionMode, BoolCallbackFunction successCallback) = 0;
-    virtual void beginTransaction(int64_t transactionID, std::function<void()> completionCallback) = 0;
-    virtual void commitTransaction(int64_t transactionID, BoolCallbackFunction successCallback) = 0;
-    virtual void resetTransaction(int64_t transactionID, std::function<void()> completionCallback) = 0;
-    virtual bool resetTransactionSync(int64_t transactionID) = 0;
-    virtual void rollbackTransaction(int64_t transactionID, std::function<void()> completionCallback) = 0;
-    virtual bool rollbackTransactionSync(int64_t transactionID) = 0;
-
-    virtual void setIndexKeys(int64_t transactionID, int64_t databaseID, int64_t objectStoreID, const IDBObjectStoreMetadata&, IDBKey& primaryKey, const Vector<int64_t, 1>& indexIDs, const Vector<Vector<RefPtr<IDBKey>>, 1>& indexKeys, std::function<void(PassRefPtr<IDBDatabaseError>)> completionCallback) = 0;
-
-    virtual void createObjectStore(IDBTransactionBackend&, const CreateObjectStoreOperation&, std::function<void(PassRefPtr<IDBDatabaseError>)> completionCallback) = 0;
-    virtual void createIndex(IDBTransactionBackend&, const CreateIndexOperation&, std::function<void(PassRefPtr<IDBDatabaseError>)> completionCallback) = 0;
-    virtual void deleteIndex(IDBTransactionBackend&, const DeleteIndexOperation&, std::function<void(PassRefPtr<IDBDatabaseError>)> completionCallback) = 0;
-    virtual void get(IDBTransactionBackend&, const GetOperation&, std::function<void(const IDBGetResult&, PassRefPtr<IDBDatabaseError>)> completionCallback) = 0;
-    virtual void put(IDBTransactionBackend&, const PutOperation&, std::function<void(PassRefPtr<IDBKey>, PassRefPtr<IDBDatabaseError>)> completionCallback) = 0;
-    virtual void openCursor(IDBTransactionBackend&, const OpenCursorOperation&, std::function<void(int64_t, PassRefPtr<IDBKey>, PassRefPtr<IDBKey>, PassRefPtr<SharedBuffer>, PassRefPtr<IDBDatabaseError>)> completionCallback) = 0;
-    virtual void count(IDBTransactionBackend&, const CountOperation&, std::function<void(int64_t, PassRefPtr<IDBDatabaseError>)> completionCallback) = 0;
-    virtual void deleteRange(IDBTransactionBackend&, const DeleteRangeOperation&, std::function<void(PassRefPtr<IDBDatabaseError>)> completionCallback) = 0;
-    virtual void clearObjectStore(IDBTransactionBackend&, const ClearObjectStoreOperation&, std::function<void(PassRefPtr<IDBDatabaseError>)> completionCallback) = 0;
-    virtual void deleteObjectStore(IDBTransactionBackend&, const DeleteObjectStoreOperation&, std::function<void(PassRefPtr<IDBDatabaseError>)> completionCallback) = 0;
-    virtual void changeDatabaseVersion(IDBTransactionBackend&, const IDBDatabaseBackend::VersionChangeOperation&, std::function<void(PassRefPtr<IDBDatabaseError>)> completionCallback) = 0;
-
-    // Cursor-level operations
-    virtual void cursorAdvance(IDBCursorBackend&, const CursorAdvanceOperation&, std::function<void(PassRefPtr<IDBKey>, PassRefPtr<IDBKey>, PassRefPtr<SharedBuffer>, PassRefPtr<IDBDatabaseError>)> completionCallback) = 0;
-    virtual void cursorIterate(IDBCursorBackend&, const CursorIterationOperation&, std::function<void(PassRefPtr<IDBKey>, PassRefPtr<IDBKey>, PassRefPtr<SharedBuffer>, PassRefPtr<IDBDatabaseError>)> completionCallback) = 0;
-};
-
-} // namespace WebCore
-
-#endif // ENABLE(INDEXED_DATABASE)
-#endif // IDBServerConnection_h
index 5f156af..9e9a0e8 100644 (file)
@@ -40,13 +40,11 @@ namespace WebCore {
 class DOMError;
 class IDBCursor;
 class IDBDatabase;
-class IDBDatabaseBackend;
 class IDBDatabaseError;
 class IDBObjectStore;
 class IDBOpenDBRequest;
 
 struct ExceptionCodeWithMessage;
-struct IDBObjectStoreMetadata;
 
 class IDBTransaction : public RefCounted<IDBTransaction>, public EventTargetWithInlineData, public ActiveDOMObject {
 public:
index 30b8169..a2ab020 100644 (file)
@@ -32,7 +32,6 @@
 #include "WorkerGlobalScopeIndexedDatabase.h"
 
 #include "IDBFactory.h"
-#include "IDBFactoryBackendInterface.h"
 #include "ScriptExecutionContext.h"
 #include "SecurityOrigin.h"
 
@@ -69,11 +68,7 @@ IDBFactory* WorkerGlobalScopeIndexedDatabase::indexedDB(ScriptExecutionContext*
 
 IDBFactory* WorkerGlobalScopeIndexedDatabase::indexedDB()
 {
-    if (!m_factoryBackend)
-        m_factoryBackend = IDBFactoryBackendInterface::create();
-    if (!m_idbFactory)
-        m_idbFactory = IDBFactory::create(m_factoryBackend.get());
-    return m_idbFactory.get();
+    return nullptr;
 }
 
 } // namespace WebCore
index 8b0dce6..956cb67 100644 (file)
@@ -35,7 +35,6 @@
 namespace WebCore {
 
 class IDBFactory;
-class IDBFactoryBackendInterface;
 class ScriptExecutionContext;
 
 class WorkerGlobalScopeIndexedDatabase : public Supplement<ScriptExecutionContext> {
@@ -50,7 +49,6 @@ private:
     IDBFactory* indexedDB();
     static const char* supplementName();
 
-    RefPtr<IDBFactoryBackendInterface> m_factoryBackend;
     RefPtr<IDBFactory> m_idbFactory;
 };
 
diff --git a/Source/WebCore/Modules/indexeddb/legacy/IDBCallbacks.h b/Source/WebCore/Modules/indexeddb/legacy/IDBCallbacks.h
deleted file mode 100644 (file)
index b6572f1..0000000
+++ /dev/null
@@ -1,82 +0,0 @@
-/*
- * Copyright (C) 2010 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1.  Redistributions of source code must retain the above copyright
- *     notice, this list of conditions and the following disclaimer.
- * 2.  Redistributions in binary form must reproduce the above copyright
- *     notice, this list of conditions and the following disclaimer in the
- *     documentation and/or other materials provided with the distribution.
- * 3.  Neither the name of Apple Inc. ("Apple") nor the names of
- *     its contributors may be used to endorse or promote products derived
- *     from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef IDBCallbacks_h
-#define IDBCallbacks_h
-
-#include "IDBDatabaseError.h"
-#include "IDBKey.h"
-#include "IDBKeyPath.h"
-#include <wtf/RefCounted.h>
-
-#if ENABLE(INDEXED_DATABASE)
-
-namespace WebCore {
-class DOMStringList;
-class IDBCursorBackend;
-class IDBDatabaseBackend;
-class SharedBuffer;
-
-struct IDBDatabaseMetadata;
-
-class IDBCallbacks : public RefCounted<IDBCallbacks> {
-public:
-    virtual ~IDBCallbacks() { }
-
-    virtual void onError(PassRefPtr<IDBDatabaseError>) = 0;
-    // From IDBFactory.webkitGetDatabaseNames()
-    virtual void onSuccess(PassRefPtr<DOMStringList>) = 0;
-    // From IDBObjectStore/IDBIndex.openCursor(), IDBIndex.openKeyCursor()
-    virtual void onSuccess(PassRefPtr<IDBCursorBackend>) = 0;
-    // From IDBObjectStore.add()/put(), IDBIndex.getKey()
-    virtual void onSuccess(PassRefPtr<IDBKey>) = 0;
-    // From IDBObjectStore/IDBIndex.get()/count(), and various methods that yield null/undefined.
-    virtual void onSuccess(PassRefPtr<SharedBuffer>) = 0;
-    // From IDBObjectStore/IDBIndex.get() (with key injection)
-    virtual void onSuccess(PassRefPtr<SharedBuffer>, PassRefPtr<IDBKey>, const IDBKeyPath&) = 0;
-    // From IDBObjectStore/IDBIndex.count()
-    virtual void onSuccess(int64_t value) = 0;
-
-    // From IDBFactor.deleteDatabase(), IDBObjectStore/IDBIndex.get(), IDBObjectStore.delete(), IDBObjectStore.clear()
-    virtual void onSuccess() = 0;
-
-    // From IDBCursor.advance()/continue()
-    virtual void onSuccess(PassRefPtr<IDBKey>, PassRefPtr<IDBKey> primaryKey, PassRefPtr<SharedBuffer>) = 0;
-
-    // From IDBFactory.open()/deleteDatabase()
-    virtual void onBlocked(uint64_t /* existingVersion */) { ASSERT_NOT_REACHED(); }
-    // From IDBFactory.open()
-    virtual void onUpgradeNeeded(uint64_t /* oldVersion */, PassRefPtr<IDBDatabaseBackend>, const IDBDatabaseMetadata&) { ASSERT_NOT_REACHED(); }
-    virtual void onSuccess(PassRefPtr<IDBDatabaseBackend>, const IDBDatabaseMetadata&) { ASSERT_NOT_REACHED(); }
-};
-
-} // namespace WebCore
-
-#endif
-
-#endif // IDBCallbacks_h
diff --git a/Source/WebCore/Modules/indexeddb/legacy/IDBCursorBackend.cpp b/Source/WebCore/Modules/indexeddb/legacy/IDBCursorBackend.cpp
deleted file mode 100644 (file)
index 3801c7e..0000000
+++ /dev/null
@@ -1,109 +0,0 @@
-/*
- * Copyright (C) 2010 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1.  Redistributions of source code must retain the above copyright
- *     notice, this list of conditions and the following disclaimer.
- * 2.  Redistributions in binary form must reproduce the above copyright
- *     notice, this list of conditions and the following disclaimer in the
- *     documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-#include "IDBCursorBackend.h"
-
-#if ENABLE(INDEXED_DATABASE)
-
-#include "IDBCallbacks.h"
-#include "IDBCursorBackendOperations.h"
-#include "IDBDatabaseBackend.h"
-#include "IDBDatabaseCallbacks.h"
-#include "IDBDatabaseError.h"
-#include "IDBDatabaseException.h"
-#include "IDBKeyRange.h"
-#include "IDBOperation.h"
-#include "IDBServerConnection.h"
-#include "Logging.h"
-#include "SharedBuffer.h"
-
-namespace WebCore {
-
-IDBCursorBackend::IDBCursorBackend(int64_t cursorID, IndexedDB::CursorType cursorType, IDBDatabaseBackend::TaskType taskType, IDBTransactionBackend& transaction, int64_t objectStoreID)
-    : m_taskType(taskType)
-    , m_cursorType(cursorType)
-    , m_transaction(&transaction)
-    , m_objectStoreID(objectStoreID)
-    , m_cursorID(cursorID)
-    , m_savedCursorID(0)
-    , m_closed(false)
-{
-    m_transaction->registerOpenCursor(this);
-}
-
-IDBCursorBackend::~IDBCursorBackend()
-{
-    m_transaction->unregisterOpenCursor(this);
-}
-
-void IDBCursorBackend::continueFunction(PassRefPtr<IDBKey> key, PassRefPtr<IDBCallbacks> prpCallbacks, ExceptionCode&)
-{
-    LOG(StorageAPI, "IDBCursorBackend::continue");
-    RefPtr<IDBCallbacks> callbacks = prpCallbacks;
-    m_transaction->scheduleTask(m_taskType, CursorIterationOperation::create(this, key, callbacks));
-}
-
-void IDBCursorBackend::advance(unsigned long count, PassRefPtr<IDBCallbacks> prpCallbacks, ExceptionCode&)
-{
-    LOG(StorageAPI, "IDBCursorBackend::advance");
-    RefPtr<IDBCallbacks> callbacks = prpCallbacks;
-    m_transaction->scheduleTask(CursorAdvanceOperation::create(this, count, callbacks));
-}
-
-void IDBCursorBackend::deleteFunction(PassRefPtr<IDBCallbacks> prpCallbacks, ExceptionCode&)
-{
-    LOG(StorageAPI, "IDBCursorBackend::delete");
-    ASSERT(m_transaction->mode() != IndexedDB::TransactionMode::ReadOnly);
-    RefPtr<IDBKeyRange> keyRange = IDBKeyRange::create(primaryKey());
-    m_transaction->database().deleteRange(m_transaction->id(), m_objectStoreID, keyRange.release(), prpCallbacks);
-}
-
-void IDBCursorBackend::close()
-{
-    LOG(StorageAPI, "IDBCursorBackend::close");
-    clear();
-    m_closed = true;
-    m_savedCursorID = 0;
-}
-
-void IDBCursorBackend::updateCursorData(IDBKey* key, IDBKey* primaryKey, SharedBuffer* valueBuffer)
-{
-    m_currentKey = key;
-    m_currentPrimaryKey = primaryKey;
-    m_currentValueBuffer = valueBuffer;
-}
-
-void IDBCursorBackend::clear()
-{
-    m_cursorID = 0;
-    m_currentKey = nullptr;
-    m_currentPrimaryKey = nullptr;
-    m_currentValueBuffer = nullptr;
-}
-
-} // namespace WebCore
-
-#endif // ENABLE(INDEXED_DATABASE)
diff --git a/Source/WebCore/Modules/indexeddb/legacy/IDBCursorBackend.h b/Source/WebCore/Modules/indexeddb/legacy/IDBCursorBackend.h
deleted file mode 100644 (file)
index 424d1f9..0000000
+++ /dev/null
@@ -1,96 +0,0 @@
-/*
- * Copyright (C) 2010 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1.  Redistributions of source code must retain the above copyright
- *     notice, this list of conditions and the following disclaimer.
- * 2.  Redistributions in binary form must reproduce the above copyright
- *     notice, this list of conditions and the following disclaimer in the
- *     documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-
-#ifndef IDBCursorBackend_h
-#define IDBCursorBackend_h
-
-#if ENABLE(INDEXED_DATABASE)
-
-#include "IDBDatabaseBackend.h"
-#include "IDBTransactionBackend.h"
-#include <wtf/RefPtr.h>
-
-namespace WebCore {
-
-class IDBKeyRange;
-class SharedBuffer;
-
-class IDBCursorBackend : public RefCounted<IDBCursorBackend> {
-public:
-    static Ref<IDBCursorBackend> create(int64_t cursorID, IndexedDB::CursorType cursorType, IDBTransactionBackend& transaction, int64_t objectStoreID)
-    {
-        return adoptRef(*new IDBCursorBackend(cursorID, cursorType, IDBDatabaseBackend::NormalTask, transaction, objectStoreID));
-    }
-    static Ref<IDBCursorBackend> create(int64_t cursorID, IndexedDB::CursorType cursorType, IDBDatabaseBackend::TaskType taskType, IDBTransactionBackend& transaction, int64_t objectStoreID)
-    {
-        return adoptRef(*new IDBCursorBackend(cursorID, cursorType, taskType, transaction, objectStoreID));
-    }
-    ~IDBCursorBackend();
-
-    void advance(unsigned long, PassRefPtr<IDBCallbacks>, ExceptionCode&);
-    void continueFunction(PassRefPtr<IDBKey>, PassRefPtr<IDBCallbacks>, ExceptionCode&);
-    void deleteFunction(PassRefPtr<IDBCallbacks>, ExceptionCode&);
-    void postSuccessHandlerCallback() { }
-
-    IDBKey* key() const { return m_currentKey.get(); }
-    IDBKey* primaryKey() const { return m_currentPrimaryKey.get(); }
-    SharedBuffer* valueBuffer() const { return (m_cursorType == IndexedDB::CursorType::KeyOnly) ? nullptr : m_currentValueBuffer.get(); }
-    void updateCursorData(IDBKey*, IDBKey* primaryKey, SharedBuffer* valueBuffer);
-
-    void close();
-
-    IndexedDB::CursorType cursorType() const { return m_cursorType; }
-
-    int64_t id() const { return m_cursorID; }
-
-    IDBTransactionBackend& transaction() { return *m_transaction; }
-
-    void clear();
-    void setSavedCursorID(int64_t cursorID) { m_savedCursorID = cursorID; }
-
-private:
-    IDBCursorBackend(int64_t cursorID, IndexedDB::CursorType, IDBDatabaseBackend::TaskType, IDBTransactionBackend&, int64_t objectStoreID);
-
-    IDBDatabaseBackend::TaskType m_taskType;
-    IndexedDB::CursorType m_cursorType;
-    RefPtr<IDBTransactionBackend> m_transaction;
-    const int64_t m_objectStoreID;
-
-    int64_t m_cursorID;
-    int64_t m_savedCursorID;
-
-    RefPtr<IDBKey> m_currentKey;
-    RefPtr<IDBKey> m_currentPrimaryKey;
-    RefPtr<SharedBuffer> m_currentValueBuffer;
-
-    bool m_closed;
-};
-
-} // namespace WebCore
-
-#endif // ENABLE(INDEXED_DATABASE)
-
-#endif // IDBCursorBackend_h
diff --git a/Source/WebCore/Modules/indexeddb/legacy/IDBCursorBackendOperations.cpp b/Source/WebCore/Modules/indexeddb/legacy/IDBCursorBackendOperations.cpp
deleted file mode 100644 (file)
index 5f8a5fe..0000000
+++ /dev/null
@@ -1,89 +0,0 @@
-/*
- * Copyright (C) 2010 Google Inc. All rights reserved.
- * Copyright (C) 2013 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1.  Redistributions of source code must retain the above copyright
- *     notice, this list of conditions and the following disclaimer.
- * 2.  Redistributions in binary form must reproduce the above copyright
- *     notice, this list of conditions and the following disclaimer in the
- *     documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-#include "IDBCursorBackendOperations.h"
-
-#if ENABLE(INDEXED_DATABASE)
-
-#include "IDBServerConnection.h"
-#include "Logging.h"
-
-namespace WebCore {
-
-void CursorAdvanceOperation::perform(std::function<void()> completionCallback)
-{
-    LOG(StorageAPI, "CursorAdvanceOperation");
-
-    RefPtr<CursorAdvanceOperation> operation(this);
-    auto callback = [this, operation, completionCallback](PassRefPtr<IDBKey> key, PassRefPtr<IDBKey> primaryKey, PassRefPtr<SharedBuffer> valueBuffer, PassRefPtr<IDBDatabaseError> error) {
-        if (error) {
-            m_cursor->clear();
-            m_callbacks->onError(error);
-        } else if (!key) {
-            // If there's no error but also no key, then the cursor reached the end.
-            m_cursor->clear();
-            m_callbacks->onSuccess(static_cast<SharedBuffer*>(nullptr));
-        } else {
-            m_cursor->updateCursorData(key.get(), primaryKey.get(), valueBuffer.get());
-            m_callbacks->onSuccess(key, primaryKey, valueBuffer);
-        }
-
-        // FIXME: Cursor operations should be able to pass along an error instead of success
-        completionCallback();
-    };
-
-    m_cursor->transaction().database().serverConnection().cursorAdvance(*m_cursor, *this, callback);
-}
-
-void CursorIterationOperation::perform(std::function<void()> completionCallback)
-{
-    LOG(StorageAPI, "CursorIterationOperation");
-
-    RefPtr<CursorIterationOperation> operation(this);
-    auto callback = [this, operation, completionCallback](PassRefPtr<IDBKey> key, PassRefPtr<IDBKey> primaryKey, PassRefPtr<SharedBuffer> valueBuffer, PassRefPtr<IDBDatabaseError> error) {
-        if (error) {
-            m_cursor->clear();
-            m_callbacks->onError(error);
-        } else if (!key) {
-            // If there's no error but also no key, then the cursor reached the end.
-            m_cursor->clear();
-            m_callbacks->onSuccess(static_cast<SharedBuffer*>(nullptr));
-        } else {
-            m_cursor->updateCursorData(key.get(), primaryKey.get(), valueBuffer.get());
-            m_callbacks->onSuccess(key, primaryKey, valueBuffer);
-        }
-
-        // FIXME: Cursor operations should be able to pass along an error instead of success
-        completionCallback();
-    };
-
-    m_cursor->transaction().database().serverConnection().cursorIterate(*m_cursor, *this, callback);
-}
-
-} // namespace WebCore
-
-#endif // ENABLED(INDEXED_DATABASE)
diff --git a/Source/WebCore/Modules/indexeddb/legacy/IDBCursorBackendOperations.h b/Source/WebCore/Modules/indexeddb/legacy/IDBCursorBackendOperations.h
deleted file mode 100644 (file)
index 627977b..0000000
+++ /dev/null
@@ -1,88 +0,0 @@
-/*
- * Copyright (C) 2010 Google Inc. All rights reserved.
- * Copyright (C) 2013 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1.  Redistributions of source code must retain the above copyright
- *     notice, this list of conditions and the following disclaimer.
- * 2.  Redistributions in binary form must reproduce the above copyright
- *     notice, this list of conditions and the following disclaimer in the
- *     documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef IDBCursorBackendOperations_h
-#define IDBCursorBackendOperations_h
-
-#if ENABLE(INDEXED_DATABASE)
-
-#include "IDBCursorBackend.h"
-#include "IDBOperation.h"
-
-namespace WebCore {
-
-class CursorIterationOperation : public IDBOperation {
-public:
-    static Ref<IDBOperation> create(PassRefPtr<IDBCursorBackend> cursor, PassRefPtr<IDBKey> key, PassRefPtr<IDBCallbacks> callbacks)
-    {
-        return adoptRef(*new CursorIterationOperation(cursor, key, callbacks));
-    }
-    virtual void perform(std::function<void()> completionCallback) override final;
-
-    int64_t cursorID() const { return m_cursor->id(); }
-    IDBKey* key() const { return m_key.get(); }
-
-private:
-    CursorIterationOperation(PassRefPtr<IDBCursorBackend> cursor, PassRefPtr<IDBKey> key, PassRefPtr<IDBCallbacks> callbacks)
-        : m_cursor(cursor)
-        , m_key(key)
-        , m_callbacks(callbacks)
-    {
-    }
-
-    RefPtr<IDBCursorBackend> m_cursor;
-    RefPtr<IDBKey> m_key;
-    RefPtr<IDBCallbacks> m_callbacks;
-};
-
-class CursorAdvanceOperation : public IDBOperation {
-public:
-    static Ref<IDBOperation> create(PassRefPtr<IDBCursorBackend> cursor, unsigned long count, PassRefPtr<IDBCallbacks> callbacks)
-    {
-        return adoptRef(*new CursorAdvanceOperation(cursor, count, callbacks));
-    }
-    virtual void perform(std::function<void()> completionCallback) override final;
-
-    int64_t cursorID() const { return m_cursor->id(); }
-    unsigned long count() const { return m_count; }
-
-private:
-    CursorAdvanceOperation(PassRefPtr<IDBCursorBackend> cursor, unsigned long count, PassRefPtr<IDBCallbacks> callbacks)
-        : m_cursor(cursor)
-        , m_count(count)
-        , m_callbacks(callbacks)
-    {
-    }
-
-    RefPtr<IDBCursorBackend> m_cursor;
-    unsigned long m_count;
-    RefPtr<IDBCallbacks> m_callbacks;
-};
-
-} // namespace WebCore
-
-#endif // ENABLE(INDEXED_DATABASE)
-#endif // IDBCursorBackendOperations_h
diff --git a/Source/WebCore/Modules/indexeddb/legacy/IDBDatabaseBackend.cpp b/Source/WebCore/Modules/indexeddb/legacy/IDBDatabaseBackend.cpp
deleted file mode 100644 (file)
index f81bf4d..0000000
+++ /dev/null
@@ -1,622 +0,0 @@
-/*
- * Copyright (C) 2011 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1.  Redistributions of source code must retain the above copyright
- *     notice, this list of conditions and the following disclaimer.
- * 2.  Redistributions in binary form must reproduce the above copyright
- *     notice, this list of conditions and the following disclaimer in the
- *     documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-#include "IDBDatabaseBackend.h"
-
-#if ENABLE(INDEXED_DATABASE)
-
-#include "IDBCursorBackend.h"
-#include "IDBDatabaseCallbacks.h"
-#include "IDBDatabaseException.h"
-#include "IDBFactoryBackendInterface.h"
-#include "IDBKeyRange.h"
-#include "IDBRecordIdentifier.h"
-#include "IDBServerConnection.h"
-#include "IDBTransactionBackend.h"
-#include "IDBTransactionCoordinator.h"
-#include "Logging.h"
-#include "SharedBuffer.h"
-#include <wtf/TemporaryChange.h>
-
-namespace WebCore {
-
-Ref<IDBDatabaseBackend> IDBDatabaseBackend::create(const String& name, const String& uniqueIdentifier, IDBFactoryBackendInterface* factory, IDBServerConnection& serverConnection)
-{
-    Ref<IDBDatabaseBackend> backend = adoptRef(*new IDBDatabaseBackend(name, uniqueIdentifier, factory, serverConnection));
-    backend->openInternalAsync();
-    
-    return backend;
-}
-
-IDBDatabaseBackend::IDBDatabaseBackend(const String& name, const String& uniqueIdentifier, IDBFactoryBackendInterface* factory, IDBServerConnection& serverConnection)
-    : m_metadata(name, InvalidId, 0, InvalidId)
-    , m_identifier(uniqueIdentifier)
-    , m_factory(factory)
-    , m_serverConnection(serverConnection)
-    , m_transactionCoordinator(std::make_unique<IDBTransactionCoordinator>())
-    , m_closingConnection(false)
-    , m_didOpenInternal(false)
-{
-    ASSERT(!m_metadata.name.isNull());
-}
-
-void IDBDatabaseBackend::addObjectStore(const IDBObjectStoreMetadata& objectStore, int64_t newMaxObjectStoreId)
-{
-    ASSERT(!m_metadata.objectStores.contains(objectStore.id));
-    if (newMaxObjectStoreId != IDBObjectStoreMetadata::InvalidId) {
-        ASSERT(m_metadata.maxObjectStoreId < newMaxObjectStoreId);
-        m_metadata.maxObjectStoreId = newMaxObjectStoreId;
-    }
-    m_metadata.objectStores.set(objectStore.id, objectStore);
-}
-
-void IDBDatabaseBackend::removeObjectStore(int64_t objectStoreId)
-{
-    ASSERT(m_metadata.objectStores.contains(objectStoreId));
-    m_metadata.objectStores.remove(objectStoreId);
-}
-
-void IDBDatabaseBackend::addIndex(int64_t objectStoreId, const IDBIndexMetadata& index, int64_t newMaxIndexId)
-{
-    ASSERT(m_metadata.objectStores.contains(objectStoreId));
-    IDBObjectStoreMetadata objectStore = m_metadata.objectStores.get(objectStoreId);
-
-    ASSERT(!objectStore.indexes.contains(index.id));
-    objectStore.indexes.set(index.id, index);
-    if (newMaxIndexId != IDBIndexMetadata::InvalidId) {
-        ASSERT(objectStore.maxIndexId < newMaxIndexId);
-        objectStore.maxIndexId = newMaxIndexId;
-    }
-    m_metadata.objectStores.set(objectStoreId, objectStore);
-}
-
-void IDBDatabaseBackend::removeIndex(int64_t objectStoreId, int64_t indexId)
-{
-    ASSERT(m_metadata.objectStores.contains(objectStoreId));
-    IDBObjectStoreMetadata objectStore = m_metadata.objectStores.get(objectStoreId);
-
-    ASSERT(objectStore.indexes.contains(indexId));
-    objectStore.indexes.remove(indexId);
-    m_metadata.objectStores.set(objectStoreId, objectStore);
-}
-
-void IDBDatabaseBackend::openInternalAsync()
-{
-    RefPtr<IDBDatabaseBackend> self = this;
-    m_serverConnection->getOrEstablishIDBDatabaseMetadata([self](const IDBDatabaseMetadata& metadata, bool success) {
-        self->didOpenInternalAsync(metadata, success);
-    });
-}
-
-void IDBDatabaseBackend::didOpenInternalAsync(const IDBDatabaseMetadata& metadata, bool success)
-{
-    m_didOpenInternal = true;
-
-    if (!success) {
-        processPendingOpenCalls(false);
-        return;
-    }
-
-    m_metadata = metadata;
-
-    processPendingCalls();
-}
-
-IDBDatabaseBackend::~IDBDatabaseBackend()
-{
-    m_factory->removeIDBDatabaseBackend(m_identifier);
-}
-
-void IDBDatabaseBackend::createObjectStore(int64_t transactionId, int64_t objectStoreId, const String& name, const IDBKeyPath& keyPath, bool autoIncrement)
-{
-    LOG(StorageAPI, "IDBDatabaseBackend::createObjectStore");
-    IDBTransactionBackend* transaction = m_transactions.get(transactionId);
-    if (!transaction)
-        return;
-    ASSERT(transaction->mode() == IndexedDB::TransactionMode::VersionChange);
-
-    ASSERT(!m_metadata.objectStores.contains(objectStoreId));
-    IDBObjectStoreMetadata objectStoreMetadata(name, objectStoreId, keyPath, autoIncrement, IDBDatabaseBackend::MinimumIndexId);
-
-    transaction->scheduleCreateObjectStoreOperation(objectStoreMetadata);
-    addObjectStore(objectStoreMetadata, objectStoreId);
-}
-
-void IDBDatabaseBackend::deleteObjectStore(int64_t transactionId, int64_t objectStoreId)
-{
-    LOG(StorageAPI, "IDBDatabaseBackend::deleteObjectStore");
-    IDBTransactionBackend* transaction = m_transactions.get(transactionId);
-    if (!transaction)
-        return;
-    ASSERT(transaction->mode() == IndexedDB::TransactionMode::VersionChange);
-
-    ASSERT(m_metadata.objectStores.contains(objectStoreId));
-    const IDBObjectStoreMetadata& objectStoreMetadata = m_metadata.objectStores.get(objectStoreId);
-
-    transaction->scheduleDeleteObjectStoreOperation(objectStoreMetadata);
-    removeObjectStore(objectStoreId);
-}
-
-void IDBDatabaseBackend::createIndex(int64_t transactionId, int64_t objectStoreId, int64_t indexId, const String& name, const IDBKeyPath& keyPath, bool unique, bool multiEntry)
-{
-    LOG(StorageAPI, "IDBDatabaseBackend::createIndex");
-    IDBTransactionBackend* transaction = m_transactions.get(transactionId);
-    if (!transaction)
-        return;
-    ASSERT(transaction->mode() == IndexedDB::TransactionMode::VersionChange);
-
-    ASSERT(m_metadata.objectStores.contains(objectStoreId));
-    const IDBObjectStoreMetadata objectStore = m_metadata.objectStores.get(objectStoreId);
-
-    ASSERT(!objectStore.indexes.contains(indexId));
-    const IDBIndexMetadata indexMetadata(name, indexId, keyPath, unique, multiEntry);
-
-    transaction->scheduleCreateIndexOperation(objectStoreId, indexMetadata);
-
-    addIndex(objectStoreId, indexMetadata, indexId);
-}
-
-void IDBDatabaseBackend::deleteIndex(int64_t transactionId, int64_t objectStoreId, int64_t indexId)
-{
-    LOG(StorageAPI, "IDBDatabaseBackend::deleteIndex");
-    IDBTransactionBackend* transaction = m_transactions.get(transactionId);
-    if (!transaction)
-        return;
-    ASSERT(transaction->mode() == IndexedDB::TransactionMode::VersionChange);
-
-    ASSERT(m_metadata.objectStores.contains(objectStoreId));
-    const IDBObjectStoreMetadata objectStore = m_metadata.objectStores.get(objectStoreId);
-
-    ASSERT(objectStore.indexes.contains(indexId));
-    const IDBIndexMetadata& indexMetadata = objectStore.indexes.get(indexId);
-
-    transaction->scheduleDeleteIndexOperation(objectStoreId, indexMetadata);
-
-    removeIndex(objectStoreId, indexId);
-}
-
-void IDBDatabaseBackend::commit(int64_t transactionId)
-{
-    // The frontend suggests that we commit, but we may have previously initiated an abort, and so have disposed of the transaction. onAbort has already been dispatched to the frontend, so it will find out about that asynchronously.
-    if (m_transactions.contains(transactionId))
-        m_transactions.get(transactionId)->commit();
-}
-
-void IDBDatabaseBackend::abort(int64_t transactionId)
-{
-    // If the transaction is unknown, then it has already been aborted by the backend before this call so it is safe to ignore it.
-    if (m_transactions.contains(transactionId))
-        m_transactions.get(transactionId)->abort();
-}
-
-void IDBDatabaseBackend::abort(int64_t transactionId, PassRefPtr<IDBDatabaseError> error)
-{
-    // If the transaction is unknown, then it has already been aborted by the backend before this call so it is safe to ignore it.
-    if (m_transactions.contains(transactionId))
-        m_transactions.get(transactionId)->abort(error);
-}
-
-void IDBDatabaseBackend::get(int64_t transactionId, int64_t objectStoreId, int64_t indexId, PassRefPtr<IDBKeyRange> keyRange, bool keyOnly, PassRefPtr<IDBCallbacks> callbacks)
-{
-    LOG(StorageAPI, "IDBDatabaseBackend::get");
-    IDBTransactionBackend* transaction = m_transactions.get(transactionId);
-    if (!transaction)
-        return;
-
-    transaction->scheduleGetOperation(m_metadata, objectStoreId, indexId, keyRange, keyOnly ? IndexedDB::CursorType::KeyOnly : IndexedDB::CursorType::KeyAndValue, callbacks);
-}
-
-void IDBDatabaseBackend::put(int64_t transactionId, int64_t objectStoreId, PassRefPtr<SharedBuffer> value, PassRefPtr<IDBKey> key, PutMode putMode, PassRefPtr<IDBCallbacks> callbacks, const Vector<int64_t>& indexIds, const Vector<IndexKeys>& indexKeys)
-{
-    LOG(StorageAPI, "IDBDatabaseBackend::put");
-    IDBTransactionBackend* transaction = m_transactions.get(transactionId);
-    if (!transaction)
-        return;
-    ASSERT(transaction->mode() != IndexedDB::TransactionMode::ReadOnly);
-
-    const IDBObjectStoreMetadata objectStoreMetadata = m_metadata.objectStores.get(objectStoreId);
-
-    ASSERT(objectStoreMetadata.autoIncrement || key.get());
-
-    transaction->schedulePutOperation(objectStoreMetadata, value, key, putMode, callbacks, indexIds, indexKeys);
-}
-
-void IDBDatabaseBackend::setIndexKeys(int64_t transactionID, int64_t objectStoreID, PassRefPtr<IDBKey> prpPrimaryKey, const Vector<int64_t, 1>& indexIDs, const Vector<IndexKeys, 1>& indexKeys)
-{
-    LOG(StorageAPI, "IDBDatabaseBackend::setIndexKeys");
-    ASSERT(prpPrimaryKey);
-    ASSERT(m_metadata.objectStores.contains(objectStoreID));
-
-    RefPtr<IDBTransactionBackend> transaction = m_transactions.get(transactionID);
-    if (!transaction)
-        return;
-    ASSERT(transaction->mode() == IndexedDB::TransactionMode::VersionChange);
-
-    RefPtr<IDBKey> primaryKey = prpPrimaryKey;
-    m_serverConnection->setIndexKeys(transactionID, m_metadata.id, objectStoreID, m_metadata.objectStores.get(objectStoreID), *primaryKey, indexIDs, indexKeys, [transaction](PassRefPtr<IDBDatabaseError> error) {
-        if (error)
-            transaction->abort(error);
-    });
-}
-
-void IDBDatabaseBackend::setIndexesReady(int64_t transactionId, int64_t, const Vector<int64_t, 1>& indexIds)
-{
-    LOG(StorageAPI, "IDBDatabaseBackend::setIndexesReady");
-
-    IDBTransactionBackend* transaction = m_transactions.get(transactionId);
-    if (!transaction)
-        return;
-
-    transaction->scheduleSetIndexesReadyOperation(indexIds.size());
-}
-
-void IDBDatabaseBackend::openCursor(int64_t transactionId, int64_t objectStoreId, int64_t indexId, PassRefPtr<IDBKeyRange> keyRange, IndexedDB::CursorDirection direction, bool keyOnly, TaskType taskType, PassRefPtr<IDBCallbacks> callbacks)
-{
-    LOG(StorageAPI, "IDBDatabaseBackend::openCursor");
-    IDBTransactionBackend* transaction = m_transactions.get(transactionId);
-    if (!transaction)
-        return;
-
-    transaction->scheduleOpenCursorOperation(objectStoreId, indexId, keyRange, direction, keyOnly ? IndexedDB::CursorType::KeyOnly : IndexedDB::CursorType::KeyAndValue, taskType, callbacks);
-}
-
-void IDBDatabaseBackend::count(int64_t transactionId, int64_t objectStoreId, int64_t indexId, PassRefPtr<IDBKeyRange> keyRange, PassRefPtr<IDBCallbacks> callbacks)
-{
-    LOG(StorageAPI, "IDBDatabaseBackend::count");
-    IDBTransactionBackend* transaction = m_transactions.get(transactionId);
-    if (!transaction)
-        return;
-
-    ASSERT(m_metadata.objectStores.contains(objectStoreId));
-    transaction->scheduleCountOperation(objectStoreId, indexId, keyRange, callbacks);
-}
-
-
-void IDBDatabaseBackend::deleteRange(int64_t transactionId, int64_t objectStoreId, PassRefPtr<IDBKeyRange> keyRange, PassRefPtr<IDBCallbacks> callbacks)
-{
-    LOG(StorageAPI, "IDBDatabaseBackend::deleteRange");
-    IDBTransactionBackend* transaction = m_transactions.get(transactionId);
-    if (!transaction)
-        return;
-    ASSERT(transaction->mode() != IndexedDB::TransactionMode::ReadOnly);
-
-    transaction->scheduleDeleteRangeOperation(objectStoreId, keyRange, callbacks);
-}
-
-void IDBDatabaseBackend::clearObjectStore(int64_t transactionId, int64_t objectStoreId, PassRefPtr<IDBCallbacks> callbacks)
-{
-    LOG(StorageAPI, "IDBDatabaseBackend::clearObjectStore %lli in transaction %lli", static_cast<long long>(objectStoreId), static_cast<long long>(transactionId));
-    IDBTransactionBackend* transaction = m_transactions.get(transactionId);
-    if (!transaction)
-        return;
-    ASSERT(transaction->mode() != IndexedDB::TransactionMode::ReadOnly);
-
-    transaction->scheduleClearObjectStoreOperation(objectStoreId, callbacks);
-}
-
-void IDBDatabaseBackend::transactionStarted(IDBTransactionBackend* transaction)
-{
-    if (transaction->mode() == IndexedDB::TransactionMode::VersionChange) {
-        ASSERT(!m_runningVersionChangeTransaction);
-        m_runningVersionChangeTransaction = transaction;
-    }
-}
-
-void IDBDatabaseBackend::transactionFinished(IDBTransactionBackend* rawTransaction)
-{
-    RefPtr<IDBTransactionBackend> transaction = rawTransaction;
-    ASSERT(m_transactions.contains(transaction->id()));
-    ASSERT(m_transactions.get(transaction->id()) == transaction.get());
-    m_transactions.remove(transaction->id());
-    if (transaction->mode() == IndexedDB::TransactionMode::VersionChange) {
-        ASSERT(transaction.get() == m_runningVersionChangeTransaction.get());
-        m_runningVersionChangeTransaction = nullptr;
-    }
-}
-
-void IDBDatabaseBackend::transactionFinishedAndAbortFired(IDBTransactionBackend* rawTransaction)
-{
-    RefPtr<IDBTransactionBackend> transaction = rawTransaction;
-    if (transaction->mode() == IndexedDB::TransactionMode::VersionChange) {
-        // If this was an open-with-version call, there will be a "second
-        // half" open call waiting for us in processPendingCalls.
-        // FIXME: When we no longer support setVersion, assert such a thing.
-        if (m_pendingSecondHalfOpen) {
-            m_pendingSecondHalfOpen->callbacks()->onError(IDBDatabaseError::create(IDBDatabaseException::AbortError, "Version change transaction was aborted in upgradeneeded event handler."));
-            m_pendingSecondHalfOpen = nullptr;
-        }
-        processPendingCalls();
-    }
-}
-
-void IDBDatabaseBackend::transactionFinishedAndCompleteFired(IDBTransactionBackend* rawTransaction)
-{
-    RefPtr<IDBTransactionBackend> transaction = rawTransaction;
-    if (transaction->mode() == IndexedDB::TransactionMode::VersionChange)
-        processPendingCalls();
-}
-
-size_t IDBDatabaseBackend::connectionCount()
-{
-    // This does not include pending open calls, as those should not block version changes and deletes.
-    return m_databaseCallbacksSet.size();
-}
-
-void IDBDatabaseBackend::processPendingCalls()
-{
-    // processPendingCalls() will be called again after openInternalAsync() completes.
-    if (!m_didOpenInternal)
-        return;
-
-    if (m_pendingSecondHalfOpen) {
-        ASSERT(m_pendingSecondHalfOpen->version() == m_metadata.version);
-        ASSERT(m_metadata.id != InvalidId);
-        m_pendingSecondHalfOpen->callbacks()->onSuccess(this, this->metadata());
-        m_pendingSecondHalfOpen = nullptr;
-        // Fall through when complete, as pending deletes may be (partially) unblocked.
-    }
-
-    // Note that this check is only an optimization to reduce queue-churn and
-    // not necessary for correctness; deleteDatabase and openConnection will
-    // requeue their calls if this condition is true.
-    if (m_runningVersionChangeTransaction)
-        return;
-
-    if (!m_pendingDeleteCalls.isEmpty() && isDeleteDatabaseBlocked())
-        return;
-    while (!m_pendingDeleteCalls.isEmpty()) {
-        std::unique_ptr<IDBPendingDeleteCall> pendingDeleteCall = m_pendingDeleteCalls.takeFirst();
-        m_deleteCallbacksWaitingCompletion.add(pendingDeleteCall->callbacks());
-        deleteDatabaseAsync(pendingDeleteCall->callbacks());
-    }
-
-    // deleteDatabaseAsync should never re-queue calls.
-    ASSERT(m_pendingDeleteCalls.isEmpty());
-
-    // If there are any database deletions waiting for completion, we're done for now.
-    // Further callbacks will be handled in a future call to processPendingCalls().
-    if (!m_deleteCallbacksWaitingCompletion.isEmpty())
-        return;
-
-    if (m_runningVersionChangeTransaction)
-        return;
-
-    processPendingOpenCalls(true);
-}
-
-void IDBDatabaseBackend::processPendingOpenCalls(bool success)
-{
-    // Open calls can be requeued if an open call started a version change transaction or deletes the database.
-    Deque<std::unique_ptr<IDBPendingOpenCall>> pendingOpenCalls;
-    m_pendingOpenCalls.swap(pendingOpenCalls);
-
-    while (!pendingOpenCalls.isEmpty()) {
-        std::unique_ptr<IDBPendingOpenCall> pendingOpenCall = pendingOpenCalls.takeFirst();
-        if (success) {
-            if (m_metadata.id == InvalidId) {
-                // This database was deleted then quickly re-opened.
-                // openInternalAsync() will recreate it in the backing store and then resume processing pending callbacks.
-                pendingOpenCalls.prepend(WTFMove(pendingOpenCall));
-                pendingOpenCalls.swap(m_pendingOpenCalls);
-
-                openInternalAsync();
-                return;
-            }
-            openConnectionInternal(pendingOpenCall->callbacks(), pendingOpenCall->databaseCallbacks(), pendingOpenCall->transactionId(), pendingOpenCall->version());
-        } else {
-            String message;
-            if (pendingOpenCall->version() == IDBDatabaseMetadata::NoIntVersion)
-                message = "Internal error opening database with no version specified.";
-            else
-                message = String::format("Internal error opening database with version %" PRIu64, pendingOpenCall->version());
-            pendingOpenCall->callbacks()->onError(IDBDatabaseError::create(IDBDatabaseException::UnknownError, message));
-        }
-    }
-}
-
-void IDBDatabaseBackend::createTransaction(int64_t transactionID, PassRefPtr<IDBDatabaseCallbacks> callbacks, const Vector<int64_t>& objectStoreIDs, IndexedDB::TransactionMode mode)
-{
-    RefPtr<IDBTransactionBackend> transaction = IDBTransactionBackend::create(this, transactionID, callbacks, objectStoreIDs, mode);
-
-    ASSERT(!m_transactions.contains(transactionID));
-    m_transactions.add(transactionID, transaction.get());
-}
-
-void IDBDatabaseBackend::openConnection(PassRefPtr<IDBCallbacks> prpCallbacks, PassRefPtr<IDBDatabaseCallbacks> prpDatabaseCallbacks, int64_t transactionId, uint64_t version)
-{
-    RefPtr<IDBCallbacks> callbacks = prpCallbacks;
-    RefPtr<IDBDatabaseCallbacks> databaseCallbacks = prpDatabaseCallbacks;
-
-    m_pendingOpenCalls.append(std::make_unique<IDBPendingOpenCall>(*callbacks, *databaseCallbacks, transactionId, version));
-
-    processPendingCalls();
-}
-
-void IDBDatabaseBackend::openConnectionInternal(PassRefPtr<IDBCallbacks> prpCallbacks, PassRefPtr<IDBDatabaseCallbacks> prpDatabaseCallbacks, int64_t transactionId, uint64_t version)
-{
-    ASSERT(m_pendingDeleteCalls.isEmpty());
-    ASSERT(!m_runningVersionChangeTransaction);
-
-    RefPtr<IDBCallbacks> callbacks = prpCallbacks;
-    RefPtr<IDBDatabaseCallbacks> databaseCallbacks = prpDatabaseCallbacks;
-
-    // We infer that the database didn't exist from its lack of version.
-    bool isNewDatabase = m_metadata.version == IDBDatabaseMetadata::NoIntVersion;
-
-    if (version == IDBDatabaseMetadata::DefaultIntVersion && !isNewDatabase) {
-        m_databaseCallbacksSet.add(databaseCallbacks);
-        callbacks->onSuccess(this, this->metadata());
-        return;
-    }
-
-    if (isNewDatabase && version == IDBDatabaseMetadata::DefaultIntVersion) {
-        // Spec says: If no version is specified and no database exists, set database version to 1.
-        version = 1;
-    }
-
-    if (version > m_metadata.version || m_metadata.version == IDBDatabaseMetadata::NoIntVersion) {
-        runIntVersionChangeTransaction(callbacks, databaseCallbacks, transactionId, version);
-        return;
-    }
-
-    if (version < m_metadata.version && m_metadata.version != IDBDatabaseMetadata::NoIntVersion) {
-        callbacks->onError(IDBDatabaseError::create(IDBDatabaseException::VersionError, String::format("The requested version (%" PRIu64 ") is less than the existing version (%" PRIu64 ").", version, m_metadata.version)));
-        return;
-    }
-
-    ASSERT(version == m_metadata.version);
-    m_databaseCallbacksSet.add(databaseCallbacks);
-    callbacks->onSuccess(this, this->metadata());
-}
-
-void IDBDatabaseBackend::runIntVersionChangeTransaction(PassRefPtr<IDBCallbacks> prpCallbacks, PassRefPtr<IDBDatabaseCallbacks> prpDatabaseCallbacks, int64_t transactionId, int64_t requestedVersion)
-{
-    RefPtr<IDBCallbacks> callbacks = prpCallbacks;
-    RefPtr<IDBDatabaseCallbacks> databaseCallbacks = prpDatabaseCallbacks;
-    ASSERT(callbacks);
-    for (auto& callback : m_databaseCallbacksSet) {
-        // Front end ensures the event is not fired at connections that have closePending set.
-        if (callback != databaseCallbacks)
-            callback->onVersionChange(m_metadata.version, requestedVersion);
-    }
-    // The spec dictates we wait until all the version change events are
-    // delivered and then check m_databaseCallbacks.empty() before proceeding
-    // or firing a blocked event, but instead we should be consistent with how
-    // the old setVersion (incorrectly) did it.
-    // FIXME: Remove the call to onBlocked and instead wait until the frontend
-    // tells us that all the blocked events have been delivered. See
-    // https://bugs.webkit.org/show_bug.cgi?id=71130
-    if (connectionCount())
-        callbacks->onBlocked(m_metadata.version);
-    // FIXME: Add test for m_runningVersionChangeTransaction.
-    if (m_runningVersionChangeTransaction || connectionCount()) {
-        m_pendingOpenCalls.append(std::make_unique<IDBPendingOpenCall>(*callbacks, *databaseCallbacks, transactionId, requestedVersion));
-        return;
-    }
-
-    Vector<int64_t> objectStoreIds;
-    createTransaction(transactionId, databaseCallbacks, objectStoreIds, IndexedDB::TransactionMode::VersionChange);
-    RefPtr<IDBTransactionBackend> transaction = m_transactions.get(transactionId);
-
-    transaction->scheduleVersionChangeOperation(requestedVersion, callbacks, databaseCallbacks, m_metadata);
-
-    ASSERT(!m_pendingSecondHalfOpen);
-    m_databaseCallbacksSet.add(databaseCallbacks);
-}
-
-void IDBDatabaseBackend::deleteDatabase(PassRefPtr<IDBCallbacks> prpCallbacks)
-{
-    RefPtr<IDBCallbacks> callbacks = prpCallbacks;
-    if (isDeleteDatabaseBlocked()) {
-        for (auto& callback : m_databaseCallbacksSet) {
-            // Front end ensures the event is not fired at connections that have closePending set.
-            callback->onVersionChange(m_metadata.version, 0);
-        }
-        // FIXME: Only fire onBlocked if there are open connections after the
-        // VersionChangeEvents are received, not just set up to fire.
-        // https://bugs.webkit.org/show_bug.cgi?id=71130
-        callbacks->onBlocked(m_metadata.version);
-        m_pendingDeleteCalls.append(std::make_unique<IDBPendingDeleteCall>(callbacks.release()));
-        return;
-    }
-    deleteDatabaseAsync(callbacks.release());
-}
-
-bool IDBDatabaseBackend::isDeleteDatabaseBlocked()
-{
-    return connectionCount();
-}
-
-void IDBDatabaseBackend::deleteDatabaseAsync(PassRefPtr<IDBCallbacks> prpCallbacks)
-{
-    ASSERT(!isDeleteDatabaseBlocked());
-
-    RefPtr<IDBDatabaseBackend> self(this);
-    RefPtr<IDBCallbacks> callbacks = prpCallbacks;
-    m_serverConnection->deleteDatabase(m_metadata.name, [self, callbacks](bool success) {
-        self->m_deleteCallbacksWaitingCompletion.remove(callbacks);
-
-        // If this IDBDatabaseBackend was closed while waiting for deleteDatabase to complete, no point in performing any callbacks.
-        if (!self->m_serverConnection->isClosed())
-            return;
-
-        if (success) {
-            self->m_metadata.id = InvalidId;
-            self->m_metadata.version = IDBDatabaseMetadata::NoIntVersion;
-            self->m_metadata.objectStores.clear();
-            callbacks->onSuccess();
-        } else
-            callbacks->onError(IDBDatabaseError::create(IDBDatabaseException::UnknownError, "Internal error deleting database."));
-
-        self->processPendingCalls();
-    });
-}
-
-void IDBDatabaseBackend::close(PassRefPtr<IDBDatabaseCallbacks> prpCallbacks)
-{
-    RefPtr<IDBDatabaseCallbacks> callbacks = prpCallbacks;
-    ASSERT(m_databaseCallbacksSet.contains(callbacks));
-
-    m_databaseCallbacksSet.remove(callbacks);
-    if (m_pendingSecondHalfOpen && m_pendingSecondHalfOpen->databaseCallbacks() == callbacks) {
-        m_pendingSecondHalfOpen->callbacks()->onError(IDBDatabaseError::create(IDBDatabaseException::AbortError, "The connection was closed."));
-        m_pendingSecondHalfOpen = nullptr;
-    }
-
-    if (connectionCount() > 1)
-        return;
-
-    // processPendingCalls allows the inspector to process a pending open call
-    // and call close, reentering IDBDatabaseBackend::close. Then the
-    // backend would be removed both by the inspector closing its connection, and
-    // by the connection that first called close.
-    // To avoid that situation, don't proceed in case of reentrancy.
-    if (m_closingConnection)
-        return;
-    TemporaryChange<bool> closingConnection(m_closingConnection, true);
-    processPendingCalls();
-
-    // FIXME: Add a test for the m_pendingOpenCalls cases below.
-    if (!connectionCount() && !m_pendingOpenCalls.size() && !m_pendingDeleteCalls.size()) {
-        TransactionMap transactions(m_transactions);
-        RefPtr<IDBDatabaseError> error = IDBDatabaseError::create(IDBDatabaseException::UnknownError, "Connection is closing.");
-        for (auto& transaction : transactions.values())
-            transaction->abort(error);
-
-        ASSERT(m_transactions.isEmpty());
-
-        m_serverConnection->close();
-
-        // This check should only be false in unit tests.
-        ASSERT(m_factory);
-        if (m_factory)
-            m_factory->removeIDBDatabaseBackend(m_identifier);
-    }
-}
-
-} // namespace WebCore
-
-#endif // ENABLE(INDEXED_DATABASE)
diff --git a/Source/WebCore/Modules/indexeddb/legacy/IDBDatabaseBackend.h b/Source/WebCore/Modules/indexeddb/legacy/IDBDatabaseBackend.h
deleted file mode 100644 (file)
index cae0d0f..0000000
+++ /dev/null
@@ -1,175 +0,0 @@
-/*
- * Copyright (C) 2010 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1.  Redistributions of source code must retain the above copyright
- *     notice, this list of conditions and the following disclaimer.
- * 2.  Redistributions in binary form must reproduce the above copyright
- *     notice, this list of conditions and the following disclaimer in the
- *     documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef IDBDatabaseBackend_h
-#define IDBDatabaseBackend_h
-
-#include "IDBDatabaseCallbacks.h"
-#include "IDBDatabaseMetadata.h"
-#include "IDBKeyRange.h"
-#include "IDBPendingDeleteCall.h"
-#include "IDBPendingOpenCall.h"
-
-#include <stdint.h>
-#include <wtf/Deque.h>
-#include <wtf/HashMap.h>
-#include <wtf/ListHashSet.h>
-
-#if ENABLE(INDEXED_DATABASE)
-
-namespace WebCore {
-
-class IDBDatabase;
-class IDBFactoryBackendInterface;
-class IDBKey;
-class IDBKeyPath;
-class IDBServerConnection;
-class IDBTransactionBackend;
-class IDBTransactionCoordinator;
-class SharedBuffer;
-
-struct IDBDatabaseMetadata;
-struct IDBIndexMetadata;
-struct IDBObjectStoreMetadata;
-
-typedef Vector<RefPtr<IDBKey>> IndexKeys;
-typedef int ExceptionCode;
-
-class IDBDatabaseBackend : public RefCounted<IDBDatabaseBackend> {
-public:
-    WEBCORE_EXPORT static Ref<IDBDatabaseBackend> create(const String& name, const String& uniqueIdentifier, IDBFactoryBackendInterface*, IDBServerConnection&);
-    WEBCORE_EXPORT ~IDBDatabaseBackend();
-
-    IDBServerConnection& serverConnection() { return m_serverConnection.get(); }
-
-    static const int64_t InvalidId = 0;
-    int64_t id() const { return m_metadata.id; }
-    void addObjectStore(const IDBObjectStoreMetadata&, int64_t newMaxObjectStoreId);
-    void removeObjectStore(int64_t objectStoreId);
-    void addIndex(int64_t objectStoreId, const IDBIndexMetadata&, int64_t newMaxIndexId);
-    void removeIndex(int64_t objectStoreId, int64_t indexId);
-
-    WEBCORE_EXPORT void openConnection(PassRefPtr<IDBCallbacks>, PassRefPtr<IDBDatabaseCallbacks>, int64_t transactionId, uint64_t version);
-    WEBCORE_EXPORT void deleteDatabase(PassRefPtr<IDBCallbacks>);
-
-    // IDBDatabaseBackend
-    void createObjectStore(int64_t transactionId, int64_t objectStoreId, const String& name, const IDBKeyPath&, bool autoIncrement);
-    void deleteObjectStore(int64_t transactionId, int64_t objectStoreId);
-    void createTransaction(int64_t transactionId, PassRefPtr<IDBDatabaseCallbacks>, const Vector<int64_t>& objectStoreIds, IndexedDB::TransactionMode);
-    void close(PassRefPtr<IDBDatabaseCallbacks>);
-
-    void commit(int64_t transactionId);
-    void abort(int64_t transactionId);
-    void abort(int64_t transactionId, PassRefPtr<IDBDatabaseError>);
-
-    void createIndex(int64_t transactionId, int64_t objectStoreId, int64_t indexId, const String& name, const IDBKeyPath&, bool unique, bool multiEntry);
-    void deleteIndex(int64_t transactionId, int64_t objectStoreId, int64_t indexId);
-
-    IDBTransactionCoordinator* transactionCoordinator() const { return m_transactionCoordinator.get(); }
-    void transactionStarted(IDBTransactionBackend*);
-    void transactionFinished(IDBTransactionBackend*);
-    void transactionFinishedAndCompleteFired(IDBTransactionBackend*);
-    void transactionFinishedAndAbortFired(IDBTransactionBackend*);
-
-    enum TaskType {
-        NormalTask = 0,
-        PreemptiveTask
-    };
-
-    enum PutMode {
-        AddOrUpdate,
-        AddOnly,
-        CursorUpdate
-    };
-
-    static const int64_t MinimumIndexId = 30;
-
-    void get(int64_t transactionId, int64_t objectStoreId, int64_t indexId, PassRefPtr<IDBKeyRange>, bool keyOnly, PassRefPtr<IDBCallbacks>);
-    void put(int64_t transactionId, int64_t objectStoreId, PassRefPtr<SharedBuffer> value, PassRefPtr<IDBKey>, PutMode, PassRefPtr<IDBCallbacks>, const Vector<int64_t>& indexIds, const Vector<IndexKeys>&);
-    void setIndexKeys(int64_t transactionId, int64_t objectStoreId, PassRefPtr<IDBKey> prpPrimaryKey, const Vector<int64_t, 1>& indexIds, const Vector<IndexKeys, 1>&);
-    void setIndexesReady(int64_t transactionId, int64_t objectStoreId, const Vector<int64_t, 1>& indexIds);
-    void openCursor(int64_t transactionId, int64_t objectStoreId, int64_t indexId, PassRefPtr<IDBKeyRange>, IndexedDB::CursorDirection, bool keyOnly, TaskType, PassRefPtr<IDBCallbacks>);
-    void count(int64_t transactionId, int64_t objectStoreId, int64_t indexId, PassRefPtr<IDBKeyRange>, PassRefPtr<IDBCallbacks>);
-    void deleteRange(int64_t transactionId, int64_t objectStoreId, PassRefPtr<IDBKeyRange>, PassRefPtr<IDBCallbacks>);
-    void clearObjectStore(int64_t transactionId, int64_t objectStoreId, PassRefPtr<IDBCallbacks>);
-
-    const IDBDatabaseMetadata& metadata() const { return m_metadata; }
-    void setCurrentVersion(uint64_t version) { m_metadata.version = version; }
-
-    bool hasPendingSecondHalfOpen() { return m_pendingSecondHalfOpen.get(); }
-    void setPendingSecondHalfOpen(std::unique_ptr<IDBPendingOpenCall> pendingOpenCall) { m_pendingSecondHalfOpen = WTFMove(pendingOpenCall); }
-
-    IDBFactoryBackendInterface& factoryBackend() { return *m_factory; }
-
-    class VersionChangeOperation;
-    class VersionChangeAbortOperation;
-
-private:
-    IDBDatabaseBackend(const String& name, const String& uniqueIdentifier, IDBFactoryBackendInterface*, IDBServerConnection&);
-
-    void openConnectionInternal(PassRefPtr<IDBCallbacks>, PassRefPtr<IDBDatabaseCallbacks>, int64_t transactionId, uint64_t version);
-
-    void openInternalAsync();
-    void didOpenInternalAsync(const IDBDatabaseMetadata&, bool success);
-
-    void runIntVersionChangeTransaction(PassRefPtr<IDBCallbacks>, PassRefPtr<IDBDatabaseCallbacks>, int64_t transactionId, int64_t requestedVersion);
-    size_t connectionCount();
-    void processPendingCalls();
-    void processPendingOpenCalls(bool success);
-
-    bool isDeleteDatabaseBlocked();
-    void deleteDatabaseAsync(PassRefPtr<IDBCallbacks>);
-
-    IDBDatabaseMetadata m_metadata;
-
-    String m_identifier;
-
-    RefPtr<IDBFactoryBackendInterface> m_factory;
-    Ref<IDBServerConnection> m_serverConnection;
-
-    std::unique_ptr<IDBTransactionCoordinator> m_transactionCoordinator;
-    RefPtr<IDBTransactionBackend> m_runningVersionChangeTransaction;
-
-    typedef HashMap<int64_t, IDBTransactionBackend*> TransactionMap;
-    TransactionMap m_transactions;
-
-    Deque<std::unique_ptr<IDBPendingOpenCall>> m_pendingOpenCalls;
-    std::unique_ptr<IDBPendingOpenCall> m_pendingSecondHalfOpen;
-
-    Deque<std::unique_ptr<IDBPendingDeleteCall>> m_pendingDeleteCalls;
-    HashSet<RefPtr<IDBCallbacks>> m_deleteCallbacksWaitingCompletion;
-
-    typedef ListHashSet<RefPtr<IDBDatabaseCallbacks>> DatabaseCallbacksSet;
-    DatabaseCallbacksSet m_databaseCallbacksSet;
-
-    bool m_closingConnection;
-    bool m_didOpenInternal;
-};
-
-} // namespace WebCore
-
-#endif // ENABLE(INDEXED_DATABASE)
-
-#endif // IDBDatabaseBackend_h
diff --git a/Source/WebCore/Modules/indexeddb/legacy/IDBDatabaseCallbacks.h b/Source/WebCore/Modules/indexeddb/legacy/IDBDatabaseCallbacks.h
deleted file mode 100644 (file)
index 75c0ea5..0000000
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * Copyright (C) 2011 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1.  Redistributions of source code must retain the above copyright
- *     notice, this list of conditions and the following disclaimer.
- * 2.  Redistributions in binary form must reproduce the above copyright
- *     notice, this list of conditions and the following disclaimer in the
- *     documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef IDBDatabaseCallbacks_h
-#define IDBDatabaseCallbacks_h
-
-#if ENABLE(INDEXED_DATABASE)
-
-#include "IDBDatabaseError.h"
-#include "IndexedDB.h"
-#include <wtf/RefCounted.h>
-#include <wtf/text/WTFString.h>
-
-namespace WebCore {
-
-class LegacyDatabase;
-
-class IDBDatabaseCallbacks : public RefCounted<IDBDatabaseCallbacks> {
-public:
-    virtual ~IDBDatabaseCallbacks() { }
-
-    virtual void onForcedClose() = 0;
-    virtual void onVersionChange(uint64_t oldVersion, uint64_t newVersion) = 0;
-
-    virtual void onAbort(int64_t transactionId, PassRefPtr<IDBDatabaseError>) = 0;
-    virtual void onComplete(int64_t transactionId) = 0;
-
-    virtual void connect(LegacyDatabase*) = 0;
-};
-
-} // namespace WebCore
-
-#endif
-
-#endif // IDBDatabaseCallbacks_h
diff --git a/Source/WebCore/Modules/indexeddb/legacy/IDBDatabaseCallbacksImpl.cpp b/Source/WebCore/Modules/indexeddb/legacy/IDBDatabaseCallbacksImpl.cpp
deleted file mode 100644 (file)
index f63ddeb..0000000
+++ /dev/null
@@ -1,82 +0,0 @@
-/*
- * Copyright (C) 2011 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1.  Redistributions of source code must retain the above copyright
- *     notice, this list of conditions and the following disclaimer.
- * 2.  Redistributions in binary form must reproduce the above copyright
- *     notice, this list of conditions and the following disclaimer in the
- *     documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-#include "IDBDatabaseCallbacksImpl.h"
-
-#if ENABLE(INDEXED_DATABASE)
-
-#include "LegacyDatabase.h"
-
-namespace WebCore {
-
-Ref<IDBDatabaseCallbacksImpl> IDBDatabaseCallbacksImpl::create()
-{
-    return adoptRef(*new IDBDatabaseCallbacksImpl());
-}
-
-IDBDatabaseCallbacksImpl::IDBDatabaseCallbacksImpl()
-    : m_database(nullptr)
-{
-}
-
-IDBDatabaseCallbacksImpl::~IDBDatabaseCallbacksImpl()
-{
-}
-
-void IDBDatabaseCallbacksImpl::onForcedClose()
-{
-    if (m_database)
-        m_database->forceClose();
-}
-
-void IDBDatabaseCallbacksImpl::onVersionChange(uint64_t oldVersion, uint64_t newVersion)
-{
-    if (m_database)
-        m_database->onVersionChange(oldVersion, newVersion);
-}
-
-void IDBDatabaseCallbacksImpl::connect(LegacyDatabase* database)
-{
-    ASSERT(!m_database);
-    ASSERT(database);
-    m_database = database;
-}
-
-void IDBDatabaseCallbacksImpl::onAbort(int64_t transactionId, PassRefPtr<IDBDatabaseError> error)
-{
-    if (m_database)
-        m_database->onAbort(transactionId, error);
-}
-
-void IDBDatabaseCallbacksImpl::onComplete(int64_t transactionId)
-{
-    if (m_database)
-        m_database->onComplete(transactionId);
-}
-
-} // namespace WebCore
-
-#endif
diff --git a/Source/WebCore/Modules/indexeddb/legacy/IDBDatabaseCallbacksImpl.h b/Source/WebCore/Modules/indexeddb/legacy/IDBDatabaseCallbacksImpl.h
deleted file mode 100644 (file)
index 5d3b0cb..0000000
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * Copyright (C) 2011 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1.  Redistributions of source code must retain the above copyright
- *     notice, this list of conditions and the following disclaimer.
- * 2.  Redistributions in binary form must reproduce the above copyright
- *     notice, this list of conditions and the following disclaimer in the
- *     documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef IDBDatabaseCallbacksImpl_h
-#define IDBDatabaseCallbacksImpl_h
-
-#include "IDBDatabaseCallbacks.h"
-#include <wtf/RefCounted.h>
-#include <wtf/text/WTFString.h>
-
-#if ENABLE(INDEXED_DATABASE)
-
-namespace WebCore {
-
-class LegacyDatabase;
-
-class IDBDatabaseCallbacksImpl final : public IDBDatabaseCallbacks {
-public:
-    static Ref<IDBDatabaseCallbacksImpl> create();
-    virtual ~IDBDatabaseCallbacksImpl() override;
-
-    // IDBDatabaseCallbacks
-    virtual void onForcedClose() override;
-    virtual void onVersionChange(uint64_t oldVersion, uint64_t newVersion) override;
-
-    virtual void onAbort(int64_t transactionId, PassRefPtr<IDBDatabaseError>) override;
-    virtual void onComplete(int64_t transactionId) override;
-
-    virtual void connect(LegacyDatabase*) override;
-
-private:
-    IDBDatabaseCallbacksImpl();
-
-    // The initial IDBOpenDBRequest or final IDBDatabase maintains a RefPtr to this
-    LegacyDatabase* m_database;
-};
-
-} // namespace WebCore
-
-#endif
-
-#endif // IDBDatabaseCallbacksImpl_h
diff --git a/Source/WebCore/Modules/indexeddb/legacy/IDBFactoryBackendInterface.h b/Source/WebCore/Modules/indexeddb/legacy/IDBFactoryBackendInterface.h
deleted file mode 100644 (file)
index 3299019..0000000
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (C) 2010 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1.  Redistributions of source code must retain the above copyright
- *     notice, this list of conditions and the following disclaimer.
- * 2.  Redistributions in binary form must reproduce the above copyright
- *     notice, this list of conditions and the following disclaimer in the
- *     documentation and/or other materials provided with the distribution.
- * 3.  Neither the name of Apple Inc. ("Apple") nor the names of
- *     its contributors may be used to endorse or promote products derived
- *     from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-#ifndef IDBFactoryBackendInterface_h
-#define IDBFactoryBackendInterface_h
-
-#include "IDBDatabaseBackend.h"
-#include "IndexedDB.h"
-
-#include <wtf/PassRefPtr.h>
-#include <wtf/RefCounted.h>
-#include <wtf/text/WTFString.h>
-
-#if ENABLE(INDEXED_DATABASE)
-
-namespace WebCore {
-
-class IDBCallbacks;
-class IDBCursorBackend;
-class IDBDatabase;
-class IDBDatabaseBackend;
-class IDBDatabaseCallbacks;
-class IDBTransactionBackend;
-class SecurityOrigin;
-class ScriptExecutionContext;
-
-typedef int ExceptionCode;
-
-// This class is shared by IDBFactory (async) and IDBFactorySync (sync).
-// This is implemented by IDBFactoryBackendImpl and optionally others (in order to proxy
-// calls across process barriers). All calls to these classes should be non-blocking and
-// trigger work on a background thread if necessary.
-class IDBFactoryBackendInterface : public RefCounted<IDBFactoryBackendInterface> {
-public:
-    virtual ~IDBFactoryBackendInterface() { }
-
-    virtual void getDatabaseNames(PassRefPtr<IDBCallbacks>, const SecurityOrigin& openingOrigin, const SecurityOrigin& mainFrameOrigin, ScriptExecutionContext*) = 0;
-    virtual void open(const String& name, uint64_t version, int64_t transactionId, PassRefPtr<IDBCallbacks>, PassRefPtr<IDBDatabaseCallbacks>, const SecurityOrigin& openingOrigin, const SecurityOrigin& mainFrameOrigin) = 0;
-    virtual void deleteDatabase(const String& name, const SecurityOrigin& openingOrigin, const SecurityOrigin& mainFrameOrigin, PassRefPtr<IDBCallbacks>, ScriptExecutionContext*) = 0;
-
-    virtual void removeIDBDatabaseBackend(const String& uniqueIdentifier) = 0;
-
-};
-
-} // namespace WebCore
-
-#endif // IDBFactoryBackendInterface_h
-
-#endif // IDBFactoryBackendInterface_h
diff --git a/Source/WebCore/Modules/indexeddb/legacy/IDBPendingDeleteCall.h b/Source/WebCore/Modules/indexeddb/legacy/IDBPendingDeleteCall.h
deleted file mode 100644 (file)
index 4fba2e1..0000000
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * Copyright (C) 2013 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef IDBPendingDeleteCall_h
-#define IDBPendingDeleteCall_h
-
-#include "IDBCallbacks.h"
-#include <wtf/RefPtr.h>
-
-#if ENABLE(INDEXED_DATABASE)
-
-namespace WebCore {
-
-class IDBPendingDeleteCall {
-public:
-    explicit IDBPendingDeleteCall(PassRefPtr<IDBCallbacks> callbacks)
-        : m_callbacks(callbacks)
-    {
-    }
-
-    IDBCallbacks* callbacks() { return m_callbacks.get(); }
-
-private:
-    RefPtr<IDBCallbacks> m_callbacks;
-};
-
-} // namespace WebCore
-
-#endif // ENABLE(INDEXED_DATABASE)
-#endif // IDBPendingDeleteCall_h
diff --git a/Source/WebCore/Modules/indexeddb/legacy/IDBPendingOpenCall.h b/Source/WebCore/Modules/indexeddb/legacy/IDBPendingOpenCall.h
deleted file mode 100644 (file)
index 9b53ef9..0000000
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- * Copyright (C) 2013 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef IDBPendingOpenCall_h
-#define IDBPendingOpenCall_h
-
-#include <wtf/RefPtr.h>
-
-#if ENABLE(INDEXED_DATABASE)
-
-namespace WebCore {
-
-class IDBCallbacks;
-class IDBDatabaseCallbacks;
-
-class IDBPendingOpenCall {
-public:
-    IDBPendingOpenCall(IDBCallbacks& callbacks, IDBDatabaseCallbacks& databaseCallbacks, int64_t transactionId, uint64_t version)
-        : m_callbacks(&callbacks)
-        , m_databaseCallbacks(&databaseCallbacks)
-        , m_version(version)
-        , m_transactionId(transactionId)
-    {
-    }
-
-    IDBCallbacks* callbacks() { return m_callbacks.get(); }
-    IDBDatabaseCallbacks* databaseCallbacks() { return m_databaseCallbacks.get(); }
-    uint64_t version() { return m_version; }
-    int64_t transactionId() const { return m_transactionId; }
-
-private:
-    RefPtr<IDBCallbacks> m_callbacks;
-    RefPtr<IDBDatabaseCallbacks> m_databaseCallbacks;
-    uint64_t m_version;
-    const int64_t m_transactionId;
-};
-
-} // namespace WebCore
-
-#endif // ENABLE(INDEXED_DATABASE)
-#endif // IDBPendingOpenCall_h
diff --git a/Source/WebCore/Modules/indexeddb/legacy/IDBPendingTransactionMonitor.cpp b/Source/WebCore/Modules/indexeddb/legacy/IDBPendingTransactionMonitor.cpp
deleted file mode 100644 (file)
index e9d6601..0000000
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- * Copyright (C) 2010 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1.  Redistributions of source code must retain the above copyright
- *     notice, this list of conditions and the following disclaimer.
- * 2.  Redistributions in binary form must reproduce the above copyright
- *     notice, this list of conditions and the following disclaimer in the
- *     documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-#include "IDBPendingTransactionMonitor.h"
-
-#include "LegacyTransaction.h"
-#include <mutex>
-#include <wtf/ThreadSpecific.h>
-
-using WTF::ThreadSpecific;
-
-#if ENABLE(INDEXED_DATABASE)
-
-namespace WebCore {
-
-typedef Vector<RefPtr<LegacyTransaction>> TransactionList;
-
-static ThreadSpecific<TransactionList>& transactions()
-{
-    // FIXME: Move the Vector to ScriptExecutionContext to avoid dealing with
-    // thread-local storage.
-    static std::once_flag onceFlag;
-    static ThreadSpecific<TransactionList>* transactions;
-    std::call_once(onceFlag, [] {
-        transactions = new ThreadSpecific<TransactionList>;
-    });
-
-    return *transactions;
-}
-
-void IDBPendingTransactionMonitor::addNewTransaction(PassRefPtr<LegacyTransaction> transaction)
-{
-    transactions()->append(transaction);
-}
-
-void IDBPendingTransactionMonitor::deactivateNewTransactions()
-{
-    ThreadSpecific<TransactionList>& list = transactions();
-    for (auto& transaction : *list)
-        transaction->setActive(false);
-    // FIXME: Exercise this call to clear() in a layout test.
-    list->clear();
-}
-
-};
-#endif // ENABLE(INDEXED_DATABASE)
diff --git a/Source/WebCore/Modules/indexeddb/legacy/IDBPendingTransactionMonitor.h b/Source/WebCore/Modules/indexeddb/legacy/IDBPendingTransactionMonitor.h
deleted file mode 100644 (file)
index 73fe273..0000000
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * Copyright (C) 2010 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1.  Redistributions of source code must retain the above copyright
- *     notice, this list of conditions and the following disclaimer.
- * 2.  Redistributions in binary form must reproduce the above copyright
- *     notice, this list of conditions and the following disclaimer in the
- *     documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef IDBPendingTransactionMonitor_h
-#define IDBPendingTransactionMonitor_h
-
-#if ENABLE(INDEXED_DATABASE)
-
-#include <wtf/Noncopyable.h>
-#include <wtf/Vector.h>
-
-namespace WebCore {
-
-class LegacyTransaction;
-
-// This class keeps track of the transactions created during the current
-// Javascript execution context. Transactions have an internal |active| flag
-// which is set to true on creation, but must be set to false when control
-// returns to the event loop.
-
-class IDBPendingTransactionMonitor {
-    WTF_MAKE_NONCOPYABLE(IDBPendingTransactionMonitor);
-public:
-    static void addNewTransaction(PassRefPtr<LegacyTransaction>);
-    static void deactivateNewTransactions();
-
-private:
-    IDBPendingTransactionMonitor();
-};
-
-} // namespace WebCore
-
-#endif // ENABLE(INDEXED_DATABASE)
-
-#endif // IDBPendingTransactionMonitor_h
diff --git a/Source/WebCore/Modules/indexeddb/legacy/IDBTransactionBackend.cpp b/Source/WebCore/Modules/indexeddb/legacy/IDBTransactionBackend.cpp
deleted file mode 100644 (file)
index 79ba87c..0000000
+++ /dev/null
@@ -1,377 +0,0 @@
-/*
- * Copyright (C) 2010 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1.  Redistributions of source code must retain the above copyright
- *     notice, this list of conditions and the following disclaimer.
- * 2.  Redistributions in binary form must reproduce the above copyright
- *     notice, this list of conditions and the following disclaimer in the
- *     documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-#include "IDBTransactionBackend.h"
-
-#if ENABLE(INDEXED_DATABASE)
-
-#include "IDBCursorBackend.h"
-#include "IDBDatabaseBackend.h"
-#include "IDBDatabaseCallbacks.h"
-#include "IDBDatabaseException.h"
-#include "IDBFactoryBackendInterface.h"
-#include "IDBKeyRange.h"
-#include "IDBServerConnection.h"
-#include "IDBTransactionBackendOperations.h"
-#include "IDBTransactionCoordinator.h"
-#include "Logging.h"
-
-namespace WebCore {
-
-Ref<IDBTransactionBackend> IDBTransactionBackend::create(IDBDatabaseBackend* databaseBackend, int64_t id, PassRefPtr<IDBDatabaseCallbacks> callbacks, const Vector<int64_t>& objectStoreIds, IndexedDB::TransactionMode mode)
-{
-    HashSet<int64_t> objectStoreHashSet;
-    for (auto& id : objectStoreIds)
-        objectStoreHashSet.add(id);
-
-    return adoptRef(*new IDBTransactionBackend(databaseBackend, id, callbacks, objectStoreHashSet, mode));
-}
-
-IDBTransactionBackend::IDBTransactionBackend(IDBDatabaseBackend* databaseBackend, int64_t id, PassRefPtr<IDBDatabaseCallbacks> callbacks, const HashSet<int64_t>& objectStoreIds, IndexedDB::TransactionMode mode)
-    : m_objectStoreIds(objectStoreIds)
-    , m_mode(mode)
-    , m_state(Unopened)
-    , m_commitPending(false)
-    , m_callbacks(callbacks)
-    , m_database(databaseBackend)
-    , m_taskTimer(*this, &IDBTransactionBackend::taskTimerFired)
-    , m_pendingPreemptiveEvents(0)
-    , m_id(id)
-{
-    // We pass a reference of this object before it can be adopted.
-    relaxAdoptionRequirement();
-
-    m_database->transactionCoordinator()->didCreateTransaction(this);
-
-    RefPtr<IDBTransactionBackend> backend(this);
-    m_database->serverConnection().openTransaction(id, objectStoreIds, mode, [backend](bool success) {
-        if (!success) {
-            callOnMainThread([backend]() {
-                backend->abort();
-            });
-            return;
-        }
-
-        // Handle the case where the transaction was aborted before the server connection finished opening the transaction.
-        if (backend->m_state == Finished)
-            return;
-
-        backend->m_state = Unused;
-        if (backend->hasPendingTasks())
-            backend->start();
-    });
-}
-
-IDBTransactionBackend::~IDBTransactionBackend()
-{
-    // It shouldn't be possible for this object to get deleted unless it's unused, complete, or aborted.
-    ASSERT(m_state == Finished || m_state == Unused);
-}
-
-void IDBTransactionBackend::scheduleTask(IDBDatabaseBackend::TaskType type, PassRefPtr<IDBOperation> task, PassRefPtr<IDBSynchronousOperation> abortTask)
-{
-    if (m_state == Finished)
-        return;
-
-    if (type == IDBDatabaseBackend::NormalTask)
-        m_taskQueue.append(task);
-    else
-        m_preemptiveTaskQueue.append(task);
-
-    if (abortTask)
-        m_abortTaskQueue.prepend(abortTask);
-
-    if (m_state == Unopened)
-        return;
-
-    if (m_state == Unused)
-        start();
-    else if (m_state == Running && !m_taskTimer.isActive())
-        m_taskTimer.startOneShot(0);
-}
-
-void IDBTransactionBackend::abort()
-{
-    abort(IDBDatabaseError::create(IDBDatabaseException::UnknownError, "Internal error (unknown cause)"));
-}
-
-void IDBTransactionBackend::abort(PassRefPtr<IDBDatabaseError> error)
-{
-#ifndef NDEBUG
-    if (error)
-        LOG(StorageAPI, "IDBTransactionBackend::abort - (%s) %s", error->name().utf8().data(), error->message().utf8().data());
-    else
-        LOG(StorageAPI, "IDBTransactionBackend::abort (no error)");
-#endif
-
-    if (m_state == Finished)
-        return;
-
-    bool wasRunning = m_state == Running;
-
-    // The last reference to this object may be released while performing the
-    // abort steps below. We therefore take a self reference to keep ourselves
-    // alive while executing this method.
-    Ref<IDBTransactionBackend> protect(*this);
-
-    m_state = Finished;
-    m_taskTimer.stop();
-
-    if (wasRunning)
-        m_database->serverConnection().rollbackTransactionSync(m_id);
-
-    // Run the abort tasks, if any.
-    while (!m_abortTaskQueue.isEmpty()) {
-        RefPtr<IDBSynchronousOperation> task(m_abortTaskQueue.takeFirst());
-        task->perform();
-    }
-
-    // Backing store resources (held via cursors) must be released before script callbacks
-    // are fired, as the script callbacks may release references and allow the backing store
-    // itself to be released, and order is critical.
-    closeOpenCursors();
-
-    m_database->serverConnection().resetTransactionSync(m_id);
-
-    // Transactions must also be marked as completed before the front-end is notified, as
-    // the transaction completion unblocks operations like closing connections.
-    m_database->transactionCoordinator()->didFinishTransaction(this);
-    ASSERT(!m_database->transactionCoordinator()->isActive(this));
-    m_database->transactionFinished(this);
-
-    RefPtr<IDBDatabaseBackend> database = m_database.release();
-
-    if (m_callbacks)
-        m_callbacks->onAbort(id(), error);
-
-    database->transactionFinishedAndAbortFired(this);
-}
-
-bool IDBTransactionBackend::isTaskQueueEmpty() const
-{
-    return m_preemptiveTaskQueue.isEmpty() && m_taskQueue.isEmpty();
-}
-
-bool IDBTransactionBackend::hasPendingTasks() const
-{
-    return m_pendingPreemptiveEvents || !isTaskQueueEmpty();
-}
-
-void IDBTransactionBackend::registerOpenCursor(IDBCursorBackend* cursor)
-{
-    m_openCursors.add(cursor);
-}
-
-void IDBTransactionBackend::unregisterOpenCursor(IDBCursorBackend* cursor)
-{
-    m_openCursors.remove(cursor);
-}
-
-void IDBTransactionBackend::run()
-{
-    // TransactionCoordinator has started this transaction. Schedule a timer
-    // to process the first task.
-    ASSERT(m_state == StartPending || m_state == Running);
-    ASSERT(!m_taskTimer.isActive());
-
-    m_taskTimer.startOneShot(0);
-}
-
-void IDBTransactionBackend::start()
-{
-    ASSERT(m_state == Unused);
-
-    m_state = StartPending;
-    m_database->transactionCoordinator()->didStartTransaction(this);
-    m_database->transactionStarted(this);
-}
-
-void IDBTransactionBackend::commit()
-{
-    LOG(StorageAPI, "IDBTransactionBackend::commit transaction %lli in state %u", static_cast<long long>(m_id), m_state);
-
-    // In multiprocess ports, front-end may have requested a commit but an abort has already
-    // been initiated asynchronously by the back-end.
-    if (m_state == Finished)
-        return;
-
-    ASSERT(m_state == Unopened || m_state == Unused || m_state == Running);
-    m_commitPending = true;
-
-    // Front-end has requested a commit, but there may be tasks like createIndex which
-    // are considered synchronous by the front-end but are processed asynchronously.
-    if (hasPendingTasks()) {
-        LOG(StorageAPI, "IDBTransactionBackend::commit - Not committing now, transaction still has pending tasks (Transaction %lli)", static_cast<long long>(m_id));
-        return;
-    }
-
-    // The last reference to this object may be released while performing the
-    // commit steps below. We therefore take a self reference to keep ourselves
-    // alive while executing this method.
-    RefPtr<IDBTransactionBackend> backend(this);
-
-    bool unused = m_state == Unused || m_state == Unopened;
-    m_state = Finished;
-
-    bool committed = unused;
-
-    m_database->serverConnection().commitTransaction(m_id, [backend, this, committed, unused](bool success) mutable {
-        // This might be commitTransaction request aborting during or after synchronous IDBTransactionBackend::abort() call.
-        // This can easily happen if the page is navigated before all transactions finish.
-        // In this case we have no further cleanup and don't need to make any callbacks.
-        if (!m_database) {
-            ASSERT(!success);
-            return;
-        }
-
-        committed |= success;
-
-        // Backing store resources (held via cursors) must be released before script callbacks
-        // are fired, as the script callbacks may release references and allow the backing store
-        // itself to be released, and order is critical.
-        closeOpenCursors();
-
-        m_database->serverConnection().resetTransaction(m_id, []() { });
-
-        // Transactions must also be marked as completed before the front-end is notified, as
-        // the transaction completion unblocks operations like closing connections.
-        if (!unused)
-            m_database->transactionCoordinator()->didFinishTransaction(this);
-        m_database->transactionFinished(this);
-
-        if (committed) {
-            m_callbacks->onComplete(id());
-            m_database->transactionFinishedAndCompleteFired(this);
-        } else {
-            m_callbacks->onAbort(id(), IDBDatabaseError::create(IDBDatabaseException::UnknownError, "Internal error committing transaction."));
-            m_database->transactionFinishedAndAbortFired(this);
-        }
-
-        m_database = nullptr;
-    });
-}
-
-void IDBTransactionBackend::taskTimerFired()
-{
-    LOG(StorageAPI, "IDBTransactionBackend::taskTimerFired");
-
-    if (m_state == StartPending) {
-        m_database->serverConnection().beginTransaction(m_id, []() { });
-        m_state = Running;
-    }
-
-    // The last reference to this object may be released while performing a task.
-    // Take a self reference to keep this object alive so that tasks can
-    // successfully make their completion callbacks.
-    RefPtr<IDBTransactionBackend> self(this);
-
-    TaskQueue* taskQueue = m_pendingPreemptiveEvents ? &m_preemptiveTaskQueue : &m_taskQueue;
-    if (!taskQueue->isEmpty() && m_state != Finished) {
-        ASSERT(m_state == Running);
-        RefPtr<IDBOperation> task(taskQueue->takeFirst());
-        task->perform([self, this, task]() {
-            m_taskTimer.startOneShot(0);
-        });
-
-        return;
-    }
-
-    // If there are no pending tasks, we haven't already committed/aborted,
-    // and the front-end requested a commit, it is now safe to do so.
-    if (!hasPendingTasks() && m_state != Finished && m_commitPending)
-        commit();
-}
-
-void IDBTransactionBackend::closeOpenCursors()
-{
-    for (auto& cursor : m_openCursors)
-        cursor->close();
-    m_openCursors.clear();
-}
-
-void IDBTransactionBackend::scheduleCreateObjectStoreOperation(const IDBObjectStoreMetadata& objectStoreMetadata)
-{
-    scheduleTask(CreateObjectStoreOperation::create(this, objectStoreMetadata), CreateObjectStoreAbortOperation::create(this, objectStoreMetadata.id));
-}
-
-void IDBTransactionBackend::scheduleDeleteObjectStoreOperation(const IDBObjectStoreMetadata& objectStoreMetadata)
-{
-    scheduleTask(DeleteObjectStoreOperation::create(this, objectStoreMetadata), DeleteObjectStoreAbortOperation::create(this, objectStoreMetadata));
-}
-
-void IDBTransactionBackend::scheduleVersionChangeOperation(int64_t requestedVersion, PassRefPtr<IDBCallbacks> callbacks, PassRefPtr<IDBDatabaseCallbacks> databaseCallbacks, const IDBDatabaseMetadata& metadata)
-{
-    scheduleTask(IDBDatabaseBackend::VersionChangeOperation::create(this, requestedVersion, callbacks, databaseCallbacks), IDBDatabaseBackend::VersionChangeAbortOperation::create(this, String::number(metadata.version), metadata.version));
-}
-
-void IDBTransactionBackend::scheduleCreateIndexOperation(int64_t objectStoreId, const IDBIndexMetadata& indexMetadata)
-{
-    scheduleTask(CreateIndexOperation::create(this, objectStoreId, indexMetadata), CreateIndexAbortOperation::create(this, objectStoreId, indexMetadata.id));
-}
-
-void IDBTransactionBackend::scheduleDeleteIndexOperation(int64_t objectStoreId, const IDBIndexMetadata& indexMetadata)
-{
-    scheduleTask(DeleteIndexOperation::create(this, objectStoreId, indexMetadata), DeleteIndexAbortOperation::create(this, objectStoreId, indexMetadata));
-}
-
-void IDBTransactionBackend::scheduleGetOperation(const IDBDatabaseMetadata& metadata, int64_t objectStoreId, int64_t indexId, PassRefPtr<IDBKeyRange> keyRange, IndexedDB::CursorType cursorType, PassRefPtr<IDBCallbacks> callbacks)
-{
-    scheduleTask(GetOperation::create(this, metadata, objectStoreId, indexId, keyRange, cursorType, callbacks));
-}
-
-void IDBTransactionBackend::schedulePutOperation(const IDBObjectStoreMetadata& objectStoreMetadata, PassRefPtr<SharedBuffer> value, PassRefPtr<IDBKey> key, IDBDatabaseBackend::PutMode putMode, PassRefPtr<IDBCallbacks> callbacks, const Vector<int64_t>& indexIds, const Vector<IndexKeys>& indexKeys)
-{
-    scheduleTask(PutOperation::create(this, objectStoreMetadata, value, key, putMode, callbacks, indexIds, indexKeys));
-}
-
-void IDBTransactionBackend::scheduleSetIndexesReadyOperation(size_t indexCount)
-{
-    scheduleTask(IDBDatabaseBackend::PreemptiveTask, SetIndexesReadyOperation::create(this, indexCount));
-}
-
-void IDBTransactionBackend::scheduleOpenCursorOperation(int64_t objectStoreId, int64_t indexId, PassRefPtr<IDBKeyRange> keyRange, IndexedDB::CursorDirection direction, IndexedDB::CursorType cursorType, IDBDatabaseBackend::TaskType taskType, PassRefPtr<IDBCallbacks> callbacks)
-{
-    scheduleTask(OpenCursorOperation::create(this, objectStoreId, indexId, keyRange, direction, cursorType, taskType, callbacks));
-}
-
-void IDBTransactionBackend::scheduleCountOperation(int64_t objectStoreId, int64_t indexId, PassRefPtr<IDBKeyRange> keyRange, PassRefPtr<IDBCallbacks> callbacks)
-{
-    scheduleTask(CountOperation::create(this, objectStoreId, indexId, keyRange, callbacks));
-}
-
-void IDBTransactionBackend::scheduleDeleteRangeOperation(int64_t objectStoreId, PassRefPtr<IDBKeyRange> keyRange, PassRefPtr<IDBCallbacks> callbacks)
-{
-    scheduleTask(DeleteRangeOperation::create(this, objectStoreId, keyRange, callbacks));
-}
-
-void IDBTransactionBackend::scheduleClearObjectStoreOperation(int64_t objectStoreId, PassRefPtr<IDBCallbacks> callbacks)
-{
-    scheduleTask(ClearObjectStoreOperation::create(this, objectStoreId, callbacks));
-}
-
-};
-
-#endif // ENABLE(INDEXED_DATABASE)
diff --git a/Source/WebCore/Modules/indexeddb/legacy/IDBTransactionBackend.h b/Source/WebCore/Modules/indexeddb/legacy/IDBTransactionBackend.h
deleted file mode 100644 (file)
index 83b9ef3..0000000
+++ /dev/null
@@ -1,128 +0,0 @@
-/*
- * Copyright (C) 2010 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1.  Redistributions of source code must retain the above copyright
- *     notice, this list of conditions and the following disclaimer.
- * 2.  Redistributions in binary form must reproduce the above copyright
- *     notice, this list of conditions and the following disclaimer in the
- *     documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef IDBTransactionBackend_h
-#define IDBTransactionBackend_h
-
-#if ENABLE(INDEXED_DATABASE)
-
-#include "IDBDatabaseBackend.h"
-#include "IDBDatabaseError.h"
-#include "IDBOperation.h"
-#include "Timer.h"
-#include <wtf/Deque.h>
-#include <wtf/HashSet.h>
-#include <wtf/RefPtr.h>
-
-namespace WebCore {
-
-class IDBCursorBackend;
-class IDBDatabaseCallbacks;
-
-class IDBTransactionBackend : public RefCounted<IDBTransactionBackend> {
-public:
-    static Ref<IDBTransactionBackend> create(IDBDatabaseBackend*, int64_t transactionId, PassRefPtr<IDBDatabaseCallbacks>, const Vector<int64_t>& objectStoreIds, IndexedDB::TransactionMode);
-    ~IDBTransactionBackend();
-
-    void commit();
-    void abort();
-    void abort(PassRefPtr<IDBDatabaseError>);
-
-    void run();
-    IndexedDB::TransactionMode mode() const  { return m_mode; }
-    const HashSet<int64_t>& scope() const  { return m_objectStoreIds; }
-
-    void scheduleTask(PassRefPtr<IDBOperation> task, PassRefPtr<IDBSynchronousOperation> abortTask = nullptr) { scheduleTask(IDBDatabaseBackend::NormalTask, task, abortTask); }
-    void scheduleTask(IDBDatabaseBackend::TaskType, PassRefPtr<IDBOperation>, PassRefPtr<IDBSynchronousOperation> abortTask = nullptr);
-
-    void registerOpenCursor(IDBCursorBackend*);
-    void unregisterOpenCursor(IDBCursorBackend*);
-
-    void addPreemptiveEvent()  { m_pendingPreemptiveEvents++; }
-    void didCompletePreemptiveEvent()  { m_pendingPreemptiveEvents--; ASSERT(m_pendingPreemptiveEvents >= 0); }
-
-    IDBDatabaseBackend& database() const  { return *m_database; }
-
-    void scheduleCreateObjectStoreOperation(const IDBObjectStoreMetadata&);
-    void scheduleDeleteObjectStoreOperation(const IDBObjectStoreMetadata&);
-    void scheduleVersionChangeOperation(int64_t requestedVersion, PassRefPtr<IDBCallbacks>, PassRefPtr<IDBDatabaseCallbacks>, const IDBDatabaseMetadata&);
-    void scheduleCreateIndexOperation(int64_t objectStoreId, const IDBIndexMetadata&);
-    void scheduleDeleteIndexOperation(int64_t objectStoreId, const IDBIndexMetadata&);
-    void scheduleGetOperation(const IDBDatabaseMetadata&, int64_t objectStoreId, int64_t indexId, PassRefPtr<IDBKeyRange>, IndexedDB::CursorType, PassRefPtr<IDBCallbacks>);
-    void schedulePutOperation(const IDBObjectStoreMetadata&, PassRefPtr<SharedBuffer> value, PassRefPtr<IDBKey>, IDBDatabaseBackend::PutMode, PassRefPtr<IDBCallbacks>, const Vector<int64_t>& indexIds, const Vector<IndexKeys>&);
-    void scheduleSetIndexesReadyOperation(size_t indexCount);
-    void scheduleOpenCursorOperation(int64_t objectStoreId, int64_t indexId, PassRefPtr<IDBKeyRange>, IndexedDB::CursorDirection, IndexedDB::CursorType, IDBDatabaseBackend::TaskType, PassRefPtr<IDBCallbacks>);
-    void scheduleCountOperation(int64_t objectStoreId, int64_t indexId, PassRefPtr<IDBKeyRange>, PassRefPtr<IDBCallbacks>);
-    void scheduleDeleteRangeOperation(int64_t objectStoreId, PassRefPtr<IDBKeyRange>, PassRefPtr<IDBCallbacks>);
-    void scheduleClearObjectStoreOperation(int64_t objectStoreId, PassRefPtr<IDBCallbacks>);
-
-    int64_t id() const { return m_id; }
-
-private:
-    IDBTransactionBackend(IDBDatabaseBackend*, int64_t id, PassRefPtr<IDBDatabaseCallbacks>, const HashSet<int64_t>& objectStoreIds, IndexedDB::TransactionMode);
-
-    enum State {
-        Unopened, // Backing store transaction not yet created.
-        Unused, // Backing store transaction created, but no tasks yet.
-        StartPending, // Enqueued tasks, but backing store transaction not yet started.
-        Running, // Backing store transaction started but not yet finished.
-        Finished, // Either aborted or committed.
-    };
-
-    void start();
-
-    bool isTaskQueueEmpty() const;
-    bool hasPendingTasks() const;
-
-    void taskTimerFired();
-    void closeOpenCursors();
-
-    const HashSet<int64_t> m_objectStoreIds;
-    const IndexedDB::TransactionMode m_mode;
-
-    State m_state;
-    bool m_commitPending;
-    RefPtr<IDBDatabaseCallbacks> m_callbacks;
-    RefPtr<IDBDatabaseBackend> m_database;
-
-    typedef Deque<RefPtr<IDBOperation>> TaskQueue;
-    TaskQueue m_taskQueue;
-    TaskQueue m_preemptiveTaskQueue;
-    Deque<RefPtr<IDBSynchronousOperation>> m_abortTaskQueue;
-
-    // FIXME: delete the timer once we have threads instead.
-    Timer m_taskTimer;
-    int m_pendingPreemptiveEvents;
-
-    HashSet<IDBCursorBackend*> m_openCursors;
-
-    int64_t m_id;
-};
-
-} // namespace WebCore
-
-#endif // ENABLE(INDEXED_DATABASE)
-
-#endif // IDBTransactionBackend_h
diff --git a/Source/WebCore/Modules/indexeddb/legacy/IDBTransactionBackendOperations.cpp b/Source/WebCore/Modules/indexeddb/legacy/IDBTransactionBackendOperations.cpp
deleted file mode 100644 (file)
index b929fc6..0000000
+++ /dev/null
@@ -1,285 +0,0 @@
-/*
- * Copyright (C) 2013 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-#include "IDBTransactionBackendOperations.h"
-
-#include "IDBCursorBackend.h"
-#include "IDBDatabaseCallbacks.h"
-#include "IDBKeyRange.h"
-#include "IDBRecordIdentifier.h"
-#include "IDBServerConnection.h"
-#include "Logging.h"
-#include <wtf/text/CString.h>
-
-#if ENABLE(INDEXED_DATABASE)
-
-#define STANDARD_DATABASE_ERROR_CALLBACK std::function<void(PassRefPtr<IDBDatabaseError>)> operationCallback = \
-    [operation, completionCallback](PassRefPtr<IDBDatabaseError> error) { \
-        if (error) \
-            operation->m_transaction->abort(error); \
-        completionCallback(); \
-    };
-
-namespace WebCore {
-
-void CreateObjectStoreOperation::perform(std::function<void()> completionCallback)
-{
-    LOG(StorageAPI, "CreateObjectStoreOperation");
-
-    RefPtr<CreateObjectStoreOperation> operation(this);
-    STANDARD_DATABASE_ERROR_CALLBACK;
-
-    m_transaction->database().serverConnection().createObjectStore(*m_transaction, *this, operationCallback);
-}
-
-void CreateIndexOperation::perform(std::function<void()> completionCallback)
-{
-    LOG(StorageAPI, "CreateIndexOperation");
-
-    RefPtr<CreateIndexOperation> operation(this);
-    STANDARD_DATABASE_ERROR_CALLBACK;
-
-    m_transaction->database().serverConnection().createIndex(*m_transaction, *this, operationCallback);
-}
-
-void CreateIndexAbortOperation::perform()
-{
-    LOG(StorageAPI, "CreateIndexAbortOperation");
-    m_transaction->database().removeIndex(m_objectStoreID, m_indexID);
-}
-
-void DeleteIndexOperation::perform(std::function<void()> completionCallback)
-{
-    LOG(StorageAPI, "DeleteIndexOperation");
-
-    RefPtr<DeleteIndexOperation> operation(this);
-    STANDARD_DATABASE_ERROR_CALLBACK;
-
-    m_transaction->database().serverConnection().deleteIndex(*m_transaction, *this, operationCallback);
-}
-
-void DeleteIndexAbortOperation::perform()
-{
-    LOG(StorageAPI, "DeleteIndexAbortOperation");
-    m_transaction->database().addIndex(m_objectStoreID, m_indexMetadata, IDBIndexMetadata::InvalidId);
-}
-
-void GetOperation::perform(std::function<void()> completionCallback)
-{
-    LOG(StorageAPI, "GetOperation");
-
-    RefPtr<GetOperation> operation(this);
-    STANDARD_DATABASE_ERROR_CALLBACK;
-
-    m_transaction->database().serverConnection().get(*m_transaction, *this, [this, operation, operationCallback](const IDBGetResult& result, PassRefPtr<IDBDatabaseError> prpError) {
-        RefPtr<IDBDatabaseError> error = prpError;
-
-        if (error)
-            m_callbacks->onError(error);
-        else {
-            if (!result.valueBuffer().data()) {
-                if (result.keyData().isNull())
-                    m_callbacks->onSuccess();
-                else
-                    m_callbacks->onSuccess(result.keyData().maybeCreateIDBKey());
-            } else {
-                auto valueBuffer = SharedBuffer::create(result.valueBuffer().data()->data(), result.valueBuffer().data()->size());
-                if (!result.keyData().isNull())
-                    m_callbacks->onSuccess(valueBuffer, result.keyData().maybeCreateIDBKey(), result.keyPath());
-                else
-                    m_callbacks->onSuccess(valueBuffer);
-            }
-        }
-
-        operationCallback(error.release());
-    });
-}
-
-void PutOperation::perform(std::function<void()> completionCallback)
-{
-    LOG(StorageAPI, "PutOperation");
-    ASSERT(m_transaction->mode() != IndexedDB::TransactionMode::ReadOnly);
-    ASSERT(m_indexIDs.size() == m_indexKeys.size());
-
-    m_transaction->database().serverConnection().put(*m_transaction, *this, [this, completionCallback](PassRefPtr<IDBKey> key, PassRefPtr<IDBDatabaseError> prpError) {
-        RefPtr<IDBDatabaseError> error = prpError;
-        if (key) {
-            ASSERT(!error);
-            m_callbacks->onSuccess(key);
-        } else {
-            ASSERT(error);
-            m_callbacks->onError(error);
-        }
-        completionCallback();
-    });
-}
-
-void SetIndexesReadyOperation::perform(std::function<void()> completionCallback)
-{
-    LOG(StorageAPI, "SetIndexesReadyOperation");
-
-    for (size_t i = 0; i < m_indexCount; ++i)
-        m_transaction->didCompletePreemptiveEvent();
-
-    callOnMainThread(completionCallback);
-}
-
-void OpenCursorOperation::perform(std::function<void()> completionCallback)
-{
-    LOG(StorageAPI, "OpenCursorOperation");
-
-    RefPtr<OpenCursorOperation> operation(this);
-    auto callback = [this, operation, completionCallback](int64_t cursorID, PassRefPtr<IDBKey> key, PassRefPtr<IDBKey> primaryKey, PassRefPtr<SharedBuffer> valueBuffer, PassRefPtr<IDBDatabaseError> error) {
-        if (error) {
-            m_callbacks->onError(error);
-        } else if (!key) {
-            // If there's no error but also no key, then the cursor had no records.
-            m_callbacks->onSuccess(static_cast<SharedBuffer*>(nullptr));
-        } else {
-            RefPtr<IDBCursorBackend> cursor = IDBCursorBackend::create(cursorID, m_cursorType, m_taskType, *m_transaction, m_objectStoreID);
-            cursor->updateCursorData(key.get(), primaryKey.get(), valueBuffer.get());
-            m_callbacks->onSuccess(cursor.release());
-        }
-
-        completionCallback();
-    };
-
-    m_transaction->database().serverConnection().openCursor(*m_transaction, *this, callback);
-}
-
-void CountOperation::perform(std::function<void()> completionCallback)
-{
-    LOG(StorageAPI, "CountOperation");
-
-    RefPtr<CountOperation> operation(this);
-    auto callback = [this, operation, completionCallback](int64_t count, PassRefPtr<IDBDatabaseError>) {
-        // FIXME: The LevelDB port never had an error condition for the count operation.
-        // We probably need to support an error for the count operation, breaking the LevelDB port.
-        m_callbacks->onSuccess(count);
-
-        completionCallback();
-    };
-
-    m_transaction->database().serverConnection().count(*m_transaction, *this, callback);
-}
-
-void DeleteRangeOperation::perform(std::function<void()> completionCallback)
-{
-    LOG(StorageAPI, "DeleteRangeOperation");
-
-    RefPtr<DeleteRangeOperation> operation(this);
-    auto callback = [this, operation, completionCallback](PassRefPtr<IDBDatabaseError> error) {
-        if (error)
-            m_callbacks->onError(error);
-        else
-            m_callbacks->onSuccess();
-
-        completionCallback();
-    };
-
-    m_transaction->database().serverConnection().deleteRange(*m_transaction, *this, callback);
-}
-
-void ClearObjectStoreOperation::perform(std::function<void()> completionCallback)
-{
-    LOG(StorageAPI, "ClearObjectStoreOperation");
-
-    RefPtr<ClearObjectStoreOperation> operation(this);
-
-    auto clearCallback = [this, operation, completionCallback](PassRefPtr<IDBDatabaseError> prpError) {
-        RefPtr<IDBDatabaseError> error = prpError;
-
-        if (error) {
-            m_callbacks->onError(error);
-            m_transaction->abort(error.release());
-        } else
-            m_callbacks->onSuccess();
-
-        completionCallback();
-    };
-
-    m_transaction->database().serverConnection().clearObjectStore(*m_transaction, *this, clearCallback);
-}
-
-void DeleteObjectStoreOperation::perform(std::function<void()> completionCallback)
-{
-    LOG(StorageAPI, "DeleteObjectStoreOperation");
-
-    RefPtr<DeleteObjectStoreOperation> operation(this);
-    STANDARD_DATABASE_ERROR_CALLBACK;
-
-    m_transaction->database().serverConnection().deleteObjectStore(*m_transaction, *this, operationCallback);
-}
-
-void IDBDatabaseBackend::VersionChangeOperation::perform(std::function<void()> completionCallback)
-{
-    LOG(StorageAPI, "VersionChangeOperation");
-
-    uint64_t oldVersion = m_transaction->database().metadata().version;
-    if (oldVersion == IDBDatabaseMetadata::NoIntVersion)
-        oldVersion = 0;
-
-    RefPtr<IDBDatabaseBackend::VersionChangeOperation> operation(this);
-    ASSERT(static_cast<uint64_t>(m_version) > oldVersion);
-
-    std::function<void(PassRefPtr<IDBDatabaseError>)> operationCallback = [oldVersion, operation, this, completionCallback](PassRefPtr<IDBDatabaseError> prpError) {
-        RefPtr<IDBDatabaseError> error = prpError;
-        if (error) {
-            m_callbacks->onError(error);
-            m_transaction->abort(error);
-        } else {
-            ASSERT(!m_transaction->database().hasPendingSecondHalfOpen());
-            m_transaction->database().setCurrentVersion(m_version);
-            m_transaction->database().setPendingSecondHalfOpen(std::make_unique<IDBPendingOpenCall>(*m_callbacks, *m_databaseCallbacks, m_transaction->id(), m_version));
-            m_callbacks->onUpgradeNeeded(oldVersion, &m_transaction->database(), m_transaction->database().metadata());
-        }
-        completionCallback();
-    };
-
-    m_transaction->database().serverConnection().changeDatabaseVersion(*m_transaction, *this, operationCallback);
-}
-
-void CreateObjectStoreAbortOperation::perform()
-{
-    LOG(StorageAPI, "CreateObjectStoreAbortOperation");
-    m_transaction->database().removeObjectStore(m_objectStoreID);
-}
-
-void DeleteObjectStoreAbortOperation::perform()
-{
-    LOG(StorageAPI, "DeleteObjectStoreAbortOperation");
-    m_transaction->database().addObjectStore(m_objectStoreMetadata, IDBObjectStoreMetadata::InvalidId);
-}
-
-void IDBDatabaseBackend::VersionChangeAbortOperation::perform()
-{
-    LOG(StorageAPI, "VersionChangeAbortOperation");
-    m_transaction->database().setCurrentVersion(m_previousIntVersion);
-}
-
-} // namespace WebCore
-
-#endif // ENABLE(INDEXED_DATABASE)
diff --git a/Source/WebCore/Modules/indexeddb/legacy/IDBTransactionBackendOperations.h b/Source/WebCore/Modules/indexeddb/legacy/IDBTransactionBackendOperations.h
deleted file mode 100644 (file)
index 1410979..0000000
+++ /dev/null
@@ -1,471 +0,0 @@
-/*
- * Copyright (C) 2013 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef IDBTransactionBackendOperations_h
-#define IDBTransactionBackendOperations_h
-
-#include "IDBDatabaseBackend.h"
-#include "IDBOperation.h"
-#include "IDBTransactionBackend.h"
-
-#if ENABLE(INDEXED_DATABASE)
-
-namespace WebCore {
-
-class IDBServerConnection;
-
-class CreateObjectStoreOperation : public IDBOperation {
-public:
-    static Ref<IDBOperation> create(IDBTransactionBackend* transaction, const IDBObjectStoreMetadata& objectStoreMetadata)
-    {
-        return adoptRef(*new CreateObjectStoreOperation(transaction, objectStoreMetadata));
-    }
-    virtual void perform(std::function<void()> successCallback) override final;
-
-    const IDBObjectStoreMetadata& objectStoreMetadata() const { return m_objectStoreMetadata; }
-
-private:
-    CreateObjectStoreOperation(IDBTransactionBackend* transaction, const IDBObjectStoreMetadata& objectStoreMetadata)
-        : m_transaction(transaction)
-        , m_objectStoreMetadata(objectStoreMetadata)
-    {
-    }
-    
-    RefPtr<IDBTransactionBackend> m_transaction;
-    const IDBObjectStoreMetadata m_objectStoreMetadata;
-};
-
-class DeleteObjectStoreOperation : public IDBOperation {
-public:
-    static Ref<IDBOperation> create(IDBTransactionBackend* transaction, const IDBObjectStoreMetadata& objectStoreMetadata)
-    {
-        return adoptRef(*new DeleteObjectStoreOperation(transaction, objectStoreMetadata));
-    }
-    virtual void perform(std::function<void()> successCallback) override final;
-
-    IDBTransactionBackend* transaction() const { return m_transaction.get(); }
-    const IDBObjectStoreMetadata& objectStoreMetadata() const { return m_objectStoreMetadata; }
-
-private:
-    DeleteObjectStoreOperation(IDBTransactionBackend* transaction, const IDBObjectStoreMetadata& objectStoreMetadata)
-        : m_transaction(transaction)
-        , m_objectStoreMetadata(objectStoreMetadata)
-    {
-    }
-
-    RefPtr<IDBTransactionBackend> m_transaction;
-    const IDBObjectStoreMetadata m_objectStoreMetadata;
-};
-
-class IDBDatabaseBackend::VersionChangeOperation : public IDBOperation {
-public:
-    static Ref<IDBOperation> create(IDBTransactionBackend* transaction, int64_t version, PassRefPtr<IDBCallbacks> callbacks, PassRefPtr<IDBDatabaseCallbacks> databaseCallbacks)
-    {
-        return adoptRef(*new VersionChangeOperation(transaction, version, callbacks, databaseCallbacks));
-    }
-    virtual void perform(std::function<void()> successCallback) override final;
-
-    IDBTransactionBackend* transaction() const { return m_transaction.get(); }
-    int64_t version() const { return m_version; }
-    IDBDatabaseCallbacks* databaseCallbacks() const { return m_databaseCallbacks.get(); }
-
-private:
-    VersionChangeOperation(IDBTransactionBackend* transaction, int64_t version, PassRefPtr<IDBCallbacks> callbacks, PassRefPtr<IDBDatabaseCallbacks> databaseCallbacks)
-        : m_transaction(transaction)
-        , m_version(version)
-        , m_callbacks(callbacks)
-        , m_databaseCallbacks(databaseCallbacks)
-    {
-    }
-
-    RefPtr<IDBTransactionBackend> m_transaction;
-    int64_t m_version;
-    RefPtr<IDBCallbacks> m_callbacks;
-    RefPtr<IDBDatabaseCallbacks> m_databaseCallbacks;
-};
-
-class CreateObjectStoreAbortOperation : public IDBSynchronousOperation {
-public:
-    static Ref<IDBSynchronousOperation> create(IDBTransactionBackend* transaction, int64_t objectStoreId)
-    {
-        return adoptRef(*new CreateObjectStoreAbortOperation(transaction, objectStoreId));
-    }
-    virtual void perform() override final;
-private:
-    CreateObjectStoreAbortOperation(IDBTransactionBackend* transaction, int64_t objectStoreId)
-        : m_transaction(transaction)
-        , m_objectStoreID(objectStoreId)
-    {
-    }
-
-    RefPtr<IDBTransactionBackend> m_transaction;
-    const int64_t m_objectStoreID;
-};
-
-class DeleteObjectStoreAbortOperation : public IDBSynchronousOperation {
-public:
-    static Ref<IDBSynchronousOperation> create(IDBTransactionBackend* transaction, const IDBObjectStoreMetadata& objectStore)
-    {
-        return adoptRef(*new DeleteObjectStoreAbortOperation(transaction, objectStore));
-    }
-    virtual void perform() override final;
-private:
-    DeleteObjectStoreAbortOperation(IDBTransactionBackend* transaction, const IDBObjectStoreMetadata& objectStoreMetadata)
-        : m_transaction(transaction)
-        , m_objectStoreMetadata(objectStoreMetadata)
-    {
-    }
-
-    RefPtr<IDBTransactionBackend> m_transaction;
-    IDBObjectStoreMetadata m_objectStoreMetadata;
-};
-
-class IDBDatabaseBackend::VersionChangeAbortOperation : public IDBSynchronousOperation {
-public:
-    static Ref<IDBSynchronousOperation> create(IDBTransactionBackend* transaction, const String& previousVersion, int64_t previousIntVersion)
-    {
-        return adoptRef(*new VersionChangeAbortOperation(transaction, previousVersion, previousIntVersion));
-    }
-    virtual void perform() override final;
-private:
-    VersionChangeAbortOperation(IDBTransactionBackend* transaction, const String& previousVersion, int64_t previousIntVersion)
-        : m_transaction(transaction)
-        , m_previousVersion(previousVersion)
-        , m_previousIntVersion(previousIntVersion)
-    {
-    }
-
-    RefPtr<IDBTransactionBackend> m_transaction;
-    String m_previousVersion;
-    int64_t m_previousIntVersion;
-};
-
-class CreateIndexOperation : public IDBOperation {
-public:
-    static Ref<IDBOperation> create(IDBTransactionBackend* transaction, int64_t objectStoreId, const IDBIndexMetadata& indexMetadata)
-    {
-        return adoptRef(*new CreateIndexOperation(transaction, objectStoreId, indexMetadata));
-    }
-    virtual void perform(std::function<void()> successCallback) override final;
-
-    int64_t objectStoreID() const { return m_objectStoreID; }
-    const IDBIndexMetadata& idbIndexMetadata() const { return m_indexMetadata; }
-
-private:
-    CreateIndexOperation(IDBTransactionBackend* transaction, int64_t objectStoreId, const IDBIndexMetadata& indexMetadata)
-        : m_transaction(transaction)
-        , m_objectStoreID(objectStoreId)
-        , m_indexMetadata(indexMetadata)
-    {
-    }
-
-    RefPtr<IDBTransactionBackend> m_transaction;
-    const int64_t m_objectStoreID;
-    const IDBIndexMetadata m_indexMetadata;
-};
-
-class CreateIndexAbortOperation : public IDBSynchronousOperation {
-public:
-    static Ref<IDBSynchronousOperation> create(IDBTransactionBackend* transaction, int64_t objectStoreId, int64_t indexId)
-    {
-        return adoptRef(*new CreateIndexAbortOperation(transaction, objectStoreId, indexId));
-    }
-    virtual void perform() override final;
-private:
-    CreateIndexAbortOperation(IDBTransactionBackend* transaction, int64_t objectStoreId, int64_t indexId)
-        : m_transaction(transaction)
-        , m_objectStoreID(objectStoreId)
-        , m_indexID(indexId)
-    {
-    }
-
-    const RefPtr<IDBTransactionBackend> m_transaction;
-    const int64_t m_objectStoreID;
-    const int64_t m_indexID;
-};
-
-class DeleteIndexOperation : public IDBOperation {
-public:
-    static Ref<IDBOperation> create(IDBTransactionBackend* transaction, int64_t objectStoreId, const IDBIndexMetadata& indexMetadata)
-    {
-        return adoptRef(*new DeleteIndexOperation(transaction, objectStoreId, indexMetadata));
-    }
-    virtual void perform(std::function<void()> successCallback) override final;
-
-    int64_t objectStoreID() const { return m_objectStoreID; }
-    const IDBIndexMetadata& idbIndexMetadata() const { return m_indexMetadata; }
-
-private:
-    DeleteIndexOperation(IDBTransactionBackend* transaction, int64_t objectStoreId, const IDBIndexMetadata& indexMetadata)
-        : m_transaction(transaction)
-        , m_objectStoreID(objectStoreId)
-        , m_indexMetadata(indexMetadata)
-    {
-    }
-
-    RefPtr<IDBTransactionBackend> m_transaction;
-    const int64_t m_objectStoreID;
-    const IDBIndexMetadata m_indexMetadata;
-};
-
-class DeleteIndexAbortOperation : public IDBSynchronousOperation {
-public:
-    static Ref<IDBSynchronousOperation> create(IDBTransactionBackend* transaction, int64_t objectStoreId, const IDBIndexMetadata& indexMetadata)
-    {
-        return adoptRef(*new DeleteIndexAbortOperation(transaction, objectStoreId, indexMetadata));
-    }
-    virtual void perform() override final;
-private:
-    DeleteIndexAbortOperation(IDBTransactionBackend* transaction, int64_t objectStoreId, const IDBIndexMetadata& indexMetadata)
-        : m_transaction(transaction)
-        , m_objectStoreID(objectStoreId)
-        , m_indexMetadata(indexMetadata)
-    {
-    }
-
-    RefPtr<IDBTransactionBackend> m_transaction;
-    const int64_t m_objectStoreID;
-    const IDBIndexMetadata m_indexMetadata;
-};
-
-class GetOperation : public IDBOperation {
-public:
-    static Ref<IDBOperation> create(IDBTransactionBackend* transaction, const IDBDatabaseMetadata& metadata, int64_t objectStoreId, int64_t indexId, PassRefPtr<IDBKeyRange> keyRange, IndexedDB::CursorType cursorType, PassRefPtr<IDBCallbacks> callbacks)
-    {
-        return adoptRef(*new GetOperation(transaction, metadata, objectStoreId, indexId, keyRange, cursorType, callbacks));
-    }
-    virtual void perform(std::function<void()> successCallback) override final;
-
-    int64_t objectStoreID() const { return m_objectStoreID; }
-    int64_t indexID() const { return m_indexID; }
-    IndexedDB::CursorType cursorType() const { return m_cursorType; }
-    IDBKeyRange* keyRange() const { return m_keyRange.get(); }
-    bool autoIncrement() const { return m_autoIncrement; }
-    IDBKeyPath keyPath() const { return m_keyPath; }
-
-private:
-    GetOperation(IDBTransactionBackend* transaction, const IDBDatabaseMetadata& metadata, int64_t objectStoreId, int64_t indexId, PassRefPtr<IDBKeyRange> keyRange, IndexedDB::CursorType cursorType, PassRefPtr<IDBCallbacks> callbacks)
-        : m_transaction(transaction)
-        , m_objectStoreID(objectStoreId)
-        , m_indexID(indexId)
-        , m_keyPath(metadata.objectStores.get(objectStoreId).keyPath)
-        , m_autoIncrement(metadata.objectStores.get(objectStoreId).autoIncrement)
-        , m_keyRange(keyRange)
-        , m_cursorType(cursorType)
-        , m_callbacks(callbacks)
-    {
-        ASSERT(metadata.objectStores.contains(objectStoreId));
-        ASSERT(metadata.objectStores.get(objectStoreId).id == objectStoreId);
-    }
-
-    RefPtr<IDBTransactionBackend> m_transaction;
-    const int64_t m_objectStoreID;
-    const int64_t m_indexID;
-    const IDBKeyPath m_keyPath;
-    const bool m_autoIncrement;
-    const RefPtr<IDBKeyRange> m_keyRange;
-    const IndexedDB::CursorType m_cursorType;
-    const RefPtr<IDBCallbacks> m_callbacks;
-};
-
-class PutOperation : public IDBOperation {
-public:
-    static Ref<IDBOperation> create(IDBTransactionBackend* transaction, const IDBObjectStoreMetadata& objectStore, PassRefPtr<SharedBuffer> value, PassRefPtr<IDBKey> key, IDBDatabaseBackend::PutMode putMode, PassRefPtr<IDBCallbacks> callbacks, const Vector<int64_t>& indexIds, const Vector<IndexKeys>& indexKeys)
-    {
-        return adoptRef(*new PutOperation(transaction, objectStore, value, key, putMode, callbacks, indexIds, indexKeys));
-    }
-    virtual void perform(std::function<void()> successCallback) override final;
-
-    IDBDatabaseBackend::PutMode putMode() const { return m_putMode; }
-    const IDBObjectStoreMetadata& objectStore() const { return m_objectStore; }
-    IDBKey* key() const { return m_key.get(); }
-    const Vector<int64_t>& indexIDs() const { return m_indexIDs; }
-    const Vector<IndexKeys>& indexKeys() const { return m_indexKeys; }
-    SharedBuffer* value() const { return m_value.get(); }
-
-private:
-    PutOperation(IDBTransactionBackend* transaction, const IDBObjectStoreMetadata& objectStore, PassRefPtr<SharedBuffer>& value, PassRefPtr<IDBKey> key, IDBDatabaseBackend::PutMode putMode, PassRefPtr<IDBCallbacks> callbacks, const Vector<int64_t>& indexIds, const Vector<IndexKeys>& indexKeys)
-        : m_transaction(transaction)
-        , m_objectStore(objectStore)
-        , m_value(value)
-        , m_key(key)
-        , m_putMode(putMode)
-        , m_callbacks(callbacks)
-        , m_indexIDs(indexIds)
-        , m_indexKeys(indexKeys)
-    {
-    }
-
-    RefPtr<IDBTransactionBackend> m_transaction;
-    const IDBObjectStoreMetadata m_objectStore;
-    const RefPtr<SharedBuffer> m_value;
-    const RefPtr<IDBKey> m_key;
-    const IDBDatabaseBackend::PutMode m_putMode;
-    const RefPtr<IDBCallbacks> m_callbacks;
-    const Vector<int64_t> m_indexIDs;
-    const Vector<IndexKeys> m_indexKeys;
-};
-
-class SetIndexesReadyOperation : public IDBOperation {
-public:
-    static Ref<IDBOperation> create(IDBTransactionBackend* transaction, size_t indexCount)
-    {
-        return adoptRef(*new SetIndexesReadyOperation(transaction, indexCount));
-    }
-    virtual void perform(std::function<void()> successCallback) override final;
-private:
-    SetIndexesReadyOperation(IDBTransactionBackend* transaction, size_t indexCount)
-        : m_transaction(transaction)
-        , m_indexCount(indexCount)
-    {
-    }
-
-    RefPtr<IDBTransactionBackend> m_transaction;
-    const size_t m_indexCount;
-};
-
-class OpenCursorOperation : public IDBOperation {
-public:
-    static Ref<IDBOperation> create(IDBTransactionBackend* transaction, int64_t objectStoreId, int64_t indexId, PassRefPtr<IDBKeyRange> keyRange, IndexedDB::CursorDirection direction, IndexedDB::CursorType cursorType, IDBDatabaseBackend::TaskType taskType, PassRefPtr<IDBCallbacks> callbacks)
-    {
-        return adoptRef(*new OpenCursorOperation(transaction, objectStoreId, indexId, keyRange, direction, cursorType, taskType, callbacks));
-    }
-    virtual void perform(std::function<void()> successCallback) override final;
-
-    int64_t transactionID() const { return m_transaction->id(); }
-    int64_t objectStoreID() const { return m_objectStoreID; }
-    int64_t indexID() const { return m_indexID; }
-    IndexedDB::CursorDirection direction() const { return m_direction; }
-    IndexedDB::CursorType cursorType() const { return m_cursorType; }
-    IDBDatabaseBackend::TaskType taskType() const { return m_taskType; }
-    IDBKeyRange* keyRange() const { return m_keyRange.get(); }
-    IndexedDB::CursorDirection cursorDirection() const { return m_direction; }
-
-private:
-    OpenCursorOperation(IDBTransactionBackend* transaction, int64_t objectStoreId, int64_t indexId, PassRefPtr<IDBKeyRange> keyRange, IndexedDB::CursorDirection direction, IndexedDB::CursorType cursorType, IDBDatabaseBackend::TaskType taskType, PassRefPtr<IDBCallbacks> callbacks)
-        : m_transaction(transaction)
-        , m_objectStoreID(objectStoreId)
-        , m_indexID(indexId)
-        , m_keyRange(keyRange)
-        , m_direction(direction)
-        , m_cursorType(cursorType)
-        , m_taskType(taskType)
-        , m_callbacks(callbacks)
-    {
-    }
-
-    RefPtr<IDBTransactionBackend> m_transaction;
-    const int64_t m_objectStoreID;
-    const int64_t m_indexID;
-    const PassRefPtr<IDBKeyRange> m_keyRange;
-    const IndexedDB::CursorDirection m_direction;
-    const IndexedDB::CursorType m_cursorType;
-    const IDBDatabaseBackend::TaskType m_taskType;
-    const RefPtr<IDBCallbacks> m_callbacks;
-};
-
-class CountOperation : public IDBOperation {
-public:
-    static Ref<IDBOperation> create(IDBTransactionBackend* transaction, int64_t objectStoreId, int64_t indexId, PassRefPtr<IDBKeyRange> keyRange, PassRefPtr<IDBCallbacks> callbacks)
-    {
-        return adoptRef(*new CountOperation(transaction, objectStoreId, indexId, keyRange, callbacks));
-    }
-    virtual void perform(std::function<void()> successCallback) override final;
-
-    int64_t objectStoreID() const { return m_objectStoreID; }
-    int64_t indexID() const { return m_indexID; }
-    IDBKeyRange* keyRange() const { return m_keyRange.get(); }
-
-private:
-    CountOperation(IDBTransactionBackend* transaction, int64_t objectStoreId, int64_t indexId, PassRefPtr<IDBKeyRange> keyRange, PassRefPtr<IDBCallbacks> callbacks)
-        : m_transaction(transaction)
-        , m_objectStoreID(objectStoreId)
-        , m_indexID(indexId)
-        , m_keyRange(keyRange)
-        , m_callbacks(callbacks)
-    {
-    }
-
-    RefPtr<IDBTransactionBackend> m_transaction;
-    const int64_t m_objectStoreID;
-    const int64_t m_indexID;
-    const RefPtr<IDBKeyRange> m_keyRange;
-    const RefPtr<IDBCallbacks> m_callbacks;
-};
-
-class DeleteRangeOperation : public IDBOperation {
-public:
-    static Ref<IDBOperation> create(IDBTransactionBackend* transaction, int64_t objectStoreId, PassRefPtr<IDBKeyRange> keyRange, PassRefPtr<IDBCallbacks> callbacks)
-    {
-        return adoptRef(*new DeleteRangeOperation(transaction, objectStoreId, keyRange, callbacks));
-    }
-    virtual void perform(std::function<void()> successCallback) override final;
-
-    int64_t objectStoreID() const { return m_objectStoreID; }
-    IDBKeyRange* keyRange() const { return m_keyRange.get(); }
-
-private:
-    DeleteRangeOperation(IDBTransactionBackend* transaction, int64_t objectStoreId, PassRefPtr<IDBKeyRange> keyRange, PassRefPtr<IDBCallbacks> callbacks)
-        : m_transaction(transaction)
-        , m_objectStoreID(objectStoreId)
-        , m_keyRange(keyRange)
-        , m_callbacks(callbacks)
-    {
-    }
-
-    RefPtr<IDBTransactionBackend> m_transaction;
-    const int64_t m_objectStoreID;
-    const RefPtr<IDBKeyRange> m_keyRange;
-    const RefPtr<IDBCallbacks> m_callbacks;
-};
-
-class ClearObjectStoreOperation : public IDBOperation {
-public:
-    static Ref<IDBOperation> create(IDBTransactionBackend* transaction, int64_t objectStoreId, PassRefPtr<IDBCallbacks> callbacks)
-    {
-        return adoptRef(*new ClearObjectStoreOperation(transaction, objectStoreId, callbacks));
-    }
-    virtual void perform(std::function<void()> successCallback) override final;
-
-    IDBTransactionBackend* transaction() const { return m_transaction.get(); }
-    int64_t objectStoreID() const { return m_objectStoreID; }
-
-private:
-    ClearObjectStoreOperation(IDBTransactionBackend* transaction, int64_t objectStoreId, PassRefPtr<IDBCallbacks> callbacks)
-        : m_transaction(transaction)
-        , m_objectStoreID(objectStoreId)
-        , m_callbacks(callbacks)
-    {
-    }
-
-    RefPtr<IDBTransactionBackend> m_transaction;
-    const int64_t m_objectStoreID;
-    const RefPtr<IDBCallbacks> m_callbacks;
-};
-
-} // namespace WebCore
-
-#endif // ENABLE(INDEXED_DATABASE)
-#endif // IDBTransactionBackendOperations_h
diff --git a/Source/WebCore/Modules/indexeddb/legacy/IDBTransactionCoordinator.cpp b/Source/WebCore/Modules/indexeddb/legacy/IDBTransactionCoordinator.cpp
deleted file mode 100644 (file)
index 9d69e0a..0000000
+++ /dev/null
@@ -1,118 +0,0 @@
-/*
- * Copyright (C) 2010 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1.  Redistributions of source code must retain the above copyright
- *     notice, this list of conditions and the following disclaimer.
- * 2.  Redistributions in binary form must reproduce the above copyright
- *     notice, this list of conditions and the following disclaimer in the
- *     documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-#include "IDBTransactionCoordinator.h"
-
-#if ENABLE(INDEXED_DATABASE)
-
-#include "IDBDatabaseCallbacks.h"
-#include "IDBTransactionBackend.h"
-
-namespace WebCore {
-
-IDBTransactionCoordinator::IDBTransactionCoordinator()
-{
-}
-
-IDBTransactionCoordinator::~IDBTransactionCoordinator()
-{
-}
-
-void IDBTransactionCoordinator::didCreateTransaction(IDBTransactionBackend* transaction)
-{
-    ASSERT(!m_transactions.contains(transaction));
-    m_transactions.add(transaction, transaction);
-}
-
-void IDBTransactionCoordinator::didStartTransaction(IDBTransactionBackend* transaction)
-{
-    ASSERT(m_transactions.contains(transaction));
-
-    m_queuedTransactions.add(transaction);
-    processStartedTransactions();
-}
-
-void IDBTransactionCoordinator::didFinishTransaction(IDBTransactionBackend* transaction)
-{
-    ASSERT(m_transactions.contains(transaction));
-
-    if (m_queuedTransactions.contains(transaction)) {
-        ASSERT(!m_startedTransactions.contains(transaction));
-        m_queuedTransactions.remove(transaction);
-    } else if (m_startedTransactions.contains(transaction))
-        m_startedTransactions.remove(transaction);
-
-    m_transactions.remove(transaction);
-
-    processStartedTransactions();
-}
-
-#ifndef NDEBUG
-// Verifies internal consistiency while returning whether anything is found.
-bool IDBTransactionCoordinator::isActive(IDBTransactionBackend* transaction)
-{
-    bool found = false;
-    if (m_queuedTransactions.contains(transaction))
-        found = true;
-    if (m_startedTransactions.contains(transaction)) {
-        ASSERT(!found);
-        found = true;
-    }
-    ASSERT(found == m_transactions.contains(transaction));
-    return found;
-}
-#endif
-
-void IDBTransactionCoordinator::processStartedTransactions()
-{
-    if (m_queuedTransactions.isEmpty())
-        return;
-
-    ASSERT(m_startedTransactions.isEmpty() || (*m_startedTransactions.begin())->mode() != IndexedDB::TransactionMode::VersionChange);
-
-    ListHashSet<IDBTransactionBackend*>::const_iterator it = m_queuedTransactions.begin();
-    while (it != m_queuedTransactions.end()) {
-        IDBTransactionBackend* transaction = *it;
-        ++it;
-        if (canRunTransaction(transaction)) {
-            m_queuedTransactions.remove(transaction);
-            m_startedTransactions.add(transaction);
-            transaction->run();
-        }
-    }
-}
-
-bool IDBTransactionCoordinator::canRunTransaction(IDBTransactionBackend* transaction)
-{
-    ASSERT(m_queuedTransactions.contains(transaction));
-
-    UNUSED_PARAM(transaction);
-    return !m_startedTransactions.size();
-}
-
-};
-
-#endif // ENABLE(INDEXED_DATABASE)
diff --git a/Source/WebCore/Modules/indexeddb/legacy/IDBTransactionCoordinator.h b/Source/WebCore/Modules/indexeddb/legacy/IDBTransactionCoordinator.h
deleted file mode 100644 (file)
index 9455438..0000000
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
- * Copyright (C) 2010 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1.  Redistributions of source code must retain the above copyright
- *     notice, this list of conditions and the following disclaimer.
- * 2.  Redistributions in binary form must reproduce the above copyright
- *     notice, this list of conditions and the following disclaimer in the
- *     documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef IDBTransactionCoordinator_h
-#define IDBTransactionCoordinator_h
-
-#if ENABLE(INDEXED_DATABASE)
-
-#include <memory>
-#include <wtf/HashMap.h>
-#include <wtf/ListHashSet.h>
-#include <wtf/RefPtr.h>
-
-namespace WebCore {
-
-class IDBTransactionBackend;
-
-// Transactions are executed in the order the were created.
-class IDBTransactionCoordinator {
-public:
-    IDBTransactionCoordinator();
-    virtual ~IDBTransactionCoordinator();
-
-    // Called by transactions as they start and finish.
-    void didCreateTransaction(IDBTransactionBackend*);
-    void didOpenBackingStoreTransaction(IDBTransactionBackend*);
-    void didStartTransaction(IDBTransactionBackend*);
-    void didFinishTransaction(IDBTransactionBackend*);
-
-#ifndef NDEBUG
-    bool isActive(IDBTransactionBackend*);
-#endif
-
-private:
-    void processStartedTransactions();
-    bool canRunTransaction(IDBTransactionBackend*);
-
-    // This is just an efficient way to keep references to all transactions.
-    HashMap<IDBTransactionBackend*, RefPtr<IDBTransactionBackend> > m_transactions;
-    // Transactions in different states are grouped below.
-    ListHashSet<IDBTransactionBackend*> m_queuedTransactions;
-    HashSet<IDBTransactionBackend*> m_startedTransactions;
-};
-
-} // namespace WebCore
-
-#endif // ENABLE(INDEXED_DATABASE)
-
-#endif // IDBTransactionCoordinator_h
diff --git a/Source/WebCore/Modules/indexeddb/legacy/LegacyAny.cpp b/Source/WebCore/Modules/indexeddb/legacy/LegacyAny.cpp
deleted file mode 100644 (file)
index e22a2e6..0000000
+++ /dev/null
@@ -1,261 +0,0 @@
-/*
- * Copyright (C) 2010 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1.  Redistributions of source code must retain the above copyright
- *     notice, this list of conditions and the following disclaimer.
- * 2.  Redistributions in binary form must reproduce the above copyright
- *     notice, this list of conditions and the following disclaimer in the
- *     documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-#include "LegacyAny.h"
-
-#if ENABLE(INDEXED_DATABASE)
-
-#include "DOMStringList.h"
-#include "IDBKeyPath.h"
-#include "LegacyCursorWithValue.h"
-#include "LegacyDatabase.h"
-#include "LegacyFactory.h"
-#include "LegacyIndex.h"
-#include "LegacyObjectStore.h"
-
-namespace WebCore {
-
-RefPtr<LegacyAny> LegacyAny::createInvalid()
-{
-    return adoptRef(new LegacyAny(Type::Undefined));
-}
-
-RefPtr<LegacyAny> LegacyAny::createNull()
-{
-    return adoptRef(new LegacyAny(Type::Null));
-}
-
-RefPtr<LegacyAny> LegacyAny::createString(const String& value)
-{
-    return adoptRef(new LegacyAny(value));
-}
-
-LegacyAny::LegacyAny(Type type)
-    : m_type(type)
-    , m_integer(0)
-{
-    ASSERT(type == Type::Undefined || type == Type::Null);
-}
-
-LegacyAny::~LegacyAny()
-{
-}
-
-RefPtr<DOMStringList> LegacyAny::domStringList()
-{
-    ASSERT(m_type == Type::DOMStringList);
-    return m_domStringList;
-}
-
-RefPtr<IDBCursor> LegacyAny::idbCursor()
-{
-    ASSERT(m_type == Type::IDBCursor);
-    return m_idbCursor;
-}
-
-RefPtr<IDBCursorWithValue> LegacyAny::idbCursorWithValue()
-{
-    ASSERT(m_type == Type::IDBCursorWithValue);
-    return m_idbCursorWithValue;
-}
-
-RefPtr<IDBDatabase> LegacyAny::idbDatabase()
-{
-    ASSERT(m_type == Type::IDBDatabase);
-    return m_idbDatabase;
-}
-
-RefPtr<IDBFactory> LegacyAny::idbFactory()
-{
-    ASSERT(m_type == Type::IDBFactory);
-    return m_idbFactory;
-}
-
-RefPtr<IDBIndex> LegacyAny::idbIndex()
-{
-    ASSERT(m_type == Type::IDBIndex);
-    return m_idbIndex;
-}
-
-RefPtr<IDBObjectStore> LegacyAny::idbObjectStore()
-{
-    ASSERT(m_type == Type::IDBObjectStore);
-    return m_idbObjectStore;
-}
-
-RefPtr<IDBTransaction> LegacyAny::idbTransaction()
-{
-    ASSERT(m_type == Type::IDBTransaction);
-    return m_idbTransaction;
-}
-
-const Deprecated::ScriptValue& LegacyAny::scriptValue()
-{
-    ASSERT(m_type == Type::ScriptValue);
-    return m_scriptValue;
-}
-
-const String& LegacyAny::string()
-{
-    ASSERT(m_type == Type::String);
-    return m_string;
-}
-
-int64_t LegacyAny::integer()
-{
-    ASSERT(m_type == Type::Integer);
-    return m_integer;
-}
-
-LegacyAny::LegacyAny(RefPtr<DOMStringList> value)
-    : m_type(Type::DOMStringList)
-    , m_domStringList(value)
-    , m_integer(0)
-{
-}
-
-LegacyAny::LegacyAny(RefPtr<LegacyCursorWithValue> value)
-    : m_type(Type::IDBCursorWithValue)
-    , m_idbCursorWithValue(value)
-    , m_integer(0)
-{
-}
-
-LegacyAny::LegacyAny(RefPtr<LegacyCursor> value)
-    : m_type(Type::IDBCursor)
-    , m_idbCursor(value)
-    , m_integer(0)
-{
-}
-
-LegacyAny::LegacyAny(RefPtr<LegacyDatabase> value)
-    : m_type(Type::IDBDatabase)
-    , m_idbDatabase(value)
-    , m_integer(0)
-{
-}
-
-LegacyAny::LegacyAny(RefPtr<LegacyFactory> value)
-    : m_type(Type::IDBFactory)
-    , m_idbFactory(value)
-    , m_integer(0)
-{
-}
-
-LegacyAny::LegacyAny(RefPtr<LegacyIndex> value)
-    : m_type(Type::IDBIndex)
-    , m_idbIndex(value)
-    , m_integer(0)
-{
-}
-
-LegacyAny::LegacyAny(RefPtr<LegacyTransaction> value)
-    : m_type(Type::IDBTransaction)
-    , m_idbTransaction(value)
-    , m_integer(0)
-{
-}
-
-LegacyAny::LegacyAny(RefPtr<LegacyObjectStore> value)
-    : m_type(Type::IDBObjectStore)
-    , m_idbObjectStore(value)
-    , m_integer(0)
-{
-}
-
-LegacyAny::LegacyAny(const Deprecated::ScriptValue& value)
-    : m_type(Type::ScriptValue)
-    , m_scriptValue(value)
-    , m_integer(0)
-{
-}
-
-LegacyAny::LegacyAny(const IDBKeyPath& value)
-    : m_type(Type::KeyPath)
-    , m_idbKeyPath(value)
-    , m_integer(0)
-{
-}
-
-LegacyAny::LegacyAny(const String& value)
-    : m_type(Type::String)
-    , m_string(value)
-    , m_integer(0)
-{
-}
-
-LegacyAny::LegacyAny(int64_t value)
-    : m_type(Type::Integer)
-    , m_integer(value)
-{
-}
-
-LegacyCursor* LegacyAny::legacyCursor()
-{
-    ASSERT(m_type == Type::IDBCursor);
-    return m_idbCursor.get();
-}
-
-LegacyCursorWithValue* LegacyAny::legacyCursorWithValue()
-{
-    ASSERT(m_type == Type::IDBCursorWithValue);
-    return m_idbCursorWithValue.get();
-}
-
-LegacyDatabase* LegacyAny::legacyDatabase()
-{
-    ASSERT(m_type == Type::IDBDatabase);
-    return m_idbDatabase.get();
-}
-
-LegacyFactory* LegacyAny::legacyFactory()
-{
-    ASSERT(m_type == Type::IDBFactory);
-    return m_idbFactory.get();
-}
-
-LegacyIndex* LegacyAny::legacyIndex()
-{
-    ASSERT(m_type == Type::IDBIndex);
-    return m_idbIndex.get();
-}
-
-LegacyObjectStore* LegacyAny::legacyObjectStore()
-{
-    ASSERT(m_type == Type::IDBObjectStore);
-    return m_idbObjectStore.get();
-}
-
-LegacyTransaction* LegacyAny::legacyTransaction()
-{
-    ASSERT(m_type == Type::IDBTransaction);
-    return m_idbTransaction.get();
-}
-
-} // namespace WebCore
-
-#endif // ENABLE(INDEXED_DATABASE)
-
diff --git a/Source/WebCore/Modules/indexeddb/legacy/LegacyAny.h b/Source/WebCore/Modules/indexeddb/legacy/LegacyAny.h
deleted file mode 100644 (file)
index 6c29f26..0000000
+++ /dev/null
@@ -1,150 +0,0 @@
-/*
- * Copyright (C) 2010 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1.  Redistributions of source code must retain the above copyright
- *     notice, this list of conditions and the following disclaimer.
- * 2.  Redistributions in binary form must reproduce the above copyright
- *     notice, this list of conditions and the following disclaimer in the
- *     documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef LegacyAny_h
-#define LegacyAny_h
-
-#if ENABLE(INDEXED_DATABASE)
-
-#include "IDBAny.h"
-#include "IDBKeyPath.h"
-#include "ScriptWrappable.h"
-#include <bindings/ScriptValue.h>
-#include <wtf/PassRefPtr.h>
-#include <wtf/RefCounted.h>
-#include <wtf/RefPtr.h>
-#include <wtf/text/WTFString.h>
-
-namespace WebCore {
-
-class DOMStringList;
-class IDBCursor;
-class IDBCursorWithValue;
-class IDBDatabase;
-class IDBFactory;
-class IDBIndex;
-class IDBKeyPath;
-class IDBObjectStore;
-class IDBTransaction;
-
-class LegacyCursor;
-class LegacyCursorWithValue;
-class LegacyDatabase;
-class LegacyFactory;
-class LegacyIndex;
-class LegacyObjectStore;
-class LegacyTransaction;
-
-class LegacyAny : public IDBAny {
-public:
-    static RefPtr<LegacyAny> createInvalid();
-    static RefPtr<LegacyAny> createNull();
-    static RefPtr<LegacyAny> createString(const String&);
-    template<typename T>
-    static RefPtr<LegacyAny> create(T* idbObject)
-    {
-        return adoptRef(new LegacyAny(idbObject));
-    }
-    template<typename T>
-    static RefPtr<LegacyAny> create(const T& idbObject)
-    {
-        return adoptRef(new LegacyAny(idbObject));
-    }
-    template<typename T>
-    static RefPtr<LegacyAny> create(PassRefPtr<T> idbObject)
-    {
-        RefPtr<T> refObject = idbObject;
-        return adoptRef(new LegacyAny(WTFMove(refObject)));
-    }
-    static RefPtr<LegacyAny> create(int64_t value)
-    {
-        return adoptRef(new LegacyAny(value));
-    }
-    ~LegacyAny();
-
-    // FIXME: This is a temporary hack to allow casts in WebInspector code while Modern IDB and Legacy IDB live side-by-side.
-    // It should be removed when the legacy implementation is removed as part of https://bugs.webkit.org/show_bug.cgi?id=149117
-    virtual bool isLegacy() const override final { return true; }
-
-    virtual Type type() const override final { return m_type; }
-    // Use type() to figure out which one of these you're allowed to call.
-    virtual RefPtr<DOMStringList> domStringList() override final;
-    virtual RefPtr<IDBCursor> idbCursor() override final;
-    virtual RefPtr<IDBCursorWithValue> idbCursorWithValue() override final;
-    virtual RefPtr<IDBDatabase> idbDatabase() override final;
-    virtual RefPtr<IDBFactory> idbFactory() override final;
-    virtual RefPtr<IDBIndex> idbIndex() override final;
-    virtual RefPtr<IDBObjectStore> idbObjectStore() override final;
-    virtual RefPtr<IDBTransaction> idbTransaction() override final;
-    virtual const Deprecated::ScriptValue& scriptValue() override final;
-    virtual int64_t integer() override final;
-    virtual const String& string() override final;
-    virtual const IDBKeyPath& keyPath() override final { return m_idbKeyPath; };
-
-    LegacyCursor* legacyCursor();
-    LegacyCursorWithValue* legacyCursorWithValue();
-    LegacyDatabase* legacyDatabase();
-    LegacyFactory* legacyFactory();
-    LegacyIndex* legacyIndex();
-    LegacyObjectStore* legacyObjectStore();
-    LegacyTransaction* legacyTransaction();
-
-private:
-    explicit LegacyAny(Type);
-    explicit LegacyAny(RefPtr<DOMStringList>);
-    explicit LegacyAny(RefPtr<LegacyCursor>);
-    explicit LegacyAny(RefPtr<LegacyCursorWithValue>);
-    explicit LegacyAny(RefPtr<LegacyDatabase>);
-    explicit LegacyAny(RefPtr<LegacyFactory>);
-    explicit LegacyAny(RefPtr<LegacyIndex>);
-    explicit LegacyAny(RefPtr<LegacyObjectStore>);
-    explicit LegacyAny(RefPtr<LegacyTransaction>);
-    explicit LegacyAny(const IDBKeyPath&);
-    explicit LegacyAny(const String&);
-    explicit LegacyAny(const Deprecated::ScriptValue&);
-    explicit LegacyAny(int64_t);
-
-    const Type m_type;
-
-    // Only one of the following should ever be in use at any given time.
-    const RefPtr<DOMStringList> m_domStringList;
-    const RefPtr<LegacyCursor> m_idbCursor;
-    const RefPtr<LegacyCursorWithValue> m_idbCursorWithValue;
-    const RefPtr<LegacyDatabase> m_idbDatabase;
-    const RefPtr<LegacyFactory> m_idbFactory;
-    const RefPtr<LegacyIndex> m_idbIndex;
-    const RefPtr<LegacyObjectStore> m_idbObjectStore;
-    const RefPtr<LegacyTransaction> m_idbTransaction;
-    const IDBKeyPath m_idbKeyPath;
-    const Deprecated::ScriptValue m_scriptValue;
-    const String m_string;
-    const int64_t m_integer;
-};
-
-} // namespace WebCore
-
-#endif // ENABLE(INDEXED_DATABASE)
-
-#endif // LegacyAny_h
diff --git a/Source/WebCore/Modules/indexeddb/legacy/LegacyCursor.cpp b/Source/WebCore/Modules/indexeddb/legacy/LegacyCursor.cpp
deleted file mode 100644 (file)
index 93399d1..0000000
+++ /dev/null
@@ -1,277 +0,0 @@
-/*
- * Copyright (C) 2010 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1.  Redistributions of source code must retain the above copyright
- *     notice, this list of conditions and the following disclaimer.
- * 2.  Redistributions in binary form must reproduce the above copyright
- *     notice, this list of conditions and the following disclaimer in the
- *     documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-#include "LegacyCursor.h"
-
-#if ENABLE(INDEXED_DATABASE)
-
-#include "IDBAny.h"
-#include "IDBBindingUtilities.h"
-#include "IDBCallbacks.h"
-#include "IDBCursorBackend.h"
-#include "IDBKey.h"
-#include "IDBObjectStore.h"
-#include "IDBTransaction.h"
-#include "LegacyRequest.h"
-#include "Logging.h"
-#include "ScriptExecutionContext.h"
-#include <inspector/ScriptCallStack.h>
-#include <limits>
-
-namespace WebCore {
-
-Ref<LegacyCursor> LegacyCursor::create(PassRefPtr<IDBCursorBackend> backend, IndexedDB::CursorDirection direction, LegacyRequest* request, LegacyAny* source, LegacyTransaction* transaction)
-{
-    return adoptRef(*new LegacyCursor(backend, direction, request, source, transaction));
-}
-
-LegacyCursor::LegacyCursor(PassRefPtr<IDBCursorBackend> backend, IndexedDB::CursorDirection direction, LegacyRequest* request, LegacyAny* source, LegacyTransaction* transaction)
-    : m_backend(backend)
-    , m_request(request)
-    , m_direction(direction)
-    , m_source(source)
-    , m_transaction(transaction)
-    , m_transactionNotifier(transaction, this)
-    , m_gotValue(false)
-{
-    ASSERT(m_backend);
-    ASSERT(m_request);
-    ASSERT(m_source->type() == IDBAny::Type::IDBObjectStore || m_source->type() == IDBAny::Type::IDBIndex);
-    ASSERT(m_transaction);
-}
-
-LegacyCursor::~LegacyCursor()
-{
-}
-
-const String& LegacyCursor::direction() const
-{
-    LOG(StorageAPI, "LegacyCursor::direction");
-    return directionToString(m_direction);
-}
-
-const Deprecated::ScriptValue& LegacyCursor::key() const
-{
-    LOG(StorageAPI, "LegacyCursor::key");
-    return m_currentKeyValue;
-}
-
-const Deprecated::ScriptValue& LegacyCursor::primaryKey() const
-{
-    LOG(StorageAPI, "LegacyCursor::primaryKey");
-    return m_currentPrimaryKeyValue;
-}
-
-const Deprecated::ScriptValue& LegacyCursor::value() const
-{
-    LOG(StorageAPI, "LegacyCursor::value");
-    return m_currentValue;
-}
-
-IDBAny* LegacyCursor::source()
-{
-    return m_source.get();
-}
-
-RefPtr<IDBRequest> LegacyCursor::update(JSC::ExecState& state, Deprecated::ScriptValue& value, ExceptionCodeWithMessage& ec)
-{
-    LOG(StorageAPI, "LegacyCursor::update");
-
-    if (!m_gotValue || isKeyCursor()) {
-        ec.code = IDBDatabaseException::InvalidStateError;
-        return 0;
-    }
-    if (!m_transaction->isActive()) {
-        ec.code = IDBDatabaseException::TransactionInactiveError;
-        return 0;
-    }
-    if (m_transaction->isReadOnly()) {
-        ec.code = IDBDatabaseException::ReadOnlyError;
-        return 0;
-    }
-
-    RefPtr<LegacyObjectStore> objectStore = effectiveObjectStore();
-    const IDBKeyPath& keyPath = objectStore->metadata().keyPath;
-    const bool usesInLineKeys = !keyPath.isNull();
-    if (usesInLineKeys) {
-        RefPtr<IDBKey> keyPathKey = createIDBKeyFromScriptValueAndKeyPath(m_request->requestState()->exec(), value, keyPath);
-        if (!keyPathKey || !keyPathKey->isEqual(m_currentPrimaryKey.get())) {
-            ec.code = IDBDatabaseException::DataError;
-            return 0;
-        }
-    }
-
-    return objectStore->put(IDBDatabaseBackend::CursorUpdate, LegacyAny::create(this), state, value, m_currentPrimaryKey, ec);
-}
-
-void LegacyCursor::advance(unsigned long count, ExceptionCodeWithMessage& ec)
-{
-    ec.code = 0;
-    LOG(StorageAPI, "LegacyCursor::advance");
-    if (!m_gotValue) {
-        ec.code = IDBDatabaseException::InvalidStateError;
-        return;
-    }
-
-    if (!m_transaction->isActive()) {
-        ec.code = IDBDatabaseException::TransactionInactiveError;
-        return;
-    }
-
-    if (!count) {
-        ec.code = TypeError;
-        return;
-    }
-
-    m_request->setPendingCursor(this);
-    m_gotValue = false;
-    m_backend->advance(count, m_request, ec.code);
-    ASSERT(!ec.code);
-}
-
-void LegacyCursor::continueFunction(ScriptExecutionContext* context, const Deprecated::ScriptValue& keyValue, ExceptionCodeWithMessage& ec)
-{
-    DOMRequestState requestState(context);
-    RefPtr<IDBKey> key = scriptValueToIDBKey(&requestState, keyValue);
-    continueFunction(key.release(), ec);
-}
-
-void LegacyCursor::continueFunction(PassRefPtr<IDBKey> key, ExceptionCodeWithMessage& ec)
-{
-    ec.code = 0;
-    LOG(StorageAPI, "LegacyCursor::continue");
-    if (key && !key->isValid()) {
-        ec.code = IDBDatabaseException::DataError;
-        return;
-    }
-
-    if (!m_transaction->isActive()) {
-        ec.code = IDBDatabaseException::TransactionInactiveError;
-        return;
-    }
-
-    if (!m_gotValue) {
-        ec.code = IDBDatabaseException::InvalidStateError;
-        return;
-    }
-
-    if (key) {
-        ASSERT(m_currentKey);
-        if (m_direction == IndexedDB::CursorDirection::Next || m_direction == IndexedDB::CursorDirection::NextNoDuplicate) {
-            if (!m_currentKey->isLessThan(key.get())) {
-                ec.code = IDBDatabaseException::DataError;
-                return;
-            }
-        } else {
-            if (!key->isLessThan(m_currentKey.get())) {
-                ec.code = IDBDatabaseException::DataError;
-                return;
-            }
-        }
-    }
-
-    // FIXME: We're not using the context from when continue was called, which means the callback
-    //        will be on the original context openCursor was called on. Is this right?
-    m_request->setPendingCursor(this);
-    m_gotValue = false;
-    m_backend->continueFunction(key, m_request, ec.code);
-    ASSERT(!ec.code);
-}
-
-RefPtr<IDBRequest> LegacyCursor::deleteFunction(ScriptExecutionContext* context, ExceptionCodeWithMessage& ec)
-{
-    ec.code = 0;
-    LOG(StorageAPI, "LegacyCursor::delete");
-    if (!m_transaction->isActive()) {
-        ec.code = IDBDatabaseException::TransactionInactiveError;
-        return 0;
-    }
-    if (m_transaction->isReadOnly()) {
-        ec.code = IDBDatabaseException::ReadOnlyError;
-        return 0;
-    }
-
-    if (!m_gotValue || isKeyCursor()) {
-        ec.code = IDBDatabaseException::InvalidStateError;
-        return 0;
-    }
-    RefPtr<LegacyRequest> request = LegacyRequest::create(context, LegacyAny::create(this), m_transaction.get());
-    m_backend->deleteFunction(request, ec.code);
-    ASSERT(!ec.code);
-    return request.release();
-}
-
-void LegacyCursor::postSuccessHandlerCallback()
-{
-    m_backend->postSuccessHandlerCallback();
-}
-
-void LegacyCursor::close()
-{
-    m_transactionNotifier.cursorFinished();
-    if (m_request) {
-        m_request->finishCursor();
-        m_request = nullptr;
-    }
-}
-
-void LegacyCursor::setValueReady(DOMRequestState* state, PassRefPtr<IDBKey> key, PassRefPtr<IDBKey> primaryKey, Deprecated::ScriptValue& value)
-{
-    m_currentKey = key;
-    m_currentKeyValue = idbKeyToScriptValue(state, m_currentKey);
-
-    m_currentPrimaryKey = primaryKey;
-    m_currentPrimaryKeyValue = idbKeyToScriptValue(state, m_currentPrimaryKey);
-
-    if (!isKeyCursor()) {
-        RefPtr<LegacyObjectStore> objectStore = effectiveObjectStore();
-        const IDBObjectStoreMetadata metadata = objectStore->metadata();
-        if (metadata.autoIncrement && !metadata.keyPath.isNull()) {
-#ifndef NDEBUG
-            RefPtr<IDBKey> expectedKey = createIDBKeyFromScriptValueAndKeyPath(m_request->requestState()->exec(), value, metadata.keyPath);
-            ASSERT(!expectedKey || expectedKey->isEqual(m_currentPrimaryKey.get()));
-#endif
-            bool injected = injectIDBKeyIntoScriptValue(m_request->requestState(), m_currentPrimaryKey, value, metadata.keyPath);
-            // FIXME: There is no way to report errors here. Move this into onSuccessWithContinuation so that we can abort the transaction there. See: https://bugs.webkit.org/show_bug.cgi?id=92278
-            ASSERT_UNUSED(injected, injected);
-        }
-    }
-    m_currentValue = value;
-
-    m_gotValue = true;
-}
-
-PassRefPtr<LegacyObjectStore> LegacyCursor::effectiveObjectStore()
-{
-    if (m_source->type() == IDBAny::Type::IDBObjectStore)
-        return m_source->legacyObjectStore();
-    RefPtr<LegacyIndex> index = m_source->legacyIndex();
-    return index->legacyObjectStore();
-}
-
-} // namespace WebCore
-
-#endif // ENABLE(INDEXED_DATABASE)
diff --git a/Source/WebCore/Modules/indexeddb/legacy/LegacyCursor.h b/Source/WebCore/Modules/indexeddb/legacy/LegacyCursor.h
deleted file mode 100644 (file)
index 46e0b42..0000000
+++ /dev/null
@@ -1,105 +0,0 @@
-/*
- * Copyright (C) 2010 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1.  Redistributions of source code must retain the above copyright
- *     notice, this list of conditions and the following disclaimer.
- * 2.  Redistributions in binary form must reproduce the above copyright
- *     notice, this list of conditions and the following disclaimer in the
- *     documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef LegacyCursor_h
-#define LegacyCursor_h
-
-#if ENABLE(INDEXED_DATABASE)
-
-#include "IDBCursorWithValue.h"
-#include "IDBKey.h"
-#include "IndexedDB.h"
-#include "LegacyObjectStore.h"
-#include "LegacyTransaction.h"
-#include "ScriptWrappable.h"
-#include <bindings/ScriptValue.h>
-#include <wtf/RefCounted.h>
-#include <wtf/RefPtr.h>
-
-namespace WebCore {
-
-class DOMRequestState;
-class IDBAny;
-class IDBCallbacks;
-class IDBCursorBackend;
-class LegacyRequest;
-class ScriptExecutionContext;
-
-typedef int ExceptionCode;
-
-class LegacyCursor : public IDBCursorWithValue {
-public:
-    static Ref<LegacyCursor> create(PassRefPtr<IDBCursorBackend>, IndexedDB::CursorDirection, LegacyRequest*, LegacyAny* source, LegacyTransaction*);
-    virtual ~LegacyCursor();
-
-    // Implement the IDL
-    const String& direction() const override;
-    const Deprecated::ScriptValue& key() const override;
-    const Deprecated::ScriptValue& primaryKey() const override;
-    const Deprecated::ScriptValue& value() const override;
-    IDBAny* source() override;
-
-    RefPtr<IDBRequest> update(JSC::ExecState&, Deprecated::ScriptValue&, ExceptionCodeWithMessage&) override;
-    void advance(unsigned long, ExceptionCodeWithMessage&) override;
-    // FIXME: Try to modify the code generator so this overload is unneeded.
-    void continueFunction(ScriptExecutionContext*, ExceptionCodeWithMessage& ec) override { continueFunction(static_cast<IDBKey*>(nullptr), ec); }
-    void continueFunction(ScriptExecutionContext*, const Deprecated::ScriptValue& key, ExceptionCodeWithMessage&) override;
-    RefPtr<IDBRequest> deleteFunction(ScriptExecutionContext*, ExceptionCodeWithMessage&) override;
-
-    void continueFunction(PassRefPtr<IDBKey>, ExceptionCodeWithMessage&);
-    void postSuccessHandlerCallback();
-    void close();
-    void setValueReady(DOMRequestState*, PassRefPtr<IDBKey>, PassRefPtr<IDBKey> primaryKey, Deprecated::ScriptValue&);
-    PassRefPtr<IDBKey> idbPrimaryKey() { return m_currentPrimaryKey; }
-
-    virtual bool isKeyCursor() const override { return true; }
-
-protected:
-    LegacyCursor(PassRefPtr<IDBCursorBackend>, IndexedDB::CursorDirection, LegacyRequest*, LegacyAny* source, LegacyTransaction*);
-
-private:
-    PassRefPtr<LegacyObjectStore> effectiveObjectStore();
-
-    RefPtr<IDBCursorBackend> m_backend;
-    RefPtr<LegacyRequest> m_request;
-    const IndexedDB::CursorDirection m_direction;
-    RefPtr<LegacyAny> m_source;
-    RefPtr<LegacyTransaction> m_transaction;
-    LegacyTransaction::OpenCursorNotifier m_transactionNotifier;
-    bool m_gotValue;
-    // These values are held because m_backend may advance while they
-    // are still valid for the current success handlers.
-    Deprecated::ScriptValue m_currentKeyValue;
-    Deprecated::ScriptValue m_currentPrimaryKeyValue;
-    RefPtr<IDBKey> m_currentKey;
-    RefPtr<IDBKey> m_currentPrimaryKey;
-    Deprecated::ScriptValue m_currentValue;
-};
-
-} // namespace WebCore
-
-#endif
-
-#endif // LegacyCursor_h
diff --git a/Source/WebCore/Modules/indexeddb/legacy/LegacyCursorWithValue.cpp b/Source/WebCore/Modules/indexeddb/legacy/LegacyCursorWithValue.cpp
deleted file mode 100644 (file)
index 31cd11d..0000000
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Copyright (C) 2011 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1.  Redistributions of source code must retain the above copyright
- *     notice, this list of conditions and the following disclaimer.
- * 2.  Redistributions in binary form must reproduce the above copyright
- *     notice, this list of conditions and the following disclaimer in the
- *     documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-#include "LegacyCursorWithValue.h"
-
-#if ENABLE(INDEXED_DATABASE)
-
-#include "IDBCursorBackend.h"
-#include "IDBKey.h"
-
-namespace WebCore {
-
-PassRefPtr<LegacyCursorWithValue> LegacyCursorWithValue::create(PassRefPtr<IDBCursorBackend> backend, IndexedDB::CursorDirection direction, LegacyRequest* request, LegacyAny* source, LegacyTransaction* transaction)
-{
-    return adoptRef(new LegacyCursorWithValue(backend, direction, request, source, transaction));
-}
-
-PassRefPtr<LegacyCursorWithValue> LegacyCursorWithValue::fromCursor(PassRefPtr<LegacyCursor> prpCursor)
-{
-    RefPtr<LegacyCursorWithValue> cursorWithValue(static_cast<LegacyCursorWithValue*>(prpCursor.get()));
-    return cursorWithValue.release();
-}
-
-LegacyCursorWithValue::LegacyCursorWithValue(PassRefPtr<IDBCursorBackend> backend, IndexedDB::CursorDirection direction, LegacyRequest* request, LegacyAny* source, LegacyTransaction* transaction)
-    : LegacyCursor(backend, direction, request, source, transaction)
-{
-}
-
-LegacyCursorWithValue::~LegacyCursorWithValue()
-{
-}
-
-} // namespace WebCore
-
-#endif // ENABLE(INDEXED_DATABASE)
diff --git a/Source/WebCore/Modules/indexeddb/legacy/LegacyCursorWithValue.h b/Source/WebCore/Modules/indexeddb/legacy/LegacyCursorWithValue.h
deleted file mode 100644 (file)
index 7258f2d..0000000
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * Copyright (C) 2011 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1.  Redistributions of source code must retain the above copyright
- *     notice, this list of conditions and the following disclaimer.
- * 2.  Redistributions in binary form must reproduce the above copyright
- *     notice, this list of conditions and the following disclaimer in the
- *     documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef LegacyCursorWithValue_h
-#define LegacyCursorWithValue_h
-
-#if ENABLE(INDEXED_DATABASE)
-
-#include "LegacyCursor.h"
-
-namespace WebCore {
-
-class LegacyCursorWithValue : public LegacyCursor {
-public:
-    static PassRefPtr<LegacyCursorWithValue> create(PassRefPtr<IDBCursorBackend>, IndexedDB::CursorDirection, LegacyRequest*, LegacyAny* source, LegacyTransaction*);
-    static PassRefPtr<LegacyCursorWithValue> fromCursor(PassRefPtr<LegacyCursor>);
-    virtual ~LegacyCursorWithValue();
-
-    // The value attribute defined in the IDL is simply implemented in LegacyCursor (but not exposed via
-    // its IDL). This is to make the implementation more simple while matching what the spec says.
-
-    virtual bool isKeyCursor() const override final { return false; }
-
-private:
-    LegacyCursorWithValue(PassRefPtr<IDBCursorBackend>, IndexedDB::CursorDirection, LegacyRequest*, LegacyAny* source, LegacyTransaction*);
-};
-
-} // namespace WebCore
-
-#endif
-
-#endif // LegacyCursorWithValue_h
diff --git a/Source/WebCore/Modules/indexeddb/legacy/LegacyDatabase.cpp b/Source/WebCore/Modules/indexeddb/legacy/LegacyDatabase.cpp
deleted file mode 100644 (file)
index 9f3fb99..0000000
+++ /dev/null
@@ -1,404 +0,0 @@
-/*
- * Copyright (C) 2010 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1.  Redistributions of source code must retain the above copyright
- *     notice, this list of conditions and the following disclaimer.
- * 2.  Redistributions in binary form must reproduce the above copyright
- *     notice, this list of conditions and the following disclaimer in the
- *     documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-#include "LegacyDatabase.h"
-
-#if ENABLE(INDEXED_DATABASE)
-
-#include "DOMStringList.h"
-#include "EventQueue.h"
-#include "ExceptionCode.h"
-#include "IDBAny.h"
-#include "IDBDatabaseBackend.h"
-#include "IDBDatabaseCallbacks.h"
-#include "IDBDatabaseError.h"
-#include "IDBDatabaseException.h"
-#include "IDBEventDispatcher.h"
-#include "IDBIndex.h"
-#include "IDBKeyPath.h"
-#include "IDBObjectStore.h"
-#include "IDBTransaction.h"
-#include "IDBVersionChangeEvent.h"
-#include "LegacyObjectStore.h"
-#include "LegacyVersionChangeEvent.h"
-#include "Logging.h"
-#include "ScriptExecutionContext.h"
-#include <atomic>
-#include <inspector/ScriptCallStack.h>
-#include <limits>
-#include <wtf/Atomics.h>
-
-namespace WebCore {
-
-Ref<LegacyDatabase> LegacyDatabase::create(ScriptExecutionContext* context, PassRefPtr<IDBDatabaseBackend> database, PassRefPtr<IDBDatabaseCallbacks> callbacks)
-{
-    Ref<LegacyDatabase> legacyDatabase(adoptRef(*new LegacyDatabase(context, database, callbacks)));
-    legacyDatabase->suspendIfNeeded();
-    return legacyDatabase;
-}
-
-LegacyDatabase::LegacyDatabase(ScriptExecutionContext* context, PassRefPtr<IDBDatabaseBackend> backend, PassRefPtr<IDBDatabaseCallbacks> callbacks)
-    : IDBDatabase(context)
-    , m_backend(backend)
-    , m_closePending(false)
-    , m_isClosed(false)
-    , m_contextStopped(false)
-    , m_databaseCallbacks(callbacks)
-{
-    // We pass a reference of this object before it can be adopted.
-    relaxAdoptionRequirement();
-}
-
-LegacyDatabase::~LegacyDatabase()
-{
-    // This does what LegacyDatabase::close does, but without any ref/deref of the
-    // database since it is already in the process of being deleted. The logic here
-    // is also simpler since we know there are no transactions (since they ref the
-    // database when they are alive).
-
-    ASSERT(m_transactions.isEmpty());
-
-    if (!m_closePending) {
-        m_closePending = true;
-        m_backend->close(m_databaseCallbacks);
-    }
-
-    if (auto* context = scriptExecutionContext()) {
-        // Remove any pending versionchange events scheduled to fire on this
-        // connection. They would have been scheduled by the backend when another
-        // connection called setVersion, but the frontend connection is being
-        // closed before they could fire.
-        for (auto& event : m_enqueuedEvents)
-            context->eventQueue().cancelEvent(event);
-    }
-}
-
-int64_t LegacyDatabase::nextTransactionId()
-{
-    // Only keep a 32-bit counter to allow ports to use the other 32
-    // bits of the id.
-    static std::atomic<uint32_t> currentTransactionId;
-
-    return ++currentTransactionId;
-}
-
-void LegacyDatabase::transactionCreated(LegacyTransaction* transaction)
-{
-    ASSERT(transaction);
-    ASSERT(!m_transactions.contains(transaction->id()));
-    m_transactions.add(transaction->id(), transaction);
-
-    if (transaction->isVersionChange()) {
-        ASSERT(!m_versionChangeTransaction);
-        m_versionChangeTransaction = transaction;
-    }
-}
-
-void LegacyDatabase::transactionFinished(LegacyTransaction* transaction)
-{
-    ASSERT(transaction);
-    ASSERT(m_transactions.contains(transaction->id()));
-    ASSERT(m_transactions.get(transaction->id()) == transaction);
-    m_transactions.remove(transaction->id());
-
-    if (transaction->isVersionChange()) {
-        ASSERT(m_versionChangeTransaction == transaction);
-        m_versionChangeTransaction = nullptr;
-    }
-
-    if (m_closePending && m_transactions.isEmpty())
-        closeConnection();
-}
-
-void LegacyDatabase::onAbort(int64_t transactionId, PassRefPtr<IDBDatabaseError> error)
-{
-    ASSERT(m_transactions.contains(transactionId));
-    m_transactions.get(transactionId)->onAbort(error);
-}
-
-void LegacyDatabase::onComplete(int64_t transactionId)
-{
-    ASSERT(m_transactions.contains(transactionId));
-    m_transactions.get(transactionId)->onComplete();
-}
-
-RefPtr<DOMStringList> LegacyDatabase::objectStoreNames() const
-{
-    RefPtr<DOMStringList> objectStoreNames = DOMStringList::create();
-    for (auto& objectStore : m_metadata.objectStores.values())
-        objectStoreNames->append(objectStore.name);
-    objectStoreNames->sort();
-    return objectStoreNames.release();
-}
-
-uint64_t LegacyDatabase::version() const
-{
-    // NoIntVersion is a special value for internal use only and shouldn't be exposed to script.
-    // DefaultIntVersion should be exposed instead.
-    return m_metadata.version != IDBDatabaseMetadata::NoIntVersion ? m_metadata.version : static_cast<uint64_t>(IDBDatabaseMetadata::DefaultIntVersion);
-}
-
-RefPtr<IDBObjectStore> LegacyDatabase::createObjectStore(const String& name, const Dictionary& options, ExceptionCodeWithMessage& ec)
-{
-    IDBKeyPath keyPath;
-    bool autoIncrement = false;
-    if (!options.isUndefinedOrNull()) {
-        String keyPathString;
-        Vector<String> keyPathArray;
-        if (options.get("keyPath", keyPathArray))
-            keyPath = IDBKeyPath(keyPathArray);
-        else if (options.getWithUndefinedOrNullCheck("keyPath", keyPathString))
-            keyPath = IDBKeyPath(keyPathString);
-
-        options.get("autoIncrement", autoIncrement);
-    }
-
-    return createObjectStore(name, keyPath, autoIncrement, ec);
-}
-
-RefPtr<IDBObjectStore> LegacyDatabase::createObjectStore(const String& name, const IDBKeyPath& keyPath, bool autoIncrement, ExceptionCodeWithMessage& ec)
-{
-    LOG(StorageAPI, "LegacyDatabase::createObjectStore");
-    if (!m_versionChangeTransaction) {
-        ec.code = IDBDatabaseException::InvalidStateError;
-        return 0;
-    }
-    if (!m_versionChangeTransaction->isActive()) {
-        ec.code = IDBDatabaseException::TransactionInactiveError;
-        return 0;
-    }
-
-    if (containsObjectStore(name)) {
-        ec.code = IDBDatabaseException::ConstraintError;
-        return 0;
-    }
-
-    if (!keyPath.isNull() && !keyPath.isValid()) {
-        ec.code = IDBDatabaseException::SyntaxError;
-        return 0;
-    }
-
-    if (autoIncrement && ((keyPath.type() == IndexedDB::KeyPathType::String && keyPath.string().isEmpty()) || keyPath.type() == IndexedDB::KeyPathType::Array)) {
-        ec.code = IDBDatabaseException::InvalidAccessError;
-        return 0;
-    }
-
-    int64_t objectStoreId = m_metadata.maxObjectStoreId + 1;
-    m_backend->createObjectStore(m_versionChangeTransaction->id(), objectStoreId, name, keyPath, autoIncrement);
-
-    IDBObjectStoreMetadata metadata(name, objectStoreId, keyPath, autoIncrement, IDBDatabaseBackend::MinimumIndexId);
-    RefPtr<LegacyObjectStore> objectStore = LegacyObjectStore::create(metadata, m_versionChangeTransaction.get());
-    m_metadata.objectStores.set(metadata.id, metadata);
-    ++m_metadata.maxObjectStoreId;
-
-    m_versionChangeTransaction->objectStoreCreated(name, objectStore);
-    return objectStore.release();
-}
-
-void LegacyDatabase::deleteObjectStore(const String& name, ExceptionCodeWithMessage& ec)
-{
-    LOG(StorageAPI, "LegacyDatabase::deleteObjectStore");
-    if (!m_versionChangeTransaction) {
-        ec.code = IDBDatabaseException::InvalidStateError;
-        return;
-    }
-    if (!m_versionChangeTransaction->isActive()) {
-        ec.code = IDBDatabaseException::TransactionInactiveError;
-        return;
-    }
-
-    int64_t objectStoreId = findObjectStoreId(name);
-    if (objectStoreId == IDBObjectStoreMetadata::InvalidId) {
-        ec.code = IDBDatabaseException::NotFoundError;
-        return;
-    }
-
-    m_backend->deleteObjectStore(m_versionChangeTransaction->id(), objectStoreId);
-    m_versionChangeTransaction->objectStoreDeleted(name);
-    m_metadata.objectStores.remove(objectStoreId);
-}
-
-RefPtr<IDBTransaction> LegacyDatabase::transaction(ScriptExecutionContext* context, const Vector<String>& scope, const String& modeString, ExceptionCodeWithMessage& ec)
-{
-    LOG(StorageAPI, "LegacyDatabase::transaction");
-    if (!scope.size()) {
-        ec.code = IDBDatabaseException::InvalidAccessError;
-        return 0;
-    }
-
-    IndexedDB::TransactionMode mode = IDBTransaction::stringToMode(modeString, ec.code);
-    if (ec.code)
-        return 0;
-
-    if (m_versionChangeTransaction || m_closePending) {
-        ec.code = IDBDatabaseException::InvalidStateError;
-        return 0;
-    }
-
-    Vector<int64_t> objectStoreIds;
-    for (auto& name : scope) {
-        int64_t objectStoreId = findObjectStoreId(name);
-        if (objectStoreId == IDBObjectStoreMetadata::InvalidId) {
-            ec.code = IDBDatabaseException::NotFoundError;
-            return 0;
-        }
-        objectStoreIds.append(objectStoreId);
-    }
-
-    int64_t transactionId = nextTransactionId();
-    m_backend->createTransaction(transactionId, m_databaseCallbacks, objectStoreIds, mode);
-
-    RefPtr<LegacyTransaction> transaction = LegacyTransaction::create(context, transactionId, scope, mode, this);
-    return transaction.release();
-}
-
-RefPtr<IDBTransaction> LegacyDatabase::transaction(ScriptExecutionContext* context, const String& storeName, const String& mode, ExceptionCodeWithMessage& ec)
-{
-    RefPtr<DOMStringList> storeNames = DOMStringList::create();
-    storeNames->append(storeName);
-    return transaction(context, storeNames, mode, ec);
-}
-
-void LegacyDatabase::forceClose()
-{
-    ExceptionCodeWithMessage ec;
-    for (auto& transaction : m_transactions.values())
-        transaction->abort(ec);
-    this->close();
-}
-
-void LegacyDatabase::close()
-{
-    LOG(StorageAPI, "LegacyDatabase::close");
-    if (m_closePending)
-        return;
-
-    m_closePending = true;
-
-    if (m_transactions.isEmpty())
-        closeConnection();
-}
-
-void LegacyDatabase::closeConnection()
-{
-    ASSERT(m_closePending);
-    ASSERT(m_transactions.isEmpty());
-
-    // Closing may result in deallocating the last transaction, which could result in deleting
-    // this LegacyDatabase. We need the deallocation to happen after we are through.
-    Ref<LegacyDatabase> protect(*this);
-
-    m_backend->close(m_databaseCallbacks);
-
-    if (m_contextStopped || !scriptExecutionContext())
-        return;
-
-    EventQueue& eventQueue = scriptExecutionContext()->eventQueue();
-    // Remove any pending versionchange events scheduled to fire on this
-    // connection. They would have been scheduled by the backend when another
-    // connection called setVersion, but the frontend connection is being
-    // closed before they could fire.
-    for (auto& event : m_enqueuedEvents) {
-        bool removed = eventQueue.cancelEvent(event);
-        ASSERT_UNUSED(removed, removed);
-    }
-
-    m_isClosed = true;
-}
-
-void LegacyDatabase::onVersionChange(uint64_t oldVersion, uint64_t newVersion)
-{
-    LOG(StorageAPI, "LegacyDatabase::onVersionChange");
-    if (m_contextStopped || !scriptExecutionContext())
-        return;
-
-    if (m_closePending)
-        return;
-
-    ASSERT(newVersion != IDBDatabaseMetadata::NoIntVersion);
-    enqueueEvent(LegacyVersionChangeEvent::create(oldVersion, newVersion, eventNames().versionchangeEvent));
-}
-
-void LegacyDatabase::enqueueEvent(Ref<Event>&& event)
-{
-    ASSERT(!m_contextStopped);
-    ASSERT(!m_isClosed);
-    ASSERT(scriptExecutionContext());
-    event->setTarget(this);
-    scriptExecutionContext()->eventQueue().enqueueEvent(event.copyRef());
-    m_enqueuedEvents.append(WTFMove(event));
-}
-
-bool LegacyDatabase::dispatchEvent(Event& event)
-{
-    LOG(StorageAPI, "LegacyDatabase::dispatchEvent");
-    ASSERT(event.type() == eventNames().versionchangeEvent);
-    for (size_t i = 0; i < m_enqueuedEvents.size(); ++i) {
-        if (m_enqueuedEvents[i].ptr() == &event)
-            m_enqueuedEvents.remove(i);
-    }
-    return EventTarget::dispatchEvent(event);
-}
-
-int64_t LegacyDatabase::findObjectStoreId(const String& name) const
-{
-    for (auto& objectStore : m_metadata.objectStores) {
-        if (objectStore.value.name == name) {
-            ASSERT(objectStore.key != IDBObjectStoreMetadata::InvalidId);
-            return objectStore.key;
-        }
-    }
-    return IDBObjectStoreMetadata::InvalidId;
-}
-
-bool LegacyDatabase::hasPendingActivity() const
-{
-    // The script wrapper must not be collected before the object is closed or
-    // we can't fire a "versionchange" event to let script manually close the connection.
-    return !m_closePending && hasEventListeners() && !m_contextStopped;
-}
-
-void LegacyDatabase::stop()
-{
-    // Stop fires at a deterministic time, so we need to call close in it.
-    close();
-
-    m_contextStopped = true;
-}
-
-const char* LegacyDatabase::activeDOMObjectName() const
-{
-    return "LegacyDatabase";
-}
-
-bool LegacyDatabase::canSuspendForDocumentSuspension() const
-{
-    return m_isClosed;
-}
-
-} // namespace WebCore
-
-#endif // ENABLE(INDEXED_DATABASE)
diff --git a/Source/WebCore/Modules/indexeddb/legacy/LegacyDatabase.h b/Source/WebCore/Modules/indexeddb/legacy/LegacyDatabase.h
deleted file mode 100644 (file)
index a128af4..0000000
+++ /dev/null
@@ -1,142 +0,0 @@
-/*
- * Copyright (C) 2010 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1.  Redistributions of source code must retain the above copyright
- *     notice, this list of conditions and the following disclaimer.
- * 2.  Redistributions in binary form must reproduce the above copyright
- *     notice, this list of conditions and the following disclaimer in the
- *     documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef LegacyDatabase_h
-#define LegacyDatabase_h
-
-#include "ActiveDOMObject.h"
-#include "DOMStringList.h"
-#include "Dictionary.h"
-#include "Event.h"
-#include "EventTarget.h"
-#include "IDBDatabase.h"
-#include "IDBDatabaseCallbacks.h"
-#include "IDBDatabaseMetadata.h"
-#include "IDBObjectStore.h"
-#include "IndexedDB.h"
-#include "LegacyTransaction.h"
-#include "ScriptWrappable.h"
-#include <wtf/PassRefPtr.h>
-#include <wtf/RefCounted.h>
-#include <wtf/RefPtr.h>
-
-#if ENABLE(INDEXED_DATABASE)
-
-namespace WebCore {
-
-class LegacyTransaction;
-class ScriptExecutionContext;
-
-typedef int ExceptionCode;
-
-class LegacyDatabase final : public IDBDatabase {
-public:
-    static Ref<LegacyDatabase> create(ScriptExecutionContext*, PassRefPtr<IDBDatabaseBackend>, PassRefPtr<IDBDatabaseCallbacks>);
-    ~LegacyDatabase();
-
-    void setMetadata(const IDBDatabaseMetadata& metadata) { m_metadata = metadata; }
-    void transactionCreated(LegacyTransaction*);
-    void transactionFinished(LegacyTransaction*);
-
-    // Implement the IDL
-    virtual const String name() const override final { return m_metadata.name; }
-    virtual uint64_t version() const override final;
-    virtual RefPtr<DOMStringList> objectStoreNames() const override final;
-
-    virtual RefPtr<IDBObjectStore> createObjectStore(const String& name, const Dictionary&, ExceptionCodeWithMessage&) override final;
-    virtual RefPtr<IDBObjectStore> createObjectStore(const String& name, const IDBKeyPath&, bool autoIncrement, ExceptionCodeWithMessage&) override final;
-    virtual RefPtr<IDBTransaction> transaction(ScriptExecutionContext*, const Vector<String>&, const String& mode, ExceptionCodeWithMessage&) override final;
-    virtual RefPtr<IDBTransaction> transaction(ScriptExecutionContext*, const String&, const String& mode, ExceptionCodeWithMessage&) override final;
-    virtual void deleteObjectStore(const String& name, ExceptionCodeWithMessage&) override final;
-    virtual void close() override final;
-
-    // IDBDatabaseCallbacks
-    virtual void onVersionChange(uint64_t oldVersion, uint64_t newVersion);
-    virtual void onAbort(int64_t, PassRefPtr<IDBDatabaseError>);
-    virtual void onComplete(int64_t);
-
-    // EventTarget
-    virtual EventTargetInterface eventTargetInterface() const override final { return IDBDatabaseEventTargetInterfaceType; }
-    virtual ScriptExecutionContext* scriptExecutionContext() const override final { return ActiveDOMObject::scriptExecutionContext(); }
-
-    bool isClosePending() const { return m_closePending; }
-    void forceClose();
-    const IDBDatabaseMetadata metadata() const { return m_metadata; }
-    void enqueueEvent(Ref<Event>&&);
-
-    using EventTarget::dispatchEvent;
-    virtual bool dispatchEvent(Event&) override;
-
-    int64_t findObjectStoreId(const String& name) const;
-    bool containsObjectStore(const String& name) const
-    {
-        return findObjectStoreId(name) != IDBObjectStoreMetadata::InvalidId;
-    }
-
-    IDBDatabaseBackend* backend() const { return m_backend.get(); }
-
-    static int64_t nextTransactionId();
-
-    // ActiveDOMObject API.
-    bool hasPendingActivity() const override;
-
-private:
-    LegacyDatabase(ScriptExecutionContext*, PassRefPtr<IDBDatabaseBackend>, PassRefPtr<IDBDatabaseCallbacks>);
-
-    PassRefPtr<IDBTransaction> transaction(ScriptExecutionContext* context, PassRefPtr<DOMStringList> scope, const String& mode, ExceptionCodeWithMessage& ec) { return transaction(context, *scope, mode, ec); }
-
-    // ActiveDOMObject API.
-    void stop() override;
-    const char* activeDOMObjectName() const override;
-    bool canSuspendForDocumentSuspension() const override;
-
-    // EventTarget
-    virtual void refEventTarget() override final { ref(); }
-    virtual void derefEventTarget() override final { deref(); }
-
-    void closeConnection();
-
-    IDBDatabaseMetadata m_metadata;
-    RefPtr<IDBDatabaseBackend> m_backend;
-    RefPtr<LegacyTransaction> m_versionChangeTransaction;
-    typedef HashMap<int64_t, LegacyTransaction*> TransactionMap;
-    TransactionMap m_transactions;
-
-    bool m_closePending;
-    bool m_isClosed;
-    bool m_contextStopped;
-
-    // Keep track of the versionchange events waiting to be fired on this
-    // database so that we can cancel them if the database closes.
-    Vector<Ref<Event>> m_enqueuedEvents;
-
-    RefPtr<IDBDatabaseCallbacks> m_databaseCallbacks;
-};
-
-} // namespace WebCore
-
-#endif
-
-#endif // LegacyDatabase_h
diff --git a/Source/WebCore/Modules/indexeddb/legacy/LegacyFactory.cpp b/Source/WebCore/Modules/indexeddb/legacy/LegacyFactory.cpp
deleted file mode 100644 (file)
index 80852ca..0000000
+++ /dev/null
@@ -1,168 +0,0 @@
-/*
- * Copyright (C) 2010 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1.  Redistributions of source code must retain the above copyright
- *     notice, this list of conditions and the following disclaimer.
- * 2.  Redistributions in binary form must reproduce the above copyright
- *     notice, this list of conditions and the following disclaimer in the
- *     documentation and/or other materials provided with the distribution.
- * 3.  Neither the name of Apple Inc. ("Apple") nor the names of
- *     its contributors may be used to endorse or promote products derived
- *     from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-#include "LegacyFactory.h"
-
-#if ENABLE(INDEXED_DATABASE)
-
-#include "Document.h"
-#include "ExceptionCode.h"
-#include "Frame.h"
-#include "IDBBindingUtilities.h"
-#include "IDBDatabaseCallbacksImpl.h"
-#include "IDBDatabaseException.h"
-#include "IDBFactoryBackendInterface.h"
-#include "IDBKey.h"
-#include "IDBKeyRange.h"
-#include "LegacyAny.h"
-#include "LegacyDatabase.h"
-#include "LegacyOpenDBRequest.h"
-#include "Logging.h"
-#include "Page.h"
-#include "PageGroup.h"
-#include "SchemeRegistry.h"
-#include "SecurityOrigin.h"
-#include "WorkerGlobalScope.h"
-#include "WorkerLoaderProxy.h"
-#include "WorkerThread.h"
-
-namespace WebCore {
-
-LegacyFactory::LegacyFactory(IDBFactoryBackendInterface* factory)
-    : m_backend(factory)
-{
-    // We pass a reference to this object before it can be adopted.
-    relaxAdoptionRequirement();
-}
-
-LegacyFactory::~LegacyFactory()
-{
-}
-
-static bool isContextValid(ScriptExecutionContext* context)
-{
-    ASSERT(is<Document>(*context) || context->isWorkerGlobalScope());
-    if (is<Document>(*context)) {
-        Document& document = downcast<Document>(*context);
-        return document.frame() && document.page() && (!document.page()->usesEphemeralSession() || SchemeRegistry::allowsDatabaseAccessInPrivateBrowsing(document.securityOrigin()->protocol()));
-    }
-    return true;
-}
-
-RefPtr<IDBRequest> LegacyFactory::getDatabaseNames(ScriptExecutionContext* context, ExceptionCode& ec)
-{
-    LOG(StorageAPI, "LegacyFactory::getDatabaseNames");
-    if (!isContextValid(context))
-        return 0;
-    if (!context->securityOrigin()->canAccessDatabase(context->topOrigin())) {
-        ec = SECURITY_ERR;
-        return 0;
-    }
-
-    RefPtr<LegacyRequest> request = LegacyRequest::create(context, LegacyAny::create(this), 0);
-    m_backend->getDatabaseNames(request, *(context->securityOrigin()), *(context->topOrigin()), context);
-    return request;
-}
-
-RefPtr<IDBOpenDBRequest> LegacyFactory::open(ScriptExecutionContext* context, const String& name, ExceptionCode& ec)
-{
-    LOG(StorageAPI, "LegacyFactory::open");
-    return openInternal(context, name, 0, IndexedDB::VersionNullness::Null, ec);
-}
-
-RefPtr<IDBOpenDBRequest> LegacyFactory::open(ScriptExecutionContext* context, const String& name, unsigned long long version, ExceptionCode& ec)
-{
-    LOG(StorageAPI, "LegacyFactory::open");
-    if (!version) {
-        ec = TypeError;
-        return 0;
-    }
-    return openInternal(context, name, version, IndexedDB::VersionNullness::NonNull, ec);
-}
-
-PassRefPtr<IDBOpenDBRequest> LegacyFactory::openInternal(ScriptExecutionContext* context, const String& name, uint64_t version, IndexedDB::VersionNullness versionNullness, ExceptionCode& ec)
-{
-    ASSERT(version >= 1 || versionNullness == IndexedDB::VersionNullness::Null);
-    if (name.isNull()) {
-        ec = TypeError;
-        return 0;
-    }
-    if (!isContextValid(context))
-        return 0;
-    if (!context->securityOrigin()->canAccessDatabase(context->topOrigin())) {
-        ec = SECURITY_ERR;
-        return 0;
-    }
-
-    RefPtr<IDBDatabaseCallbacks> databaseCallbacks = IDBDatabaseCallbacksImpl::create();
-    int64_t transactionId = LegacyDatabase::nextTransactionId();
-    RefPtr<LegacyOpenDBRequest> request = LegacyOpenDBRequest::create(context, databaseCallbacks, transactionId, version, versionNullness);
-    m_backend->open(name, version, transactionId, request, databaseCallbacks, *(context->securityOrigin()), *(context->topOrigin()));
-    return request;
-}
-
-RefPtr<IDBOpenDBRequest> LegacyFactory::deleteDatabase(ScriptExecutionContext* context, const String& name, ExceptionCode& ec)
-{
-    LOG(StorageAPI, "LegacyFactory::deleteDatabase");
-    if (name.isNull()) {
-        ec = TypeError;
-        return 0;
-    }
-    if (!isContextValid(context))
-        return 0;
-    if (!context->securityOrigin()->canAccessDatabase(context->topOrigin())) {
-        ec = SECURITY_ERR;
-        return 0;
-    }
-
-    RefPtr<LegacyOpenDBRequest> request = LegacyOpenDBRequest::create(context, 0, 0, 0, IndexedDB::VersionNullness::Null);
-    m_backend->deleteDatabase(name, *context->securityOrigin(), *context->topOrigin(), request, context);
-    return request;
-}
-
-short LegacyFactory::cmp(ScriptExecutionContext* context, const Deprecated::ScriptValue& firstValue, const Deprecated::ScriptValue& secondValue, ExceptionCodeWithMessage& ec)
-{
-    DOMRequestState requestState(context);
-    RefPtr<IDBKey> first = scriptValueToIDBKey(&requestState, firstValue);
-    RefPtr<IDBKey> second = scriptValueToIDBKey(&requestState, secondValue);
-
-    ASSERT(first);
-    ASSERT(second);
-
-    if (!first->isValid() || !second->isValid()) {
-        ec.code = IDBDatabaseException::DataError;
-        return 0;
-    }
-
-    return static_cast<short>(first->compare(second.get()));
-}
-
-} // namespace WebCore
-
-#endif // ENABLE(INDEXED_DATABASE)
diff --git a/Source/WebCore/Modules/indexeddb/legacy/LegacyFactory.h b/Source/WebCore/Modules/indexeddb/legacy/LegacyFactory.h
deleted file mode 100644 (file)
index 43c1e74..0000000
+++ /dev/null
@@ -1,84 +0,0 @@
-/*
- * Copyright (C) 2010 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1.  Redistributions of source code must retain the above copyright
- *     notice, this list of conditions and the following disclaimer.
- * 2.  Redistributions in binary form must reproduce the above copyright
- *     notice, this list of conditions and the following disclaimer in the
- *     documentation and/or other materials provided with the distribution.
- * 3.  Neither the name of Apple Inc. ("Apple") nor the names of
- *     its contributors may be used to endorse or promote products derived
- *     from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-#ifndef LegacyFactory_h
-#define LegacyFactory_h
-
-#include "IDBFactory.h"
-#include "IDBOpenDBRequest.h"
-#include "ScriptWrappable.h"
-#include <wtf/PassRefPtr.h>
-#include <wtf/RefCounted.h>
-#include <wtf/RefPtr.h>
-#include <wtf/text/WTFString.h>
-
-#if ENABLE(INDEXED_DATABASE)
-
-namespace WebCore {
-
-class IDBKey;
-class IDBKeyRange;
-class IDBFactoryBackendInterface;
-class ScriptExecutionContext;
-
-typedef int ExceptionCode;
-
-class LegacyFactory : public ScriptWrappable, public IDBFactory {
-public:
-    static PassRefPtr<LegacyFactory> create(IDBFactoryBackendInterface* factory)
-    {
-        // FIXME: While the feature is under development we'll handle a null factory backend here,
-        // returning null, so javascript can't try to use the feature.
-        // Once the feature is fully functional we should remove the null factory backend.
-        return factory ? adoptRef(new LegacyFactory(factory)) : nullptr;
-    }
-    ~LegacyFactory();
-
-    // FIXME: getDatabaseNames is no longer a web-facing API, and should be removed from LegacyFactory.
-    // The Web Inspector currently uses this to enumerate the list of databases, but is more complicated as a result.
-    // We should provide a simpler API to the Web Inspector then remove getDatabaseNames.
-    virtual RefPtr<IDBRequest> getDatabaseNames(ScriptExecutionContext*, ExceptionCode&) override;
-
-    virtual RefPtr<IDBOpenDBRequest> open(ScriptExecutionContext*, const String& name, ExceptionCode&) override;
-    virtual RefPtr<IDBOpenDBRequest> open(ScriptExecutionContext*, const String& name, unsigned long long version, ExceptionCode&) override;
-    virtual RefPtr<IDBOpenDBRequest> deleteDatabase(ScriptExecutionContext*, const String& name, ExceptionCode&) override;
-
-    short cmp(ScriptExecutionContext*, const Deprecated::ScriptValue& first, const Deprecated::ScriptValue& second, ExceptionCodeWithMessage&) override;
-
-private:
-    LegacyFactory(IDBFactoryBackendInterface*);
-
-    PassRefPtr<IDBOpenDBRequest> openInternal(ScriptExecutionContext*, const String& name, uint64_t version, IndexedDB::VersionNullness, ExceptionCode&);
-
-    RefPtr<IDBFactoryBackendInterface> m_backend;
-};
-
-} // namespace WebCore
-
-#endif
-
-#endif // LegacyFactory_h
diff --git a/Source/WebCore/Modules/indexeddb/legacy/LegacyIndex.cpp b/Source/WebCore/Modules/indexeddb/legacy/LegacyIndex.cpp
deleted file mode 100644 (file)
index 37a093f..0000000
+++ /dev/null
@@ -1,223 +0,0 @@
-/*
- * Copyright (C) 2010 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1.  Redistributions of source code must retain the above copyright
- *     notice, this list of conditions and the following disclaimer.
- * 2.  Redistributions in binary form must reproduce the above copyright
- *     notice, this list of conditions and the following disclaimer in the
- *     documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-#include "LegacyIndex.h"
-
-#if ENABLE(INDEXED_DATABASE)
-
-#include "IDBDatabaseException.h"
-#include "IDBKey.h"
-#include "IDBKeyRange.h"
-#include "IDBObjectStore.h"
-#include "IDBRequest.h"
-#include "IDBTransaction.h"
-#include "Logging.h"
-#include "ScriptExecutionContext.h"
-
-namespace WebCore {
-
-LegacyIndex::LegacyIndex(const IDBIndexMetadata& metadata, LegacyObjectStore* objectStore, LegacyTransaction* transaction)
-    : m_metadata(metadata)
-    , m_objectStore(objectStore)
-    , m_transaction(transaction)
-    , m_deleted(false)
-{
-    ASSERT(m_objectStore);
-    ASSERT(m_transaction);
-    ASSERT(m_metadata.id != IDBIndexMetadata::InvalidId);
-}
-
-LegacyIndex::~LegacyIndex()
-{
-}
-
-void LegacyIndex::ref()
-{
-    ++m_refCount;
-}
-
-void LegacyIndex::deref()
-{
-    if (--m_refCount)
-        return;
-
-    delete this;
-}
-
-RefPtr<IDBRequest> LegacyIndex::openCursor(ScriptExecutionContext* context, IDBKeyRange* keyRange, const String& directionString, ExceptionCodeWithMessage& ec)
-{
-    LOG(StorageAPI, "LegacyIndex::openCursor");
-    if (m_deleted) {
-        ec.code = IDBDatabaseException::InvalidStateError;
-        return 0;
-    }
-    if (!m_transaction->isActive()) {
-        ec.code = IDBDatabaseException::TransactionInactiveError;
-        return 0;
-    }
-    IndexedDB::CursorDirection direction = IDBCursor::stringToDirection(directionString, ec.code);
-    if (ec.code)
-        return 0;
-
-    RefPtr<LegacyRequest> request = LegacyRequest::create(context, LegacyAny::create(this), m_transaction.get());
-    request->setCursorDetails(IndexedDB::CursorType::KeyAndValue, direction);
-    backendDB()->openCursor(m_transaction->id(), m_objectStore->id(), m_metadata.id, keyRange, direction, false, IDBDatabaseBackend::NormalTask, request);
-    return request;
-}
-
-RefPtr<IDBRequest> LegacyIndex::openCursor(ScriptExecutionContext* context, const Deprecated::ScriptValue& key, const String& direction, ExceptionCodeWithMessage& ec)
-{
-    LOG(StorageAPI, "LegacyIndex::openCursor");
-    RefPtr<IDBKeyRange> keyRange = IDBKeyRange::only(context, key, ec.code);
-    if (ec.code)
-        return 0;
-    return openCursor(context, keyRange.get(), direction, ec);
-}
-
-RefPtr<IDBRequest> LegacyIndex::count(ScriptExecutionContext* context, IDBKeyRange* keyRange, ExceptionCodeWithMessage& ec)
-{
-    LOG(StorageAPI, "LegacyIndex::count");
-    if (m_deleted) {
-        ec.code = IDBDatabaseException::InvalidStateError;
-        return 0;
-    }
-    if (!m_transaction->isActive()) {
-        ec.code = IDBDatabaseException::TransactionInactiveError;
-        return 0;
-    }
-    RefPtr<LegacyRequest> request = LegacyRequest::create(context, LegacyAny::create(this), m_transaction.get());
-    backendDB()->count(m_transaction->id(), m_objectStore->id(), m_metadata.id, keyRange, request);
-    return request;
-}
-
-RefPtr<IDBRequest> LegacyIndex::count(ScriptExecutionContext* context, const Deprecated::ScriptValue& key, ExceptionCodeWithMessage& ec)
-{
-    LOG(StorageAPI, "LegacyIndex::count");
-    RefPtr<IDBKeyRange> keyRange = IDBKeyRange::only(context, key, ec.code);
-    if (ec.code)
-        return 0;
-    return count(context, keyRange.get(), ec);
-}
-
-RefPtr<IDBRequest> LegacyIndex::openKeyCursor(ScriptExecutionContext* context, IDBKeyRange* keyRange, const String& directionString, ExceptionCodeWithMessage& ec)
-{
-    LOG(StorageAPI, "LegacyIndex::openKeyCursor");
-    if (m_deleted) {
-        ec.code = IDBDatabaseException::InvalidStateError;
-        return 0;
-    }
-    if (!m_transaction->isActive()) {
-        ec.code = IDBDatabaseException::TransactionInactiveError;
-        return 0;
-    }
-    IndexedDB::CursorDirection direction = IDBCursor::stringToDirection(directionString, ec.code);
-    if (ec.code)
-        return 0;
-
-    RefPtr<LegacyRequest> request = LegacyRequest::create(context, LegacyAny::create(this), m_transaction.get());
-    request->setCursorDetails(IndexedDB::CursorType::KeyOnly, direction);
-    backendDB()->openCursor(m_transaction->id(), m_objectStore->id(), m_metadata.id, keyRange, direction, true, IDBDatabaseBackend::NormalTask, request);
-    return request;
-}
-
-RefPtr<IDBRequest> LegacyIndex::openKeyCursor(ScriptExecutionContext* context, const Deprecated::ScriptValue& key, const String& direction, ExceptionCodeWithMessage& ec)
-{
-    LOG(StorageAPI, "LegacyIndex::openKeyCursor");
-    RefPtr<IDBKeyRange> keyRange = IDBKeyRange::only(context, key, ec.code);
-    if (ec.code)
-        return 0;
-    return openKeyCursor(context, keyRange.get(), direction, ec);
-}
-
-RefPtr<IDBRequest> LegacyIndex::get(ScriptExecutionContext* context, const Deprecated::ScriptValue& key, ExceptionCodeWithMessage& ec)
-{
-    LOG(StorageAPI, "LegacyIndex::get");
-    RefPtr<IDBKeyRange> keyRange = IDBKeyRange::only(context, key, ec.code);
-    if (ec.code)
-        return 0;
-    return get(context, keyRange.get(), ec);
-}
-
-RefPtr<IDBRequest> LegacyIndex::get(ScriptExecutionContext* context, IDBKeyRange* keyRange, ExceptionCodeWithMessage& ec)
-{
-    LOG(StorageAPI, "LegacyIndex::get");
-    if (m_deleted) {
-        ec.code = IDBDatabaseException::InvalidStateError;
-        return 0;
-    }
-    if (!m_transaction->isActive()) {
-        ec.code = IDBDatabaseException::TransactionInactiveError;
-        return 0;
-    }
-    if (!keyRange) {
-        ec.code = IDBDatabaseException::DataError;
-        return 0;
-    }
-
-    RefPtr<LegacyRequest> request = LegacyRequest::create(context, LegacyAny::create(this), m_transaction.get());
-    backendDB()->get(m_transaction->id(), m_objectStore->id(), m_metadata.id, keyRange, false, request);
-    return request;
-}
-
-RefPtr<IDBRequest> LegacyIndex::getKey(ScriptExecutionContext* context, const Deprecated::ScriptValue& key, ExceptionCodeWithMessage& ec)
-{
-    LOG(StorageAPI, "LegacyIndex::getKey");
-    RefPtr<IDBKeyRange> keyRange = IDBKeyRange::only(context, key, ec.code);
-    if (ec.code)
-        return 0;
-
-    return getKey(context, keyRange.get(), ec);
-}
-
-RefPtr<IDBRequest> LegacyIndex::getKey(ScriptExecutionContext* context, IDBKeyRange* keyRange, ExceptionCodeWithMessage& ec)
-{
-    LOG(StorageAPI, "LegacyIndex::getKey");
-    if (m_deleted) {
-        ec.code = IDBDatabaseException::InvalidStateError;
-        return 0;
-    }
-    if (!m_transaction->isActive()) {
-        ec.code = IDBDatabaseException::TransactionInactiveError;
-        return 0;
-    }
-    if (!keyRange) {
-        ec.code = IDBDatabaseException::DataError;
-        return 0;
-    }
-
-    RefPtr<LegacyRequest> request = LegacyRequest::create(context, LegacyAny::create(this), m_transaction.get());
-    backendDB()->get(m_transaction->id(), m_objectStore->id(), m_metadata.id, keyRange, true, request);
-    return request;
-}
-
-IDBDatabaseBackend* LegacyIndex::backendDB() const
-{
-    return m_transaction->backendDB();
-}
-
-} // namespace WebCore
-
-#endif // ENABLE(INDEXED_DATABASE)
diff --git a/Source/WebCore/Modules/indexeddb/legacy/LegacyIndex.h b/Source/WebCore/Modules/indexeddb/legacy/LegacyIndex.h
deleted file mode 100644 (file)
index 8b7131c..0000000
+++ /dev/null
@@ -1,110 +0,0 @@
-/*
- * Copyright (C) 2010 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1.  Redistributions of source code must retain the above copyright
- *     notice, this list of conditions and the following disclaimer.
- * 2.  Redistributions in binary form must reproduce the above copyright
- *     notice, this list of conditions and the following disclaimer in the
- *     documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef LegacyIndex_h
-#define LegacyIndex_h
-
-#include "IDBCursor.h"
-#include "IDBDatabase.h"
-#include "IDBDatabaseMetadata.h"
-#include "IDBKeyPath.h"
-#include "IDBKeyRange.h"
-#include "IDBRequest.h"
-#include "LegacyAny.h"
-#include "LegacyObjectStore.h"
-#include "LegacyRequest.h"
-#include "LegacyTransaction.h"
-#include "ScriptWrappable.h"
-#include <wtf/Forward.h>
-#include <wtf/text/WTFString.h>
-
-#if ENABLE(INDEXED_DATABASE)
-
-namespace WebCore {
-
-class IDBObjectStore;
-
-class LegacyIndex : public ScriptWrappable, public IDBIndex {
-public:
-    static Ref<LegacyIndex> create(const IDBIndexMetadata& metadata, LegacyObjectStore* objectStore, LegacyTransaction* transaction)
-    {
-        return adoptRef(*new LegacyIndex(metadata, objectStore, transaction));
-    }
-    ~LegacyIndex();
-
-    // Implement the IDL
-    virtual const String& name() const override final { return m_metadata.name; }
-    virtual RefPtr<IDBObjectStore> objectStore() override final { return m_objectStore; }
-    LegacyObjectStore* legacyObjectStore() const { return m_objectStore.get(); }
-    virtual RefPtr<IDBAny> keyPathAny() const override final { return LegacyAny::create(m_metadata.keyPath); }
-    virtual const IDBKeyPath& keyPath() const override final { return m_metadata.keyPath; }
-    virtual bool unique() const override final { return m_metadata.unique; }
-    virtual bool multiEntry() const override final { return m_metadata.multiEntry; }
-    int64_t id() const { return m_metadata.id; }
-
-    // FIXME: Try to modify the code generator so this is unneeded.
-    virtual RefPtr<IDBRequest> openCursor(ScriptExecutionContext* context, ExceptionCodeWithMessage& ec) override final { return openCursor(context, static_cast<IDBKeyRange*>(nullptr), ec); }
-    virtual RefPtr<IDBRequest> openCursor(ScriptExecutionContext* context, IDBKeyRange* keyRange, ExceptionCodeWithMessage& ec) override final { return openCursor(context, keyRange, IDBCursor::directionNext(), ec); }
-    virtual RefPtr<IDBRequest> openCursor(ScriptExecutionContext* context, const Deprecated::ScriptValue& key, ExceptionCodeWithMessage& ec) override final { return openCursor(context, key, IDBCursor::directionNext(), ec); }
-    virtual RefPtr<IDBRequest> openCursor(ScriptExecutionContext*, IDBKeyRange*, const String& direction, ExceptionCodeWithMessage&) override final;
-    virtual RefPtr<IDBRequest> openCursor(ScriptExecutionContext*, const Deprecated::ScriptValue& key, const String& direction, ExceptionCodeWithMessage&) override final;
-    virtual RefPtr<IDBRequest> count(ScriptExecutionContext* context, ExceptionCodeWithMessage& ec) override final { return count(context, static_cast<IDBKeyRange*>(nullptr), ec); }
-    virtual RefPtr<IDBRequest> count(ScriptExecutionContext*, IDBKeyRange*, ExceptionCodeWithMessage&) override final;
-    virtual RefPtr<IDBRequest> count(ScriptExecutionContext*, const Deprecated::ScriptValue& key, ExceptionCodeWithMessage&) override final;
-
-    virtual RefPtr<IDBRequest> openKeyCursor(ScriptExecutionContext* context, ExceptionCodeWithMessage& ec) override final { return openKeyCursor(context, static_cast<IDBKeyRange*>(nullptr), ec); }
-    virtual RefPtr<IDBRequest> openKeyCursor(ScriptExecutionContext* context, IDBKeyRange* keyRange, ExceptionCodeWithMessage& ec) override final { return openKeyCursor(context, keyRange, IDBCursor::directionNext(), ec); }
-    virtual RefPtr<IDBRequest> openKeyCursor(ScriptExecutionContext* context, const Deprecated::ScriptValue& key, ExceptionCodeWithMessage& ec) override final { return openKeyCursor(context, key, IDBCursor::directionNext(), ec); }
-    virtual RefPtr<IDBRequest> openKeyCursor(ScriptExecutionContext*, IDBKeyRange*, const String& direction, ExceptionCodeWithMessage&) override final;
-    virtual RefPtr<IDBRequest> openKeyCursor(ScriptExecutionContext*, const Deprecated::ScriptValue& key, const String& direction, ExceptionCodeWithMessage&) override final;
-
-    virtual RefPtr<IDBRequest> get(ScriptExecutionContext*, IDBKeyRange*, ExceptionCodeWithMessage&) override final;
-    virtual RefPtr<IDBRequest> get(ScriptExecutionContext*, const Deprecated::ScriptValue& key, ExceptionCodeWithMessage&) override final;
-    virtual RefPtr<IDBRequest> getKey(ScriptExecutionContext*, IDBKeyRange*, ExceptionCodeWithMessage&) override final;
-    virtual RefPtr<IDBRequest> getKey(ScriptExecutionContext*, const Deprecated::ScriptValue& key, ExceptionCodeWithMessage&) override final;
-
-    void markDeleted() { m_deleted = true; }
-
-    IDBDatabaseBackend* backendDB() const;
-
-    virtual void ref() override;
-    virtual void deref() override;
-
-private:
-    LegacyIndex(const IDBIndexMetadata&, LegacyObjectStore*, LegacyTransaction*);
-
-    IDBIndexMetadata m_metadata;
-    RefPtr<LegacyObjectStore> m_objectStore;
-    RefPtr<LegacyTransaction> m_transaction;
-    bool m_deleted;
-
-    unsigned m_refCount { 1 };
-};
-
-} // namespace WebCore
-
-#endif
-
-#endif // LegacyIndex_h
diff --git a/Source/WebCore/Modules/indexeddb/legacy/LegacyObjectStore.cpp b/Source/WebCore/Modules/indexeddb/legacy/LegacyObjectStore.cpp
deleted file mode 100644 (file)
index 8594c24..0000000
+++ /dev/null
@@ -1,582 +0,0 @@
-/*
- * Copyright (C) 2010 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1.  Redistributions of source code must retain the above copyright
- *     notice, this list of conditions and the following disclaimer.
- * 2.  Redistributions in binary form must reproduce the above copyright
- *     notice, this list of conditions and the following disclaimer in the
- *     documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-#include "LegacyObjectStore.h"
-
-#if ENABLE(INDEXED_DATABASE)
-
-#include "DOMStringList.h"
-#include "IDBAny.h"
-#include "IDBBindingUtilities.h"
-#include "IDBCursorWithValue.h"
-#include "IDBDatabase.h"
-#include "IDBDatabaseException.h"
-#include "IDBKey.h"
-#include "IDBKeyData.h"
-#include "IDBKeyPath.h"
-#include "IDBKeyRange.h"
-#include "IDBTransaction.h"
-#include "LegacyCursorWithValue.h"
-#include "LegacyIndex.h"
-#include "Logging.h"
-#include "ScriptExecutionContext.h"
-#include "SerializedScriptValue.h"
-#include "SharedBuffer.h"
-
-namespace WebCore {
-
-LegacyObjectStore::LegacyObjectStore(const IDBObjectStoreMetadata& metadata, LegacyTransaction* transaction)
-    : m_metadata(metadata)
-    , m_transaction(transaction)
-    , m_deleted(false)
-{
-    ASSERT(m_transaction);
-    // We pass a reference to this object before it can be adopted.
-    relaxAdoptionRequirement();
-}
-
-RefPtr<DOMStringList> LegacyObjectStore::indexNames() const
-{
-    LOG(StorageAPI, "LegacyObjectStore::indexNames");
-    RefPtr<DOMStringList> indexNames = DOMStringList::create();
-    for (auto& index : m_metadata.indexes.values())
-        indexNames->append(index.name);
-    indexNames->sort();
-    return indexNames.release();
-}
-
-RefPtr<IDBRequest> LegacyObjectStore::get(ScriptExecutionContext* context, IDBKeyRange* keyRange, ExceptionCodeWithMessage& ec)
-{
-    LOG(StorageAPI, "LegacyObjectStore::get");
-    if (m_deleted) {
-        ec.code = IDBDatabaseException::InvalidStateError;
-        return 0;
-    }
-    if (!keyRange) {
-        ec.code = IDBDatabaseException::DataError;
-        return 0;
-    }
-    if (!m_transaction->isActive()) {
-        ec.code = IDBDatabaseException::TransactionInactiveError;
-        return 0;
-    }
-    RefPtr<LegacyRequest> request = LegacyRequest::create(context, LegacyAny::create(this), m_transaction.get());
-    backendDB()->get(m_transaction->id(), id(), IDBIndexMetadata::InvalidId, keyRange, false, request);
-    return request.release();
-}
-
-RefPtr<IDBRequest> LegacyObjectStore::get(ScriptExecutionContext* context, const Deprecated::ScriptValue& key, ExceptionCodeWithMessage& ec)
-{
-    RefPtr<IDBKeyRange> keyRange = IDBKeyRange::only(context, key, ec.code);
-    if (ec.code)
-        return 0;
-    return get(context, keyRange.get(), ec);
-}
-
-RefPtr<IDBRequest> LegacyObjectStore::add(JSC::ExecState& state, JSC::JSValue value, JSC::JSValue key, ExceptionCodeWithMessage& ec)
-{
-    LOG(StorageAPI, "LegacyObjectStore::add");
-    auto deprecatedValue = Deprecated::ScriptValue(state.vm(), value);
-    auto dKey = Deprecated::ScriptValue(state.vm(), key);
-    return put(IDBDatabaseBackend::AddOnly, LegacyAny::create(this), state, deprecatedValue, dKey, ec);
-}
-
-RefPtr<IDBRequest> LegacyObjectStore::add(JSC::ExecState& state, JSC::JSValue value, ExceptionCodeWithMessage& ec)
-{
-    LOG(StorageAPI, "LegacyObjectStore::add");
-    auto deprecatedValue = Deprecated::ScriptValue(state.vm(), value);
-    return put(IDBDatabaseBackend::AddOnly, LegacyAny::create(this), state, deprecatedValue, static_cast<IDBKey*>(nullptr), ec);
-}
-
-RefPtr<IDBRequest> LegacyObjectStore::put(JSC::ExecState& state, JSC::JSValue value, JSC::JSValue key, ExceptionCodeWithMessage& ec)
-{
-    LOG(StorageAPI, "LegacyObjectStore::put");
-    auto deprecatedValue = Deprecated::ScriptValue(state.vm(), value);
-    return put(IDBDatabaseBackend::AddOrUpdate, LegacyAny::create(this), state, deprecatedValue, Deprecated::ScriptValue(state.vm(), key), ec);
-}
-
-RefPtr<IDBRequest> LegacyObjectStore::put(JSC::ExecState& state, JSC::JSValue value, ExceptionCodeWithMessage& ec)
-{
-    LOG(StorageAPI, "LegacyObjectStore::put");
-    auto deprecatedValue = Deprecated::ScriptValue(state.vm(), value);
-    return put(IDBDatabaseBackend::AddOrUpdate, LegacyAny::create(this), state, deprecatedValue, static_cast<IDBKey*>(nullptr), ec);
-}
-
-RefPtr<IDBRequest> LegacyObjectStore::put(IDBDatabaseBackend::PutMode putMode, RefPtr<LegacyAny> source, JSC::ExecState& state, Deprecated::ScriptValue& value, const Deprecated::ScriptValue& keyValue, ExceptionCodeWithMessage& ec)
-{
-    ScriptExecutionContext* context = scriptExecutionContextFromExecState(&state);
-    DOMRequestState requestState(context);
-    RefPtr<IDBKey> key = scriptValueToIDBKey(&requestState, keyValue);
-    return put(putMode, source, state, value, key.release(), ec);
-}
-
-RefPtr<IDBRequest> LegacyObjectStore::put(IDBDatabaseBackend::PutMode putMode, RefPtr<LegacyAny> source, JSC::ExecState& state, Deprecated::ScriptValue& value, RefPtr<IDBKey> prpKey, ExceptionCodeWithMessage& ec)
-{
-    RefPtr<IDBKey> key = prpKey;
-    if (m_deleted) {
-        ec.code = IDBDatabaseException::InvalidStateError;
-        return nullptr;
-    }
-    if (!m_transaction->isActive()) {
-        ec.code = IDBDatabaseException::TransactionInactiveError;
-        return nullptr;
-    }
-    if (m_transaction->isReadOnly()) {
-        ec.code = IDBDatabaseException::ReadOnlyError;
-        return nullptr;
-    }
-
-    RefPtr<SerializedScriptValue> serializedValue = SerializedScriptValue::create(&state, value.jsValue(), nullptr, nullptr);
-    if (state.hadException())
-        return nullptr;
-
-    if (serializedValue->hasBlobURLs()) {
-        // FIXME: Add Blob/File/FileList support
-        ec.code = IDBDatabaseException::DataCloneError;
-        return nullptr;
-    }
-
-    const IDBKeyPath& keyPath = m_metadata.keyPath;
-    const bool usesInLineKeys = !keyPath.isNull();
-    const bool hasKeyGenerator = autoIncrement();
-
-    ScriptExecutionContext* context = scriptExecutionContextFromExecState(&state);
-    DOMRequestState requestState(context);
-
-    if (putMode != IDBDatabaseBackend::CursorUpdate && usesInLineKeys && key) {
-        ec.code = IDBDatabaseException::DataError;
-        return nullptr;
-    }
-    if (!usesInLineKeys && !hasKeyGenerator && !key) {
-        ec.code = IDBDatabaseException::DataError;
-        return nullptr;
-    }
-    if (usesInLineKeys) {
-        RefPtr<IDBKey> keyPathKey = createIDBKeyFromScriptValueAndKeyPath(requestState.exec(), value, keyPath);
-        if (keyPathKey && !keyPathKey->isValid()) {
-            ec.code = IDBDatabaseException::DataError;
-            return nullptr;
-        }
-        if (!hasKeyGenerator && !keyPathKey) {
-            ec.code = IDBDatabaseException::DataError;
-            return nullptr;
-        }
-        if (hasKeyGenerator && !keyPathKey) {
-            if (!canInjectIDBKeyIntoScriptValue(&requestState, value, keyPath)) {
-                ec.code = IDBDatabaseException::DataError;
-                return nullptr;
-            }
-        }
-        if (keyPathKey)
-            key = keyPathKey;
-    }
-    if (key && !key->isValid()) {
-        ec.code = IDBDatabaseException::DataError;
-        return nullptr;
-    }
-
-    Vector<int64_t> indexIds;
-    Vector<IndexKeys> indexKeys;
-    for (auto& index : m_metadata.indexes) {
-        Vector<IDBKeyData> keyDatas;
-        generateIndexKeysForValue(requestState.exec(), index.value, value, keyDatas);
-        indexIds.append(index.key);
-
-        // FIXME: Much of the Indexed DB code needs to use IDBKeyData directly to avoid wasteful conversions like this.
-        Vector<RefPtr<IDBKey>> keys;
-        for (auto& keyData : keyDatas) {
-            RefPtr<IDBKey> key = keyData.maybeCreateIDBKey();
-            if (key)
-                keys.append(key.release());
-        }
-        indexKeys.append(keys);
-    }
-
-    RefPtr<LegacyRequest> request = LegacyRequest::create(context, source, m_transaction.get());
-    Vector<uint8_t> valueBytes = serializedValue->toWireBytes();
-    // This is a hack to account for disagreements about whether SerializedScriptValue should deal in Vector<uint8_t> or Vector<char>.
-    // See https://lists.webkit.org/pipermail/webkit-dev/2013-February/023682.html
-    Vector<char>* valueBytesSigned = reinterpret_cast<Vector<char>*>(&valueBytes);
-    RefPtr<SharedBuffer> valueBuffer = SharedBuffer::adoptVector(*valueBytesSigned);
-    backendDB()->put(m_transaction->id(), id(), valueBuffer, key.release(), static_cast<IDBDatabaseBackend::PutMode>(putMode), request, indexIds, indexKeys);
-    return request.release();
-}
-
-RefPtr<IDBRequest> LegacyObjectStore::deleteFunction(ScriptExecutionContext* context, IDBKeyRange* keyRange, ExceptionCodeWithMessage& ec)
-{
-    LOG(StorageAPI, "LegacyObjectStore::delete");
-    if (m_deleted) {
-        ec.code = IDBDatabaseException::InvalidStateError;
-        return 0;
-    }
-    if (!m_transaction->isActive()) {
-        ec.code = IDBDatabaseException::TransactionInactiveError;
-        return 0;
-    }
-    if (m_transaction->isReadOnly()) {
-        ec.code = IDBDatabaseException::ReadOnlyError;
-        return 0;
-    }
-    if (!keyRange) {
-        ec.code = IDBDatabaseException::DataError;
-        return 0;
-    }
-
-    RefPtr<LegacyRequest> request = LegacyRequest::create(context, LegacyAny::create(this), m_transaction.get());
-    backendDB()->deleteRange(m_transaction->id(), id(), keyRange, request);
-    return request.release();
-}
-
-RefPtr<IDBRequest> LegacyObjectStore::deleteFunction(ScriptExecutionContext* context, const Deprecated::ScriptValue& key, ExceptionCodeWithMessage& ec)
-{
-    RefPtr<IDBKeyRange> keyRange = IDBKeyRange::only(context, key, ec.code);
-    if (ec.code)
-        return 0;
-    return deleteFunction(context, keyRange.get(), ec);
-}
-
-RefPtr<IDBRequest> LegacyObjectStore::clear(ScriptExecutionContext* context, ExceptionCodeWithMessage& ec)
-{
-    LOG(StorageAPI, "LegacyObjectStore::clear");
-    if (m_deleted) {
-        ec.code = IDBDatabaseException::InvalidStateError;
-        return 0;
-    }
-    if (!m_transaction->isActive()) {
-        ec.code = IDBDatabaseException::TransactionInactiveError;
-        return 0;
-    }
-    if (m_transaction->isReadOnly()) {
-        ec.code = IDBDatabaseException::ReadOnlyError;
-        return 0;
-    }
-
-    RefPtr<LegacyRequest> request = LegacyRequest::create(context, LegacyAny::create(this), m_transaction.get());
-    backendDB()->clearObjectStore(m_transaction->id(), id(), request);
-    return request.release();
-}
-
-namespace {
-// This class creates the index keys for a given index by extracting
-// them from the SerializedScriptValue, for all the existing values in
-// the objectStore. It only needs to be kept alive by virtue of being
-// a listener on an IDBRequest object, in the same way that JavaScript
-// cursor success handlers are kept alive.
-class IndexPopulator : public EventListener {
-public:
-    static Ref<IndexPopulator> create(RefPtr<IDBDatabaseBackend> backend, int64_t transactionId, int64_t objectStoreId, const IDBIndexMetadata& indexMetadata)
-    {
-        return adoptRef(*new IndexPopulator(backend, transactionId, objectStoreId, indexMetadata));
-    }
-
-    virtual bool operator==(const EventListener& other)
-    {
-        return this == &other;
-    }
-
-private:
-    IndexPopulator(RefPtr<IDBDatabaseBackend> backend, int64_t transactionId, int64_t objectStoreId, const IDBIndexMetadata& indexMetadata)
-        : EventListener(CPPEventListenerType)
-        , m_databaseBackend(backend)
-        , m_transactionId(transactionId)
-        , m_objectStoreId(objectStoreId)
-        , m_indexMetadata(indexMetadata)
-    {
-    }
-
-    virtual void handleEvent(ScriptExecutionContext*, Event* event)
-    {
-        ASSERT(event->type() == eventNames().successEvent);
-        EventTarget* target = event->target();
-        LegacyRequest* request = static_cast<LegacyRequest*>(target);
-
-        RefPtr<LegacyAny> cursorAny = request->legacyResult(ASSERT_NO_EXCEPTION);
-        RefPtr<LegacyCursorWithValue> cursor;
-        if (cursorAny->type() == IDBAny::Type::IDBCursorWithValue)
-            cursor = cursorAny->legacyCursorWithValue();
-
-        Vector<int64_t, 1> indexIds;
-        indexIds.append(m_indexMetadata.id);
-        if (cursor) {
-            ExceptionCodeWithMessage ec;
-            cursor->continueFunction(static_cast<IDBKey*>(nullptr), ec);
-            ASSERT(!ec.code);
-
-            RefPtr<IDBKey> primaryKey = cursor->idbPrimaryKey();
-            Deprecated::ScriptValue value = cursor->value();
-
-            Vector<IDBKeyData> indexKeyDatas;
-            generateIndexKeysForValue(request->requestState()->exec(), m_indexMetadata, value, indexKeyDatas);
-
-            Vector<RefPtr<IDBKey>> indexKeys;
-            for (auto& indexKeyData : indexKeyDatas) {
-                RefPtr<IDBKey> key = indexKeyData.maybeCreateIDBKey();
-                if (key)
-                    indexKeys.append(key.release());
-            }
-            Vector<LegacyObjectStore::IndexKeys, 1> indexKeysList;
-            indexKeysList.append(indexKeys);
-
-            m_databaseBackend->setIndexKeys(m_transactionId, m_objectStoreId, primaryKey, indexIds, indexKeysList);
-        } else {
-            // Now that we are done indexing, tell the backend to go
-            // back to processing tasks of type NormalTask.
-            m_databaseBackend->setIndexesReady(m_transactionId, m_objectStoreId, indexIds);
-            m_databaseBackend = nullptr;
-        }
-
-    }
-
-    RefPtr<IDBDatabaseBackend> m_databaseBackend;
-    const int64_t m_transactionId;
-    const int64_t m_objectStoreId;
-    const IDBIndexMetadata m_indexMetadata;
-};
-}
-
-RefPtr<IDBIndex> LegacyObjectStore::createIndex(ScriptExecutionContext* context, const String& name, const IDBKeyPath& keyPath, const Dictionary& options, ExceptionCodeWithMessage& ec)
-{
-    bool unique = false;
-    options.get("unique", unique);
-
-    bool multiEntry = false;
-    options.get("multiEntry", multiEntry);
-
-    return createIndex(context, name, keyPath, unique, multiEntry, ec);
-}
-
-RefPtr<IDBIndex> LegacyObjectStore::createIndex(ScriptExecutionContext* context, const String& name, const IDBKeyPath& keyPath, bool unique, bool multiEntry, ExceptionCodeWithMessage& ec)
-{
-    LOG(StorageAPI, "LegacyObjectStore::createIndex");
-    if (!m_transaction->isVersionChange() || m_deleted) {
-        ec.code = IDBDatabaseException::InvalidStateError;
-        return 0;
-    }
-    if (!m_transaction->isActive()) {
-        ec.code = IDBDatabaseException::TransactionInactiveError;
-        return 0;
-    }
-    if (!keyPath.isValid()) {
-        ec.code = IDBDatabaseException::SyntaxError;
-        return 0;
-    }
-    if (name.isNull()) {
-        ec.code = TypeError;
-        return 0;
-    }
-    if (containsIndex(name)) {
-        ec.code = IDBDatabaseException::ConstraintError;
-        return 0;
-    }
-
-    if (keyPath.type() == IndexedDB::KeyPathType::Array && multiEntry) {
-        ec.code = IDBDatabaseException::InvalidAccessError;
-        return 0;
-    }
-
-    int64_t indexId = m_metadata.maxIndexId + 1;
-    backendDB()->createIndex(m_transaction->id(), id(), indexId, name, keyPath, unique, multiEntry);
-
-    ++m_metadata.maxIndexId;
-
-    IDBIndexMetadata metadata(name, indexId, keyPath, unique, multiEntry);
-    RefPtr<LegacyIndex> index = LegacyIndex::create(metadata, this, m_transaction.get());
-    m_indexMap.set(name, index);
-    m_metadata.indexes.set(indexId, metadata);
-
-    ASSERT(!ec.code);
-    if (ec.code)
-        return 0;
-
-    ASSERT_UNUSED(context, context);
-    return index.release();
-}
-
-RefPtr<IDBIndex> LegacyObjectStore::index(const String& name, ExceptionCodeWithMessage& ec)
-{
-    LOG(StorageAPI, "LegacyObjectStore::index");
-    if (m_deleted) {
-        ec.code = IDBDatabaseException::InvalidStateError;
-        return 0;
-    }
-    if (m_transaction->isFinished()) {
-        ec.code = IDBDatabaseException::InvalidStateError;
-        return 0;
-    }
-
-    IDBIndexMap::iterator it = m_indexMap.find(name);
-    if (it != m_indexMap.end())
-        return it->value;
-
-    int64_t indexId = findIndexId(name);
-    if (indexId == IDBIndexMetadata::InvalidId) {
-        ec.code = IDBDatabaseException::NotFoundError;
-        return 0;
-    }
-
-    const IDBIndexMetadata* indexMetadata(nullptr);
-    for (auto& index : m_metadata.indexes.values()) {
-        if (index.name == name) {
-            indexMetadata = &index;
-            break;
-        }
-    }
-    ASSERT(indexMetadata);
-    ASSERT(indexMetadata->id != IDBIndexMetadata::InvalidId);
-
-    RefPtr<LegacyIndex> index = LegacyIndex::create(*indexMetadata, this, m_transaction.get());
-    m_indexMap.set(name, index);
-    return index.release();
-}
-
-void LegacyObjectStore::deleteIndex(const String& name, ExceptionCodeWithMessage& ec)
-{
-    LOG(StorageAPI, "LegacyObjectStore::deleteIndex");
-    if (!m_transaction->isVersionChange() || m_deleted) {
-        ec.code = IDBDatabaseException::InvalidStateError;
-        return;
-    }
-    if (!m_transaction->isActive()) {
-        ec.code = IDBDatabaseException::TransactionInactiveError;
-        return;
-    }
-    int64_t indexId = findIndexId(name);
-    if (indexId == IDBIndexMetadata::InvalidId) {
-        ec.code = IDBDatabaseException::NotFoundError;
-        return;
-    }
-
-    backendDB()->deleteIndex(m_transaction->id(), id(), indexId);
-
-    m_metadata.indexes.remove(indexId);
-    IDBIndexMap::iterator it = m_indexMap.find(name);
-    if (it != m_indexMap.end()) {
-        it->value->markDeleted();
-        m_indexMap.remove(name);
-    }
-}
-
-RefPtr<IDBRequest> LegacyObjectStore::openCursor(ScriptExecutionContext* context, ExceptionCodeWithMessage& ec)
-{
-    return openCursor(context, static_cast<IDBKeyRange*>(nullptr), ec);
-}
-
-RefPtr<IDBRequest> LegacyObjectStore::openCursor(ScriptExecutionContext* context, IDBKeyRange* keyRange, ExceptionCodeWithMessage& ec)
-{
-    return openCursor(context, keyRange, IDBCursor::directionNext(), ec);
-}
-
-RefPtr<IDBRequest> LegacyObjectStore::openCursor(ScriptExecutionContext* context, const Deprecated::ScriptValue& key, ExceptionCodeWithMessage& ec)
-{
-    return openCursor(context, key, IDBCursor::directionNext(), ec);
-}
-
-RefPtr<IDBRequest> LegacyObjectStore::openCursor(ScriptExecutionContext* context, IDBKeyRange* range, const String& direction, ExceptionCodeWithMessage& ec)
-{
-    return openCursor(context, range, direction, IDBDatabaseBackend::NormalTask, ec);
-}
-
-RefPtr<IDBRequest> LegacyObjectStore::openCursor(ScriptExecutionContext* context, IDBKeyRange* range, const String& directionString, IDBDatabaseBackend::TaskType taskType, ExceptionCodeWithMessage& ec)
-{
-    LOG(StorageAPI, "LegacyObjectStore::openCursor");
-    if (m_deleted) {
-        ec.code = IDBDatabaseException::InvalidStateError;
-        return 0;
-    }
-    if (!m_transaction->isActive()) {
-        ec.code = IDBDatabaseException::TransactionInactiveError;
-        return 0;
-    }
-    IndexedDB::CursorDirection direction = IDBCursor::stringToDirection(directionString, ec.code);
-    if (ec.code)
-        return 0;
-
-    RefPtr<LegacyRequest> request = LegacyRequest::create(context, LegacyAny::create(this), m_transaction.get());
-    request->setCursorDetails(IndexedDB::CursorType::KeyAndValue, direction);
-
-    backendDB()->openCursor(m_transaction->id(), id(), IDBIndexMetadata::InvalidId, range, direction, false, static_cast<IDBDatabaseBackend::TaskType>(taskType), request);
-    return request.release();
-}
-
-RefPtr<IDBRequest> LegacyObjectStore::openCursor(ScriptExecutionContext* context, const Deprecated::ScriptValue& key, const String& direction, ExceptionCodeWithMessage& ec)
-{
-    RefPtr<IDBKeyRange> keyRange = IDBKeyRange::only(context, key, ec.code);
-    if (ec.code)
-        return 0;
-    return openCursor(context, keyRange.get(), direction, ec);
-}
-
-RefPtr<IDBRequest> LegacyObjectStore::count(ScriptExecutionContext* context, IDBKeyRange* range, ExceptionCodeWithMessage& ec)
-{
-    LOG(StorageAPI, "LegacyObjectStore::count");
-    if (m_deleted) {
-        ec.code = IDBDatabaseException::InvalidStateError;
-        return 0;
-    }
-    if (!m_transaction->isActive()) {
-        ec.code = IDBDatabaseException::TransactionInactiveError;
-        return 0;
-    }
-    RefPtr<LegacyRequest> request = LegacyRequest::create(context, LegacyAny::create(this), m_transaction.get());
-    backendDB()->count(m_transaction->id(), id(), IDBIndexMetadata::InvalidId, range, request);
-    return request.release();
-}
-
-RefPtr<IDBRequest> LegacyObjectStore::count(ScriptExecutionContext* context, const Deprecated::ScriptValue& key, ExceptionCodeWithMessage& ec)
-{
-    RefPtr<IDBKeyRange> keyRange = IDBKeyRange::only(context, key, ec.code);
-    if (ec.code)
-        return 0;
-    return count(context, keyRange.get(), ec);
-}
-
-void LegacyObjectStore::transactionFinished()
-{
-    ASSERT(m_transaction->isFinished());
-
-    // Break reference cycles.
-    m_indexMap.clear();
-}
-
-int64_t LegacyObjectStore::findIndexId(const String& name) const
-{
-    for (auto& index : m_metadata.indexes) {
-        if (index.value.name == name) {
-            ASSERT(index.key != IDBIndexMetadata::InvalidId);
-            return index.key;
-        }
-    }
-    return IDBIndexMetadata::InvalidId;
-}
-
-IDBDatabaseBackend* LegacyObjectStore::backendDB() const
-{
-    return m_transaction->backendDB();
-}
-
-} // namespace WebCore
-
-#endif // ENABLE(INDEXED_DATABASE)
diff --git a/Source/WebCore/Modules/indexeddb/legacy/LegacyObjectStore.h b/Source/WebCore/Modules/indexeddb/legacy/LegacyObjectStore.h
deleted file mode 100644 (file)
index e97de64..0000000
+++ /dev/null
@@ -1,134 +0,0 @@
-/*
- * Copyright (C) 2010 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1.  Redistributions of source code must retain the above copyright
- *     notice, this list of conditions and the following disclaimer.
- * 2.  Redistributions in binary form must reproduce the above copyright
- *     notice, this list of conditions and the following disclaimer in the
- *     documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef LegacyObjectStore_h
-#define LegacyObjectStore_h
-
-#include "Dictionary.h"
-#include "IDBCursor.h"
-#include "IDBDatabaseBackend.h"
-#include "IDBDatabaseMetadata.h"
-#include "IDBIndex.h"
-#include "IDBKey.h"
-#include "IDBKeyRange.h"
-#include "IDBRequest.h"
-#include "LegacyIndex.h"
-#include "LegacyTransaction.h"
-#include "ScriptWrappable.h"
-#include "SerializedScriptValue.h"
-#include <wtf/RefCounted.h>
-#include <wtf/RefPtr.h>
-#include <wtf/text/WTFString.h>
-
-#if ENABLE(INDEXED_DATABASE)
-
-namespace WebCore {
-
-class DOMStringList;
-class IDBAny;
-class LegacyIndex;
-
-class LegacyObjectStore : public ScriptWrappable, public IDBObjectStore {
-public:
-    static Ref<LegacyObjectStore> create(const IDBObjectStoreMetadata& metadata, LegacyTransaction* transaction)
-    {
-        return adoptRef(*new LegacyObjectStore(metadata, transaction));
-    }
-    ~LegacyObjectStore() { }
-
-    // Implement the IDBObjectStore IDL
-    int64_t id() const { return m_metadata.id; }
-    const String name() const { return m_metadata.name; }
-    RefPtr<IDBAny> keyPathAny() const { return LegacyAny::create(m_metadata.keyPath); }
-    const IDBKeyPath keyPath() const { return m_metadata.keyPath; }
-    RefPtr<DOMStringList> indexNames() const;
-    RefPtr<IDBTransaction> transaction() { return m_transaction; }
-    bool autoIncrement() const { return m_metadata.autoIncrement; }
-
-    RefPtr<IDBRequest> add(JSC::ExecState&, JSC::JSValue, ExceptionCodeWithMessage&);
-    RefPtr<IDBRequest> put(JSC::ExecState&, JSC::JSValue, ExceptionCodeWithMessage&);
-    RefPtr<IDBRequest> openCursor(ScriptExecutionContext*, ExceptionCodeWithMessage&);
-    RefPtr<IDBRequest> openCursor(ScriptExecutionContext*, IDBKeyRange*, ExceptionCodeWithMessage&);
-    RefPtr<IDBRequest> openCursor(ScriptExecutionContext*, const Deprecated::ScriptValue& key, ExceptionCodeWithMessage&);
-    RefPtr<IDBRequest> openCursor(ScriptExecutionContext*, IDBKeyRange*, const String& direction, ExceptionCodeWithMessage&);
-    RefPtr<IDBRequest> openCursor(ScriptExecutionContext*, IDBKeyRange*, const String& direction, IDBDatabaseBackend::TaskType, ExceptionCodeWithMessage&);
-    RefPtr<IDBRequest> openCursor(ScriptExecutionContext*, const Deprecated::ScriptValue& key, const String& direction, ExceptionCodeWithMessage&);
-
-    RefPtr<IDBRequest> get(ScriptExecutionContext*, const Deprecated::ScriptValue& key, ExceptionCodeWithMessage&);
-    RefPtr<IDBRequest> get(ScriptExecutionContext*, IDBKeyRange*, ExceptionCodeWithMessage&);
-    RefPtr<IDBRequest> add(JSC::ExecState&, JSC::JSValue, JSC::JSValue key, ExceptionCodeWithMessage&);
-    RefPtr<IDBRequest> put(JSC::ExecState&, JSC::JSValue, JSC::JSValue key, ExceptionCodeWithMessage&);
-    RefPtr<IDBRequest> put(IDBDatabaseBackend::PutMode, RefPtr<LegacyAny>, JSC::ExecState&, Deprecated::ScriptValue&, RefPtr<IDBKey>, ExceptionCodeWithMessage&);
-    RefPtr<IDBRequest> put(IDBDatabaseBackend::PutMode, RefPtr<LegacyAny> source, JSC::ExecState&, Deprecated::ScriptValue&, const Deprecated::ScriptValue& key, ExceptionCodeWithMessage&);
-
-    RefPtr<IDBRequest> deleteFunction(ScriptExecutionContext*, IDBKeyRange*, ExceptionCodeWithMessage&);
-    RefPtr<IDBRequest> deleteFunction(ScriptExecutionContext*, const Deprecated::ScriptValue& key, ExceptionCodeWithMessage&);
-    RefPtr<IDBRequest> clear(ScriptExecutionContext*, ExceptionCodeWithMessage&);
-
-    RefPtr<IDBIndex> createIndex(ScriptExecutionContext* context, const String& name, const String& keyPath, const Dictionary& options, ExceptionCodeWithMessage& ec) { return createIndex(context, name, IDBKeyPath(keyPath), options, ec); }
-    RefPtr<IDBIndex> createIndex(ScriptExecutionContext* context, const String& name, const Vector<String>& keyPath, const Dictionary& options, ExceptionCodeWithMessage& ec) { return createIndex(context, name, IDBKeyPath(keyPath), options, ec); }
-    RefPtr<IDBIndex> createIndex(ScriptExecutionContext*, const String& name, const IDBKeyPath&, const Dictionary&, ExceptionCodeWithMessage&);
-    RefPtr<IDBIndex> createIndex(ScriptExecutionContext*, const String& name, const IDBKeyPath&, bool unique, bool multiEntry, ExceptionCodeWithMessage&);
-
-    RefPtr<IDBIndex> index(const String& name, ExceptionCodeWithMessage&);
-    void deleteIndex(const String& name, ExceptionCodeWithMessage&);
-
-    RefPtr<IDBRequest> count(ScriptExecutionContext* context, ExceptionCodeWithMessage& ec) { return count(context, static_cast<IDBKeyRange*>(nullptr), ec); }
-    RefPtr<IDBRequest> count(ScriptExecutionContext*, IDBKeyRange*, ExceptionCodeWithMessage&);
-    RefPtr<IDBRequest> count(ScriptExecutionContext*, const Deprecated::ScriptValue& key, ExceptionCodeWithMessage&);
-
-    void markDeleted() { m_deleted = true; }
-    void transactionFinished();
-
-    IDBObjectStoreMetadata metadata() const { return m_metadata; }
-    void setMetadata(const IDBObjectStoreMetadata& metadata) { m_metadata = metadata; }
-
-    typedef Vector<RefPtr<IDBKey>> IndexKeys;
-    typedef HashMap<String, IndexKeys> IndexKeyMap;
-
-    IDBDatabaseBackend* backendDB() const;
-
-private:
-    LegacyObjectStore(const IDBObjectStoreMetadata&, LegacyTransaction*);
-
-    int64_t findIndexId(const String& name) const;
-    bool containsIndex(const String& name) const
-    {
-        return findIndexId(name) != IDBIndexMetadata::InvalidId;
-    }
-
-    IDBObjectStoreMetadata m_metadata;
-    RefPtr<LegacyTransaction> m_transaction;
-    bool m_deleted;
-
-    typedef HashMap<String, RefPtr<LegacyIndex>> IDBIndexMap;
-    IDBIndexMap m_indexMap;
-};
-
-} // namespace WebCore
-
-#endif
-
-#endif // LegacyObjectStore_h
diff --git a/Source/WebCore/Modules/indexeddb/legacy/LegacyOpenDBRequest.cpp b/Source/WebCore/Modules/indexeddb/legacy/LegacyOpenDBRequest.cpp
deleted file mode 100644 (file)
index 7217bc3..0000000
+++ /dev/null
@@ -1,156 +0,0 @@
-/*
- * Copyright (C) 2012 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1.  Redistributions of source code must retain the above copyright
- *     notice, this list of conditions and the following disclaimer.
- * 2.  Redistributions in binary form must reproduce the above copyright
- *     notice, this list of conditions and the following disclaimer in the
- *     documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-#include "LegacyOpenDBRequest.h"
-
-#if ENABLE(INDEXED_DATABASE)
-
-#include "IDBDatabaseCallbacksImpl.h"
-#include "IDBPendingTransactionMonitor.h"
-#include "IDBVersionChangeEvent.h"
-#include "LegacyDatabase.h"
-#include "LegacyVersionChangeEvent.h"
-#include "Logging.h"
-#include "ScriptExecutionContext.h"
-
-namespace WebCore {
-
-Ref<LegacyOpenDBRequest> LegacyOpenDBRequest::create(ScriptExecutionContext* context, PassRefPtr<IDBDatabaseCallbacks> callbacks, int64_t transactionId, uint64_t version, IndexedDB::VersionNullness versionNullness)
-{
-    Ref<LegacyOpenDBRequest> request(adoptRef(*new LegacyOpenDBRequest(context, callbacks, transactionId, version, versionNullness)));
-    request->suspendIfNeeded();
-    return request;
-}
-
-LegacyOpenDBRequest::LegacyOpenDBRequest(ScriptExecutionContext* context, PassRefPtr<IDBDatabaseCallbacks> callbacks, int64_t transactionId, uint64_t version, IndexedDB::VersionNullness versionNullness)
-    : LegacyRequest(context, LegacyAny::createNull(), IDBDatabaseBackend::NormalTask, 0)
-    , m_databaseCallbacks(callbacks)
-    , m_transactionId(transactionId)
-    , m_version(version)
-    , m_versionNullness(versionNullness)
-{
-    ASSERT(!m_result);
-}
-
-LegacyOpenDBRequest::~LegacyOpenDBRequest()
-{
-}
-
-EventTargetInterface LegacyOpenDBRequest::eventTargetInterface() const
-{
-    return IDBOpenDBRequestEventTargetInterfaceType;
-}
-
-void LegacyOpenDBRequest::onBlocked(uint64_t oldVersion)
-{
-    LOG(StorageAPI, "LegacyOpenDBRequest::onBlocked()");
-    if (!shouldEnqueueEvent())
-        return;
-    
-    enqueueEvent(LegacyVersionChangeEvent::create(oldVersion, m_version, eventNames().blockedEvent));
-}
-
-void LegacyOpenDBRequest::onUpgradeNeeded(uint64_t oldVersion, PassRefPtr<IDBDatabaseBackend> prpDatabaseBackend, const IDBDatabaseMetadata& metadata)
-{
-    LOG(StorageAPI, "LegacyOpenDBRequest::onUpgradeNeeded()");
-    if (m_contextStopped || !scriptExecutionContext()) {
-        RefPtr<IDBDatabaseBackend> db = prpDatabaseBackend;
-        db->abort(m_transactionId);
-        db->close(m_databaseCallbacks);
-        return;
-    }
-    if (!shouldEnqueueEvent())
-        return;
-
-    ASSERT(m_databaseCallbacks);
-
-    RefPtr<IDBDatabaseBackend> databaseBackend = prpDatabaseBackend;
-
-    RefPtr<LegacyDatabase> idbDatabase = LegacyDatabase::create(scriptExecutionContext(), databaseBackend, m_databaseCallbacks);
-    idbDatabase->setMetadata(metadata);
-    m_databaseCallbacks->connect(idbDatabase.get());
-    m_databaseCallbacks = nullptr;
-
-    IDBDatabaseMetadata oldMetadata(metadata);
-    oldMetadata.version = oldVersion;
-
-    m_transaction = LegacyTransaction::create(scriptExecutionContext(), m_transactionId, idbDatabase.get(), this, oldMetadata);
-    m_result = LegacyAny::create(idbDatabase.release());
-
-    if (m_versionNullness == IndexedDB::VersionNullness::Null)
-        m_version = 1;
-    enqueueEvent(LegacyVersionChangeEvent::create(oldVersion, m_version, eventNames().upgradeneededEvent));
-}
-
-void LegacyOpenDBRequest::onSuccess(PassRefPtr<IDBDatabaseBackend> prpBackend, const IDBDatabaseMetadata& metadata)
-{
-    LOG(StorageAPI, "LegacyOpenDBRequest::onSuccess()");
-    if (!shouldEnqueueEvent())
-        return;
-
-    RefPtr<IDBDatabaseBackend> backend = prpBackend;
-    RefPtr<LegacyDatabase> idbDatabase;
-    if (m_result) {
-        idbDatabase = m_result->legacyDatabase();
-        ASSERT(idbDatabase);
-        ASSERT(!m_databaseCallbacks);
-    } else {
-        ASSERT(m_databaseCallbacks);
-        idbDatabase = LegacyDatabase::create(scriptExecutionContext(), backend.release(), m_databaseCallbacks);
-        m_databaseCallbacks->connect(idbDatabase.get());
-        m_databaseCallbacks = nullptr;
-        m_result = LegacyAny::create(idbDatabase.get());
-    }
-    idbDatabase->setMetadata(metadata);
-    enqueueEvent(Event::create(eventNames().successEvent, false, false));
-}
-
-bool LegacyOpenDBRequest::shouldEnqueueEvent() const
-{
-    if (m_contextStopped || !scriptExecutionContext())
-        return false;
-    ASSERT(m_readyState == IDBRequestReadyState::Pending || m_readyState == IDBRequestReadyState::Done);
-    if (m_requestAborted)
-        return false;
-    return true;
-}
-
-bool LegacyOpenDBRequest::dispatchEvent(Event& event)
-{
-    // If the connection closed between onUpgradeNeeded and the delivery of the "success" event,
-    // an "error" event should be fired instead.
-    if (event.type() == eventNames().successEvent && m_result->type() == IDBAny::Type::IDBDatabase && m_result->legacyDatabase()->isClosePending()) {
-        m_result = nullptr;
-        onError(IDBDatabaseError::create(IDBDatabaseException::AbortError, "The connection was closed."));
-        return false;
-    }
-
-    return LegacyRequest::dispatchEvent(event);
-}
-
-} // namespace WebCore
-
-#endif
diff --git a/Source/WebCore/Modules/indexeddb/legacy/LegacyOpenDBRequest.h b/Source/WebCore/Modules/indexeddb/legacy/LegacyOpenDBRequest.h
deleted file mode 100644 (file)
index 64f66c4..0000000
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- * Copyright (C) 2012 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1.  Redistributions of source code must retain the above copyright
- *     notice, this list of conditions and the following disclaimer.
- * 2.  Redistributions in binary form must reproduce the above copyright
- *     notice, this list of conditions and the following disclaimer in the
- *     documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef LegacyOpenDBRequest_h
-#define LegacyOpenDBRequest_h
-
-#if ENABLE(INDEXED_DATABASE)
-
-#include "IDBDatabaseMetadata.h"
-#include "IDBOpenDBRequest.h"
-#include "IndexedDB.h"
-#include "LegacyRequest.h"
-
-namespace WebCore {
-
-class IDBDatabaseCallbacks;
-
-class LegacyOpenDBRequest : public LegacyRequest {
-public:
-    static Ref<LegacyOpenDBRequest> create(ScriptExecutionContext*, PassRefPtr<IDBDatabaseCallbacks>, int64_t transactionId, uint64_t version, IndexedDB::VersionNullness);
-    virtual ~LegacyOpenDBRequest();
-
-    virtual void onBlocked(uint64_t existingVersion) override final;
-    virtual void onUpgradeNeeded(uint64_t oldVersion, PassRefPtr<IDBDatabaseBackend>, const IDBDatabaseMetadata&) override final;
-    virtual void onSuccess(PassRefPtr<IDBDatabaseBackend>, const IDBDatabaseMetadata&) override final;
-
-    // EventTarget
-    virtual EventTargetInterface eventTargetInterface() const override final;
-    virtual bool dispatchEvent(Event&) override final;
-
-protected:
-    virtual bool shouldEnqueueEvent() const override;
-
-private:
-    LegacyOpenDBRequest(ScriptExecutionContext*, PassRefPtr<IDBDatabaseCallbacks>, int64_t transactionId, uint64_t version, IndexedDB::VersionNullness);
-
-    RefPtr<IDBDatabaseCallbacks> m_databaseCallbacks;
-    const int64_t m_transactionId;
-    uint64_t m_version;
-    IndexedDB::VersionNullness m_versionNullness;
-};
-
-} // namespace WebCore
-
-#endif // ENABLE(INDEXED_DATABASE)
-
-#endif // LegacyOpenDBRequest_h
diff --git a/Source/WebCore/Modules/indexeddb/legacy/LegacyRequest.cpp b/Source/WebCore/Modules/indexeddb/legacy/LegacyRequest.cpp
deleted file mode 100644 (file)
index bfcddc5..0000000
+++ /dev/null
@@ -1,588 +0,0 @@
-/*
- * Copyright (C) 2010 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1.  Redistributions of source code must retain the above copyright
- *     notice, this list of conditions and the following disclaimer.
- * 2.  Redistributions in binary form must reproduce the above copyright
- *     notice, this list of conditions and the following disclaimer in the
- *     documentation and/or other materials provided with the distribution.
- * 3.  Neither the name of Apple Inc. ("Apple") nor the names of
- *     its contributors may be used to endorse or promote products derived
- *     from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-#include "LegacyRequest.h"
-
-#if ENABLE(INDEXED_DATABASE)
-
-#include "EventListener.h"
-#include "EventNames.h"
-#include "EventQueue.h"
-#include "ExceptionCodePlaceholder.h"
-#include "IDBBindingUtilities.h"
-#include "IDBCursorBackend.h"
-#include "IDBCursorWithValue.h"
-#include "IDBDatabase.h"
-#include "IDBEventDispatcher.h"
-#include "IDBIndex.h"
-#include "LegacyCursor.h"
-#include "LegacyCursorWithValue.h"
-#include "LegacyTransaction.h"
-#include "Logging.h"
-#include "ScriptExecutionContext.h"
-#include "SharedBuffer.h"
-#include <wtf/NeverDestroyed.h>
-
-namespace WebCore {
-
-Ref<LegacyRequest> LegacyRequest::create(ScriptExecutionContext* context, PassRefPtr<LegacyAny> source, LegacyTransaction* transaction)
-{
-    Ref<LegacyRequest> request(adoptRef(*new LegacyRequest(context, source, IDBDatabaseBackend::NormalTask, transaction)));
-    request->suspendIfNeeded();
-    // Requests associated with IDBFactory (open/deleteDatabase/getDatabaseNames) are not associated with transactions.
-    if (transaction)
-        transaction->registerRequest(request.ptr());
-    return request;
-}
-
-Ref<LegacyRequest> LegacyRequest::create(ScriptExecutionContext* context, PassRefPtr<LegacyAny> source, IDBDatabaseBackend::TaskType taskType, LegacyTransaction* transaction)
-{
-    Ref<LegacyRequest> request(adoptRef(*new LegacyRequest(context, source, taskType, transaction)));
-    request->suspendIfNeeded();
-    // Requests associated with IDBFactory (open/deleteDatabase/getDatabaseNames) are not associated with transactions.
-    if (transaction)
-        transaction->registerRequest(request.ptr());
-    return request;
-}
-
-LegacyRequest::LegacyRequest(ScriptExecutionContext* context, PassRefPtr<LegacyAny> source, IDBDatabaseBackend::TaskType taskType, LegacyTransaction* transaction)
-    : IDBOpenDBRequest(context)
-    , m_result(nullptr)
-    , m_errorCode(0)
-    , m_contextStopped(false)
-    , m_transaction(transaction)
-    , m_readyState(IDBRequestReadyState::Pending)
-    , m_requestAborted(false)
-    , m_source(source)
-    , m_taskType(taskType)
-    , m_hasPendingActivity(true)
-    , m_cursorType(IndexedDB::CursorType::KeyAndValue)
-    , m_cursorDirection(IndexedDB::CursorDirection::Next)
-    , m_cursorFinished(false)
-    , m_pendingCursor(nullptr)
-    , m_didFireUpgradeNeededEvent(false)
-    , m_preventPropagation(false)
-    , m_requestState(context)
-{
-}
-
-LegacyRequest::~LegacyRequest()
-{
-}
-
-RefPtr<IDBAny> LegacyRequest::result(ExceptionCodeWithMessage& ec) const
-{
-    if (m_readyState != IDBRequestReadyState::Done) {
-        ec.code = IDBDatabaseException::InvalidStateError;
-        return 0;
-    }
-    return m_result;
-}
-
-RefPtr<DOMError> LegacyRequest::error(ExceptionCodeWithMessage& ec) const
-{
-    if (m_readyState != IDBRequestReadyState::Done) {
-        ec.code = IDBDatabaseException::InvalidStateError;
-        return 0;
-    }
-    return m_error;
-}
-
-unsigned short LegacyRequest::errorCode(ExceptionCode& ec) const
-{
-    if (m_readyState != IDBRequestReadyState::Done) {
-        ec = IDBDatabaseException::InvalidStateError;
-        return 0;
-    }
-    return m_errorCode;
-}
-
-RefPtr<IDBAny> LegacyRequest::source() const
-{
-    return m_source;
-}
-
-RefPtr<IDBTransaction> LegacyRequest::transaction() const
-{
-    return m_transaction;
-}
-
-const String& LegacyRequest::readyState() const
-{
-    ASSERT(m_readyState == IDBRequestReadyState::Pending || m_readyState == IDBRequestReadyState::Done);
-    static NeverDestroyed<AtomicString> pending("pending", AtomicString::ConstructFromLiteral);
-    static NeverDestroyed<AtomicString> done("done", AtomicString::ConstructFromLiteral);
-
-    if (m_readyState == IDBRequestReadyState::Pending)
-        return pending.get();
-
-    return done.get();
-}
-
-void LegacyRequest::markEarlyDeath()
-{
-    ASSERT(m_readyState == IDBRequestReadyState::Pending);
-    m_readyState = IDBRequestReadyState::DeprecatedEarlyDeath;
-    if (m_transaction)
-        m_transaction->unregisterRequest(this);
-}
-
-void LegacyRequest::abort()
-{
-    ASSERT(!m_requestAborted);
-    if (m_contextStopped || !scriptExecutionContext())
-        return;
-    ASSERT(m_readyState == IDBRequestReadyState::Pending || m_readyState == IDBRequestReadyState::Done);
-    if (m_readyState == IDBRequestReadyState::Done)
-        return;
-
-    // Enqueued events may be the only reference to this object.
-    RefPtr<LegacyRequest> self(this);
-
-    EventQueue& eventQueue = scriptExecutionContext()->eventQueue();
-    for (auto& event : m_enqueuedEvents) {
-        bool removed = eventQueue.cancelEvent(event);
-        ASSERT_UNUSED(removed, removed);
-    }
-    m_enqueuedEvents.clear();
-
-    m_errorCode = 0;
-    m_error = nullptr;
-    m_errorMessage = String();
-    m_result = nullptr;
-    onError(IDBDatabaseError::create(IDBDatabaseException::AbortError));
-    m_requestAborted = true;
-}
-
-void LegacyRequest::setCursorDetails(IndexedDB::CursorType cursorType, IndexedDB::CursorDirection direction)
-{
-    ASSERT(m_readyState == IDBRequestReadyState::Pending);
-    ASSERT(!m_pendingCursor);
-    m_cursorType = cursorType;
-    m_cursorDirection = direction;
-}
-
-void LegacyRequest::setPendingCursor(PassRefPtr<LegacyCursor> cursor)
-{
-    ASSERT(m_readyState == IDBRequestReadyState::Done);
-    ASSERT(scriptExecutionContext());
-    ASSERT(m_transaction);
-    ASSERT(!m_pendingCursor);
-    ASSERT(cursor == getResultCursor());
-
-    m_pendingCursor = cursor;
-    m_result = nullptr;
-    m_readyState = IDBRequestReadyState::Pending;
-    m_errorCode = 0;
-    m_error = nullptr;
-    m_errorMessage = String();
-    m_transaction->registerRequest(this);
-}
-
-RefPtr<LegacyCursor> LegacyRequest::getResultCursor()
-{
-    if (!m_result)
-        return nullptr;
-    if (m_result->type() == IDBAny::Type::IDBCursor)
-        return m_result->legacyCursor();
-    if (m_result->type() == IDBAny::Type::IDBCursorWithValue)
-        return m_result->legacyCursorWithValue();
-    return nullptr;
-}
-
-void LegacyRequest::setResultCursor(PassRefPtr<LegacyCursor> cursor, PassRefPtr<IDBKey> key, PassRefPtr<IDBKey> primaryKey, const Deprecated::ScriptValue& value)
-{
-    ASSERT(m_readyState == IDBRequestReadyState::Pending);
-    m_cursorKey = key;
-    m_cursorPrimaryKey = primaryKey;
-    m_cursorValue = value;
-
-    if (m_cursorType == IndexedDB::CursorType::KeyOnly) {
-        m_result = LegacyAny::create(cursor);
-        return;
-    }
-
-    m_result = LegacyAny::create(LegacyCursorWithValue::fromCursor(cursor));
-}
-
-void LegacyRequest::finishCursor()
-{
-    m_cursorFinished = true;
-    if (m_readyState != IDBRequestReadyState::Pending)
-        m_hasPendingActivity = false;
-}
-
-bool LegacyRequest::shouldEnqueueEvent() const
-{
-    if (m_contextStopped || !scriptExecutionContext())
-        return false;
-    ASSERT(m_readyState == IDBRequestReadyState::Pending || m_readyState == IDBRequestReadyState::Done);
-    if (m_requestAborted)
-        return false;
-    ASSERT(m_readyState == IDBRequestReadyState::Pending);
-    ASSERT(!m_errorCode && m_errorMessage.isNull() && !m_error && !m_result);
-    return true;
-}
-
-void LegacyRequest::onError(PassRefPtr<IDBDatabaseError> error)
-{
-    LOG(StorageAPI, "LegacyRequest::onError() (%s) '%s'", error->name().utf8().data(), error->message().utf8().data());
-    if (!shouldEnqueueEvent())
-        return;
-
-    m_errorCode = error->code();
-    m_errorMessage = error->message();
-    m_error = DOMError::create(IDBDatabaseException::getErrorName(error->idbCode()));
-    m_pendingCursor = nullptr;
-    enqueueEvent(Event::create(eventNames().errorEvent, true, true));
-}
-
-static Ref<Event> createSuccessEvent()
-{
-    return Event::create(eventNames().successEvent, false, false);
-}
-
-void LegacyRequest::onSuccess(PassRefPtr<DOMStringList> domStringList)
-{
-    LOG(StorageAPI, "LegacyRequest::onSuccess(DOMStringList)");
-    if (!shouldEnqueueEvent())
-        return;
-
-    m_result = LegacyAny::create(domStringList);
-    enqueueEvent(createSuccessEvent());
-}
-
-void LegacyRequest::onSuccess(PassRefPtr<IDBCursorBackend> prpBackend)
-{
-    LOG(StorageAPI, "LegacyRequest::onSuccess(IDBCursor)");
-    if (!shouldEnqueueEvent())
-        return;
-
-    DOMRequestState::Scope scope(m_requestState);
-
-    RefPtr<IDBCursorBackend> backend = prpBackend;
-    RefPtr<IDBKey> key = backend->key();
-    RefPtr<IDBKey> primaryKey = backend->primaryKey();
-
-    Deprecated::ScriptValue value = deserializeIDBValueBuffer(requestState(), backend->valueBuffer(), !!key);
-
-    ASSERT(!m_pendingCursor);
-    RefPtr<LegacyCursor> cursor;
-    switch (m_cursorType) {
-    case IndexedDB::CursorType::KeyOnly:
-        cursor = LegacyCursor::create(backend.get(), m_cursorDirection, this, m_source.get(), m_transaction.get());
-        break;
-    case IndexedDB::CursorType::KeyAndValue:
-        cursor = LegacyCursorWithValue::create(backend.release(), m_cursorDirection, this, m_source.get(), m_transaction.get());
-        break;
-    default:
-        ASSERT_NOT_REACHED();
-    }
-    setResultCursor(cursor, key.release(), primaryKey.release(), value);
-
-    enqueueEvent(createSuccessEvent());
-}
-
-void LegacyRequest::onSuccess(PassRefPtr<IDBKey> idbKey)
-{
-    LOG(StorageAPI, "LegacyRequest::onSuccess(IDBKey)");
-    if (!shouldEnqueueEvent())
-        return;
-
-    if (idbKey && idbKey->isValid()) {
-        DOMRequestState::Scope scope(m_requestState);
-        m_result = LegacyAny::create(idbKeyToScriptValue(requestState(), idbKey));
-    } else
-        m_result = LegacyAny::createInvalid();
-    enqueueEvent(createSuccessEvent());
-}
-
-void LegacyRequest::onSuccess(PassRefPtr<SharedBuffer> valueBuffer)
-{
-    LOG(StorageAPI, "LegacyRequest::onSuccess(SharedBuffer)");
-    if (!shouldEnqueueEvent())
-        return;
-
-    DOMRequestState::Scope scope(m_requestState);
-
-    // FIXME: By not knowing whether or not the key is defined here, we don't know
-    // if a null valueBuffer means the value is null or the value is undefined.
-    Deprecated::ScriptValue value = deserializeIDBValueBuffer(requestState(), valueBuffer, true);
-    onSuccessInternal(value);
-}
-
-#ifndef NDEBUG
-static PassRefPtr<IDBObjectStore> effectiveObjectStore(LegacyAny* source)
-{
-    if (source->type() == IDBAny::Type::IDBObjectStore)
-        return source->idbObjectStore();
-    if (source->type() == IDBAny::Type::IDBIndex)
-        return source->idbIndex()->objectStore();
-
-    ASSERT_NOT_REACHED();
-    return 0;
-}
-#endif
-
-void LegacyRequest::onSuccess(PassRefPtr<SharedBuffer> valueBuffer, PassRefPtr<IDBKey> prpPrimaryKey, const IDBKeyPath& keyPath)
-{
-    LOG(StorageAPI, "LegacyRequest::onSuccess(SharedBuffer, IDBKey, IDBKeyPath)");
-    if (!shouldEnqueueEvent())
-        return;
-
-#ifndef NDEBUG
-    ASSERT(keyPath == effectiveObjectStore(m_source.get())->keyPath());
-#endif
-    DOMRequestState::Scope scope(m_requestState);
-
-    // FIXME: By not knowing whether or not the key is defined here, we don't know
-    // if a null valueBuffer means the value is null or the value is undefined.
-    Deprecated::ScriptValue value = deserializeIDBValueBuffer(requestState(), valueBuffer, true);
-
-    RefPtr<IDBKey> primaryKey = prpPrimaryKey;
-
-    if (!keyPath.isNull()) {
-#ifndef NDEBUG
-        RefPtr<IDBKey> expectedKey = createIDBKeyFromScriptValueAndKeyPath(requestState()->exec(), value, keyPath);
-        ASSERT(!expectedKey || expectedKey->isEqual(primaryKey.get()));
-#endif
-        bool injected = injectIDBKeyIntoScriptValue(requestState(), primaryKey, value, keyPath);
-        ASSERT_UNUSED(injected, injected);
-    }
-
-    onSuccessInternal(value);
-}
-
-void LegacyRequest::onSuccess(int64_t value)
-{
-    LOG(StorageAPI, "LegacyRequest::onSuccess(int64_t)");
-    if (!shouldEnqueueEvent())
-        return;
-    return onSuccessInternal(SerializedScriptValue::numberValue(value));
-}
-
-void LegacyRequest::onSuccess()
-{
-    LOG(StorageAPI, "LegacyRequest::onSuccess()");
-    if (!shouldEnqueueEvent())
-        return;
-    return onSuccessInternal(SerializedScriptValue::undefinedValue());
-}
-
-void LegacyRequest::onSuccessInternal(PassRefPtr<SerializedScriptValue> value)
-{
-    ASSERT(!m_contextStopped);
-    DOMRequestState::Scope scope(m_requestState);
-    return onSuccessInternal(deserializeIDBValue(requestState(), value));
-}
-
-void LegacyRequest::onSuccessInternal(const Deprecated::ScriptValue& value)
-{
-    m_result = LegacyAny::create(value);
-    if (m_pendingCursor) {
-        m_pendingCursor->close();
-        m_pendingCursor = nullptr;
-    }
-    enqueueEvent(createSuccessEvent());
-}
-
-void LegacyRequest::onSuccess(PassRefPtr<IDBKey> key, PassRefPtr<IDBKey> primaryKey, PassRefPtr<SharedBuffer> buffer)
-{
-    LOG(StorageAPI, "LegacyRequest::onSuccess(key, primaryKey, valueBuffer)");
-    if (!shouldEnqueueEvent())
-        return;
-
-    DOMRequestState::Scope scope(m_requestState);
-
-    Deprecated::ScriptValue value = deserializeIDBValueBuffer(requestState(), buffer, !!key);
-
-    ASSERT(m_pendingCursor);
-    setResultCursor(m_pendingCursor.release(), key, primaryKey, value);
-    enqueueEvent(createSuccessEvent());
-}
-
-void LegacyRequest::onSuccess(PassRefPtr<IDBDatabaseBackend>, const IDBDatabaseMetadata&)
-{
-    // Only the LegacyOpenDBRequest version of this should ever be called;
-    ASSERT_NOT_REACHED();
-}
-
-bool LegacyRequest::hasPendingActivity() const
-{
-    // FIXME: In an ideal world, we should return true as long as anyone has a or can
-    //        get a handle to us and we have event listeners. This is order to handle
-    //        user generated events properly.
-    return m_hasPendingActivity && !m_contextStopped;
-}
-
-void LegacyRequest::stop()
-{
-    if (m_contextStopped)
-        return;
-
-    m_contextStopped = true;
-    m_requestState.clear();
-    if (m_readyState == IDBRequestReadyState::Pending)
-        markEarlyDeath();
-}
-
-bool LegacyRequest::canSuspendForDocumentSuspension() const
-{
-    return !m_hasPendingActivity;
-}
-
-const char* LegacyRequest::activeDOMObjectName() const
-{
-    return "LegacyRequest";
-}
-
-EventTargetInterface LegacyRequest::eventTargetInterface() const
-{
-    return IDBRequestEventTargetInterfaceType;
-}
-
-bool LegacyRequest::dispatchEvent(Event& event)
-{
-    LOG(StorageAPI, "LegacyRequest::dispatchEvent");
-    ASSERT(m_readyState == IDBRequestReadyState::Pending);
-    ASSERT(!m_contextStopped);
-    ASSERT(m_hasPendingActivity);
-    ASSERT(m_enqueuedEvents.size());
-    ASSERT(scriptExecutionContext());
-    ASSERT(event.target() == this);
-    ASSERT_WITH_MESSAGE(m_readyState < IDBRequestReadyState::Done, "When dispatching event %s, m_readyState < DONE(%d), was %d", event.type().string().utf8().data(), static_cast<int>(IDBRequestReadyState::Done), static_cast<int>(m_readyState));
-
-    DOMRequestState::Scope scope(m_requestState);
-
-    if (event.type() != eventNames().blockedEvent)
-        m_readyState = IDBRequestReadyState::Done;
-
-    for (size_t i = 0; i < m_enqueuedEvents.size(); ++i) {
-        if (m_enqueuedEvents[i].ptr() == &event)
-            m_enqueuedEvents.remove(i);
-    }
-
-    Vector<RefPtr<EventTarget>> targets;
-    targets.append(this);
-    if (m_transaction && !m_preventPropagation) {
-        targets.append(m_transaction);
-        // If there ever are events that are associated with a database but
-        // that do not have a transaction, then this will not work and we need
-        // this object to actually hold a reference to the database (to ensure
-        // it stays alive).
-        targets.append(m_transaction->db());
-    }
-
-    // Cursor properties should not updated until the success event is being dispatched.
-    RefPtr<LegacyCursor> cursorToNotify;
-    if (event.type() == eventNames().successEvent) {
-        cursorToNotify = getResultCursor();
-        if (cursorToNotify) {
-            cursorToNotify->setValueReady(requestState(), m_cursorKey.release(), m_cursorPrimaryKey.release(), m_cursorValue);
-            m_cursorValue.clear();
-        }
-    }
-
-    if (event.type() == eventNames().upgradeneededEvent) {
-        ASSERT(!m_didFireUpgradeNeededEvent);
-        m_didFireUpgradeNeededEvent = true;
-    }
-
-    // FIXME: When we allow custom event dispatching, this will probably need to change.
-    ASSERT_WITH_MESSAGE(event.type() == eventNames().successEvent || event.type() == eventNames().errorEvent || event.type() == eventNames().blockedEvent || event.type() == eventNames().upgradeneededEvent, "event type was %s", event.type().string().utf8().data());
-    const bool setTransactionActive = m_transaction && (event.type() == eventNames().successEvent || event.type() == eventNames().upgradeneededEvent || (event.type() == eventNames().errorEvent && m_errorCode != IDBDatabaseException::AbortError));
-
-    if (setTransactionActive)
-        m_transaction->setActive(true);
-
-    bool dontPreventDefault = IDBEventDispatcher::dispatch(event, targets);
-
-    if (m_transaction) {
-        if (m_readyState == IDBRequestReadyState::Done)
-            m_transaction->unregisterRequest(this);
-
-        // Possibly abort the transaction. This must occur after unregistering (so this request
-        // doesn't receive a second error) and before deactivating (which might trigger commit).
-        if (event.type() == eventNames().errorEvent && dontPreventDefault && !m_requestAborted) {
-            m_transaction->setError(m_error, m_errorMessage);
-            ExceptionCodeWithMessage ec;
-            m_transaction->abort(ec);
-        }
-
-        // If this was the last request in the transaction's list, it may commit here.
-        if (setTransactionActive)
-            m_transaction->setActive(false);
-    }
-
-    if (cursorToNotify)
-        cursorToNotify->postSuccessHandlerCallback();
-
-    if (m_readyState == IDBRequestReadyState::Done && (!cursorToNotify || m_cursorFinished) && event.type() != eventNames().upgradeneededEvent)
-        m_hasPendingActivity = false;
-
-    return dontPreventDefault;
-}
-
-void LegacyRequest::uncaughtExceptionInEventHandler()
-{
-    if (m_transaction && !m_requestAborted) {
-        m_transaction->setError(DOMError::create(IDBDatabaseException::getErrorName(IDBDatabaseException::AbortError)), "Uncaught exception in event handler.");
-        ExceptionCodeWithMessage ec;
-        m_transaction->abort(ec);
-    }
-}
-
-void LegacyRequest::transactionDidFinishAndDispatch()
-{
-    ASSERT(m_transaction);
-    ASSERT(m_transaction->isVersionChange());
-    ASSERT(m_readyState == IDBRequestReadyState::Done);
-    ASSERT(scriptExecutionContext());
-    m_transaction = nullptr;
-    m_readyState = IDBRequestReadyState::Pending;
-}
-
-void LegacyRequest::enqueueEvent(Ref<Event>&& event)
-{
-    ASSERT(m_readyState == IDBRequestReadyState::Pending || m_readyState == IDBRequestReadyState::Done);
-
-    if (m_contextStopped || !scriptExecutionContext())
-        return;
-
-    ASSERT_WITH_MESSAGE(m_readyState == IDBRequestReadyState::Pending || m_didFireUpgradeNeededEvent, "When queueing event %s, m_readyState was %d", event->type().string().utf8().data(), static_cast<int>(m_readyState));
-
-    event->setTarget(this);
-
-    if (scriptExecutionContext()->eventQueue().enqueueEvent(event.copyRef()))
-        m_enqueuedEvents.append(WTFMove(event));
-}
-
-} // namespace WebCore
-
-#endif
diff --git a/Source/WebCore/Modules/indexeddb/legacy/LegacyRequest.h b/Source/WebCore/Modules/indexeddb/legacy/LegacyRequest.h
deleted file mode 100644 (file)
index 1a774b9..0000000
+++ /dev/null
@@ -1,162 +0,0 @@
-/*
- * Copyright (C) 2010 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1.  Redistributions of source code must retain the above copyright
- *     notice, this list of conditions and the following disclaimer.
- * 2.  Redistributions in binary form must reproduce the above copyright
- *     notice, this list of conditions and the following disclaimer in the
- *     documentation and/or other materials provided with the distribution.
- * 3.  Neither the name of Apple Inc. ("Apple") nor the names of
- *     its contributors may be used to endorse or promote products derived
- *     from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef LegacyRequest_h
-#define LegacyRequest_h
-
-#if ENABLE(INDEXED_DATABASE)
-
-#include "ActiveDOMObject.h"
-#include "DOMError.h"
-#include "DOMRequestState.h"
-#include "DOMStringList.h"
-#include "Event.h"
-#include "EventListener.h"
-#include "EventTarget.h"
-#include "IDBCallbacks.h"
-#include "IDBCursor.h"
-#include "IDBDatabaseBackend.h"
-#include "IDBDatabaseCallbacks.h"
-#include "IDBOpenDBRequest.h"
-#include "LegacyAny.h"
-#include "ScriptWrappable.h"
-
-namespace WebCore {
-
-class LegacyTransaction;
-
-typedef int ExceptionCode;
-
-class LegacyRequest : public IDBOpenDBRequest, public IDBCallbacks {
-public:
-    static Ref<LegacyRequest> create(ScriptExecutionContext*, PassRefPtr<LegacyAny> source, LegacyTransaction*);
-    static Ref<LegacyRequest> create(ScriptExecutionContext*, PassRefPtr<LegacyAny> source, IDBDatabaseBackend::TaskType, LegacyTransaction*);
-    virtual ~LegacyRequest();
-
-    virtual RefPtr<IDBAny> result(ExceptionCodeWithMessage&) const override final;
-    PassRefPtr<LegacyAny> legacyResult(ExceptionCode&);
-    virtual unsigned short errorCode(ExceptionCode&) const override final;
-    virtual RefPtr<DOMError> error(ExceptionCodeWithMessage&) const override final;
-    virtual RefPtr<IDBAny> source() const override final;
-    virtual RefPtr<IDBTransaction> transaction() const override final;
-    virtual const String& readyState() const override final;
-
-    void preventPropagation() { m_preventPropagation = true; }
-
-    void markEarlyDeath();
-    void setCursorDetails(IndexedDB::CursorType, IndexedDB::CursorDirection);
-    void setPendingCursor(PassRefPtr<LegacyCursor>);
-    void finishCursor();
-    void abort();
-
-    // IDBCallbacks
-    virtual void onError(PassRefPtr<IDBDatabaseError>) override final;
-    virtual void onSuccess(PassRefPtr<DOMStringList>) override final;
-    virtual void onSuccess(PassRefPtr<IDBCursorBackend>) override final;
-    virtual void onSuccess(PassRefPtr<IDBKey>) override final;
-    virtual void onSuccess(PassRefPtr<SharedBuffer>) override final;
-    virtual void onSuccess(PassRefPtr<SharedBuffer>, PassRefPtr<IDBKey>, const IDBKeyPath&) override final;
-    virtual void onSuccess(int64_t) override final;
-    virtual void onSuccess() override final;
-    virtual void onSuccess(PassRefPtr<IDBKey>, PassRefPtr<IDBKey> primaryKey, PassRefPtr<SharedBuffer>) override final;
-    virtual void onSuccess(PassRefPtr<IDBDatabaseBackend>, const IDBDatabaseMetadata&) override;
-
-    // EventTarget
-    virtual EventTargetInterface eventTargetInterface() const override;
-    virtual ScriptExecutionContext* scriptExecutionContext() const override final { return ActiveDOMObject::scriptExecutionContext(); }
-    virtual void uncaughtExceptionInEventHandler() override final;
-
-    using EventTarget::dispatchEvent;
-    virtual bool dispatchEvent(Event&) override;
-
-    void transactionDidFinishAndDispatch();
-
-    IDBDatabaseBackend::TaskType taskType() { return m_taskType; }
-
-    DOMRequestState* requestState() { return &m_requestState; }
-
-    // ActiveDOMObject API.
-    bool hasPendingActivity() const override;
-
-    using IDBCallbacks::ref;
-    using IDBCallbacks::deref;
-
-protected:
-    LegacyRequest(ScriptExecutionContext*, PassRefPtr<LegacyAny> source, IDBDatabaseBackend::TaskType, LegacyTransaction*);
-    void enqueueEvent(Ref<Event>&&);
-    virtual bool shouldEnqueueEvent() const;
-    void onSuccessInternal(PassRefPtr<SerializedScriptValue>);
-    void onSuccessInternal(const Deprecated::ScriptValue&);
-
-    RefPtr<LegacyAny> m_result;
-    unsigned short m_errorCode;
-    String m_errorMessage;
-    RefPtr<DOMError> m_error;
-    bool m_contextStopped;
-    RefPtr<LegacyTransaction> m_transaction;
-    IDBRequestReadyState m_readyState;
-    bool m_requestAborted; // May be aborted by transaction then receive async onsuccess; ignore vs. assert.
-
-private:
-    // ActiveDOMObject API.
-    void stop() override;
-    const char* activeDOMObjectName() const override;
-    bool canSuspendForDocumentSuspension() const override;
-
-    // EventTarget API.
-    virtual void refEventTarget() override final { ref(); }
-    virtual void derefEventTarget() override final { deref(); }
-
-    RefPtr<LegacyCursor> getResultCursor();
-    void setResultCursor(PassRefPtr<LegacyCursor>, PassRefPtr<IDBKey>, PassRefPtr<IDBKey> primaryKey, const Deprecated::ScriptValue&);
-
-    RefPtr<LegacyAny> m_source;
-    const IDBDatabaseBackend::TaskType m_taskType;
-
-    bool m_hasPendingActivity;
-    Vector<Ref<Event>> m_enqueuedEvents;
-
-    // Only used if the result type will be a cursor.
-    IndexedDB::CursorType m_cursorType;
-    IndexedDB::CursorDirection m_cursorDirection;
-    bool m_cursorFinished;
-    RefPtr<LegacyCursor> m_pendingCursor;
-    RefPtr<IDBKey> m_cursorKey;
-    RefPtr<IDBKey> m_cursorPrimaryKey;
-    Deprecated::ScriptValue m_cursorValue;
-    bool m_didFireUpgradeNeededEvent;
-    bool m_preventPropagation;
-
-    DOMRequestState m_requestState;
-};
-
-} // namespace WebCore
-
-#endif // ENABLE(INDEXED_DATABASE)
-
-#endif // LegacyRequest_h
diff --git a/Source/WebCore/Modules/indexeddb/legacy/LegacyTransaction.cpp b/Source/WebCore/Modules/indexeddb/legacy/LegacyTransaction.cpp
deleted file mode 100644 (file)
index d433425..0000000
+++ /dev/null
@@ -1,379 +0,0 @@
-/*
- * Copyright (C) 2010 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1.  Redistributions of source code must retain the above copyright
- *     notice, this list of conditions and the following disclaimer.
- * 2.  Redistributions in binary form must reproduce the above copyright
- *     notice, this list of conditions and the following disclaimer in the
- *     documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-#include "LegacyTransaction.h"
-
-#if ENABLE(INDEXED_DATABASE)
-
-#include "EventQueue.h"
-#include "ExceptionCodePlaceholder.h"
-#include "IDBDatabase.h"
-#include "IDBDatabaseException.h"
-#include "IDBEventDispatcher.h"
-#include "IDBIndex.h"
-#include "IDBObjectStore.h"
-#include "IDBPendingTransactionMonitor.h"
-#include "LegacyCursor.h"
-#include "LegacyObjectStore.h"
-#include "LegacyOpenDBRequest.h"
-#include "Logging.h"
-#include "ScriptExecutionContext.h"
-
-namespace WebCore {
-
-Ref<LegacyTransaction> LegacyTransaction::create(ScriptExecutionContext* context, int64_t id, const Vector<String>& objectStoreNames, IndexedDB::TransactionMode mode, LegacyDatabase* db)
-{
-    LegacyOpenDBRequest* openDBRequest = nullptr;
-    Ref<LegacyTransaction> transaction(adoptRef(*new LegacyTransaction(context, id, objectStoreNames, mode, db, openDBRequest, IDBDatabaseMetadata())));
-    transaction->suspendIfNeeded();
-    return transaction;
-}
-
-Ref<LegacyTransaction> LegacyTransaction::create(ScriptExecutionContext* context, int64_t id, LegacyDatabase* db, LegacyOpenDBRequest* openDBRequest, const IDBDatabaseMetadata& previousMetadata)
-{
-    Ref<LegacyTransaction> transaction(adoptRef(*new LegacyTransaction(context, id, Vector<String>(), IndexedDB::TransactionMode::VersionChange, db, openDBRequest, previousMetadata)));
-    transaction->suspendIfNeeded();
-    return transaction;
-}
-
-LegacyTransaction::LegacyTransaction(ScriptExecutionContext* context, int64_t id, const Vector<String>& objectStoreNames, IndexedDB::TransactionMode mode, LegacyDatabase* db, LegacyOpenDBRequest* openDBRequest, const IDBDatabaseMetadata& previousMetadata)
-    : IDBTransaction(context)
-    , m_id(id)
-    , m_database(db)
-    , m_objectStoreNames(objectStoreNames)
-    , m_openDBRequest(openDBRequest)
-    , m_mode(mode)
-    , m_state(Active)
-    , m_hasPendingActivity(true)
-    , m_contextStopped(false)
-    , m_previousMetadata(previousMetadata)
-{
-    if (mode == IndexedDB::TransactionMode::VersionChange) {
-        // Not active until the callback.
-        m_state = Inactive;
-    }
-
-    // We pass a reference of this object before it can be adopted.
-    relaxAdoptionRequirement();
-    if (m_state == Active)
-        IDBPendingTransactionMonitor::addNewTransaction(this);
-    m_database->transactionCreated(this);
-}
-
-LegacyTransaction::~LegacyTransaction()
-{
-    ASSERT(m_state == Finished || m_contextStopped);
-    ASSERT(m_requestList.isEmpty() || m_contextStopped);
-}
-
-const String& LegacyTransaction::mode() const
-{
-    return modeToString(m_mode);
-}
-
-IDBDatabase* LegacyTransaction::db()
-{
-    return m_database.get();
-}
-
-void LegacyTransaction::setError(PassRefPtr<DOMError> error, const String& errorMessage)
-{
-    ASSERT(m_state != Finished);
-    ASSERT(error);
-
-    // The first error to be set is the true cause of the
-    // transaction abort.
-    if (!m_error) {
-        m_error = error;
-        m_errorMessage = errorMessage;
-    }
-}
-
-RefPtr<IDBObjectStore> LegacyTransaction::objectStore(const String& name, ExceptionCodeWithMessage& ec)
-{
-    if (m_state == Finished) {
-        ec.code = IDBDatabaseException::InvalidStateError;
-        return 0;
-    }
-
-    IDBObjectStoreMap::iterator it = m_objectStoreMap.find(name);
-    if (it != m_objectStoreMap.end())
-        return it->value;
-
-    if (!isVersionChange() && !m_objectStoreNames.contains(name)) {
-        ec.code = IDBDatabaseException::NotFoundError;
-        return 0;
-    }
-
-    int64_t objectStoreId = m_database->findObjectStoreId(name);
-    if (objectStoreId == IDBObjectStoreMetadata::InvalidId) {
-        ASSERT(isVersionChange());
-        ec.code = IDBDatabaseException::NotFoundError;
-        return 0;
-    }
-
-    const IDBDatabaseMetadata& metadata = m_database->metadata();
-
-    RefPtr<LegacyObjectStore> objectStore = LegacyObjectStore::create(metadata.objectStores.get(objectStoreId), this);
-    objectStoreCreated(name, objectStore);
-    return objectStore.release();
-}
-
-void LegacyTransaction::objectStoreCreated(const String& name, PassRefPtr<LegacyObjectStore> prpObjectStore)
-{
-    ASSERT(m_state != Finished);
-    RefPtr<LegacyObjectStore> objectStore = prpObjectStore;
-    m_objectStoreMap.set(name, objectStore);
-    if (isVersionChange())
-        m_objectStoreCleanupMap.set(objectStore, objectStore->metadata());
-}
-
-void LegacyTransaction::objectStoreDeleted(const String& name)
-{
-    ASSERT(m_state != Finished);
-    ASSERT(isVersionChange());
-    IDBObjectStoreMap::iterator it = m_objectStoreMap.find(name);
-    if (it != m_objectStoreMap.end()) {
-        RefPtr<LegacyObjectStore> objectStore = it->value;
-        m_objectStoreMap.remove(name);
-        objectStore->markDeleted();
-        m_objectStoreCleanupMap.set(objectStore, objectStore->metadata());
-        m_deletedObjectStores.add(objectStore);
-    }
-}
-
-void LegacyTransaction::setActive(bool active)
-{
-    LOG(StorageAPI, "LegacyTransaction::setActive(%s) for transaction id %lli", active ? "true" : "false", static_cast<long long>(m_id));
-    ASSERT_WITH_MESSAGE(m_state != Finished, "A finished transaction tried to setActive(%s)", active ? "true" : "false");
-    if (m_state == Finishing)
-        return;
-    ASSERT(active != (m_state == Active));
-    m_state = active ? Active : Inactive;
-
-    if (!active && m_requestList.isEmpty())
-        backendDB()->commit(m_id);
-}
-
-void LegacyTransaction::abort(ExceptionCodeWithMessage& ec)
-{
-    if (m_state == Finishing || m_state == Finished) {
-        ec.code = IDBDatabaseException::InvalidStateError;
-        return;
-    }
-
-    m_state = Finishing;
-
-    while (!m_requestList.isEmpty()) {
-        RefPtr<LegacyRequest> request = *m_requestList.begin();
-        m_requestList.remove(request);
-        request->abort();
-    }
-
-    RefPtr<LegacyTransaction> selfRef = this;
-    backendDB()->abort(m_id);
-}
-
-LegacyTransaction::OpenCursorNotifier::OpenCursorNotifier(PassRefPtr<LegacyTransaction> transaction, LegacyCursor* cursor)
-    : m_transaction(transaction)
-    , m_cursor(cursor)
-{
-    m_transaction->registerOpenCursor(m_cursor);
-}
-
-LegacyTransaction::OpenCursorNotifier::~OpenCursorNotifier()
-{
-    if (m_cursor)
-        m_transaction->unregisterOpenCursor(m_cursor);
-}
-
-void LegacyTransaction::OpenCursorNotifier::cursorFinished()
-{
-    if (m_cursor) {
-        m_transaction->unregisterOpenCursor(m_cursor);
-        m_cursor = nullptr;
-        m_transaction = nullptr;
-    }
-}
-
-void LegacyTransaction::registerOpenCursor(LegacyCursor* cursor)
-{
-    m_openCursors.add(cursor);
-}
-
-void LegacyTransaction::unregisterOpenCursor(LegacyCursor* cursor)
-{
-    m_openCursors.remove(cursor);
-}
-
-void LegacyTransaction::closeOpenCursors()
-{
-    HashSet<LegacyCursor*> cursors;
-    cursors.swap(m_openCursors);
-    for (auto& cursor : cursors)
-        cursor->close();
-}
-
-void LegacyTransaction::registerRequest(LegacyRequest* request)
-{
-    ASSERT(request);
-    ASSERT(m_state == Active);
-    m_requestList.add(request);
-}
-
-void LegacyTransaction::unregisterRequest(LegacyRequest* request)
-{
-    ASSERT(request);
-    // If we aborted the request, it will already have been removed.
-    m_requestList.remove(request);
-}
-
-void LegacyTransaction::onAbort(PassRefPtr<IDBDatabaseError> prpError)
-{
-    LOG(StorageAPI, "LegacyTransaction::onAbort");
-    RefPtr<IDBDatabaseError> error = prpError;
-    ASSERT(m_state != Finished);
-
-    if (m_state != Finishing) {
-        ASSERT(error.get());
-        setError(DOMError::create(error->name()), error->message());
-
-        // Abort was not triggered by front-end, so outstanding requests must
-        // be aborted now.
-        while (!m_requestList.isEmpty()) {
-            RefPtr<LegacyRequest> request = *m_requestList.begin();
-            m_requestList.remove(request);
-            request->abort();
-        }
-        m_state = Finishing;
-    }
-
-    if (isVersionChange()) {
-        for (auto& objectStore : m_objectStoreCleanupMap)
-            objectStore.key->setMetadata(objectStore.value);
-        m_database->setMetadata(m_previousMetadata);
-        m_database->close();
-    }
-    m_objectStoreCleanupMap.clear();
-    closeOpenCursors();
-
-    // Enqueue events before notifying database, as database may close which enqueues more events and order matters.
-    enqueueEvent(Event::create(eventNames().abortEvent, true, false));
-    m_database->transactionFinished(this);
-}
-
-void LegacyTransaction::onComplete()
-{
-    LOG(StorageAPI, "LegacyTransaction::onComplete");
-    ASSERT(m_state != Finished);
-    m_state = Finishing;
-    m_objectStoreCleanupMap.clear();
-    closeOpenCursors();
-
-    // Enqueue events before notifying database, as database may close which enqueues more events and order matters.
-    enqueueEvent(Event::create(eventNames().completeEvent, false, false));
-    m_database->transactionFinished(this);
-}
-
-bool LegacyTransaction::hasPendingActivity() const
-{
-    // FIXME: In an ideal world, we should return true as long as anyone has a or can
-    //        get a handle to us or any child request object and any of those have
-    //        event listeners. This is  in order to handle user generated events properly.
-    return m_hasPendingActivity && !m_contextStopped;
-}
-
-bool LegacyTransaction::dispatchEvent(Event& event)
-{
-    LOG(StorageAPI, "LegacyTransaction::dispatchEvent");
-    ASSERT(m_state != Finished);
-    ASSERT(m_hasPendingActivity);
-    ASSERT(scriptExecutionContext());
-    ASSERT(event.target() == this);
-    m_state = Finished;
-
-    // Break reference cycles.
-    for (auto& objectStore : m_objectStoreMap)
-        objectStore.value->transactionFinished();
-    m_objectStoreMap.clear();
-    for (auto& objectStore : m_deletedObjectStores)
-        objectStore->transactionFinished();
-    m_deletedObjectStores.clear();
-
-    Vector<RefPtr<EventTarget>> targets;
-    targets.append(this);
-    targets.append(db());
-
-    // FIXME: When we allow custom event dispatching, this will probably need to change.
-    ASSERT(event.type() == eventNames().completeEvent || event.type() == eventNames().abortEvent);
-    bool returnValue = IDBEventDispatcher::dispatch(event, targets);
-    // FIXME: Try to construct a test where |this| outlives openDBRequest and we
-    // get a crash.
-    if (m_openDBRequest) {
-        ASSERT(isVersionChange());
-        m_openDBRequest->transactionDidFinishAndDispatch();
-    }
-    m_hasPendingActivity = false;
-    return returnValue;
-}
-
-bool LegacyTransaction::canSuspendForDocumentSuspension() const
-{
-    // FIXME: Technically we can suspend before the first request is schedule
-    //        and after the complete/abort event is enqueued.
-    return m_state == Finished;
-}
-
-void LegacyTransaction::stop()
-{
-    m_contextStopped = true;
-    ExceptionCodeWithMessage ec;
-    abort(ec);
-}
-
-const char* LegacyTransaction::activeDOMObjectName() const
-{
-    return "LegacyTransaction";
-}
-
-void LegacyTransaction::enqueueEvent(Ref<Event>&& event)
-{
-    ASSERT_WITH_MESSAGE(m_state != Finished, "A finished transaction tried to enqueue an event of type %s.", event->type().string().utf8().data());
-    if (m_contextStopped || !scriptExecutionContext())
-        return;
-
-    event->setTarget(this);
-    scriptExecutionContext()->eventQueue().enqueueEvent(WTFMove(event));
-}
-
-IDBDatabaseBackend* LegacyTransaction::backendDB() const
-{
-    return m_database->backend();
-}
-
-}
-
-#endif // ENABLE(INDEXED_DATABASE)
diff --git a/Source/WebCore/Modules/indexeddb/legacy/LegacyTransaction.h b/Source/WebCore/Modules/indexeddb/legacy/LegacyTransaction.h
deleted file mode 100644 (file)
index 1d696a9..0000000
+++ /dev/null
@@ -1,159 +0,0 @@
-/*
- * Copyright (C) 2010 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1.  Redistributions of source code must retain the above copyright
- *     notice, this list of conditions and the following disclaimer.
- * 2.  Redistributions in binary form must reproduce the above copyright
- *     notice, this list of conditions and the following disclaimer in the
- *     documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef LegacyTransaction_h
-#define LegacyTransaction_h
-
-#if ENABLE(INDEXED_DATABASE)
-
-#include "ActiveDOMObject.h"
-#include "DOMError.h"
-#include "Event.h"
-#include "EventListener.h"
-#include "EventTarget.h"
-#include "IDBDatabaseMetadata.h"
-#include "IDBTransaction.h"
-#include "IndexedDB.h"
-#include "LegacyDatabase.h"
-#include "LegacyRequest.h"
-#include "ScriptWrappable.h"
-#include <wtf/HashSet.h>
-#include <wtf/RefCounted.h>
-
-namespace WebCore {
-
-class IDBDatabaseBackend;
-class IDBDatabaseError;
-class LegacyCursor;
-class LegacyObjectStore;
-class LegacyOpenDBRequest;
-struct IDBObjectStoreMetadata;
-
-class LegacyTransaction final : public IDBTransaction {
-public:
-    static Ref<LegacyTransaction> create(ScriptExecutionContext*, int64_t, const Vector<String>& objectStoreNames, IndexedDB::TransactionMode, LegacyDatabase*);
-    static Ref<LegacyTransaction> create(ScriptExecutionContext*, int64_t, LegacyDatabase*, LegacyOpenDBRequest*, const IDBDatabaseMetadata& previousMetadata);
-    virtual ~LegacyTransaction();
-
-    IDBDatabaseBackend* backendDB() const;
-
-    int64_t id() const { return m_id; }
-    bool isActive() const { return m_state == Active; }
-    bool isFinished() const { return m_state == Finished; }
-    bool isReadOnly() const { return m_mode == IndexedDB::TransactionMode::ReadOnly; }
-    bool isVersionChange() const { return m_mode == IndexedDB::TransactionMode::VersionChange; }
-
-    virtual const String& mode() const override final;
-    virtual IDBDatabase* db() override final;
-    virtual RefPtr<DOMError> error() const override final { return m_error; }
-    virtual RefPtr<IDBObjectStore> objectStore(const String& name, ExceptionCodeWithMessage&) override final;
-    virtual void abort(ExceptionCodeWithMessage&) override final;
-
-    class OpenCursorNotifier {
-    public:
-        OpenCursorNotifier(PassRefPtr<LegacyTransaction>, LegacyCursor*);
-        ~OpenCursorNotifier();
-        void cursorFinished();
-    private:
-        RefPtr<LegacyTransaction> m_transaction;
-        LegacyCursor* m_cursor;
-    };
-
-    void registerRequest(LegacyRequest*);
-    void unregisterRequest(LegacyRequest*);
-    void objectStoreCreated(const String&, PassRefPtr<LegacyObjectStore>);
-    void objectStoreDeleted(const String&);
-    void setActive(bool);
-    void setError(PassRefPtr<DOMError>, const String& errorMessage);
-
-    void onAbort(PassRefPtr<IDBDatabaseError>);
-    void onComplete();
-
-    // EventTarget
-    virtual EventTargetInterface eventTargetInterface() const override final { return IDBTransactionEventTargetInterfaceType; }
-    virtual ScriptExecutionContext* scriptExecutionContext() const override final { return ActiveDOMObject::scriptExecutionContext(); }
-
-    using EventTarget::dispatchEvent;
-    virtual bool dispatchEvent(Event&) override final;
-
-    // ActiveDOMObject
-    virtual bool hasPendingActivity() const override final;
-
-private:
-    LegacyTransaction(ScriptExecutionContext*, int64_t, const Vector<String>&, IndexedDB::TransactionMode, LegacyDatabase*, LegacyOpenDBRequest*, const IDBDatabaseMetadata&);
-
-    void enqueueEvent(Ref<Event>&&);
-    void closeOpenCursors();
-
-    void registerOpenCursor(LegacyCursor*);
-    void unregisterOpenCursor(LegacyCursor*);
-
-    // ActiveDOMObject API.
-    bool canSuspendForDocumentSuspension() const override;
-    void stop() override;
-    const char* activeDOMObjectName() const override;
-
-    // EventTarget API.
-    virtual void refEventTarget() override { ref(); }
-    virtual void derefEventTarget() override { deref(); }
-
-    enum State {
-        Inactive, // Created or started, but not in an event callback
-        Active, // Created or started, in creation scope or an event callback
-        Finishing, // In the process of aborting or completing.
-        Finished, // No more events will fire and no new requests may be filed.
-    };
-
-    int64_t m_id;
-    RefPtr<LegacyDatabase> m_database;
-    const Vector<String> m_objectStoreNames;
-    LegacyOpenDBRequest* m_openDBRequest;
-    const IndexedDB::TransactionMode m_mode;
-    State m_state;
-    bool m_hasPendingActivity;
-    bool m_contextStopped;
-    RefPtr<DOMError> m_error;
-    String m_errorMessage;
-
-    ListHashSet<RefPtr<LegacyRequest>> m_requestList;
-
-    typedef HashMap<String, RefPtr<LegacyObjectStore>> IDBObjectStoreMap;
-    IDBObjectStoreMap m_objectStoreMap;
-
-    typedef HashSet<RefPtr<LegacyObjectStore>> IDBObjectStoreSet;
-    IDBObjectStoreSet m_deletedObjectStores;
-
-    typedef HashMap<RefPtr<LegacyObjectStore>, IDBObjectStoreMetadata> IDBObjectStoreMetadataMap;
-    IDBObjectStoreMetadataMap m_objectStoreCleanupMap;
-    IDBDatabaseMetadata m_previousMetadata;
-
-    HashSet<LegacyCursor*> m_openCursors;
-};
-
-} // namespace WebCore
-
-#endif // ENABLE(INDEXED_DATABASE)
-
-#endif // LegacyTransaction_h
diff --git a/Source/WebCore/Modules/indexeddb/legacy/LegacyVersionChangeEvent.cpp b/Source/WebCore/Modules/indexeddb/legacy/LegacyVersionChangeEvent.cpp
deleted file mode 100644 (file)
index 922f759..0000000
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * Copyright (C) 2011 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1.  Redistributions of source code must retain the above copyright
- *     notice, this list of conditions and the following disclaimer.
- * 2.  Redistributions in binary form must reproduce the above copyright
- *     notice, this list of conditions and the following disclaimer in the
- *     documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-#include "LegacyVersionChangeEvent.h"
-
-#if ENABLE(INDEXED_DATABASE)
-
-namespace WebCore {
-
-LegacyVersionChangeEvent::LegacyVersionChangeEvent(unsigned long long oldVersion, unsigned long long newVersion, const AtomicString& eventType)
-    : IDBVersionChangeEvent(eventType)
-    , m_oldVersion(oldVersion)
-    , m_newVersion(newVersion)
-{
-}
-
-Optional<uint64_t> LegacyVersionChangeEvent::newVersion() const
-{
-    return m_newVersion;
-}
-
-EventInterface LegacyVersionChangeEvent::eventInterface() const
-{
-    return IDBVersionChangeEventInterfaceType;
-}
-
-} // namespace WebCore
-
-#endif
diff --git a/Source/WebCore/Modules/indexeddb/legacy/LegacyVersionChangeEvent.h b/Source/WebCore/Modules/indexeddb/legacy/LegacyVersionChangeEvent.h
deleted file mode 100644 (file)
index ebdb620..0000000
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Copyright (C) 2011 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1.  Redistributions of source code must retain the above copyright
- *     notice, this list of conditions and the following disclaimer.
- * 2.  Redistributions in binary form must reproduce the above copyright
- *     notice, this list of conditions and the following disclaimer in the
- *     documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef LegacyVersionChangeEvent_h
-#define LegacyVersionChangeEvent_h
-
-#if ENABLE(INDEXED_DATABASE)
-
-#include "IDBVersionChangeEvent.h"
-#include "IndexedDB.h"
-
-namespace WebCore {
-
-class LegacyVersionChangeEvent final : public IDBVersionChangeEvent {
-public:
-    static Ref<LegacyVersionChangeEvent> create(unsigned long long oldVersion, unsigned long long newVersion, const AtomicString& eventType)
-    {
-        return adoptRef(*new LegacyVersionChangeEvent(oldVersion, newVersion, eventType));
-    }
-
-private:
-    LegacyVersionChangeEvent(unsigned long long oldVersion, unsigned long long newVersion, const AtomicString& eventType);
-
-    virtual uint64_t oldVersion() const override { return m_oldVersion; }
-    virtual Optional<uint64_t> newVersion() const override;
-    virtual EventInterface eventInterface() const override;
-
-    uint64_t m_oldVersion;
-    uint64_t m_newVersion;
-};
-
-} // namespace WebCore
-
-#endif // ENABLE(INDEXED_DATABASE)
-
-#endif // LegacyVersionChangeEvent_h
index 68236ab..641e44d 100644 (file)
@@ -69,7 +69,7 @@ SQLiteIDBCursor::SQLiteIDBCursor(SQLiteIDBTransaction& transaction, const IDBCur
     : m_transaction(&transaction)
     , m_cursorIdentifier(info.identifier())
     , m_objectStoreID(info.objectStoreIdentifier())
-    , m_indexID(info.cursorSource() == IndexedDB::CursorSource::Index ? info.sourceIdentifier() : IDBIndexMetadata::InvalidId)
+    , m_indexID(info.cursorSource() == IndexedDB::CursorSource::Index ? info.sourceIdentifier() : IDBIndexInfo::InvalidId)
     , m_cursorDirection(info.cursorDirection())
     , m_keyRange(info.range())
 {
@@ -80,7 +80,7 @@ SQLiteIDBCursor::SQLiteIDBCursor(SQLiteIDBTransaction& transaction, const uint64
     : m_transaction(&transaction)
     , m_cursorIdentifier(transaction.transactionIdentifier())
     , m_objectStoreID(objectStoreID)
-    , m_indexID(indexID ? indexID : IDBIndexMetadata::InvalidId)
+    , m_indexID(indexID ? indexID : IDBIndexInfo::InvalidId)
     , m_cursorDirection(IndexedDB::CursorDirection::Next)
     , m_keyRange(range)
     , m_backingStoreCursor(true)
@@ -167,7 +167,7 @@ bool SQLiteIDBCursor::establishStatement()
     ASSERT(!m_statement);
     String sql;
 
-    if (m_indexID != IDBIndexMetadata::InvalidId) {
+    if (m_indexID != IDBIndexInfo::InvalidId) {
         sql = buildIndexStatement(m_keyRange, m_cursorDirection);
         m_boundID = m_indexID;
     } else {
@@ -370,7 +370,7 @@ SQLiteIDBCursor::AdvanceResult SQLiteIDBCursor::internalAdvanceOnce()
     m_currentValueBuffer = keyData;
 
     // The primaryKey of an ObjectStore cursor is the same as its key.
-    if (m_indexID == IDBIndexMetadata::InvalidId)
+    if (m_indexID == IDBIndexInfo::InvalidId)
         m_currentPrimaryKey = m_currentKey;
     else {
         if (!deserializeIDBKeyData(keyData.data(), keyData.size(), m_currentPrimaryKey)) {
index ddf0383..a841924 100644 (file)
@@ -27,7 +27,7 @@
 
 #if ENABLE(INDEXED_DATABASE)
 
-#include "IDBDatabaseBackend.h"
+#include "IDBIndexInfo.h"
 #include "IDBKeyData.h"
 #include "IDBKeyRangeData.h"
 #include "IDBResourceIdentifier.h"
@@ -93,7 +93,7 @@ private:
     SQLiteIDBTransaction* m_transaction;
     IDBResourceIdentifier m_cursorIdentifier;
     int64_t m_objectStoreID;
-    int64_t m_indexID { IDBIndexMetadata::InvalidId };
+    int64_t m_indexID { IDBIndexInfo::InvalidId };
     IndexedDB::CursorDirection m_cursorDirection { IndexedDB::CursorDirection::Next };
     IDBKeyRangeData m_keyRange;
 
index 89ad5ae..6e849da 100644 (file)
@@ -54,6 +54,9 @@ public:
     String loggingString(int indent = 0) const;
 #endif
 
+    // FIXME: Remove the need for this.
+    static const int64_t InvalidId = -1;
+
 private:
     uint64_t m_identifier { 0 };
     uint64_t m_objectStoreIdentifier { 0 };
index eee668a..4560484 100644 (file)
                5103105B1BA8DB56003329C0 /* IDBOpenDBRequestImpl.h in Headers */ = {isa = PBXBuildFile; fileRef = 510310571BA8DB30003329C0 /* IDBOpenDBRequestImpl.h */; settings = {ATTRIBUTES = (Private, ); }; };
                5103105C1BA8DB56003329C0 /* IDBRequestImpl.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 510310581BA8DB30003329C0 /* IDBRequestImpl.cpp */; };
                5103105D1BA8DB56003329C0 /* IDBRequestImpl.h in Headers */ = {isa = PBXBuildFile; fileRef = 510310591BA8DB30003329C0 /* IDBRequestImpl.h */; settings = {ATTRIBUTES = (Private, ); }; };
-               5103C2B11BA22D1A00E26337 /* LegacyAny.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 51645B6E1BA0A76100F789CE /* LegacyAny.cpp */; };
-               5103C2B91BA23A2600E26337 /* LegacyAny.h in Headers */ = {isa = PBXBuildFile; fileRef = 51645B6F1BA0A76100F789CE /* LegacyAny.h */; };
                5106D7BD18BDB76F000AB166 /* ContextMenuContext.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5106D7BB18BDB76F000AB166 /* ContextMenuContext.cpp */; };
                5106D7BE18BDB76F000AB166 /* ContextMenuContext.h in Headers */ = {isa = PBXBuildFile; fileRef = 5106D7BC18BDB76F000AB166 /* ContextMenuContext.h */; settings = {ATTRIBUTES = (Private, ); }; };
                510A58E41BAA40B100C19282 /* InProcessIDBServer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 510A58E21BAA40AE00C19282 /* InProcessIDBServer.cpp */; };
                5160F4980B0AA75F00C1D2AF /* HistoryItemMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 5160F4970B0AA75F00C1D2AF /* HistoryItemMac.mm */; };
                5162C7F411F77EFB00612EFE /* SchemeRegistry.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5162C7F211F77EFA00612EFE /* SchemeRegistry.cpp */; };
                5162C7F511F77EFB00612EFE /* SchemeRegistry.h in Headers */ = {isa = PBXBuildFile; fileRef = 5162C7F311F77EFB00612EFE /* SchemeRegistry.h */; settings = {ATTRIBUTES = (Private, ); }; };
-               51645B5A1B9FA6C800F789CE /* LegacyCursor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 51645B281B9F639100F789CE /* LegacyCursor.cpp */; };
-               51645B5B1B9FA6C800F789CE /* LegacyCursor.h in Headers */ = {isa = PBXBuildFile; fileRef = 51645B291B9F639100F789CE /* LegacyCursor.h */; };
-               51645B5C1B9FA6C800F789CE /* LegacyCursorWithValue.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 51645B2A1B9F639100F789CE /* LegacyCursorWithValue.cpp */; };
-               51645B5D1B9FA6C800F789CE /* LegacyCursorWithValue.h in Headers */ = {isa = PBXBuildFile; fileRef = 51645B2B1B9F639100F789CE /* LegacyCursorWithValue.h */; };
-               51645B5E1B9FA6C800F789CE /* LegacyDatabase.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 51645B2C1B9F639100F789CE /* LegacyDatabase.cpp */; };
-               51645B5F1B9FA6C800F789CE /* LegacyDatabase.h in Headers */ = {isa = PBXBuildFile; fileRef = 51645B2D1B9F639100F789CE /* LegacyDatabase.h */; };
-               51645B601B9FA6C800F789CE /* LegacyFactory.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 51645B2E1B9F639100F789CE /* LegacyFactory.cpp */; };
-               51645B611B9FA6C800F789CE /* LegacyFactory.h in Headers */ = {isa = PBXBuildFile; fileRef = 51645B2F1B9F639100F789CE /* LegacyFactory.h */; };
-               51645B621B9FA6C800F789CE /* LegacyIndex.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 51645B301B9F639100F789CE /* LegacyIndex.cpp */; };
-               51645B631B9FA6C800F789CE /* LegacyIndex.h in Headers */ = {isa = PBXBuildFile; fileRef = 51645B311B9F639100F789CE /* LegacyIndex.h */; };
-               51645B641B9FA6C800F789CE /* LegacyObjectStore.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 51645B321B9F639100F789CE /* LegacyObjectStore.cpp */; };
-               51645B651B9FA6C800F789CE /* LegacyObjectStore.h in Headers */ = {isa = PBXBuildFile; fileRef = 51645B331B9F639100F789CE /* LegacyObjectStore.h */; };
-               51645B661B9FA6C800F789CE /* LegacyOpenDBRequest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 51645B341B9F639100F789CE /* LegacyOpenDBRequest.cpp */; };
-               51645B671B9FA6C800F789CE /* LegacyOpenDBRequest.h in Headers */ = {isa = PBXBuildFile; fileRef = 51645B351B9F639100F789CE /* LegacyOpenDBRequest.h */; };
-               51645B681B9FA6C800F789CE /* LegacyRequest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 51645B361B9F639100F789CE /* LegacyRequest.cpp */; };
-               51645B691B9FA6C800F789CE /* LegacyRequest.h in Headers */ = {isa = PBXBuildFile; fileRef = 51645B371B9F639100F789CE /* LegacyRequest.h */; };
-               51645B6A1B9FA6C800F789CE /* LegacyTransaction.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 51645B381B9F639100F789CE /* LegacyTransaction.cpp */; };
-               51645B6B1B9FA6C800F789CE /* LegacyTransaction.h in Headers */ = {isa = PBXBuildFile; fileRef = 51645B391B9F639100F789CE /* LegacyTransaction.h */; };
-               51645B6C1B9FA6C800F789CE /* LegacyVersionChangeEvent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 51645B3A1B9F639100F789CE /* LegacyVersionChangeEvent.cpp */; };
-               51645B6D1B9FA6C800F789CE /* LegacyVersionChangeEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = 51645B3B1B9F639100F789CE /* LegacyVersionChangeEvent.h */; };
                516953971329A3C800B92D04 /* IconDatabaseBase.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 516953951329A3C800B92D04 /* IconDatabaseBase.cpp */; };
                516953981329A3C800B92D04 /* IconDatabaseBase.h in Headers */ = {isa = PBXBuildFile; fileRef = 516953961329A3C800B92D04 /* IconDatabaseBase.h */; settings = {ATTRIBUTES = (Private, ); }; };
                516BB7940CE91E6800512F79 /* JSTreeWalkerCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 516BB7920CE91E6800512F79 /* JSTreeWalkerCustom.cpp */; };
                5185FC851BB4C4E80012898F /* IDBDatabaseException.h in Headers */ = {isa = PBXBuildFile; fileRef = 51D71985181106DF0016DC51 /* IDBDatabaseException.h */; settings = {ATTRIBUTES = (Private, ); }; };
                5185FC861BB4C4E80012898F /* IDBDatabaseIdentifier.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5103105E1BA8E090003329C0 /* IDBDatabaseIdentifier.cpp */; };
                5185FC871BB4C4E80012898F /* IDBDatabaseIdentifier.h in Headers */ = {isa = PBXBuildFile; fileRef = 5103105F1BA8E090003329C0 /* IDBDatabaseIdentifier.h */; settings = {ATTRIBUTES = (Private, ); }; };
-               5185FC881BB4C4E80012898F /* IDBDatabaseMetadata.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5163117C1851242B00534647 /* IDBDatabaseMetadata.cpp */; };
-               5185FC891BB4C4E80012898F /* IDBDatabaseMetadata.h in Headers */ = {isa = PBXBuildFile; fileRef = 51C9611A183D2B8000D2002E /* IDBDatabaseMetadata.h */; settings = {ATTRIBUTES = (Private, ); }; };
                5185FC8A1BB4C4E80012898F /* IDBEventDispatcher.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 51D71986181106DF0016DC51 /* IDBEventDispatcher.cpp */; };
                5185FC8B1BB4C4E80012898F /* IDBEventDispatcher.h in Headers */ = {isa = PBXBuildFile; fileRef = 51D71987181106DF0016DC51 /* IDBEventDispatcher.h */; };
                5185FC8C1BB4C4E80012898F /* IDBFactory.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 51645B461B9F889B00F789CE /* IDBFactory.cpp */; };
                5185FC8F1BB4C4E80012898F /* IDBGetResult.h in Headers */ = {isa = PBXBuildFile; fileRef = 5123AF1C18918AE40031CDC9 /* IDBGetResult.h */; settings = {ATTRIBUTES = (Private, ); }; };
                5185FC901BB4C4E80012898F /* IDBIndex.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 51645B481B9F889B00F789CE /* IDBIndex.cpp */; };
                5185FC911BB4C4E80012898F /* IDBIndex.h in Headers */ = {isa = PBXBuildFile; fileRef = 51645B491B9F889B00F789CE /* IDBIndex.h */; settings = {ATTRIBUTES = (Private, ); }; };
-               5185FC931BB4C4E80012898F /* IDBIndexMetadata.h in Headers */ = {isa = PBXBuildFile; fileRef = 51ABB5B6186D0ED1008391A1 /* IDBIndexMetadata.h */; settings = {ATTRIBUTES = (Private, ); }; };
                5185FC941BB4C4E80012898F /* IDBKey.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 51D71991181106E00016DC51 /* IDBKey.cpp */; };
                5185FC951BB4C4E80012898F /* IDBKey.h in Headers */ = {isa = PBXBuildFile; fileRef = 51D71992181106E00016DC51 /* IDBKey.h */; settings = {ATTRIBUTES = (Private, ); }; };
                5185FC961BB4C4E80012898F /* IDBKeyData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 511EC1A7188DAE7B00BA3EB6 /* IDBKeyData.cpp */; };
                5185FC9E1BB4C4E80012898F /* IDBKeyRangeData.h in Headers */ = {isa = PBXBuildFile; fileRef = 5123AF171890A4CA0031CDC9 /* IDBKeyRangeData.h */; settings = {ATTRIBUTES = (Private, ); }; };
                5185FC9F1BB4C4E80012898F /* IDBObjectStore.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 51645B4A1B9F889B00F789CE /* IDBObjectStore.cpp */; };
                5185FCA01BB4C4E80012898F /* IDBObjectStore.h in Headers */ = {isa = PBXBuildFile; fileRef = 51645B4B1B9F889B00F789CE /* IDBObjectStore.h */; settings = {ATTRIBUTES = (Private, ); }; };
-               5185FCA21BB4C4E80012898F /* IDBObjectStoreMetadata.h in Headers */ = {isa = PBXBuildFile; fileRef = 51ABB5B7186D0ED1008391A1 /* IDBObjectStoreMetadata.h */; settings = {ATTRIBUTES = (Private, ); }; };
                5185FCA31BB4C4E80012898F /* IDBOpenDBRequest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 51645B4C1B9F889B00F789CE /* IDBOpenDBRequest.cpp */; };
                5185FCA41BB4C4E80012898F /* IDBOpenDBRequest.h in Headers */ = {isa = PBXBuildFile; fileRef = 51645B4D1B9F889B00F789CE /* IDBOpenDBRequest.h */; settings = {ATTRIBUTES = (Private, ); }; };
-               5185FCA61BB4C4E80012898F /* IDBOperation.h in Headers */ = {isa = PBXBuildFile; fileRef = 512EA9BD18202857001D01E0 /* IDBOperation.h */; settings = {ATTRIBUTES = (Private, ); }; };
                5185FCA71BB4C4E80012898F /* IDBRecordIdentifier.h in Headers */ = {isa = PBXBuildFile; fileRef = 51EAC5B018163F4E004F1BA4 /* IDBRecordIdentifier.h */; };
                5185FCA81BB4C4E80012898F /* IDBRequest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 51645B4E1B9F889B00F789CE /* IDBRequest.cpp */; };
                5185FCA91BB4C4E80012898F /* IDBRequest.h in Headers */ = {isa = PBXBuildFile; fileRef = 51645B4F1B9F889B00F789CE /* IDBRequest.h */; settings = {ATTRIBUTES = (Private, ); }; };
-               5185FCAB1BB4C4E80012898F /* IDBServerConnection.h in Headers */ = {isa = PBXBuildFile;