Modern IDB: Start version change transaction for connections to new database.
authorbeidson@apple.com <beidson@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 12 Oct 2015 20:24:32 +0000 (20:24 +0000)
committerbeidson@apple.com <beidson@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 12 Oct 2015 20:24:32 +0000 (20:24 +0000)
https://bugs.webkit.org/show_bug.cgi?id=150033

Reviewed by Alex Christensen.

Source/WebCore:

No new tests (Covered by changes to existing tests).

* CMakeLists.txt:
* Modules/indexeddb/IDBDatabase.h:

* Modules/indexeddb/client/IDBAnyImpl.cpp:
(WebCore::IDBClient::IDBAny::IDBAny):
(WebCore::IDBClient::IDBAny::~IDBAny):
(WebCore::IDBClient::IDBAny::idbDatabase):
(WebCore::IDBClient::IDBAny::domStringList):
(WebCore::IDBClient::IDBAny::idbCursor):
(WebCore::IDBClient::IDBAny::idbCursorWithValue):
(WebCore::IDBClient::IDBAny::idbFactory):
(WebCore::IDBClient::IDBAny::idbIndex):
(WebCore::IDBClient::IDBAny::idbObjectStore):
(WebCore::IDBClient::IDBAny::idbTransaction):
(WebCore::IDBClient::IDBAny::scriptValue):
(WebCore::IDBClient::IDBAny::integer):
(WebCore::IDBClient::IDBAny::string):
(WebCore::IDBClient::IDBAny::keyPath):
* Modules/indexeddb/client/IDBAnyImpl.h:
(WebCore::IDBClient::IDBAny::create):

* Modules/indexeddb/client/IDBConnectionToServer.cpp:
(WebCore::IDBClient::IDBConnectionToServer::fireVersionChangeEvent):
(WebCore::IDBClient::IDBConnectionToServer::registerDatabaseConnection):
(WebCore::IDBClient::IDBConnectionToServer::unregisterDatabaseConnection):
* Modules/indexeddb/client/IDBConnectionToServer.h:

* Modules/indexeddb/client/IDBDatabaseImpl.cpp: Added.
(WebCore::IDBClient::IDBDatabase::create):
(WebCore::IDBClient::IDBDatabase::IDBDatabase):
(WebCore::IDBClient::IDBDatabase::~IDBDatabase):
(WebCore::IDBClient::IDBDatabase::name):
(WebCore::IDBClient::IDBDatabase::version):
(WebCore::IDBClient::IDBDatabase::objectStoreNames):
(WebCore::IDBClient::IDBDatabase::createObjectStore):
(WebCore::IDBClient::IDBDatabase::transaction):
(WebCore::IDBClient::IDBDatabase::deleteObjectStore):
(WebCore::IDBClient::IDBDatabase::close):
(WebCore::IDBClient::IDBDatabase::activeDOMObjectName):
(WebCore::IDBClient::IDBDatabase::canSuspendForPageCache):
(WebCore::IDBClient::IDBDatabase::startVersionChangeTransaction):
* Modules/indexeddb/client/IDBDatabaseImpl.h: Added.
(WebCore::IDBClient::IDBDatabase::info):

* Modules/indexeddb/client/IDBOpenDBRequestImpl.cpp:
(WebCore::IDBClient::IDBOpenDBRequest::onError):
(WebCore::IDBClient::IDBOpenDBRequest::onSuccess):
(WebCore::IDBClient::IDBOpenDBRequest::onUpgradeNeeded):
(WebCore::IDBClient::IDBOpenDBRequest::requestCompleted):
* Modules/indexeddb/client/IDBOpenDBRequestImpl.h:

* Modules/indexeddb/client/IDBRequestImpl.cpp:
(WebCore::IDBClient::IDBRequest::IDBRequest):
(WebCore::IDBClient::IDBRequest::result):
(WebCore::IDBClient::IDBRequest::source):
(WebCore::IDBClient::IDBRequest::transaction):
* Modules/indexeddb/client/IDBRequestImpl.h:
(WebCore::IDBClient::IDBRequest::connection):

* Modules/indexeddb/client/IDBTransactionImpl.cpp:
(WebCore::IDBClient::IDBTransaction::create):
(WebCore::IDBClient::IDBTransaction::IDBTransaction):
(WebCore::IDBClient::IDBTransaction::~IDBTransaction):
(WebCore::IDBClient::IDBTransaction::mode):
(WebCore::IDBClient::IDBTransaction::db):
(WebCore::IDBClient::IDBTransaction::error):
(WebCore::IDBClient::IDBTransaction::objectStore):
(WebCore::IDBClient::IDBTransaction::abort):
(WebCore::IDBClient::IDBTransaction::activeDOMObjectName):
(WebCore::IDBClient::IDBTransaction::canSuspendForPageCache):
* Modules/indexeddb/client/IDBTransactionImpl.h:
(WebCore::IDBClient::IDBTransaction::info):

* Modules/indexeddb/client/IDBVersionChangeEventImpl.cpp:
(WebCore::IDBClient::IDBVersionChangeEvent::IDBVersionChangeEvent):
(WebCore::IDBClient::IDBVersionChangeEvent::eventInterface):
* Modules/indexeddb/client/IDBVersionChangeEventImpl.h:
(WebCore::IDBClient::IDBVersionChangeEvent::create):

* Modules/indexeddb/legacy/LegacyDatabase.h:

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

* Modules/indexeddb/server/IDBServer.cpp:
(WebCore::IDBServer::IDBServer::registerDatabaseConnection):
(WebCore::IDBServer::IDBServer::unregisterDatabaseConnection):
(WebCore::IDBServer::IDBServer::deleteDatabase):
* Modules/indexeddb/server/IDBServer.h:

* Modules/indexeddb/server/UniqueIDBDatabase.cpp:
(WebCore::IDBServer::UniqueIDBDatabase::info):
(WebCore::IDBServer::UniqueIDBDatabase::handleOpenDatabaseOperations):
(WebCore::IDBServer::UniqueIDBDatabase::hasAnyOpenConnections):
(WebCore::IDBServer::UniqueIDBDatabase::startVersionChangeTransaction):
(WebCore::IDBServer::UniqueIDBDatabase::notifyConnectionsOfVersionChange):
(WebCore::IDBServer::UniqueIDBDatabase::addOpenDatabaseConnection):
* Modules/indexeddb/server/UniqueIDBDatabase.h:

* Modules/indexeddb/server/UniqueIDBDatabaseConnection.cpp:
(WebCore::IDBServer::nextDatabaseConnectionIdentifier):
(WebCore::IDBServer::UniqueIDBDatabaseConnection::create):
(WebCore::IDBServer::UniqueIDBDatabaseConnection::UniqueIDBDatabaseConnection):
(WebCore::IDBServer::UniqueIDBDatabaseConnection::fireVersionChangeEvent):
(WebCore::IDBServer::UniqueIDBDatabaseConnection::createVersionChangeTransaction):

* Modules/indexeddb/server/UniqueIDBDatabaseConnection.h:
(WebCore::IDBServer::UniqueIDBDatabaseConnection::identifier):
(WebCore::IDBServer::UniqueIDBDatabaseConnection::database):
(WebCore::IDBServer::UniqueIDBDatabaseConnection::connectionToClient):
(WebCore::IDBServer::UniqueIDBDatabaseConnection::closePending):

* Modules/indexeddb/server/UniqueIDBDatabaseTransaction.cpp:
(WebCore::IDBServer::UniqueIDBDatabaseTransaction::create):
(WebCore::IDBServer::UniqueIDBDatabaseTransaction::UniqueIDBDatabaseTransaction):
* Modules/indexeddb/server/UniqueIDBDatabaseTransaction.h:
(WebCore::IDBServer::UniqueIDBDatabaseTransaction::databaseConnection):
(WebCore::IDBServer::UniqueIDBDatabaseTransaction::info):

* Modules/indexeddb/shared/IDBDatabaseInfo.cpp:
(WebCore::IDBDatabaseInfo::IDBDatabaseInfo):
* Modules/indexeddb/shared/IDBDatabaseInfo.h:
(WebCore::IDBDatabaseInfo::name):
(WebCore::IDBDatabaseInfo::version):
(WebCore::IDBDatabaseInfo::IDBDatabaseInfo): Deleted.

* Modules/indexeddb/shared/IDBError.h:

* Modules/indexeddb/shared/IDBRequestData.cpp:
(WebCore::IDBRequestData::IDBRequestData):
(WebCore::IDBRequestData::requestedVersion):
* Modules/indexeddb/shared/IDBRequestData.h:

* Modules/indexeddb/shared/IDBResourceIdentifier.cpp:
(WebCore::nextClientResourceNumber):
(WebCore::nextServerResourceNumber):
(WebCore::IDBResourceIdentifier::IDBResourceIdentifier):
(WebCore::IDBResourceIdentifier::emptyValue):
(WebCore::IDBResourceIdentifier::deletedValue):
(WebCore::nextResourceNumber): Deleted.
* Modules/indexeddb/shared/IDBResourceIdentifier.h:

* Modules/indexeddb/shared/IDBResultData.cpp:
(WebCore::IDBResultData::IDBResultData):
(WebCore::IDBResultData::error):
(WebCore::IDBResultData::openDatabaseSuccess):
(WebCore::IDBResultData::openDatabaseUpgradeNeeded):
(WebCore::IDBResultData::databaseInfo):
(WebCore::IDBResultData::transactionInfo):
* Modules/indexeddb/shared/IDBResultData.h:
(WebCore::IDBResultData::type):
(WebCore::IDBResultData::databaseConnectionIdentifier):

* Modules/indexeddb/shared/IDBTransactionInfo.cpp:
(WebCore::IDBTransactionInfo::IDBTransactionInfo):
(WebCore::IDBTransactionInfo::versionChange):
(WebCore::IDBTransactionInfo::isolatedCopy):
* Modules/indexeddb/shared/IDBTransactionInfo.h:
(WebCore::IDBTransactionInfo::identifier):
(WebCore::IDBTransactionInfo::mode):
(WebCore::IDBTransactionInfo::newVersion):

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

* WebCore.xcodeproj/project.pbxproj:

* platform/CrossThreadCopier.cpp:
(WebCore::IDBTransactionInfo>::copy):
* platform/CrossThreadCopier.h:

LayoutTests:

* storage/indexeddb/modern/opendatabase-request-event-expected.txt:
* storage/indexeddb/modern/opendatabase-request-event.html:

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

48 files changed:
LayoutTests/ChangeLog
LayoutTests/storage/indexeddb/modern/opendatabase-request-event-expected.txt
LayoutTests/storage/indexeddb/modern/opendatabase-request-event.html
Source/WebCore/CMakeLists.txt
Source/WebCore/ChangeLog
Source/WebCore/Modules/indexeddb/IDBDatabase.h
Source/WebCore/Modules/indexeddb/client/IDBAnyImpl.cpp [new file with mode: 0644]
Source/WebCore/Modules/indexeddb/client/IDBAnyImpl.h [new file with mode: 0644]
Source/WebCore/Modules/indexeddb/client/IDBConnectionToServer.cpp
Source/WebCore/Modules/indexeddb/client/IDBConnectionToServer.h
Source/WebCore/Modules/indexeddb/client/IDBDatabaseImpl.cpp [new file with mode: 0644]
Source/WebCore/Modules/indexeddb/client/IDBDatabaseImpl.h [new file with mode: 0644]
Source/WebCore/Modules/indexeddb/client/IDBOpenDBRequestImpl.cpp
Source/WebCore/Modules/indexeddb/client/IDBOpenDBRequestImpl.h
Source/WebCore/Modules/indexeddb/client/IDBRequestImpl.cpp
Source/WebCore/Modules/indexeddb/client/IDBRequestImpl.h
Source/WebCore/Modules/indexeddb/client/IDBTransactionImpl.cpp [new file with mode: 0644]
Source/WebCore/Modules/indexeddb/client/IDBTransactionImpl.h [new file with mode: 0644]
Source/WebCore/Modules/indexeddb/client/IDBVersionChangeEventImpl.cpp [new file with mode: 0644]
Source/WebCore/Modules/indexeddb/client/IDBVersionChangeEventImpl.h [new file with mode: 0644]
Source/WebCore/Modules/indexeddb/legacy/LegacyDatabase.h
Source/WebCore/Modules/indexeddb/server/IDBConnectionToClient.cpp
Source/WebCore/Modules/indexeddb/server/IDBConnectionToClient.h
Source/WebCore/Modules/indexeddb/server/IDBConnectionToClientDelegate.h
Source/WebCore/Modules/indexeddb/server/IDBServer.cpp
Source/WebCore/Modules/indexeddb/server/IDBServer.h
Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabase.cpp
Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabase.h
Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabaseConnection.cpp [new file with mode: 0644]
Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabaseConnection.h [new file with mode: 0644]
Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabaseTransaction.cpp [new file with mode: 0644]
Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabaseTransaction.h [new file with mode: 0644]
Source/WebCore/Modules/indexeddb/shared/IDBDatabaseInfo.cpp
Source/WebCore/Modules/indexeddb/shared/IDBDatabaseInfo.h
Source/WebCore/Modules/indexeddb/shared/IDBError.h
Source/WebCore/Modules/indexeddb/shared/IDBRequestData.cpp
Source/WebCore/Modules/indexeddb/shared/IDBRequestData.h
Source/WebCore/Modules/indexeddb/shared/IDBResourceIdentifier.cpp
Source/WebCore/Modules/indexeddb/shared/IDBResourceIdentifier.h
Source/WebCore/Modules/indexeddb/shared/IDBResultData.cpp
Source/WebCore/Modules/indexeddb/shared/IDBResultData.h
Source/WebCore/Modules/indexeddb/shared/IDBTransactionInfo.cpp [new file with mode: 0644]
Source/WebCore/Modules/indexeddb/shared/IDBTransactionInfo.h [new file with mode: 0644]
Source/WebCore/Modules/indexeddb/shared/InProcessIDBServer.cpp
Source/WebCore/Modules/indexeddb/shared/InProcessIDBServer.h
Source/WebCore/WebCore.xcodeproj/project.pbxproj
Source/WebCore/platform/CrossThreadCopier.cpp
Source/WebCore/platform/CrossThreadCopier.h

index e84a830..849753f 100644 (file)
@@ -1,3 +1,13 @@
+2015-10-12  Brady Eidson  <beidson@apple.com>
+
+        Modern IDB: Start version change transaction for connections to new database.
+        https://bugs.webkit.org/show_bug.cgi?id=150033
+
+        Reviewed by Alex Christensen.
+
+        * storage/indexeddb/modern/opendatabase-request-event-expected.txt:
+        * storage/indexeddb/modern/opendatabase-request-event.html:
+
 2015-10-12  Said Abou-Hallawa  <sabouhallawa@apple.com>
 
         REGRESSION(r184895): border-image should always slice the SVG image to nine pieces when drawing it in the container element
index b342fd6..6fdcd19 100644 (file)
@@ -1,4 +1,6 @@
+ALERT: Caught exception TypeError: Type error
+ALERT: Caught exception TypeError: Type error
 ALERT: [object IDBOpenDBRequest]
-ALERT: error [object Event]
+ALERT: upgradeneeded: old version - 0 new version - 1
 ALERT: Done
 This test calls open on window.indexedDB in various ways, verifying that IDBOpenDBRequest objects are returned when expected and exceptions are thrown when expected.
index 12f8d14..c452989 100644 (file)
@@ -13,6 +13,18 @@ function done()
         testRunner.notifyDone();
 }
 
