DatabaseProcess: Add "UniqueIDBDatabase" that multiple WebProcesses can connect to
authorbeidson@apple.com <beidson@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 24 Nov 2013 23:12:28 +0000 (23:12 +0000)
committerbeidson@apple.com <beidson@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 24 Nov 2013 23:12:28 +0000 (23:12 +0000)
commita23987c008628b970fdfe4228b8ddbb3cde8ac96
tree1645d9d9b56f6b3efbd3018cfa2c8c8942c8c7a1
parent41c536b8dc80f14880ad9dceaa673e0a7b0c96f0
DatabaseProcess: Add "UniqueIDBDatabase" that multiple WebProcesses can connect to
https://bugs.webkit.org/show_bug.cgi?id=124819

Reviewed by Dan Bernstein.

Source/WebCore:

* Modules/indexeddb/IDBDatabaseBackend.cpp:
(WebCore::IDBDatabaseBackend::~IDBDatabaseBackend): Unregister from the IDBFactory.

Source/WebKit2:

UniqueIDBDatabase instances are per-DatabaseProcess, so it manages the set of them.
* DatabaseProcess/DatabaseProcess.cpp:
(WebKit::DatabaseProcess::getOrCreateUniqueIDBDatabase):
(WebKit::DatabaseProcess::removeUniqueIDBDatabase):
* DatabaseProcess/DatabaseProcess.h:

* DatabaseProcess/DatabaseToWebProcessConnection.h:

Start forwarding things along to the appropriate UniqueIDBDatabase.
* DatabaseProcess/IndexedDB/DatabaseProcessIDBConnection.cpp:
(WebKit::DatabaseProcessIDBConnection::~DatabaseProcessIDBConnection):
(WebKit::DatabaseProcessIDBConnection::disconnectedFromWebProcess):
(WebKit::DatabaseProcessIDBConnection::establishConnection):
(WebKit::DatabaseProcessIDBConnection::getOrEstablishIDBDatabaseMetadata):
* DatabaseProcess/IndexedDB/DatabaseProcessIDBConnection.h:

A class that represents a single concrete IDB database that multiple WebProcesses can connect to.
* DatabaseProcess/IndexedDB/UniqueIDBDatabase.cpp:
(WebKit::UniqueIDBDatabase::UniqueIDBDatabase):
(WebKit::UniqueIDBDatabase::~UniqueIDBDatabase):
(WebKit::UniqueIDBDatabase::registerConnection):
(WebKit::UniqueIDBDatabase::unregisterConnection):
(WebKit::UniqueIDBDatabase::getIDBDatabaseMetadata):
* DatabaseProcess/IndexedDB/UniqueIDBDatabase.h:
(WebKit::UniqueIDBDatabase::create):
(WebKit::UniqueIDBDatabase::identifier):

A class to help uniquely identify an IDBDatabase that can be expanded as needed.
Importantly, it knows how to be used as a key in a HashMap.
* DatabaseProcess/IndexedDB/UniqueIDBDatabaseIdentifier.cpp: Added.
(WebKit::UniqueIDBDatabaseIdentifier::UniqueIDBDatabaseIdentifier):
(WebKit::UniqueIDBDatabaseIdentifier::isHashTableDeletedValue):
(WebKit::UniqueIDBDatabaseIdentifier::hash):
(WebKit::UniqueIDBDatabaseIdentifier::isNull):
(WebKit::operator==):
* DatabaseProcess/IndexedDB/UniqueIDBDatabaseIdentifier.h: Added.
(WebKit::UniqueIDBDatabaseIdentifier::databaseName):
(WebKit::UniqueIDBDatabaseIdentifier::openingOrigin):
(WebKit::UniqueIDBDatabaseIdentifier::mainFrameOrigin):
(WebKit::UniqueIDBDatabaseIdentifierHash::hash):
(WebKit::UniqueIDBDatabaseIdentifierHash::equal):
(WebKit::UniqueIDBDatabaseIdentifierHashTraits::isEmptyValue):

* Shared/SecurityOriginData.cpp:
(WebKit::operator==):
* Shared/SecurityOriginData.h:

* UIProcess/WebContext.cpp:

* WebProcess/Databases/IndexedDB/WebIDBFactoryBackend.cpp:
(WebKit::WebIDBFactoryBackend::open):
(WebKit::WebIDBFactoryBackend::removeIDBDatabaseBackend):

* WebKit2.xcodeproj/project.pbxproj:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@159737 268f45cc-cd09-0410-ab3c-d52691b4dbfc
16 files changed:
Source/WebCore/ChangeLog
Source/WebCore/Modules/indexeddb/IDBDatabaseBackend.cpp
Source/WebKit2/ChangeLog
Source/WebKit2/DatabaseProcess/DatabaseProcess.cpp
Source/WebKit2/DatabaseProcess/DatabaseProcess.h
Source/WebKit2/DatabaseProcess/DatabaseToWebProcessConnection.h
Source/WebKit2/DatabaseProcess/IndexedDB/DatabaseProcessIDBConnection.cpp
Source/WebKit2/DatabaseProcess/IndexedDB/DatabaseProcessIDBConnection.h
Source/WebKit2/DatabaseProcess/IndexedDB/UniqueIDBDatabase.cpp [new file with mode: 0644]
Source/WebKit2/DatabaseProcess/IndexedDB/UniqueIDBDatabase.h [new file with mode: 0644]
Source/WebKit2/DatabaseProcess/IndexedDB/UniqueIDBDatabaseIdentifier.cpp [new file with mode: 0644]
Source/WebKit2/DatabaseProcess/IndexedDB/UniqueIDBDatabaseIdentifier.h [new file with mode: 0644]
Source/WebKit2/Shared/SecurityOriginData.cpp
Source/WebKit2/Shared/SecurityOriginData.h
Source/WebKit2/WebKit2.xcodeproj/project.pbxproj
Source/WebKit2/WebProcess/Databases/IndexedDB/WebIDBFactoryBackend.cpp