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)
commitfbd43f39cb3ab1bc64db2e592d275467b3b08488
treeb7138da64eb43b97cab214f9dbffd667d3263358
parent1d0eaf2d78df40d479d04e5f9b29bcdc52244383
Modern IDB: Start version change transaction for connections to new database.
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