+try {
+    window.indexedDB.open("TestDatabase", 0);
+} catch (e) {
+    alert("Caught exception " + e);
+}
+
+try {
+    window.indexedDB.open("TestDatabase", -1);
+} catch (e) {
+    alert("Caught exception " + e);
+}
+
 var request = window.indexedDB.open("TestDatabase");
 alert(request);
 
@@ -26,4 +38,10 @@ request.onerror = function(e)
        alert("error " + e);
        done();
 }
+
+request.onupgradeneeded = function(e)
+{
+    alert("upgradeneeded: old version - " + e.oldVersion + " new version - " + e.newVersion);
+       done();
+}
 </script>
index 8240874..6ebc31c 100644 (file)
@@ -872,10 +872,14 @@ set(WebCore_SOURCES
     Modules/indexeddb/IDBVersionChangeEvent.cpp
     Modules/indexeddb/WorkerGlobalScopeIndexedDatabase.cpp
 
+    Modules/indexeddb/client/IDBAnyImpl.cpp
     Modules/indexeddb/client/IDBConnectionToServer.cpp
+    Modules/indexeddb/client/IDBDatabaseImpl.cpp
     Modules/indexeddb/client/IDBFactoryImpl.cpp
     Modules/indexeddb/client/IDBOpenDBRequestImpl.cpp
     Modules/indexeddb/client/IDBRequestImpl.cpp
+    Modules/indexeddb/client/IDBTransactionImpl.cpp
+    Modules/indexeddb/client/IDBVersionChangeEventImpl.cpp
 
     Modules/indexeddb/legacy/IDBCursorBackend.cpp
     Modules/indexeddb/legacy/IDBCursorBackendOperations.cpp
@@ -902,12 +906,15 @@ set(WebCore_SOURCES
     Modules/indexeddb/server/IDBServerOperation.cpp
     Modules/indexeddb/server/MemoryIDBBackingStore.cpp
     Modules/indexeddb/server/UniqueIDBDatabase.cpp
+    Modules/indexeddb/server/UniqueIDBDatabaseConnection.cpp
+    Modules/indexeddb/server/UniqueIDBDatabaseTransaction.cpp
 
     Modules/indexeddb/shared/IDBDatabaseInfo.cpp
     Modules/indexeddb/shared/IDBError.cpp
     Modules/indexeddb/shared/IDBRequestData.cpp
     Modules/indexeddb/shared/IDBResourceIdentifier.cpp
     Modules/indexeddb/shared/IDBResultData.cpp
+    Modules/indexeddb/shared/IDBTransactionInfo.cpp
     Modules/indexeddb/shared/InProcessIDBServer.cpp
 
     Modules/mediacontrols/MediaControlsHost.cpp
index 244249b..1737f41 100644 (file)
@@ -1,3 +1,186 @@
+2015-10-12  Brady Eidson  <beidson@apple.com>
+
+        Modern IDB: Start version change transaction for connections to new database.
+        https://bugs.webkit.org/show_bug.cgi?id=150033
+
+        Reviewed by Alex Christensen.
+
+        No new tests (Covered by changes to existing tests).
+
+        * CMakeLists.txt:
+        * Modules/indexeddb/IDBDatabase.h:
+        
+        * Modules/indexeddb/client/IDBAnyImpl.cpp:
+        (WebCore::IDBClient::IDBAny::IDBAny):
+        (WebCore::IDBClient::IDBAny::~IDBAny):
+        (WebCore::IDBClient::IDBAny::idbDatabase):
+        (WebCore::IDBClient::IDBAny::domStringList):
+        (WebCore::IDBClient::IDBAny::idbCursor):
+        (WebCore::IDBClient::IDBAny::idbCursorWithValue):
+        (WebCore::IDBClient::IDBAny::idbFactory):
+        (WebCore::IDBClient::IDBAny::idbIndex):
+        (WebCore::IDBClient::IDBAny::idbObjectStore):
+        (WebCore::IDBClient::IDBAny::idbTransaction):
+        (WebCore::IDBClient::IDBAny::scriptValue):
+        (WebCore::IDBClient::IDBAny::integer):
+        (WebCore::IDBClient::IDBAny::string):
+        (WebCore::IDBClient::IDBAny::keyPath):
+        * Modules/indexeddb/client/IDBAnyImpl.h:
+        (WebCore::IDBClient::IDBAny::create):
+        
+        * Modules/indexeddb/client/IDBConnectionToServer.cpp:
+        (WebCore::IDBClient::IDBConnectionToServer::fireVersionChangeEvent):
+        (WebCore::IDBClient::IDBConnectionToServer::registerDatabaseConnection):
+        (WebCore::IDBClient::IDBConnectionToServer::unregisterDatabaseConnection):
+        * Modules/indexeddb/client/IDBConnectionToServer.h:
+        
+        * Modules/indexeddb/client/IDBDatabaseImpl.cpp: Added.
+        (WebCore::IDBClient::IDBDatabase::create):
+        (WebCore::IDBClient::IDBDatabase::IDBDatabase):
+        (WebCore::IDBClient::IDBDatabase::~IDBDatabase):
+        (WebCore::IDBClient::IDBDatabase::name):
+        (WebCore::IDBClient::IDBDatabase::version):
+        (WebCore::IDBClient::IDBDatabase::objectStoreNames):
+        (WebCore::IDBClient::IDBDatabase::createObjectStore):
+        (WebCore::IDBClient::IDBDatabase::transaction):
+        (WebCore::IDBClient::IDBDatabase::deleteObjectStore):
+        (WebCore::IDBClient::IDBDatabase::close):
+        (WebCore::IDBClient::IDBDatabase::activeDOMObjectName):
+        (WebCore::IDBClient::IDBDatabase::canSuspendForPageCache):
+        (WebCore::IDBClient::IDBDatabase::startVersionChangeTransaction):
+        * Modules/indexeddb/client/IDBDatabaseImpl.h: Added.
+        (WebCore::IDBClient::IDBDatabase::info):
+        
+        * Modules/indexeddb/client/IDBOpenDBRequestImpl.cpp:
+        (WebCore::IDBClient::IDBOpenDBRequest::onError):
+        (WebCore::IDBClient::IDBOpenDBRequest::onSuccess):
+        (WebCore::IDBClient::IDBOpenDBRequest::onUpgradeNeeded):
+        (WebCore::IDBClient::IDBOpenDBRequest::requestCompleted):
+        * Modules/indexeddb/client/IDBOpenDBRequestImpl.h:
+        
+        * Modules/indexeddb/client/IDBRequestImpl.cpp:
+        (WebCore::IDBClient::IDBRequest::IDBRequest):
+        (WebCore::IDBClient::IDBRequest::result):
+        (WebCore::IDBClient::IDBRequest::source):
+        (WebCore::IDBClient::IDBRequest::transaction):
+        * Modules/indexeddb/client/IDBRequestImpl.h:
+        (WebCore::IDBClient::IDBRequest::connection):
+        
+        * Modules/indexeddb/client/IDBTransactionImpl.cpp:
+        (WebCore::IDBClient::IDBTransaction::create):
+        (WebCore::IDBClient::IDBTransaction::IDBTransaction):
+        (WebCore::IDBClient::IDBTransaction::~IDBTransaction):
+        (WebCore::IDBClient::IDBTransaction::mode):
+        (WebCore::IDBClient::IDBTransaction::db):
+        (WebCore::IDBClient::IDBTransaction::error):
+        (WebCore::IDBClient::IDBTransaction::objectStore):
+        (WebCore::IDBClient::IDBTransaction::abort):
+        (WebCore::IDBClient::IDBTransaction::activeDOMObjectName):
+        (WebCore::IDBClient::IDBTransaction::canSuspendForPageCache):
+        * Modules/indexeddb/client/IDBTransactionImpl.h:
+        (WebCore::IDBClient::IDBTransaction::info):
+        
+        * Modules/indexeddb/client/IDBVersionChangeEventImpl.cpp:
+        (WebCore::IDBClient::IDBVersionChangeEvent::IDBVersionChangeEvent):
+        (WebCore::IDBClient::IDBVersionChangeEvent::eventInterface):
+        * Modules/indexeddb/client/IDBVersionChangeEventImpl.h:
+        (WebCore::IDBClient::IDBVersionChangeEvent::create):
+        
+        * Modules/indexeddb/legacy/LegacyDatabase.h:
+        
+        * Modules/indexeddb/server/IDBConnectionToClient.cpp:
+        (WebCore::IDBServer::IDBConnectionToClient::fireVersionChangeEvent):
+        * Modules/indexeddb/server/IDBConnectionToClient.h:
+        * Modules/indexeddb/server/IDBConnectionToClientDelegate.h:
+        
+        * Modules/indexeddb/server/IDBServer.cpp:
+        (WebCore::IDBServer::IDBServer::registerDatabaseConnection):
+        (WebCore::IDBServer::IDBServer::unregisterDatabaseConnection):
+        (WebCore::IDBServer::IDBServer::deleteDatabase):
+        * Modules/indexeddb/server/IDBServer.h:
+        
+        * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
+        (WebCore::IDBServer::UniqueIDBDatabase::info):
+        (WebCore::IDBServer::UniqueIDBDatabase::handleOpenDatabaseOperations):
+        (WebCore::IDBServer::UniqueIDBDatabase::hasAnyOpenConnections):
+        (WebCore::IDBServer::UniqueIDBDatabase::startVersionChangeTransaction):
+        (WebCore::IDBServer::UniqueIDBDatabase::notifyConnectionsOfVersionChange):
+        (WebCore::IDBServer::UniqueIDBDatabase::addOpenDatabaseConnection):
+        * Modules/indexeddb/server/UniqueIDBDatabase.h:
+        
+        * Modules/indexeddb/server/UniqueIDBDatabaseConnection.cpp: 
+        (WebCore::IDBServer::nextDatabaseConnectionIdentifier):
+        (WebCore::IDBServer::UniqueIDBDatabaseConnection::create):
+        (WebCore::IDBServer::UniqueIDBDatabaseConnection::UniqueIDBDatabaseConnection):
+        (WebCore::IDBServer::UniqueIDBDatabaseConnection::fireVersionChangeEvent):
+        (WebCore::IDBServer::UniqueIDBDatabaseConnection::createVersionChangeTransaction):
+
+        * Modules/indexeddb/server/UniqueIDBDatabaseConnection.h:
+        (WebCore::IDBServer::UniqueIDBDatabaseConnection::identifier):
+        (WebCore::IDBServer::UniqueIDBDatabaseConnection::database):
+        (WebCore::IDBServer::UniqueIDBDatabaseConnection::connectionToClient):
+        (WebCore::IDBServer::UniqueIDBDatabaseConnection::closePending):
+        
+        * Modules/indexeddb/server/UniqueIDBDatabaseTransaction.cpp:
+        (WebCore::IDBServer::UniqueIDBDatabaseTransaction::create):
+        (WebCore::IDBServer::UniqueIDBDatabaseTransaction::UniqueIDBDatabaseTransaction):
+        * Modules/indexeddb/server/UniqueIDBDatabaseTransaction.h:
+        (WebCore::IDBServer::UniqueIDBDatabaseTransaction::databaseConnection):
+        (WebCore::IDBServer::UniqueIDBDatabaseTransaction::info):
+        
+        * Modules/indexeddb/shared/IDBDatabaseInfo.cpp:
+        (WebCore::IDBDatabaseInfo::IDBDatabaseInfo):
+        * Modules/indexeddb/shared/IDBDatabaseInfo.h:
+        (WebCore::IDBDatabaseInfo::name):
+        (WebCore::IDBDatabaseInfo::version):
+        (WebCore::IDBDatabaseInfo::IDBDatabaseInfo): Deleted.
+        
+        * Modules/indexeddb/shared/IDBError.h:
+        
+        * Modules/indexeddb/shared/IDBRequestData.cpp:
+        (WebCore::IDBRequestData::IDBRequestData):
+        (WebCore::IDBRequestData::requestedVersion):
+        * Modules/indexeddb/shared/IDBRequestData.h:
+        
+        * Modules/indexeddb/shared/IDBResourceIdentifier.cpp:
+        (WebCore::nextClientResourceNumber):
+        (WebCore::nextServerResourceNumber):
+        (WebCore::IDBResourceIdentifier::IDBResourceIdentifier):
+        (WebCore::IDBResourceIdentifier::emptyValue):
+        (WebCore::IDBResourceIdentifier::deletedValue):
+        (WebCore::nextResourceNumber): Deleted.
+        * Modules/indexeddb/shared/IDBResourceIdentifier.h:
+        
+        * Modules/indexeddb/shared/IDBResultData.cpp:
+        (WebCore::IDBResultData::IDBResultData):
+        (WebCore::IDBResultData::error):
+        (WebCore::IDBResultData::openDatabaseSuccess):
+        (WebCore::IDBResultData::openDatabaseUpgradeNeeded):
+        (WebCore::IDBResultData::databaseInfo):
+        (WebCore::IDBResultData::transactionInfo):
+        * Modules/indexeddb/shared/IDBResultData.h:
+        (WebCore::IDBResultData::type):
+        (WebCore::IDBResultData::databaseConnectionIdentifier):
+        
+        * Modules/indexeddb/shared/IDBTransactionInfo.cpp:
+        (WebCore::IDBTransactionInfo::IDBTransactionInfo):
+        (WebCore::IDBTransactionInfo::versionChange):
+        (WebCore::IDBTransactionInfo::isolatedCopy):
+        * Modules/indexeddb/shared/IDBTransactionInfo.h:
+        (WebCore::IDBTransactionInfo::identifier):
+        (WebCore::IDBTransactionInfo::mode):
+        (WebCore::IDBTransactionInfo::newVersion):
+        
+        * Modules/indexeddb/shared/InProcessIDBServer.cpp:
+        (WebCore::InProcessIDBServer::fireVersionChangeEvent):
+        * Modules/indexeddb/shared/InProcessIDBServer.h:
+        
+        * WebCore.xcodeproj/project.pbxproj:
+        
+        * platform/CrossThreadCopier.cpp:
+        (WebCore::IDBTransactionInfo>::copy):
+        * platform/CrossThreadCopier.h:
+
 2015-10-12  Said Abou-Hallawa  <sabouhallawa@apple.com>
 
         REGRESSION(r184895): border-image should always slice the SVG image to nine pieces when drawing it in the container element
index 65a1acb..5d2b3cc 100644 (file)
@@ -31,7 +31,6 @@
 #include "Dictionary.h"
 #include "Event.h"
 #include "EventTarget.h"
-#include "IDBDatabaseMetadata.h"
 #include "IDBObjectStore.h"
 #include "IDBTransaction.h"
 #include "IndexedDB.h"
@@ -63,8 +62,6 @@ public:
     virtual void deleteObjectStore(const String& name, ExceptionCode&) = 0;
     virtual void close() = 0;
 
-    virtual const IDBDatabaseMetadata metadata() const = 0;
-
     using RefCounted<IDBDatabase>::ref;
     using RefCounted<IDBDatabase>::deref;
 
diff --git a/Source/WebCore/Modules/indexeddb/client/IDBAnyImpl.cpp b/Source/WebCore/Modules/indexeddb/client/IDBAnyImpl.cpp
new file mode 100644 (file)
index 0000000..2fdab7d
--- /dev/null
@@ -0,0 +1,113 @@
+/*
+ * Copyright (C) 2015 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 "IDBAnyImpl.h"
+
+#if ENABLE(INDEXED_DATABASE)
+
+#include "IDBAny.h"
+#include "IDBCursorWithValue.h"
+#include "IDBFactory.h"
+#include "IDBIndex.h"
+
+namespace WebCore {
+namespace IDBClient {
+
+IDBAny::IDBAny(Ref<IDBDatabase>&& database)
+    : m_type(IDBAny::Type::IDBDatabase)
+    , m_database(adoptRef(&database.leakRef()))
+{
+}
+
+IDBAny::~IDBAny()
+{
+}
+
+RefPtr<WebCore::IDBDatabase> IDBAny::idbDatabase()
+{
+    ASSERT(m_type == IDBAny::Type::IDBDatabase);
+    return m_database.get();
+}
+
+RefPtr<WebCore::DOMStringList> IDBAny::domStringList()
+{
+    return nullptr;
+}
+
+RefPtr<WebCore::IDBCursor> IDBAny::idbCursor()
+{
+    return nullptr;
+}
+
+RefPtr<WebCore::IDBCursorWithValue> IDBAny::idbCursorWithValue()
+{
+    return nullptr;
+}
+
+RefPtr<WebCore::IDBFactory> IDBAny::idbFactory()
+{
+    return nullptr;
+}
+
+RefPtr<WebCore::IDBIndex> IDBAny::idbIndex()
+{
+    return nullptr;
+}
+
+RefPtr<WebCore::IDBObjectStore> IDBAny::idbObjectStore()
+{
+    return nullptr;
+}
+
+RefPtr<WebCore::IDBTransaction> IDBAny::idbTransaction()
+{
+    return nullptr;
+}
+
+const Deprecated::ScriptValue& IDBAny::scriptValue()
+{
+    return m_scriptValue;
+}
+
+int64_t IDBAny::integer()
+{
+    return m_integer;
+}
+
+const String& IDBAny::string()
+{
+    return m_string;
+}
+
+const IDBKeyPath& IDBAny::keyPath()
+{
+    return m_idbKeyPath;
+}
+
+} // namespace IDBClient
+} // namespace WebCore
+
+#endif // ENABLE(INDEXED_DATABASE)
diff --git a/Source/WebCore/Modules/indexeddb/client/IDBAnyImpl.h b/Source/WebCore/Modules/indexeddb/client/IDBAnyImpl.h
new file mode 100644 (file)
index 0000000..c142656
--- /dev/null
@@ -0,0 +1,76 @@
+/*
+ * Copyright (C) 2015 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 IDBAnyImpl_h
+#define IDBAnyImpl_h
+
+#if ENABLE(INDEXED_DATABASE)
+
+#include "IDBAny.h"
+#include "IDBDatabaseImpl.h"
+
+namespace WebCore {
+namespace IDBClient {
+
+class IDBAny : public WebCore::IDBAny {
+public:
+    static RefPtr<IDBAny> create(Ref<IDBDatabase>&& database)
+    {
+        return adoptRef(new IDBAny(WTF::move(database)));
+    }
+
+    virtual ~IDBAny();
+
+    virtual Type type() const override final { return m_type; }
+    virtual RefPtr<WebCore::DOMStringList> domStringList() override final;
+    virtual RefPtr<WebCore::IDBCursor> idbCursor() override final;
+    virtual RefPtr<WebCore::IDBCursorWithValue> idbCursorWithValue() override final;
+    virtual RefPtr<WebCore::IDBDatabase> idbDatabase() override final;
+    virtual RefPtr<WebCore::IDBFactory> idbFactory() override final;
+    virtual RefPtr<WebCore::IDBIndex> idbIndex() override final;
+    virtual RefPtr<WebCore::IDBObjectStore> idbObjectStore() override final;
+    virtual RefPtr<WebCore::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;
+
+private:
+    IDBAny(Ref<IDBDatabase>&&);
+
+    IDBAny::Type m_type { IDBAny::Type::Undefined };
+    RefPtr<IDBDatabase> m_database;
+
+    const IDBKeyPath m_idbKeyPath;
+    const Deprecated::ScriptValue m_scriptValue;
+    const String m_string;
+    const int64_t m_integer { 0 };
+};
+
+} // namespace IDBClient
+} // namespace WebCore
+
+#endif // ENABLE(INDEXED_DATABASE)
+#endif // IDBAnyImpl_h
index 5623578..0638f87 100644 (file)
@@ -93,6 +93,25 @@ void IDBConnectionToServer::didOpenDatabase(const IDBResultData& resultData)
     request->requestCompleted(resultData);
 }
 
+void IDBConnectionToServer::fireVersionChangeEvent(uint64_t /*databaseConnectionIdentifier*/ , uint64_t /*requestedVersion*/)
+{
+    LOG(IndexedDB, "IDBConnectionToServer::fireVersionChangeEvent");
+
+    // FIXME: Implement versionchange events firing on already-open transactions.
+}
+
+void IDBConnectionToServer::registerDatabaseConnection(IDBDatabase& database)
+{
+    ASSERT(!m_databaseConnections.contains(&database));
+    m_databaseConnections.add(&database);
+}
+
+void IDBConnectionToServer::unregisterDatabaseConnection(IDBDatabase& database)
+{
+    ASSERT(m_databaseConnections.contains(&database));
+    m_databaseConnections.remove(&database);
+}
+
 } // namespace IDBClient
 } // namespace WebCore
 
