Add UniqueIDBDatabase object, IDBBackingStore objects, and a database operation thread.
authorbeidson@apple.com <beidson@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 1 Oct 2015 01:04:19 +0000 (01:04 +0000)
committerbeidson@apple.com <beidson@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 1 Oct 2015 01:04:19 +0000 (01:04 +0000)
commit79a7a7b15f000d1fda991429149ea5b0930c9d01
tree4e3381609832a7ee75172ed30d755433a0a3d78a
parenta1835b3d54f04a36cc10d52552c665763b94f130
Add UniqueIDBDatabase object, IDBBackingStore objects, and a database operation thread.
https://bugs.webkit.org/show_bug.cgi?id=149678

Reviewed by Alex Christensen.

Source/WebCore:

Test: storage/indexeddb/modern/opendatabase-request-event.html

- UniqueIDBDatabase represents a specific IDB database instance that can have multiple
  connections to it.
- IDBBackingStore is an abstract representation of a unique database's backing store,
  and has a concrete in-memory implementation for now.
- The database thread exists on IDBServer and is for offloading actual database I/O from
  the main thread.

* CMakeLists.txt:

* Modules/indexeddb/IDBDatabaseIdentifier.cpp:
(WebCore::IDBDatabaseIdentifier::isolatedCopy):
* Modules/indexeddb/IDBDatabaseIdentifier.h:

* Modules/indexeddb/client/IDBConnectionToServer.cpp:
(WebCore::IDBClient::IDBConnectionToServer::openDatabase):
(WebCore::IDBClient::IDBConnectionToServer::didOpenDatabase):
* Modules/indexeddb/client/IDBConnectionToServer.h:
* Modules/indexeddb/client/IDBConnectionToServerDelegate.h:

* Modules/indexeddb/client/IDBFactoryImpl.cpp:
(WebCore::IDBClient::IDBFactory::openInternal):

* Modules/indexeddb/server/IDBBackingStore.h: Copied from Source/WebCore/Modules/indexeddb/server/IDBConnectionToClientDelegate.h.
(WebCore::IDBServer::IDBBackingStore::~IDBBackingStore):

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

* Modules/indexeddb/server/IDBServer.cpp:
(WebCore::IDBServer::IDBServer::IDBServer):
(WebCore::IDBServer::IDBServer::getOrCreateUniqueIDBDatabase):
(WebCore::IDBServer::IDBServer::createBackingStore):
(WebCore::IDBServer::IDBServer::openDatabase):
(WebCore::IDBServer::IDBServer::deleteDatabase):
(WebCore::IDBServer::IDBServer::postDatabaseTask):
(WebCore::IDBServer::IDBServer::postDatabaseTaskReply):
(WebCore::IDBServer::IDBServer::databaseThreadEntry):
(WebCore::IDBServer::IDBServer::databaseRunLoop):
(WebCore::IDBServer::IDBServer::handleTaskRepliesOnMainThread):
* Modules/indexeddb/server/IDBServer.h:

* Modules/indexeddb/server/IDBServerOperation.cpp: Copied from Source/WebCore/Modules/indexeddb/server/IDBConnectionToClientDelegate.h.
(WebCore::IDBServer::IDBServerOperation::create):
(WebCore::IDBServer::IDBServerOperation::IDBServerOperation):
* Modules/indexeddb/server/IDBServerOperation.h: Copied from Source/WebCore/Modules/indexeddb/server/IDBServer.h.
(WebCore::IDBServer::IDBServerOperation::connection):
(WebCore::IDBServer::IDBServerOperation::requestData):