index e0a3cce..81d8fe3 100644 (file)
@@ -31,6 +31,7 @@
 #include "IDBConnectionToServerDelegate.h"
 #include "IDBResourceIdentifier.h"
 #include <wtf/HashMap.h>
+#include <wtf/HashSet.h>
 #include <wtf/Ref.h>
 #include <wtf/RefCounted.h>
 
@@ -40,6 +41,7 @@ class IDBResultData;
 
 namespace IDBClient {
 
+class IDBDatabase;
 class IDBOpenDBRequest;
 
 class IDBConnectionToServer : public RefCounted<IDBConnectionToServer> {
@@ -54,12 +56,18 @@ public:
     void openDatabase(IDBOpenDBRequest&);
     void didOpenDatabase(const IDBResultData&);
 
+    void fireVersionChangeEvent(uint64_t databaseConnectionIdentifier, uint64_t requestedVersion);
+
+    void registerDatabaseConnection(IDBDatabase&);
+    void unregisterDatabaseConnection(IDBDatabase&);
+
 private:
     IDBConnectionToServer(IDBConnectionToServerDelegate&);
     
     Ref<IDBConnectionToServerDelegate> m_delegate;
 
     HashMap<IDBResourceIdentifier, RefPtr<IDBClient::IDBOpenDBRequest>> m_openDBRequestMap;
+    HashSet<RefPtr<IDBDatabase>> m_databaseConnections;
 };
 
 } // namespace IDBClient
diff --git a/Source/WebCore/Modules/indexeddb/client/IDBDatabaseImpl.cpp b/Source/WebCore/Modules/indexeddb/client/IDBDatabaseImpl.cpp
new file mode 100644 (file)
index 0000000..ab4eedf
--- /dev/null
@@ -0,0 +1,139 @@
+/*
+ * Copyright (C) 2015 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 "IDBDatabaseImpl.h"
+
+#if ENABLE(INDEXED_DATABASE)
+
+#include "IDBConnectionToServer.h"
+#include "IDBOpenDBRequestImpl.h"
+#include "IDBResultData.h"
+#include "IDBTransactionImpl.h"
+#include "Logging.h"
+
+namespace WebCore {
+namespace IDBClient {
+
+Ref<IDBDatabase> IDBDatabase::create(ScriptExecutionContext& context, IDBConnectionToServer& connection, const IDBResultData& resultData)
+{
+    return adoptRef(*new IDBDatabase(context, connection, resultData));
+}
+
+IDBDatabase::IDBDatabase(ScriptExecutionContext& context, IDBConnectionToServer& connection, const IDBResultData& resultData)
+    : WebCore::IDBDatabase(&context)
+    , m_connection(connection)
+    , m_info(resultData.databaseInfo())
+{
+    suspendIfNeeded();
+    relaxAdoptionRequirement();
+    m_connection->registerDatabaseConnection(*this);
+}
+
+IDBDatabase::~IDBDatabase()
+{
+    m_connection->unregisterDatabaseConnection(*this);
+}
+
+const String IDBDatabase::name() const
+{
+    return m_info.name();
+}
+
+uint64_t IDBDatabase::version() const
+{
+    return m_info.version();
+}
+
+RefPtr<DOMStringList> IDBDatabase::objectStoreNames() const
+{
+    ASSERT_NOT_REACHED();
+    return nullptr;
+}
+
+RefPtr<IDBObjectStore> IDBDatabase::createObjectStore(const String&, const Dictionary&, ExceptionCode&)
+{
+    ASSERT_NOT_REACHED();
+    return nullptr;
+}
+
+RefPtr<IDBObjectStore> IDBDatabase::createObjectStore(const String&, const IDBKeyPath&, bool, ExceptionCode&)
+{
+    ASSERT_NOT_REACHED();
+    return nullptr;
+}
+
+RefPtr<WebCore::IDBTransaction> IDBDatabase::transaction(ScriptExecutionContext*, const Vector<String>&, const String&, ExceptionCode&)
+{
+    ASSERT_NOT_REACHED();
+    return nullptr;
+}
+
+RefPtr<WebCore::IDBTransaction> IDBDatabase::transaction(ScriptExecutionContext*, const String&, const String&, ExceptionCode&)
+{
+    ASSERT_NOT_REACHED();
+    return nullptr;
+}
+
+void IDBDatabase::deleteObjectStore(const String&, ExceptionCode&)
+{
+    ASSERT_NOT_REACHED();
+}
+
+void IDBDatabase::close()
+{
+    ASSERT_NOT_REACHED();
+}
+
+const char* IDBDatabase::activeDOMObjectName() const
+{
+    return "IDBDatabase";
+}
+
+bool IDBDatabase::canSuspendForPageCache() const
+{
+    // FIXME: This value will sometimes be false when database operations are actually in progress.
+    // Such database operations do not yet exist.
+    return true;
+}
+
+Ref<IDBTransaction> IDBDatabase::startVersionChangeTransaction(const IDBTransactionInfo& info)
+{
+    LOG(IndexedDB, "IDBDatabase::startVersionChangeTransaction");
+
+    ASSERT(!m_versionChangeTransaction);
+    ASSERT(info.mode() == IndexedDB::TransactionMode::VersionChange);
+
+    Ref<IDBTransaction> transaction = IDBTransaction::create(*this, info);
+    m_versionChangeTransaction = &transaction.get();
+    m_activeTransactions.set(transaction->info().identifier(), &transaction.get());
+
+    return WTF::move(transaction);
+}
+
+} // namespace IDBClient
+} // namespace WebCore
+
+#endif // ENABLE(INDEXED_DATABASE)
diff --git a/Source/WebCore/Modules/indexeddb/client/IDBDatabaseImpl.h b/Source/WebCore/Modules/indexeddb/client/IDBDatabaseImpl.h
new file mode 100644 (file)
index 0000000..5f22b68
--- /dev/null
@@ -0,0 +1,90 @@
+/*
+ * Copyright (C) 2015 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 IDBDatabaseImpl_h
+#define IDBDatabaseImpl_h
+
+#if ENABLE(INDEXED_DATABASE)
+
+#include "IDBConnectionToServer.h"
+#include "IDBDatabase.h"
+#include "IDBDatabaseInfo.h"
+
+namespace WebCore {
+
+class IDBResultData;
+class IDBTransaction;
+class IDBTransactionInfo;
+
+namespace IDBClient {
+
+class IDBTransaction;
+
+class IDBDatabase : public WebCore::IDBDatabase {
+public:
+    static Ref<IDBDatabase> create(ScriptExecutionContext&, IDBConnectionToServer&, const IDBResultData&);
+
+    virtual ~IDBDatabase();
+
+    // IDBDatabase IDL
+    virtual const String name() const override final;
+    virtual uint64_t version() const override final;
+    virtual RefPtr<DOMStringList> objectStoreNames() const override final;
+
+    virtual RefPtr<IDBObjectStore> createObjectStore(const String& name, const Dictionary&, ExceptionCode&) override final;
+    virtual RefPtr<IDBObjectStore> createObjectStore(const String& name, const IDBKeyPath&, bool autoIncrement, ExceptionCode&) override final;
+    virtual RefPtr<WebCore::IDBTransaction> transaction(ScriptExecutionContext*, const Vector<String>&, const String& mode, ExceptionCode&) override final;
+    virtual RefPtr<WebCore::IDBTransaction> transaction(ScriptExecutionContext*, const String&, const String& mode, ExceptionCode&) override final;
+    virtual void deleteObjectStore(const String& name, ExceptionCode&) override final;
+    virtual void close() override final;
+
+    // EventTarget
+    virtual EventTargetInterface eventTargetInterface() const override final { return IDBDatabaseEventTargetInterfaceType; }
+    virtual ScriptExecutionContext* scriptExecutionContext() const override final { return ActiveDOMObject::scriptExecutionContext(); }
+    virtual void refEventTarget() override final { ref(); }
+    virtual void derefEventTarget() override final { deref(); }
+
+    virtual const char* activeDOMObjectName() const override final;
+    virtual bool canSuspendForPageCache() const override final;
+
+    const IDBDatabaseInfo& info() const { return m_info; }
+
+    Ref<IDBTransaction> startVersionChangeTransaction(const IDBTransactionInfo&);
+
+private:
+    IDBDatabase(ScriptExecutionContext&, IDBConnectionToServer&, const IDBResultData&);
+
+    Ref<IDBConnectionToServer> m_connection;
+    IDBDatabaseInfo m_info;
+
+    RefPtr<IDBTransaction> m_versionChangeTransaction;
+    HashMap<IDBResourceIdentifier, RefPtr<IDBTransaction>> m_activeTransactions;
+};
+
+} // namespace IDBClient
+} // namespace WebCore
+
+#endif // ENABLE(INDEXED_DATABASE)
+#endif // IDBDatabaseImpl_h
index 0373809..654418c 100644 (file)
 
 #if ENABLE(INDEXED_DATABASE)
 
+#include "IDBDatabaseImpl.h"
 #include "IDBError.h"
 #include "IDBResultData.h"
+#include "IDBTransactionImpl.h"
+#include "IDBVersionChangeEventImpl.h"
 #include "Logging.h"
 
 namespace WebCore {
@@ -59,16 +62,52 @@ IDBOpenDBRequest::~IDBOpenDBRequest()
 {
 }
 
+
+void IDBOpenDBRequest::onError(const IDBResultData& data)
+{
+    m_domError = DOMError::create(data.error().name());
+    enqueueEvent(Event::create(eventNames().errorEvent, true, true));
+}
+
+void IDBOpenDBRequest::onSuccess(const IDBResultData&)
+{
+    // FIXME: Implement
+}
+
+void IDBOpenDBRequest::onUpgradeNeeded(const IDBResultData& resultData)
+{
+    Ref<IDBDatabase> database = IDBDatabase::create(*scriptExecutionContext(), connection(), resultData);
+    Ref<IDBTransaction> transaction = database->startVersionChangeTransaction(resultData.transactionInfo());
+
+    ASSERT(transaction->info().mode() == IndexedDB::TransactionMode::VersionChange);
+
+    uint64_t oldVersion = database->info().version();
+    uint64_t newVersion = transaction->info().newVersion();
+
+    LOG(IndexedDB, "IDBOpenDBRequest::onUpgradeNeeded() - current version is %llu, new is %llu", oldVersion, newVersion);
+
+    m_result = IDBAny::create(WTF::move(database));
+    m_readyState = IDBRequestReadyState::Done;
+    m_transaction = adoptRef(&transaction.leakRef());
+
+    enqueueEvent(IDBVersionChangeEvent::create(oldVersion, newVersion, eventNames().upgradeneededEvent));
+}
+
 void IDBOpenDBRequest::requestCompleted(const IDBResultData& data)
 {
     LOG(IndexedDB, "IDBOpenDBRequest::requestCompleted");
 
-    if (!data.error().isNull()) {
-        LOG(IndexedDB, "  with error: (%s) '%s'", data.error().name().utf8().data(), data.error().message().utf8().data());
-        m_domError = DOMError::create(data.error().name());
-        enqueueEvent(Event::create(eventNames().errorEvent, true, true));
-    } else
-        enqueueEvent(Event::create(eventNames().successEvent, true, true));
+    switch (data.type()) {
+    case IDBResultType::Error:
+        onError(data);
+        break;
+    case IDBResultType::OpenDatabaseSuccess:
+        onSuccess(data);
+        break;
+    case IDBResultType::OpenDatabaseUpgradeNeeded:
+        onUpgradeNeeded(data);
+        break;
+    }
 }
 
 } // namespace IDBClient
index 4d30a46..a6adbcb 100644 (file)
@@ -54,7 +54,11 @@ public:
 
 private:
     IDBOpenDBRequest(IDBConnectionToServer&, ScriptExecutionContext*, const IDBDatabaseIdentifier&, uint64_t version);
-    
+
+    void onError(const IDBResultData&);
+    void onSuccess(const IDBResultData&);
+    void onUpgradeNeeded(const IDBResultData&);
+
     IDBDatabaseIdentifier m_databaseIdentifier;
     uint64_t m_version;
     RefPtr<DOMError> m_domError;
index 05c4a80..664e082 100644 (file)
@@ -37,11 +37,12 @@ namespace IDBClient {
 
 IDBRequest::IDBRequest(IDBConnectionToServer& connection, ScriptExecutionContext* context)
     : IDBOpenDBRequest(context)
+    , m_connection(connection)
     , m_resourceIdentifier(connection)
 {
 }
 
-RefPtr<IDBAny> IDBRequest::result(ExceptionCode&) const
+RefPtr<WebCore::IDBAny> IDBRequest::result(ExceptionCode&) const
 {
     return nullptr;
 }
@@ -56,14 +57,14 @@ RefPtr<DOMError> IDBRequest::error(ExceptionCode&) const
     return nullptr;
 }
 
-RefPtr<IDBAny> IDBRequest::source() const
+RefPtr<WebCore::IDBAny> IDBRequest::source() const
 {
     return nullptr;
 }
 
-RefPtr<IDBTransaction> IDBRequest::transaction() const
+RefPtr<WebCore::IDBTransaction> IDBRequest::transaction() const
 {
-    return nullptr;
+    return m_transaction;
 }
 
 const String& IDBRequest::readyState() const
index 2682c14..331325d 100644 (file)
 
 #if ENABLE(INDEXED_DATABASE)
 
+#include "IDBAnyImpl.h"
 #include "IDBOpenDBRequest.h"
 #include "IDBResourceIdentifier.h"
+#include "IDBTransactionImpl.h"
 #include <wtf/RefCounted.h>
 
 namespace WebCore {
@@ -45,11 +47,11 @@ class IDBRequest : public WebCore::IDBOpenDBRequest, public RefCounted<IDBReques
 public:
     const IDBResourceIdentifier& resourceIdentifier() const { return m_resourceIdentifier; }
 
-    virtual RefPtr<IDBAny> result(ExceptionCode&) const override;
+    virtual RefPtr<WebCore::IDBAny> result(ExceptionCode&) const override;
     virtual unsigned short errorCode(ExceptionCode&) const override;
     virtual RefPtr<DOMError> error(ExceptionCode&) const override;
-    virtual RefPtr<IDBAny> source() const override;
-    virtual RefPtr<IDBTransaction> transaction() const override;
+    virtual RefPtr<WebCore::IDBAny> source() const override;
+    virtual RefPtr<WebCore::IDBTransaction> transaction() const override;
     virtual const String& readyState() const override;
 
     // EventTarget
@@ -60,7 +62,9 @@ public:
     using RefCounted<IDBRequest>::deref;
 
     void enqueueEvent(Ref<Event>&&);
-    
+
+    IDBConnectionToServer& connection() { return m_connection; }
+
 protected:
     IDBRequest(IDBConnectionToServer&, ScriptExecutionContext*);
 
@@ -72,6 +76,12 @@ protected:
     virtual void refEventTarget() override final { RefCounted<IDBRequest>::ref(); }
     virtual void derefEventTarget() override final { RefCounted<IDBRequest>::deref(); }
 
+    IDBRequestReadyState m_readyState { IDBRequestReadyState::Pending };
+    RefPtr<IDBAny> m_result;
+    RefPtr<IDBTransaction> m_transaction;
+
+private:
+    IDBConnectionToServer& m_connection;
     IDBResourceIdentifier m_resourceIdentifier;
 };
 
diff --git a/Source/WebCore/Modules/indexeddb/client/IDBTransactionImpl.cpp b/Source/WebCore/Modules/indexeddb/client/IDBTransactionImpl.cpp
new file mode 100644 (file)
index 0000000..6fb8bdf
--- /dev/null
@@ -0,0 +1,104 @@
+/*
+ * Copyright (C) 2015 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 "IDBTransactionImpl.h"
+
+#if ENABLE(INDEXED_DATABASE)
+
+#include "DOMError.h"
+#include "IDBDatabaseImpl.h"
+#include "IDBObjectStore.h"
+
+namespace WebCore {
+namespace IDBClient {
+
+Ref<IDBTransaction> IDBTransaction::create(IDBDatabase& database, const IDBTransactionInfo& info)
+{
+    return adoptRef(*new IDBTransaction(database, info));
+}
+
+IDBTransaction::IDBTransaction(IDBDatabase& database, const IDBTransactionInfo& info)
+    : WebCore::IDBTransaction(database.scriptExecutionContext())
+    , m_info(info)
+{
+    suspendIfNeeded();
+}
+
+IDBTransaction::~IDBTransaction()
+{
+}
+
+const String& IDBTransaction::mode() const
+{
+    switch (m_info.mode()) {
+    case IndexedDB::TransactionMode::ReadOnly:
+        return IDBTransaction::modeReadOnly();
+    case IndexedDB::TransactionMode::ReadWrite:
+        return IDBTransaction::modeReadWrite();
+    case IndexedDB::TransactionMode::VersionChange:
+        return IDBTransaction::modeVersionChange();
+    }
+
+    RELEASE_ASSERT_NOT_REACHED();
+}
+
+WebCore::IDBDatabase* IDBTransaction::db() const
+{
+    ASSERT_NOT_REACHED();
+    return nullptr;
+}
+
+RefPtr<DOMError> IDBTransaction::error() const
+{
+    ASSERT_NOT_REACHED();
+    return nullptr;
+}
+
+RefPtr<IDBObjectStore> IDBTransaction::objectStore(const String&, ExceptionCode&)
+{
+    ASSERT_NOT_REACHED();
+    return nullptr;
+}
+
+void IDBTransaction::abort(ExceptionCode&)
+{
+    ASSERT_NOT_REACHED();
+}
+
+const char* IDBTransaction::activeDOMObjectName() const
+{
+    return "IDBTransaction";
+}
+
+bool IDBTransaction::canSuspendForPageCache() const
+{
+    return false;
+}
+
+} // namespace IDBClient
+} // namespace WebCore
+
+#endif // ENABLE(INDEXED_DATABASE)
diff --git a/Source/WebCore/Modules/indexeddb/client/IDBTransactionImpl.h b/Source/WebCore/Modules/indexeddb/client/IDBTransactionImpl.h
new file mode 100644 (file)
index 0000000..d55a0d6
--- /dev/null
@@ -0,0 +1,72 @@
+/*
+ * Copyright (C) 2015 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 IDBTransactionImpl_h
+#define IDBTransactionImpl_h
+
+#if ENABLE(INDEXED_DATABASE)
+
+#include "IDBTransaction.h"
+#include "IDBTransactionInfo.h"
+
+namespace WebCore {
+namespace IDBClient {
+
+class IDBDatabase;
+
+class IDBTransaction : public WebCore::IDBTransaction {
+public:
+    static Ref<IDBTransaction> create(IDBDatabase&, const IDBTransactionInfo&);
+
+    virtual ~IDBTransaction() override final;
+
+    // IDBTransaction IDL
+    virtual const String& mode() const override final;
+    virtual WebCore::IDBDatabase* db() const override final;
+    virtual RefPtr<DOMError> error() const override final;
+    virtual RefPtr<IDBObjectStore> objectStore(const String& name, ExceptionCode&) override final;
+    virtual void abort(ExceptionCode&) override final;
+
+    virtual EventTargetInterface eventTargetInterface() const override final { return IDBTransactionEventTargetInterfaceType; }
+    virtual ScriptExecutionContext* scriptExecutionContext() const override final { return ActiveDOMObject::scriptExecutionContext(); }
+    virtual void refEventTarget() override final { ref(); }
+    virtual void derefEventTarget() override final { deref(); }
+
+    virtual const char* activeDOMObjectName() const override final;
+    virtual bool canSuspendForPageCache() const override final;
+
+    const IDBTransactionInfo info() const { return m_info; }
+
+private:
+    IDBTransaction(IDBDatabase&, const IDBTransactionInfo&);
+
+    IDBTransactionInfo m_info;
+};
+
+} // namespace IDBClient
+} // namespace WebCore
+
+#endif // ENABLE(INDEXED_DATABASE)
+#endif // IDBTransactionImpl_h
diff --git a/Source/WebCore/Modules/indexeddb/client/IDBVersionChangeEventImpl.cpp b/Source/WebCore/Modules/indexeddb/client/IDBVersionChangeEventImpl.cpp
new file mode 100644 (file)
index 0000000..d526622
--- /dev/null
@@ -0,0 +1,49 @@
+/*
+ * Copyright (C) 2015 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 "IDBVersionChangeEventImpl.h"
+
+#if ENABLE(INDEXED_DATABASE)
+
+namespace WebCore {
+namespace IDBClient {
+
+IDBVersionChangeEvent::IDBVersionChangeEvent(uint64_t oldVersion, uint64_t newVersion, const AtomicString& eventType)
+    : WebCore::IDBVersionChangeEvent(eventType)
+    , m_oldVersion(oldVersion)
+    , m_newVersion(newVersion)
+{
+}
+
+EventInterface IDBVersionChangeEvent::eventInterface() const
+{
+    return IDBVersionChangeEventInterfaceType;
+}
+
+} // namespace IDBClient
+} // namespace WebCore
+
+#endif // ENABLE(INDEXED_DATABASE)
diff --git a/Source/WebCore/Modules/indexeddb/client/IDBVersionChangeEventImpl.h b/Source/WebCore/Modules/indexeddb/client/IDBVersionChangeEventImpl.h
new file mode 100644 (file)
index 0000000..d6c5a00
--- /dev/null
@@ -0,0 +1,59 @@
+/*
+ * Copyright (C) 2015 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 IDBVersionChangeEventImpl_h
+#define IDBVersionChangeEventImpl_h
+
+#if ENABLE(INDEXED_DATABASE)
+
+#include "IDBVersionChangeEvent.h"
+
+namespace WebCore {
+namespace IDBClient {
+
+class IDBVersionChangeEvent : public WebCore::IDBVersionChangeEvent {
+public:
+    static Ref<IDBVersionChangeEvent> create(uint64_t oldVersion = 0, uint64_t newVersion = 0, const AtomicString& eventType = AtomicString())
+    {
+        return adoptRef(*new IDBVersionChangeEvent(oldVersion, newVersion, eventType));
+    }
+
+    virtual uint64_t oldVersion() const override final { return m_oldVersion; }
+    virtual uint64_t newVersion() const override final { return m_newVersion; }
+
+    virtual EventInterface eventInterface() const override final;
+
+private:
+    IDBVersionChangeEvent(uint64_t oldVersion, uint64_t newVersion, const AtomicString& eventType);
+
+    uint64_t m_oldVersion { 0 };
+    uint64_t m_newVersion { 0 };
+};
+
+} // namespace IDBClient
+} // namespace WebCore
+
+#endif // ENABLE(INDEXED_DATABASE)
+#endif // IDBVersionChangeEventImpl_h
index 732eb3c..1137e5e 100644 (file)
@@ -83,7 +83,7 @@ public:
 
     bool isClosePending() const { return m_closePending; }
     void forceClose();
-    virtual const IDBDatabaseMetadata metadata() const override final { return m_metadata; }
+    const IDBDatabaseMetadata metadata() const { return m_metadata; }
     void enqueueEvent(PassRefPtr<Event>);
 
     using EventTarget::dispatchEvent;
index 5d02a12..eed8245 100644 (file)
@@ -28,6 +28,8 @@
 
 #if ENABLE(INDEXED_DATABASE)
 
+#include "UniqueIDBDatabaseConnection.h"
+
 namespace WebCore {
 namespace IDBServer {
 
@@ -56,6 +58,11 @@ void IDBConnectionToClient::didOpenDatabase(const IDBResultData& result)
     m_delegate->didOpenDatabase(result);
 }
 
+void IDBConnectionToClient::fireVersionChangeEvent(UniqueIDBDatabaseConnection& connection, uint64_t requestedVersion)
+{
+    m_delegate->fireVersionChangeEvent(connection, requestedVersion);
+}
+
 } // namespace IDBServer
 } // namespace WebCore
 
index 7555074..876cb63 100644 (file)
@@ -38,6 +38,8 @@ class IDBResultData;
 
 namespace IDBServer {
 
+class UniqueIDBDatabaseConnection;
+
 class IDBConnectionToClient : public RefCounted<IDBConnectionToClient> {
 public:
     static Ref<IDBConnectionToClient> create(IDBConnectionToClientDelegate&);
@@ -46,7 +48,9 @@ public:
 
     void didDeleteDatabase(const IDBResultData&);
     void didOpenDatabase(const IDBResultData&);
-    
+
+    void fireVersionChangeEvent(UniqueIDBDatabaseConnection&, uint64_t requestedVersion);
+
 private:
     IDBConnectionToClient(IDBConnectionToClientDelegate&);
     
index b2b4b5c..7418fab 100644 (file)
@@ -34,6 +34,8 @@ class IDBResultData;
 
 namespace IDBServer {
 
+class UniqueIDBDatabaseConnection;
+
 class IDBConnectionToClientDelegate {
 public:
     virtual ~IDBConnectionToClientDelegate() { }
@@ -43,6 +45,8 @@ public:
     virtual void didDeleteDatabase(const IDBResultData&) = 0;
     virtual void didOpenDatabase(const IDBResultData&) = 0;
 
+    virtual void fireVersionChangeEvent(UniqueIDBDatabaseConnection&, uint64_t requestedVersion) = 0;
+
     virtual void ref() = 0;
     virtual void deref() = 0;
 };
index 61f487f..1116a10 100644 (file)
@@ -63,6 +63,18 @@ void IDBServer::unregisterConnection(IDBConnectionToClient& connection)
     m_connectionMap.remove(connection.identifier());
 }
 
+void IDBServer::registerDatabaseConnection(UniqueIDBDatabaseConnection& connection)
+{
+    ASSERT(!m_databaseConnections.contains(connection.identifier()));
+    m_databaseConnections.set(connection.identifier(), &connection);
+}
+
+void IDBServer::unregisterDatabaseConnection(UniqueIDBDatabaseConnection& connection)
+{
+    ASSERT(m_databaseConnections.contains(connection.identifier()));
+    m_databaseConnections.remove(connection.identifier());
+}
+
 UniqueIDBDatabase& IDBServer::getOrCreateUniqueIDBDatabase(const IDBDatabaseIdentifier& identifier)
 {
     auto uniqueIDBDatabase = m_uniqueIDBDatabaseMap.add(identifier, nullptr);
@@ -112,7 +124,7 @@ void IDBServer::deleteDatabase(const IDBRequestData& requestData)
     
     // FIXME: During bringup of modern IDB, the database deletion is a no-op, and is
     // immediately reported back to the WebProcess as failure.
-    IDBResultData result(requestData.requestIdentifier(), IDBError(IDBExceptionCode::Unknown));
+    auto result = IDBResultData::error(requestData.requestIdentifier(), IDBError(IDBExceptionCode::Unknown));
     connection->didDeleteDatabase(result);
 }
 
index 3e1e6d1..ca0340a 100644 (file)
@@ -32,6 +32,7 @@
 #include "IDBConnectionToClient.h"
 #include "IDBDatabaseIdentifier.h"
 #include "UniqueIDBDatabase.h"
+#include "UniqueIDBDatabaseConnection.h"
 #include <wtf/HashMap.h>
 #include <wtf/Lock.h>
 #include <wtf/MessageQueue.h>
@@ -60,6 +61,9 @@ public:
     void postDatabaseTask(std::unique_ptr<CrossThreadTask>&&);
     void postDatabaseTaskReply(std::unique_ptr<CrossThreadTask>&&);
 
+    void registerDatabaseConnection(UniqueIDBDatabaseConnection&);
+    void unregisterDatabaseConnection(UniqueIDBDatabaseConnection&);
+
     std::unique_ptr<IDBBackingStore> createBackingStore(const IDBDatabaseIdentifier&);
 
 private:
@@ -81,6 +85,8 @@ private:
 
     MessageQueue<CrossThreadTask> m_databaseQueue;
     MessageQueue<CrossThreadTask> m_databaseReplyQueue;
+
+    HashMap<uint64_t, UniqueIDBDatabaseConnection*> m_databaseConnections;
 };
 
 } // namespace IDBServer
index 21257e7..9716334 100644 (file)
@@ -31,6 +31,7 @@
 #include "IDBResultData.h"
 #include "IDBServer.h"
 #include "Logging.h"
+#include "UniqueIDBDatabaseConnection.h"
 #include <wtf/MainThread.h>
 #include <wtf/ThreadSafeRefCounted.h>
 
@@ -43,6 +44,12 @@ UniqueIDBDatabase::UniqueIDBDatabase(IDBServer& server, const IDBDatabaseIdentif
 {
 }
 
+const IDBDatabaseInfo& UniqueIDBDatabase::info() const
+{
+    RELEASE_ASSERT(m_databaseInfo);
+    return *m_databaseInfo;
+}
+
 void UniqueIDBDatabase::openDatabaseConnection(IDBConnectionToClient& connection, const IDBRequestData& requestData)
 {
     auto operation = IDBServerOperation::create(connection, requestData);
@@ -63,13 +70,105 @@ void UniqueIDBDatabase::handleOpenDatabaseOperations()
 
     auto operation = m_pendingOpenDatabaseOperations.takeFirst();
 
-    // FIXME: Reporting open operations as failures for now.
-    // Creating database connections for success will be the next step.
+    // 3.3.1 Opening a database
+    // If requested version is undefined, then let requested version be 1 if db was created in the previous step,
+    // or the current version of db otherwise.
+    uint64_t requestedVersion = operation->requestData().requestedVersion();
+    if (!requestedVersion)
+        requestedVersion = m_databaseInfo->version() ? m_databaseInfo->version() : 1;
+
+    // 3.3.1 Opening a database
+    // If the database version higher than the requested version, abort these steps and return a VersionError.
+    if (requestedVersion < m_databaseInfo->version()) {
+        auto result = IDBResultData::error(operation->requestData().requestIdentifier(), IDBError(IDBExceptionCode::VersionError));
+        operation->connection().didOpenDatabase(result);
+        return;
+    }
+
+    Ref<UniqueIDBDatabaseConnection> connection = UniqueIDBDatabaseConnection::create(*this, operation->connection());
+    UniqueIDBDatabaseConnection* rawConnection = &connection.get();
+    m_server.registerDatabaseConnection(*rawConnection);
+
+    if (requestedVersion == m_databaseInfo->version()) {
+        addOpenDatabaseConnection(WTF::move(connection));
+
+        auto result = IDBResultData::openDatabaseSuccess(operation->requestData().requestIdentifier(), *rawConnection);
+        operation->connection().didOpenDatabase(result);
+        return;
+    }
+
+    ASSERT(!m_versionChangeOperation);
+    ASSERT(!m_versionChangeDatabaseConnection);
+
+    m_versionChangeOperation = adoptRef(operation.leakRef());
+    m_versionChangeDatabaseConnection = rawConnection;
+
+    // 3.3.7 "versionchange" transaction steps
+    // If there's no other open connections to this database, the version change process can begin immediately.
+    if (!hasAnyOpenConnections()) {
+        startVersionChangeTransaction();
+        return;
+    }
+
+    // Otherwise we have to notify all those open connections and wait for them to close.
+    notifyConnectionsOfVersionChange();
+}
+
+bool UniqueIDBDatabase::hasAnyOpenConnections() const
+{
+    return !m_openDatabaseConnections.isEmpty();
+}
+
+void UniqueIDBDatabase::startVersionChangeTransaction()
+{
+    LOG(IndexedDB, "(main) UniqueIDBDatabase::startVersionChangeTransaction");
+
+    ASSERT(!m_versionChangeTransaction);
+    ASSERT(m_versionChangeOperation);
+    ASSERT(m_versionChangeDatabaseConnection);
+
+    auto operation = m_versionChangeOperation;
+    m_versionChangeOperation = nullptr;
 
-    IDBResultData result(operation->requestData().requestIdentifier(), IDBError(IDBExceptionCode::Unknown));
+    uint64_t requestedVersion = operation->requestData().requestedVersion();
+    if (!requestedVersion)
+        requestedVersion = m_databaseInfo->version() ? m_databaseInfo->version() : 1;
+
+    addOpenDatabaseConnection(*m_versionChangeDatabaseConnection);
+
+    m_versionChangeTransaction = m_versionChangeDatabaseConnection->createVersionChangeTransaction(requestedVersion);
+    m_inProgressTransactions.set(m_versionChangeTransaction->info().identifier(), m_versionChangeTransaction);
+
+    auto result = IDBResultData::openDatabaseUpgradeNeeded(operation->requestData().requestIdentifier(), *m_versionChangeTransaction);
     operation->connection().didOpenDatabase(result);
 }
 
+void UniqueIDBDatabase::notifyConnectionsOfVersionChange()
+{
+    ASSERT(m_versionChangeOperation);
+    ASSERT(m_versionChangeDatabaseConnection);
+
+    uint64_t requestedVersion = m_versionChangeOperation->requestData().requestedVersion();
+
+    LOG(IndexedDB, "(main) UniqueIDBDatabase::notifyConnectionsOfVersionChange - %llu", requestedVersion);
+
+    // 3.3.7 "versionchange" transaction steps
+    // Fire a versionchange event at each connection in m_openDatabaseConnections that is open.
+    // The event must not be fired on connections which has the closePending flag set.
+    for (auto connection : m_openDatabaseConnections) {
+        if (connection->closePending())
+            continue;
+
+        connection->fireVersionChangeEvent(requestedVersion);
+    }
+}
+
+void UniqueIDBDatabase::addOpenDatabaseConnection(Ref<UniqueIDBDatabaseConnection>&& connection)
+{
+    ASSERT(!m_openDatabaseConnections.contains(&connection.get()));
+    m_openDatabaseConnections.add(adoptRef(connection.leakRef()));
+}
+
 void UniqueIDBDatabase::openBackingStore(const IDBDatabaseIdentifier& identifier)
 {
     ASSERT(!isMainThread());
index 6bb632d..8c48715 100644 (file)
 #include "IDBDatabaseIdentifier.h"
 #include "IDBDatabaseInfo.h"
 #include "IDBServerOperation.h"
+#include "UniqueIDBDatabaseConnection.h"
+#include "UniqueIDBDatabaseTransaction.h"
 #include <wtf/Deque.h>
+#include <wtf/HashSet.h>
 #include <wtf/Ref.h>
 #include <wtf/ThreadSafeRefCounted.h>
 
@@ -54,10 +57,17 @@ public:
 
     void openDatabaseConnection(IDBConnectionToClient&, const IDBRequestData&);
 
+    const IDBDatabaseInfo& info() const;
+
 private:
     UniqueIDBDatabase(IDBServer&, const IDBDatabaseIdentifier&);
     
     void handleOpenDatabaseOperations();
+    void addOpenDatabaseConnection(Ref<UniqueIDBDatabaseConnection>&&);
+    bool hasAnyOpenConnections() const;
+
+    void startVersionChangeTransaction();
+    void notifyConnectionsOfVersionChange();
     
     // Database thread operations
     void openBackingStore(const IDBDatabaseIdentifier&);
@@ -69,7 +79,15 @@ private:
     IDBDatabaseIdentifier m_identifier;
     
     Deque<Ref<IDBServerOperation>> m_pendingOpenDatabaseOperations;
-    
+
+    HashSet<RefPtr<UniqueIDBDatabaseConnection>> m_openDatabaseConnections;
+
+    RefPtr<IDBServerOperation> m_versionChangeOperation;
+    RefPtr<UniqueIDBDatabaseConnection> m_versionChangeDatabaseConnection;
+
+    RefPtr<UniqueIDBDatabaseTransaction> m_versionChangeTransaction;
+    HashMap<IDBResourceIdentifier, RefPtr<UniqueIDBDatabaseTransaction>> m_inProgressTransactions;
+
     std::unique_ptr<IDBBackingStore> m_backingStore;
     std::unique_ptr<IDBDatabaseInfo> m_databaseInfo;
 };
diff --git a/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabaseConnection.cpp b/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabaseConnection.cpp
new file mode 100644 (file)
index 0000000..27468c6
--- /dev/null
@@ -0,0 +1,78 @@
+/*
+ * Copyright (C) 2015 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 "UniqueIDBDatabaseConnection.h"
+
+#if ENABLE(INDEXED_DATABASE)
+
+#include "IDBConnectionToClient.h"
+#include "IDBTransactionInfo.h"
+#include "Logging.h"
+
+namespace WebCore {
+namespace IDBServer {
+
+static uint64_t nextDatabaseConnectionIdentifier()
+{
+    static uint64_t nextIdentifier = 0;
+    return ++nextIdentifier;
+}
+
+Ref<UniqueIDBDatabaseConnection> UniqueIDBDatabaseConnection::create(UniqueIDBDatabase& database, IDBConnectionToClient& connection)
+{
+    return adoptRef(*new UniqueIDBDatabaseConnection(database, connection));
+}
+
+UniqueIDBDatabaseConnection::UniqueIDBDatabaseConnection(UniqueIDBDatabase& database, IDBConnectionToClient& connection)
+    : m_identifier(nextDatabaseConnectionIdentifier())
+    , m_database(database)
+    , m_connectionToClient(connection)
+{
+}
+
+void UniqueIDBDatabaseConnection::fireVersionChangeEvent(uint64_t requestedVersion)
+{
+    ASSERT(!m_closePending);
+    m_connectionToClient.fireVersionChangeEvent(*this, requestedVersion);
+}
+
+Ref<UniqueIDBDatabaseTransaction> UniqueIDBDatabaseConnection::createVersionChangeTransaction(uint64_t newVersion)
+{
+    LOG(IndexedDB, "UniqueIDBDatabaseConnection::createVersionChangeTransaction");
+    ASSERT(!m_closePending);
+
+    IDBTransactionInfo info = IDBTransactionInfo::versionChange(m_connectionToClient, newVersion);
+
+    Ref<UniqueIDBDatabaseTransaction> transaction = UniqueIDBDatabaseTransaction::create(*this, info);
+    m_transactionMap.set(transaction->info().identifier(), &transaction.get());
+
+    return WTF::move(transaction);
+}
+
+} // namespace IDBServer
+} // namespace WebCore
+
+#endif // ENABLE(INDEXED_DATABASE)
diff --git a/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabaseConnection.h b/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabaseConnection.h
new file mode 100644 (file)
index 0000000..ff735ee
--- /dev/null
@@ -0,0 +1,72 @@
+/*
+ * Copyright (C) 2015 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 UniqueIDBDatabaseConnection_h
+#define UniqueIDBDatabaseConnection_h
+
+#if ENABLE(INDEXED_DATABASE)
+
+#include "UniqueIDBDatabaseTransaction.h"
+#include <wtf/HashMap.h>
+#include <wtf/Ref.h>
+#include <wtf/RefCounted.h>
+
+namespace WebCore {
+namespace IDBServer {
+
+class IDBConnectionToClient;
+class UniqueIDBDatabase;
+class UniqueIDBDatabaseTransaction;
+
+class UniqueIDBDatabaseConnection : public RefCounted<UniqueIDBDatabaseConnection> {
+public:
+    static Ref<UniqueIDBDatabaseConnection> create(UniqueIDBDatabase&, IDBConnectionToClient&);
+
+    uint64_t identifier() const { return m_identifier; }
+    UniqueIDBDatabase& database() { return m_database; }
+    IDBConnectionToClient& connectionToClient() { return m_connectionToClient; }
+
+    bool closePending() const { return m_closePending; }
+
+    void fireVersionChangeEvent(uint64_t requestedVersion);
+    Ref<UniqueIDBDatabaseTransaction> createVersionChangeTransaction(uint64_t newVersion);
+
+private:
+    UniqueIDBDatabaseConnection(UniqueIDBDatabase&, IDBConnectionToClient&);
+
+    uint64_t m_identifier { 0 };
+    UniqueIDBDatabase& m_database;
+    IDBConnectionToClient& m_connectionToClient;
+
+    bool m_closePending { false };
+
+    HashMap<IDBResourceIdentifier, RefPtr<UniqueIDBDatabaseTransaction>> m_transactionMap;
+};
+
+} // namespace IDBServer
+} // namespace WebCore
+
+#endif // ENABLE(INDEXED_DATABASE)
+#endif // UniqueIDBDatabaseConnection_h
diff --git a/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabaseTransaction.cpp b/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabaseTransaction.cpp
new file mode 100644 (file)
index 0000000..473a62d
--- /dev/null
@@ -0,0 +1,48 @@
+/*
+ * Copyright (C) 2015 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 "UniqueIDBDatabaseTransaction.h"
+
+#if ENABLE(INDEXED_DATABASE)
+
+namespace WebCore {
+namespace IDBServer {
+
+Ref<UniqueIDBDatabaseTransaction> UniqueIDBDatabaseTransaction::create(UniqueIDBDatabaseConnection& connection, IDBTransactionInfo& info)
+{
+    return adoptRef(*new UniqueIDBDatabaseTransaction(connection, info));
+}
+
+UniqueIDBDatabaseTransaction::UniqueIDBDatabaseTransaction(UniqueIDBDatabaseConnection& connection, IDBTransactionInfo& info)
+    : m_databaseConnection(connection)
+    , m_transactionInfo(info)
+{
+}
+
+} // namespace IDBServer
+} // namespace WebCore
+
+#endif // ENABLE(INDEXED_DATABASE)
diff --git a/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabaseTransaction.h b/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabaseTransaction.h
new file mode 100644 (file)
index 0000000..653431a
--- /dev/null
@@ -0,0 +1,59 @@
+/*
+ * Copyright (C) 2015 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 UniqueIDBDatabaseTransaction_h
+#define UniqueIDBDatabaseTransaction_h
+
+#if ENABLE(INDEXED_DATABASE)
+
+#include "IDBTransactionInfo.h"
+#include "UniqueIDBDatabaseConnection.h"
+#include <wtf/Ref.h>
+#include <wtf/RefCounted.h>
+
+namespace WebCore {
+namespace IDBServer {
+
+class UniqueIDBDatabaseConnection;
+
+class UniqueIDBDatabaseTransaction : public RefCounted<UniqueIDBDatabaseTransaction> {
+public:
+    static Ref<UniqueIDBDatabaseTransaction> create(UniqueIDBDatabaseConnection&, IDBTransactionInfo&);
+
+    UniqueIDBDatabaseConnection& databaseConnection() { return m_databaseConnection.get(); }
+    const IDBTransactionInfo& info() const { return m_transactionInfo; }
+
+private:
+    UniqueIDBDatabaseTransaction(UniqueIDBDatabaseConnection&, IDBTransactionInfo&);
+
+    Ref<UniqueIDBDatabaseConnection> m_databaseConnection;
+    IDBTransactionInfo m_transactionInfo;
+};
+
+} // namespace IDBServer
+} // namespace WebCore
+
+#endif // ENABLE(INDEXED_DATABASE)
+#endif // UniqueIDBDatabaseTransaction_h
index aa72b57..39b4604 100644 (file)
 
 namespace WebCore {
 
+IDBDatabaseInfo::IDBDatabaseInfo()
+{
+}
+
 IDBDatabaseInfo::IDBDatabaseInfo(const String& name, uint64_t version)
     : m_name(name)
     , m_version(version)
index 687f59f..4e5859a 100644 (file)
@@ -38,10 +38,11 @@ public:
 
     IDBDatabaseInfo isolatedCopy() const;
 
+    const String& name() const { return m_name; }
+    uint64_t version() const { return m_version; }
+
 private:
-    IDBDatabaseInfo()
-    {
-    }
+    IDBDatabaseInfo();
 
     String m_name;
     uint64_t m_version { 0 };
index ef5c134..b2d723a 100644 (file)
@@ -34,7 +34,8 @@ namespace WebCore {
 
 enum class IDBExceptionCode {
     None = 0,
-    Unknown = 1,
+    Unknown,
+    VersionError,
 };
 
 class IDBError {
index ee3e12c..1d6654d 100644 (file)
@@ -36,9 +36,15 @@ namespace WebCore {
 IDBRequestData::IDBRequestData(const IDBClient::IDBConnectionToServer& connection, const IDBClient::IDBOpenDBRequest& request)
     : m_requestIdentifier(connection, request)
     , m_databaseIdentifier(request.databaseIdentifier())
+    , m_requestedVersion(request.version())
 {
 }
 
+uint64_t IDBRequestData::requestedVersion() const
+{
+    return m_requestedVersion;
+}
+
 } // namespace WebCore
 
 #endif // ENABLE(INDEXED_DATABASE)
index baa6bb5..a1f802a 100644 (file)
@@ -45,9 +45,13 @@ public:
     IDBResourceIdentifier requestIdentifier() const { return m_requestIdentifier; }
     const IDBDatabaseIdentifier& databaseIdentifier() const { return m_databaseIdentifier; }
 
+    uint64_t requestedVersion() const;
+
 private:
     IDBResourceIdentifier m_requestIdentifier;
     IDBDatabaseIdentifier m_databaseIdentifier;
+
+    uint64_t m_requestedVersion;
 };
 
 } // namespace WebCore
index b0d25ce..1971247 100644 (file)
 
 #if ENABLE(INDEXED_DATABASE)
 
+#include "IDBConnectionToClient.h"
 #include "IDBConnectionToServer.h"
 #include "IDBRequestImpl.h"
 #include <wtf/MainThread.h>
 
 namespace WebCore {
 
-static uint64_t nextResourceNumber()
+static uint64_t nextClientResourceNumber()
+{
+    ASSERT(isMainThread());
+    static uint64_t currentNumber = 1;
+    return currentNumber += 2;
+}
+
+static uint64_t nextServerResourceNumber()
 {
     ASSERT(isMainThread());
     static uint64_t currentNumber = 0;
-    return ++currentNumber;
+    return currentNumber += 2;
 }
 
-IDBResourceIdentifier::IDBResourceIdentifier()
-    : m_resourceNumber(nextResourceNumber())
+IDBResourceIdentifier::IDBResourceIdentifier(uint64_t connectionIdentifier, uint64_t resourceIdentifier)
+    : m_idbConnectionIdentifier(connectionIdentifier)
+    , m_resourceNumber(resourceIdentifier)
 {
 }
 
 IDBResourceIdentifier::IDBResourceIdentifier(const IDBClient::IDBConnectionToServer& connection)
     : m_idbConnectionIdentifier(connection.identifier())
-    , m_resourceNumber(nextResourceNumber())
+    , m_resourceNumber(nextClientResourceNumber())
 {
 }
 
@@ -58,20 +67,20 @@ IDBResourceIdentifier::IDBResourceIdentifier(const IDBClient::IDBConnectionToSer
 {
 }
 
+IDBResourceIdentifier::IDBResourceIdentifier(const IDBServer::IDBConnectionToClient& connection)
+    : m_idbConnectionIdentifier(connection.identifier())
+    , m_resourceNumber(nextServerResourceNumber())
+{
+}
+
 IDBResourceIdentifier IDBResourceIdentifier::emptyValue()
 {
-    IDBResourceIdentifier result;
-    result.m_idbConnectionIdentifier = 0;
-    result.m_resourceNumber = 0;
-    return WTF::move(result);
+    return IDBResourceIdentifier(0, 0);
 }
 
 IDBResourceIdentifier IDBResourceIdentifier::deletedValue()
 {
-    IDBResourceIdentifier result;
-    result.m_idbConnectionIdentifier = std::numeric_limits<uint64_t>::max();
-    result.m_resourceNumber = std::numeric_limits<uint64_t>::max();
-    return WTF::move(result);
+    return IDBResourceIdentifier(std::numeric_limits<uint64_t>::max(), std::numeric_limits<uint64_t>::max());
 }
 
 bool IDBResourceIdentifier::isHashTableDeletedValue() const
index c38d1f2..d87c4ca 100644 (file)
@@ -37,10 +37,15 @@ class IDBConnectionToServer;
 class IDBRequest;
 }
 
+namespace IDBServer {
+class IDBConnectionToClient;
+}
+
 class IDBResourceIdentifier {
 public:
-    IDBResourceIdentifier(const IDBClient::IDBConnectionToServer&);
+    explicit IDBResourceIdentifier(const IDBClient::IDBConnectionToServer&);
     IDBResourceIdentifier(const IDBClient::IDBConnectionToServer&, const IDBClient::IDBRequest&);
+    explicit IDBResourceIdentifier(const IDBServer::IDBConnectionToClient&);
 
     static IDBResourceIdentifier deletedValue();
     bool isHashTableDeletedValue() const;
@@ -66,9 +71,10 @@ public:
     uint64_t connectionIdentifier() const { return m_idbConnectionIdentifier; }
     
 private:
-    IDBResourceIdentifier();
+    IDBResourceIdentifier() = delete;
+    IDBResourceIdentifier(uint64_t connectionIdentifier, uint64_t resourceIdentifier);
     uint64_t m_idbConnectionIdentifier { 0 };
-    uint64_t m_resourceNumber;
+    uint64_t m_resourceNumber { 0 };
 };
 
 struct IDBResourceIdentifierHash {
index 57e8d60..45f90ac 100644 (file)
 
 #if ENABLE(INDEXED_DATABASE)
 
+#include "UniqueIDBDatabase.h"
+#include "UniqueIDBDatabaseConnection.h"
+#include "UniqueIDBDatabaseTransaction.h"
+
 namespace WebCore {
 
-IDBResultData::IDBResultData(const IDBResourceIdentifier& requestIdentifier, const IDBError& error)
+IDBResultData::IDBResultData(const IDBResourceIdentifier& requestIdentifier)
     : m_requestIdentifier(requestIdentifier)
-    , m_error(error)
 {
 }
 
+IDBResultData::IDBResultData(const IDBResultData& other)
+    : m_type(other.m_type)
+    , m_requestIdentifier(other.m_requestIdentifier)
+    , m_error(other.m_error)
+    , m_databaseConnectionIdentifier(other.m_databaseConnectionIdentifier)
+{
+    if (other.m_databaseInfo)
+        m_databaseInfo = std::make_unique<IDBDatabaseInfo>(*other.m_databaseInfo);
+    if (other.m_transactionInfo)
+        m_transactionInfo = std::make_unique<IDBTransactionInfo>(*other.m_transactionInfo);
+}
+
+IDBResultData IDBResultData::error(const IDBResourceIdentifier& requestIdentifier, const IDBError& error)
+{
+    IDBResultData result(requestIdentifier);
+    result.m_type = IDBResultType::Error;
+    result.m_error = error;
+    return WTF::move(result);
+}
+
+IDBResultData IDBResultData::openDatabaseSuccess(const IDBResourceIdentifier& requestIdentifier, IDBServer::UniqueIDBDatabaseConnection& connection)
+{
+    IDBResultData result(requestIdentifier);
+    result.m_type = IDBResultType::OpenDatabaseSuccess;
+    result.m_databaseConnectionIdentifier = connection.identifier();
+    result.m_databaseInfo = std::make_unique<IDBDatabaseInfo>(connection.database().info());
+    return WTF::move(result);
+}
+
+
+IDBResultData IDBResultData::openDatabaseUpgradeNeeded(const IDBResourceIdentifier& requestIdentifier, IDBServer::UniqueIDBDatabaseTransaction& transaction)
+{
+    IDBResultData result(requestIdentifier);
+    result.m_type = IDBResultType::OpenDatabaseUpgradeNeeded;
+    result.m_databaseConnectionIdentifier = transaction.databaseConnection().identifier();
+    result.m_databaseInfo = std::make_unique<IDBDatabaseInfo>(transaction.databaseConnection().database().info());
+    result.m_transactionInfo = std::make_unique<IDBTransactionInfo>(transaction.info());
+    return WTF::move(result);
+}
+
+const IDBDatabaseInfo& IDBResultData::databaseInfo() const
+{
+    RELEASE_ASSERT(m_databaseInfo);
+    return *m_databaseInfo;
+}
+
+const IDBTransactionInfo& IDBResultData::transactionInfo() const
+{
+    RELEASE_ASSERT(m_transactionInfo);
+    return *m_transactionInfo;
+}
+
 } // namespace WebCore
 
 #endif // ENABLE(INDEXED_DATABASE)
index 8256780..5ed7032 100644 (file)
 
 #if ENABLE(INDEXED_DATABASE)
 
+#include "IDBDatabaseInfo.h"
 #include "IDBError.h"
 #include "IDBResourceIdentifier.h"
+#include "IDBTransactionInfo.h"
 
 namespace WebCore {
 
 class IDBResourceIdentifier;
 
+namespace IDBServer {
+class UniqueIDBDatabaseConnection;
+class UniqueIDBDatabaseTransaction;
+}
+
+enum class IDBResultType {
+    Error,
+    OpenDatabaseSuccess,
+    OpenDatabaseUpgradeNeeded,
+};
+
 class IDBResultData {
 public:
-    IDBResultData(const IDBResourceIdentifier&, const IDBError&);
+    static IDBResultData error(const IDBResourceIdentifier&, const IDBError&);
+    static IDBResultData openDatabaseSuccess(const IDBResourceIdentifier&, IDBServer::UniqueIDBDatabaseConnection&);
+    static IDBResultData openDatabaseUpgradeNeeded(const IDBResourceIdentifier&, IDBServer::UniqueIDBDatabaseTransaction&);
+    IDBResultData(const IDBResultData&);
 
+    IDBResultType type() const { return m_type; }
     IDBResourceIdentifier requestIdentifier() const { return m_requestIdentifier; }
-    
+
     const IDBError& error() const { return m_error; }
-    
+    uint64_t databaseConnectionIdentifier() const { return m_databaseConnectionIdentifier; }
+
+    const IDBDatabaseInfo& databaseInfo() const;
+    const IDBTransactionInfo& transactionInfo() const;
+
 private:
+    IDBResultData(const IDBResourceIdentifier&);
+
+    IDBResultType m_type;
     IDBResourceIdentifier m_requestIdentifier;
+
     IDBError m_error;
+    uint64_t m_databaseConnectionIdentifier { 0 };
+    std::unique_ptr<IDBDatabaseInfo> m_databaseInfo;
+    std::unique_ptr<IDBTransactionInfo> m_transactionInfo;
 };
 
 } // namespace WebCore
diff --git a/Source/WebCore/Modules/indexeddb/shared/IDBTransactionInfo.cpp b/Source/WebCore/Modules/indexeddb/shared/IDBTransactionInfo.cpp
new file mode 100644 (file)
index 0000000..75a46e6
--- /dev/null
@@ -0,0 +1,58 @@
+/*
+ * Copyright (C) 2015 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 "IDBTransactionInfo.h"
+
+#if ENABLE(INDEXED_DATABASE)
+
+namespace WebCore {
+
+IDBTransactionInfo::IDBTransactionInfo(const IDBResourceIdentifier& identifier)
+    : m_identifier(identifier)
+{
+}
+
+IDBTransactionInfo IDBTransactionInfo::versionChange(const IDBServer::IDBConnectionToClient& connection, uint64_t newVersion)
+{
+    IDBTransactionInfo result((IDBResourceIdentifier(connection)));
+    result.m_mode = IndexedDB::TransactionMode::VersionChange;
+    result.m_newVersion = newVersion;
+
+    return WTF::move(result);
+}
+
+IDBTransactionInfo IDBTransactionInfo::isolatedCopy() const
+{
+    IDBTransactionInfo result(m_identifier);
+    result.m_mode = m_mode;
+    result.m_newVersion = m_newVersion;
+
+    return WTF::move(result);
+}
+
+} // namespace WebCore
+
+#endif // ENABLE(INDEXED_DATABASE)
diff --git a/Source/WebCore/Modules/indexeddb/shared/IDBTransactionInfo.h b/Source/WebCore/Modules/indexeddb/shared/IDBTransactionInfo.h
new file mode 100644 (file)
index 0000000..9a8d105
--- /dev/null
@@ -0,0 +1,62 @@
+/*
+ * Copyright (C) 2015 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 IDBTransactionInfo_h
+#define IDBTransactionInfo_h
+
+#if ENABLE(INDEXED_DATABASE)
+
+#include "IDBResourceIdentifier.h"
+#include "IndexedDB.h"
+
+namespace WebCore {
+namespace IDBServer {
+class IDBConnectionToClient;
+}
+
+class IDBTransactionInfo {
+public:
+    static IDBTransactionInfo versionChange(const IDBServer::IDBConnectionToClient&, uint64_t newVersion);
+
+    IDBTransactionInfo isolatedCopy() const;
+
+    IDBResourceIdentifier identifier() const { return m_identifier; }
+
+    IndexedDB::TransactionMode mode() const { return m_mode; }
+    uint64_t newVersion() const { return m_newVersion; }
+
+private:
+    IDBTransactionInfo(const IDBResourceIdentifier&);
+
+    IDBResourceIdentifier m_identifier;
+
+    IndexedDB::TransactionMode m_mode { IndexedDB::TransactionMode::ReadOnly };
+    uint64_t m_newVersion { 0 };
+};
+
+} // namespace WebCore
+
+#endif // ENABLE(INDEXED_DATABASE)
+#endif // IDBTransactionInfo_h
index 7b2f86d..72922dd 100644 (file)
@@ -102,6 +102,15 @@ void InProcessIDBServer::didOpenDatabase(const IDBResultData& resultData)
     });
 }
 
+void InProcessIDBServer::fireVersionChangeEvent(IDBServer::UniqueIDBDatabaseConnection& connection, uint64_t requestedVersion)
+{
+    RefPtr<InProcessIDBServer> self(this);
+    uint64_t databaseConnectionIdentifier = connection.identifier();
+    RunLoop::current().dispatch([this, self, databaseConnectionIdentifier, requestedVersion] {
+        m_connectionToServer->fireVersionChangeEvent(databaseConnectionIdentifier, requestedVersion);
+    });
+}
+
 } // namespace WebCore
 
 #endif // ENABLE(INDEXED_DATABASE)
index 5e1b9d0..05369a2 100644 (file)
@@ -61,6 +61,7 @@ public:
     virtual uint64_t identifier() const override;
     virtual void didDeleteDatabase(const IDBResultData&) override final;
     virtual void didOpenDatabase(const IDBResultData&) override final;
+    virtual void fireVersionChangeEvent(IDBServer::UniqueIDBDatabaseConnection&, uint64_t requestedVersion) override final;
 
     virtual void ref() override { RefCounted<InProcessIDBServer>::ref(); }
     virtual void deref() override { RefCounted<InProcessIDBServer>::deref(); }
index a981933..f5016d3 100644 (file)
                516C62201950D48700337E75 /* GamepadEvent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 516C621D1950D48700337E75 /* GamepadEvent.cpp */; };
                516C62211950D48700337E75 /* GamepadEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = 516C621E1950D48700337E75 /* GamepadEvent.h */; };
                516C62251950E2B900337E75 /* JSGamepadEvent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 516C62231950E2B900337E75 /* JSGamepadEvent.cpp */; };