* Modules/indexeddb/server/MemoryIDBBackingStore.cpp: Copied from Source/WebCore/Modules/indexeddb/server/IDBConnectionToClient.cpp.
(WebCore::IDBServer::MemoryIDBBackingStore::create):
(WebCore::IDBServer::MemoryIDBBackingStore::MemoryIDBBackingStore):
(WebCore::IDBServer::MemoryIDBBackingStore::~MemoryIDBBackingStore):
(WebCore::IDBServer::MemoryIDBBackingStore::getOrEstablishDatabaseInfo):
* Modules/indexeddb/server/MemoryIDBBackingStore.h: Copied from Source/WebCore/Modules/indexeddb/server/IDBConnectionToClient.h.

* Modules/indexeddb/server/UniqueIDBDatabase.cpp: Added.
(WebCore::IDBServer::UniqueIDBDatabase::UniqueIDBDatabase):
(WebCore::IDBServer::UniqueIDBDatabase::openDatabaseConnection):
(WebCore::IDBServer::UniqueIDBDatabase::handleOpenDatabaseOperations):
(WebCore::IDBServer::UniqueIDBDatabase::openBackingStore):
(WebCore::IDBServer::UniqueIDBDatabase::didOpenBackingStore):
* Modules/indexeddb/server/UniqueIDBDatabase.h: Copied from Source/WebCore/Modules/indexeddb/server/IDBServer.h.
(WebCore::IDBServer::UniqueIDBDatabase::create):

* Modules/indexeddb/shared/IDBDatabaseInfo.cpp: Copied from Source/WebCore/Modules/indexeddb/client/IDBConnectionToServerDelegate.h.
(WebCore::IDBDatabaseInfo::IDBDatabaseInfo):
(WebCore::IDBDatabaseInfo::isolatedCopy):
* Modules/indexeddb/shared/IDBDatabaseInfo.h: Copied from Source/WebCore/Modules/indexeddb/client/IDBConnectionToServerDelegate.h.
(WebCore::IDBDatabaseInfo::IDBDatabaseInfo):

* Modules/indexeddb/shared/InProcessIDBServer.cpp:
(WebCore::InProcessIDBServer::didDeleteDatabase):
(WebCore::InProcessIDBServer::openDatabase):
(WebCore::InProcessIDBServer::didOpenDatabase):
* Modules/indexeddb/shared/InProcessIDBServer.h:

* WebCore.xcodeproj/project.pbxproj:

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

LayoutTests:

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

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@190379 268f45cc-cd09-0410-ab3c-d52691b4dbfc
30 files changed:
LayoutTests/ChangeLog
LayoutTests/storage/indexeddb/modern/opendatabase-request-event-expected.txt [new file with mode: 0644]
LayoutTests/storage/indexeddb/modern/opendatabase-request-event.html [new file with mode: 0644]
Source/WebCore/CMakeLists.txt
Source/WebCore/ChangeLog
Source/WebCore/Modules/indexeddb/IDBDatabaseIdentifier.cpp
Source/WebCore/Modules/indexeddb/IDBDatabaseIdentifier.h
Source/WebCore/Modules/indexeddb/client/IDBConnectionToServer.cpp
Source/WebCore/Modules/indexeddb/client/IDBConnectionToServer.h
Source/WebCore/Modules/indexeddb/client/IDBConnectionToServerDelegate.h
Source/WebCore/Modules/indexeddb/client/IDBFactoryImpl.cpp
Source/WebCore/Modules/indexeddb/server/IDBBackingStore.h [new file with mode: 0644]
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/IDBServerOperation.cpp [new file with mode: 0644]
Source/WebCore/Modules/indexeddb/server/IDBServerOperation.h [new file with mode: 0644]
Source/WebCore/Modules/indexeddb/server/MemoryIDBBackingStore.cpp [new file with mode: 0644]
Source/WebCore/Modules/indexeddb/server/MemoryIDBBackingStore.h [new file with mode: 0644]
Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabase.cpp [new file with mode: 0644]
Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabase.h [new file with mode: 0644]
Source/WebCore/Modules/indexeddb/shared/IDBDatabaseInfo.cpp [new file with mode: 0644]
Source/WebCore/Modules/indexeddb/shared/IDBDatabaseInfo.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