-               516D7D6F1BB5F0BD00AF7C77 /* IDBConnectionToServer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5185FCBC1BB5CB770012898F /* IDBConnectionToServer.cpp */; };
                516D7D701BB5F0BD00AF7C77 /* IDBConnectionToServerDelegate.h in Headers */ = {isa = PBXBuildFile; fileRef = 5185FCBD1BB5CB770012898F /* IDBConnectionToServerDelegate.h */; settings = {ATTRIBUTES = (Private, ); }; };
                516D7D711BB5F0BD00AF7C77 /* IDBConnectionToClient.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 516D7D6D1BB5F06500AF7C77 /* IDBConnectionToClient.cpp */; };
                516D7D721BB5F0BD00AF7C77 /* IDBConnectionToClientDelegate.h in Headers */ = {isa = PBXBuildFile; fileRef = 516D7D6E1BB5F06500AF7C77 /* IDBConnectionToClientDelegate.h */; settings = {ATTRIBUTES = (Private, ); }; };
                517A63C51B74318F00E7DCDC /* KeyedDecoderCF.h in Headers */ = {isa = PBXBuildFile; fileRef = 517A63C01B74317E00E7DCDC /* KeyedDecoderCF.h */; settings = {ATTRIBUTES = (Private, ); }; };
                517A63C61B74319200E7DCDC /* KeyedEncoderCF.h in Headers */ = {isa = PBXBuildFile; fileRef = 517A63C21B74317E00E7DCDC /* KeyedEncoderCF.h */; settings = {ATTRIBUTES = (Private, ); }; };
                517FBA1E151AB17C00B57959 /* DOMWindowExtension.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 517FBA17151AA71B00B57959 /* DOMWindowExtension.cpp */; };
-               5185FC5B1BB4BE4C0012898F /* IDBConnectionToServer.h in Headers */ = {isa = PBXBuildFile; fileRef = 510A58FD1BB07A9600C19282 /* IDBConnectionToServer.h */; settings = {ATTRIBUTES = (Private, ); }; };
                5185FC741BB4C4E80012898F /* DOMWindowIndexedDatabase.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 51D7196C181106DF0016DC51 /* DOMWindowIndexedDatabase.cpp */; };
                5185FC751BB4C4E80012898F /* DOMWindowIndexedDatabase.h in Headers */ = {isa = PBXBuildFile; fileRef = 51D7196D181106DF0016DC51 /* DOMWindowIndexedDatabase.h */; };
                5185FC771BB4C4E80012898F /* IDBAny.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 51D7196F181106DF0016DC51 /* IDBAny.cpp */; };
                5185FC7D1BB4C4E80012898F /* IDBCursorWithValue.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 51645B421B9F889B00F789CE /* IDBCursorWithValue.cpp */; };
                5185FC7E1BB4C4E80012898F /* IDBCursorWithValue.h in Headers */ = {isa = PBXBuildFile; fileRef = 51645B431B9F889B00F789CE /* IDBCursorWithValue.h */; };
                5185FC801BB4C4E80012898F /* IDBDatabase.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 51645B441B9F889B00F789CE /* IDBDatabase.cpp */; };
-               5185FC811BB4C4E80012898F /* IDBDatabase.h in Headers */ = {isa = PBXBuildFile; fileRef = 51645B451B9F889B00F789CE /* IDBDatabase.h */; };
+               5185FC811BB4C4E80012898F /* IDBDatabase.h in Headers */ = {isa = PBXBuildFile; fileRef = 51645B451B9F889B00F789CE /* IDBDatabase.h */; settings = {ATTRIBUTES = (Private, ); }; };
                5185FC831BB4C4E80012898F /* IDBDatabaseError.h in Headers */ = {isa = PBXBuildFile; fileRef = 51D71983181106DF0016DC51 /* IDBDatabaseError.h */; settings = {ATTRIBUTES = (Private, ); }; };
                5185FC841BB4C4E80012898F /* IDBDatabaseException.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 51D71984181106DF0016DC51 /* IDBDatabaseException.cpp */; };
                5185FC851BB4C4E80012898F /* IDBDatabaseException.h in Headers */ = {isa = PBXBuildFile; fileRef = 51D71985181106DF0016DC51 /* IDBDatabaseException.h */; settings = {ATTRIBUTES = (Private, ); }; };
                5185FC9D1BB4C4E80012898F /* IDBKeyRangeData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5123AF161890A4CA0031CDC9 /* IDBKeyRangeData.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 */; };
+               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, ); }; };
                518F5002194CAC3A0081BAAE /* JSGamepad.h in Headers */ = {isa = PBXBuildFile; fileRef = 518F4FFE194CAC3A0081BAAE /* JSGamepad.h */; };
                518F5003194CAC3A0081BAAE /* JSGamepadButton.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 518F4FFF194CAC3A0081BAAE /* JSGamepadButton.cpp */; };
                518F5004194CAC3A0081BAAE /* JSGamepadButton.h in Headers */ = {isa = PBXBuildFile; fileRef = 518F5000194CAC3A0081BAAE /* JSGamepadButton.h */; };
+               5198F7A41BBDB79300E2CC5F /* UniqueIDBDatabaseConnection.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5198F7A21BBDAA2900E2CC5F /* UniqueIDBDatabaseConnection.cpp */; };
+               5198F7A51BBDB79300E2CC5F /* UniqueIDBDatabaseConnection.h in Headers */ = {isa = PBXBuildFile; fileRef = 5198F7A31BBDAA2900E2CC5F /* UniqueIDBDatabaseConnection.h */; settings = {ATTRIBUTES = (Private, ); }; };
+               5198F7A81BBDD38500E2CC5F /* UniqueIDBDatabaseTransaction.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5198F7A61BBDD38100E2CC5F /* UniqueIDBDatabaseTransaction.cpp */; };
+               5198F7A91BBDD38500E2CC5F /* UniqueIDBDatabaseTransaction.h in Headers */ = {isa = PBXBuildFile; fileRef = 5198F7A71BBDD38100E2CC5F /* UniqueIDBDatabaseTransaction.h */; settings = {ATTRIBUTES = (Private, ); }; };
+               5198F7AC1BBDD3EB00E2CC5F /* IDBTransactionInfo.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5198F7AA1BBDD3E300E2CC5F /* IDBTransactionInfo.cpp */; };
+               5198F7AD1BBDD3EB00E2CC5F /* IDBTransactionInfo.h in Headers */ = {isa = PBXBuildFile; fileRef = 5198F7AB1BBDD3E300E2CC5F /* IDBTransactionInfo.h */; settings = {ATTRIBUTES = (Private, ); }; };
+               5198F7B01BBDF5C800E2CC5F /* IDBDatabaseImpl.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5198F7AE1BBDF59200E2CC5F /* IDBDatabaseImpl.cpp */; };
+               5198F7B11BBDF5C800E2CC5F /* IDBDatabaseImpl.h in Headers */ = {isa = PBXBuildFile; fileRef = 5198F7AF1BBDF59200E2CC5F /* IDBDatabaseImpl.h */; settings = {ATTRIBUTES = (Private, ); }; };
+               5198F7B41BBE003C00E2CC5F /* IDBTransactionImpl.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5198F7B21BBE001D00E2CC5F /* IDBTransactionImpl.cpp */; };
+               5198F7B51BBE003C00E2CC5F /* IDBTransactionImpl.h in Headers */ = {isa = PBXBuildFile; fileRef = 5198F7B31BBE001D00E2CC5F /* IDBTransactionImpl.h */; settings = {ATTRIBUTES = (Private, ); }; };
+               5198F7B81BC3145100E2CC5F /* IDBVersionChangeEventImpl.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5198F7B61BC3141700E2CC5F /* IDBVersionChangeEventImpl.cpp */; };
+               5198F7B91BC3145100E2CC5F /* IDBVersionChangeEventImpl.h in Headers */ = {isa = PBXBuildFile; fileRef = 5198F7B71BC3141700E2CC5F /* IDBVersionChangeEventImpl.h */; };
+               5198F7BE1BC338AF00E2CC5F /* IDBAnyImpl.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5198F7BC1BC338A900E2CC5F /* IDBAnyImpl.cpp */; };
+               5198F7BF1BC338AF00E2CC5F /* IDBAnyImpl.h in Headers */ = {isa = PBXBuildFile; fileRef = 5198F7BD1BC338A900E2CC5F /* IDBAnyImpl.h */; settings = {ATTRIBUTES = (Private, ); }; };
+               5198F7C01BC4856700E2CC5F /* IDBConnectionToServer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5185FCBC1BB5CB770012898F /* IDBConnectionToServer.cpp */; };
+               5198F7C11BC4856700E2CC5F /* IDBConnectionToServer.h in Headers */ = {isa = PBXBuildFile; fileRef = 510A58FD1BB07A9600C19282 /* IDBConnectionToServer.h */; settings = {ATTRIBUTES = (Private, ); }; };
                51A052331058774F00CC9E95 /* CredentialStorage.h in Headers */ = {isa = PBXBuildFile; fileRef = 51A052311058774F00CC9E95 /* CredentialStorage.h */; settings = {ATTRIBUTES = (Private, ); }; };
                51A052341058774F00CC9E95 /* CredentialStorage.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 51A052321058774F00CC9E95 /* CredentialStorage.cpp */; };
                51A052561058874000CC9E95 /* ProtectionSpaceHash.h in Headers */ = {isa = PBXBuildFile; fileRef = 51A052551058874000CC9E95 /* ProtectionSpaceHash.h */; settings = {ATTRIBUTES = (Private, ); }; };
                518F4FFE194CAC3A0081BAAE /* JSGamepad.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSGamepad.h; sourceTree = "<group>"; };
                518F4FFF194CAC3A0081BAAE /* JSGamepadButton.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSGamepadButton.cpp; sourceTree = "<group>"; };
                518F5000194CAC3A0081BAAE /* JSGamepadButton.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSGamepadButton.h; sourceTree = "<group>"; };
+               5198F7A21BBDAA2900E2CC5F /* UniqueIDBDatabaseConnection.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = UniqueIDBDatabaseConnection.cpp; sourceTree = "<group>"; };
+               5198F7A31BBDAA2900E2CC5F /* UniqueIDBDatabaseConnection.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UniqueIDBDatabaseConnection.h; sourceTree = "<group>"; };
+               5198F7A61BBDD38100E2CC5F /* UniqueIDBDatabaseTransaction.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = UniqueIDBDatabaseTransaction.cpp; sourceTree = "<group>"; };
+               5198F7A71BBDD38100E2CC5F /* UniqueIDBDatabaseTransaction.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UniqueIDBDatabaseTransaction.h; sourceTree = "<group>"; };
+               5198F7AA1BBDD3E300E2CC5F /* IDBTransactionInfo.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = IDBTransactionInfo.cpp; sourceTree = "<group>"; };
+               5198F7AB1BBDD3E300E2CC5F /* IDBTransactionInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IDBTransactionInfo.h; sourceTree = "<group>"; };
+               5198F7AE1BBDF59200E2CC5F /* IDBDatabaseImpl.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = IDBDatabaseImpl.cpp; sourceTree = "<group>"; };
+               5198F7AF1BBDF59200E2CC5F /* IDBDatabaseImpl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IDBDatabaseImpl.h; sourceTree = "<group>"; };
+               5198F7B21BBE001D00E2CC5F /* IDBTransactionImpl.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = IDBTransactionImpl.cpp; sourceTree = "<group>"; };
+               5198F7B31BBE001D00E2CC5F /* IDBTransactionImpl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IDBTransactionImpl.h; sourceTree = "<group>"; };
+               5198F7B61BC3141700E2CC5F /* IDBVersionChangeEventImpl.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = IDBVersionChangeEventImpl.cpp; sourceTree = "<group>"; };
+               5198F7B71BC3141700E2CC5F /* IDBVersionChangeEventImpl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IDBVersionChangeEventImpl.h; sourceTree = "<group>"; };
+               5198F7BC1BC338A900E2CC5F /* IDBAnyImpl.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = IDBAnyImpl.cpp; sourceTree = "<group>"; };
+               5198F7BD1BC338A900E2CC5F /* IDBAnyImpl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IDBAnyImpl.h; sourceTree = "<group>"; };
                519FE0A10DAD446E00A08F21 /* HTMLAttributeNames.in */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = HTMLAttributeNames.in; sourceTree = "<group>"; };
                519FE0A20DAD446E00A08F21 /* HTMLTagNames.in */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = HTMLTagNames.in; sourceTree = "<group>"; };
                51A052311058774F00CC9E95 /* CredentialStorage.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CredentialStorage.h; sourceTree = "<group>"; };
                510310421BA8C64C003329C0 /* client */ = {
                        isa = PBXGroup;
                        children = (
+                               5198F7BC1BC338A900E2CC5F /* IDBAnyImpl.cpp */,
+                               5198F7BD1BC338A900E2CC5F /* IDBAnyImpl.h */,
                                5185FCBC1BB5CB770012898F /* IDBConnectionToServer.cpp */,
                                510A58FD1BB07A9600C19282 /* IDBConnectionToServer.h */,
                                5185FCBD1BB5CB770012898F /* IDBConnectionToServerDelegate.h */,
+                               5198F7AE1BBDF59200E2CC5F /* IDBDatabaseImpl.cpp */,
+                               5198F7AF1BBDF59200E2CC5F /* IDBDatabaseImpl.h */,
                                5103104A1BA8C6A6003329C0 /* IDBFactoryImpl.cpp */,
                                5103104B1BA8C6A6003329C0 /* IDBFactoryImpl.h */,
                                510310561BA8DB30003329C0 /* IDBOpenDBRequestImpl.cpp */,
                                510310571BA8DB30003329C0 /* IDBOpenDBRequestImpl.h */,
                                510310581BA8DB30003329C0 /* IDBRequestImpl.cpp */,
                                510310591BA8DB30003329C0 /* IDBRequestImpl.h */,
+                               5198F7B21BBE001D00E2CC5F /* IDBTransactionImpl.cpp */,
+                               5198F7B31BBE001D00E2CC5F /* IDBTransactionImpl.h */,
+                               5198F7B61BC3141700E2CC5F /* IDBVersionChangeEventImpl.cpp */,
+                               5198F7B71BC3141700E2CC5F /* IDBVersionChangeEventImpl.h */,
                        );
                        path = client;
                        sourceTree = "<group>";
                                5145B1081BC4890B00E86219 /* IDBResourceIdentifier.h */,
                                51D7236A1BB60BFE00478CA3 /* IDBResultData.cpp */,
                                51D7236B1BB60BFE00478CA3 /* IDBResultData.h */,
+                               5198F7AA1BBDD3E300E2CC5F /* IDBTransactionInfo.cpp */,
+                               5198F7AB1BBDD3E300E2CC5F /* IDBTransactionInfo.h */,
                                510A58E21BAA40AE00C19282 /* InProcessIDBServer.cpp */,
                                510A58E31BAA40AE00C19282 /* InProcessIDBServer.h */,
                        );
                                51BA4AC91BBC5B9E00DF3D6D /* MemoryIDBBackingStore.h */,
                                518864DE1BBAF30F00E540C9 /* UniqueIDBDatabase.cpp */,
                                518864DF1BBAF30F00E540C9 /* UniqueIDBDatabase.h */,
+                               5198F7A21BBDAA2900E2CC5F /* UniqueIDBDatabaseConnection.cpp */,
+                               5198F7A31BBDAA2900E2CC5F /* UniqueIDBDatabaseConnection.h */,
+                               5198F7A61BBDD38100E2CC5F /* UniqueIDBDatabaseTransaction.cpp */,
+                               5198F7A71BBDD38100E2CC5F /* UniqueIDBDatabaseTransaction.h */,
                        );
                        path = server;
                        sourceTree = "<group>";
                                3AC648B2129E146500C3EB25 /* EditingBoundary.h in Headers */,
                                9BAB6C6C12550631001626D4 /* EditingStyle.h in Headers */,
                                4B3043CD0AE0373B00A82647 /* Editor.h in Headers */,
+                               5198F7B11BBDF5C800E2CC5F /* IDBDatabaseImpl.h in Headers */,
                                1AF326790D78B9440068F0C4 /* EditorClient.h in Headers */,
                                4BAE95B10B2FA9CE00AED8A0 /* EditorDeleteAction.h in Headers */,
                                93FDAFCA0B11307400E2746F /* EditorInsertAction.h in Headers */,
                                B2FA3DEE0AB75A6F000E5AC4 /* JSSVGRectElement.h in Headers */,
                                B2FA3DF10AB75A6F000E5AC4 /* JSSVGRenderingIntent.h in Headers */,
                                B2FA3DF30AB75A6F000E5AC4 /* JSSVGScriptElement.h in Headers */,
+                               5198F7AD1BBDD3EB00E2CC5F /* IDBTransactionInfo.h in Headers */,
                                B2FA3DF50AB75A6F000E5AC4 /* JSSVGSetElement.h in Headers */,
                                B2FA3DF70AB75A6F000E5AC4 /* JSSVGStopElement.h in Headers */,
                                B2FA3DF90AB75A6F000E5AC4 /* JSSVGStringList.h in Headers */,
                                07C59B6917F784BA000FBCBB /* MediaSourceStates.h in Headers */,
                                078E091517D14D1C00420AA1 /* MediaStream.h in Headers */,
                                078E094C17D1709600420AA1 /* MediaStreamAudioDestinationNode.h in Headers */,
+                               5198F7C11BC4856700E2CC5F /* IDBConnectionToServer.h in Headers */,
                                0783228518013ED800999E0C /* MediaStreamAudioSource.h in Headers */,
                                FD671A78159BB07000197559 /* MediaStreamAudioSourceNode.h in Headers */,
                                0705850B17FA4827005F2BCB /* MediaStreamCapabilities.h in Headers */,
                                078E092A17D14D1C00420AA1 /* RTCStatsReport.h in Headers */,
                                078E094517D16E1C00420AA1 /* RTCStatsRequest.h in Headers */,
                                078E092B17D14D1C00420AA1 /* RTCStatsRequestImpl.h in Headers */,
-                               5185FC5B1BB4BE4C0012898F /* IDBConnectionToServer.h in Headers */,
                                078E092C17D14D1C00420AA1 /* RTCStatsResponse.h in Headers */,
                                078E094617D16E1C00420AA1 /* RTCStatsResponseBase.h in Headers */,
                                078E094717D16E1C00420AA1 /* RTCVoidRequest.h in Headers */,
                                41C760B10EDE03D300C1655F /* ScriptState.h in Headers */,
                                228C284510D82500009D0D0E /* ScriptWrappable.h in Headers */,
                                1400D7A817136EA70077CE05 /* ScriptWrappableInlines.h in Headers */,
+                               5198F7B91BC3145100E2CC5F /* IDBVersionChangeEventImpl.h in Headers */,
                                BC8AE34F12EA096A00EB3AE6 /* ScrollableArea.h in Headers */,
                                CA3BF67E10D99BAE00E6CE53 /* ScrollAnimator.h in Headers */,
                                0F1774801378B772009DA76A /* ScrollAnimatorIOS.h in Headers */,
                                CDCFABBD18C0AF78006F8450 /* SelectionSubtreeRoot.h in Headers */,
                                E44B4BB4141650D7002B1D8B /* SelectorChecker.h in Headers */,
                                432D3FE818A8658400D7DC03 /* SelectorCheckerTestFunctions.h in Headers */,
+                               5198F7BF1BC338AF00E2CC5F /* IDBAnyImpl.h in Headers */,
                                26B999971804D54200D01121 /* SelectorCompiler.h in Headers */,
                                415071581685067300C3C7B3 /* SelectorFilter.h in Headers */,
                                43107BE218CC19DE00CC18E8 /* SelectorPseudoTypeMap.h in Headers */,
                                FD45A952175D3F3E00C21EC8 /* ShapeOutsideInfo.h in Headers */,
                                FD1AF1501656F15100C6D4F7 /* ShapeValue.h in Headers */,
                                1A4A954E0B4EDCCB002D8C3C /* SharedBuffer.h in Headers */,
+                               5198F7A51BBDB79300E2CC5F /* UniqueIDBDatabaseConnection.h in Headers */,
                                97B1F02F13B025D200F5103F /* SharedBufferChunkReader.h in Headers */,
                                93309EA3099EB78C0056E581 /* SharedTimer.h in Headers */,
                                E48944A3180B57D800F165D8 /* SimpleLineLayout.h in Headers */,
                                081093DC1255F0E700ED9D29 /* SVGTextLayoutAttributesBuilder.h in Headers */,
                                5185FC8B1BB4C4E80012898F /* IDBEventDispatcher.h in Headers */,
                                081668DA125603D5006F25DE /* SVGTextLayoutEngine.h in Headers */,
+                               5198F7B51BBE003C00E2CC5F /* IDBTransactionImpl.h in Headers */,
                                080E49261255F3BD00EFCA27 /* SVGTextLayoutEngineBaseline.h in Headers */,
                                080E49281255F3BD00EFCA27 /* SVGTextLayoutEngineSpacing.h in Headers */,
                                08F0BFC61255C53C00075185 /* SVGTextMetrics.h in Headers */,
                                00B9318813BA8DBA0035A948 /* XMLDocumentParser.h in Headers */,
                                00B9318C13BA8DCC0035A948 /* XMLDocumentParserScope.h in Headers */,
                                59C28046138DC2410079B7E2 /* XMLErrors.h in Headers */,
+                               5198F7A91BBDD38500E2CC5F /* UniqueIDBDatabaseTransaction.h in Headers */,
                                BC772C470C4EB2C60083285F /* XMLHttpRequest.h in Headers */,
                                BC60D9C90D2A29E500B9918F /* XMLHttpRequestException.h in Headers */,
                                F9F0ED7A0DB50CA200D16DB9 /* XMLHttpRequestProgressEvent.h in Headers */,
                                85032DE80AA8C9BE007D3B7D /* DOMCSSStyleRule.mm in Sources */,
                                858C39290AA8FF9D00B187A4 /* DOMCSSStyleSheet.mm in Sources */,
                                FCD8832B16A49F8200962227 /* DOMCSSSupportsRule.mm in Sources */,
+                               5198F7A81BBDD38500E2CC5F /* UniqueIDBDatabaseTransaction.cpp in Sources */,
                                85032DEA0AA8C9BE007D3B7D /* DOMCSSUnknownRule.mm in Sources */,
                                858C381D0AA8E29600B187A4 /* DOMCSSValue.mm in Sources */,
                                858C383D0AA8ED8200B187A4 /* DOMCSSValueList.mm in Sources */,
                                FD31609A12B026F700C1A359 /* HRTFDatabaseLoader.cpp in Sources */,
                                FD31609C12B026F700C1A359 /* HRTFElevation.cpp in Sources */,
                                FD31609E12B026F700C1A359 /* HRTFKernel.cpp in Sources */,
+                               5198F7BE1BC338AF00E2CC5F /* IDBAnyImpl.cpp in Sources */,
                                FD3160A012B026F700C1A359 /* HRTFPanner.cpp in Sources */,
                                BC97E23B109144950010D361 /* HTMLAllCollection.cpp in Sources */,
                                A8CFF7A40A156978000A4234 /* HTMLAnchorElement.cpp in Sources */,
                                A5840E1C187B74D500843B10 /* InspectorInstrumentationCookie.cpp in Sources */,
                                71B1E1261640491A00B1880A /* InspectorLayerTreeAgent.cpp in Sources */,
                                504AACCD1834455900E3D9BC /* InspectorNodeFinder.cpp in Sources */,
+                               5198F7B41BBE003C00E2CC5F /* IDBTransactionImpl.cpp in Sources */,
                                7C522D4B15B477E8009B7C95 /* InspectorOverlay.cpp in Sources */,
                                4F6FDD641341DEDD001F8EE3 /* InspectorPageAgent.cpp in Sources */,
                                99CC0B6618BE9F15006CEBCC /* InspectorReplayAgent.cpp in Sources */,
                                FD67773B195CB1E60072E0D3 /* JSDOMWindowCSS.cpp in Sources */,
                                BCD9C2620C17AA67005C90A2 /* JSDOMWindowCustom.cpp in Sources */,
                                BCBFB53C0DCD29CF0019B3E5 /* JSDOMWindowShell.cpp in Sources */,
+                               5198F7B81BC3145100E2CC5F /* IDBVersionChangeEventImpl.cpp in Sources */,
                                FD7868B9136B999200D403DF /* JSDynamicsCompressorNode.cpp in Sources */,
                                65DF31F909D1CC60000BE325 /* JSElement.cpp in Sources */,
                                BC2ED5550C6B9BD300920BFF /* JSElementCustom.cpp in Sources */,
                                BC97E42C10915B060010D361 /* JSHTMLAllCollectionCustom.cpp in Sources */,
                                1A4A2DEF0A1B852A00C807F8 /* JSHTMLAnchorElement.cpp in Sources */,
                                1A4A2DF10A1B852A00C807F8 /* JSHTMLAppletElement.cpp in Sources */,
+                               5198F7AC1BBDD3EB00E2CC5F /* IDBTransactionInfo.cpp in Sources */,
                                BC4EDEF40C08F3FB007EDD49 /* JSHTMLAppletElementCustom.cpp in Sources */,
                                1AE2AA1E0A1CDAB400B42B25 /* JSHTMLAreaElement.cpp in Sources */,
                                7C9DBFED1A9C49B1000D6B25 /* JSHTMLAttachmentElement.cpp in Sources */,
                                E107400D0E77BDC00033AF24 /* JSMessageChannel.cpp in Sources */,
                                E1A5F99B0E7EAA2500AF85EA /* JSMessageChannelCustom.cpp in Sources */,
                                75793EC80D0CE72D007FC0AC /* JSMessageEvent.cpp in Sources */,
+                               5198F7B01BBDF5C800E2CC5F /* IDBDatabaseImpl.cpp in Sources */,
                                410B7E721045FAB000D8224F /* JSMessageEventCustom.cpp in Sources */,
                                E1ADEDDB0E76BD93004A1A5E /* JSMessagePort.cpp in Sources */,
                                E1ADED470E76B8DD004A1A5E /* JSMessagePortCustom.cpp in Sources */,
                                07B5A2DB1464320A00A81ECE /* JSTextTrackList.cpp in Sources */,
                                07B5A30D14687D7100A81ECE /* JSTextTrackListCustom.cpp in Sources */,
                                E446141A0CD6826900FADA75 /* JSTimeRanges.cpp in Sources */,
-                               516D7D6F1BB5F0BD00AF7C77 /* IDBConnectionToServer.cpp in Sources */,
                                0FDA7C16188322EB00C954B5 /* JSTouch.cpp in Sources */,
                                0FDA7C18188322EB00C954B5 /* JSTouchEvent.cpp in Sources */,
                                0FDA7C1A188322EB00C954B5 /* JSTouchList.cpp in Sources */,
                                B222799B0D00BF220071B782 /* SVGCircleElement.cpp in Sources */,
                                B222799E0D00BF220071B782 /* SVGClipPathElement.cpp in Sources */,
                                B22279A10D00BF220071B782 /* SVGColor.cpp in Sources */,
+                               5198F7A41BBDB79300E2CC5F /* UniqueIDBDatabaseConnection.cpp in Sources */,
                                B22279A40D00BF220071B782 /* SVGComponentTransferFunctionElement.cpp in Sources */,
                                B2227B050D00BFF10071B782 /* SVGCSSComputedStyleDeclaration.cpp in Sources */,
                                B2227B060D00BFF10071B782 /* SVGCSSParser.cpp in Sources */,
                                B2227AF20D00BF220071B782 /* SVGViewSpec.cpp in Sources */,
                                8485228A1190173C006EDC7F /* SVGVKernElement.cpp in Sources */,
                                B2227AF50D00BF220071B782 /* SVGZoomAndPan.cpp in Sources */,
+                               5198F7C01BC4856700E2CC5F /* IDBConnectionToServer.cpp in Sources */,
                                B2E4EC970D00C22B00432643 /* SVGZoomEvent.cpp in Sources */,
                                E180811216FCF42F00B80D07 /* SynchronousLoaderClient.cpp in Sources */,
                                E180811616FCF9CB00B80D07 /* SynchronousLoaderClient.mm in Sources */,
index 889c84d..6a31939 100644 (file)
@@ -48,6 +48,7 @@
 #include "IDBGetResult.h"
 #include "IDBKeyData.h"
 #include "IDBKeyRangeData.h"
+#include "IDBTransactionInfo.h"
 #endif
 
 namespace WebCore {
@@ -138,7 +139,13 @@ CrossThreadCopierBase<false, false, IDBDatabaseIdentifier>::Type CrossThreadCopi
 {
     return identifier.isolatedCopy();
 }
-#endif
+
+CrossThreadCopierBase<false, false, IDBTransactionInfo>::Type CrossThreadCopierBase<false, false, IDBTransactionInfo>::copy(const IDBTransactionInfo& info)
+{
+    return info.isolatedCopy();
+}
+
+#endif // ENABLE(INDEXED_DATABASE)
 
 // Test CrossThreadCopier using COMPILE_ASSERT.
 
index 156e8db..7a2f519 100644 (file)
@@ -203,6 +203,12 @@ namespace WebCore {
         static Type copy(const IDBDatabaseIdentifier&);
     };
 
+    class IDBTransactionInfo;
+    template<> struct WEBCORE_EXPORT CrossThreadCopierBase<false, false, IDBTransactionInfo> {
+        typedef IDBTransactionInfo Type;
+        static Type copy(const IDBTransactionInfo&);
+    };
+
 #endif
 
     template<typename T>