Add WebIDBServerConnection and DatabaseProcessIDBConnection stubs
authorbeidson@apple.com <beidson@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 19 Nov 2013 20:08:03 +0000 (20:08 +0000)
committerbeidson@apple.com <beidson@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 19 Nov 2013 20:08:03 +0000 (20:08 +0000)
https://bugs.webkit.org/show_bug.cgi?id=124562

Reviewed by Alexey Proskuryakov.

Source/WebCore:

Export some more symbols and headers for WK2 to use.

* WebCore.exp.in:
* WebCore.xcodeproj/project.pbxproj:

Source/WebKit2:

Also remove Web/DatabaseProcessDatabaseBackend stubs, as that is no longer the abstraction layer.

* DatabaseProcess/DatabaseToWebProcessConnection.cpp:
(WebKit::DatabaseToWebProcessConnection::didReceiveMessage):
(WebKit::DatabaseToWebProcessConnection::establishIDBConnection):
* DatabaseProcess/DatabaseToWebProcessConnection.h:
* DatabaseProcess/DatabaseToWebProcessConnection.messages.in:

* DatabaseProcess/IndexedDB/DatabaseProcessIDBConnection.cpp: Renamed from Source/WebKit2/DatabaseProcess/IndexedDB/DatabaseProcessIDBDatabaseBackend.cpp.
(WebKit::DatabaseProcessIDBConnection::DatabaseProcessIDBConnection):
(WebKit::DatabaseProcessIDBConnection::~DatabaseProcessIDBConnection):
(WebKit::DatabaseProcessIDBConnection::establishConnection):
(WebKit::DatabaseProcessIDBConnection::messageSenderConnection):
* DatabaseProcess/IndexedDB/DatabaseProcessIDBConnection.h: Renamed from Source/WebKit2/DatabaseProcess/IndexedDB/DatabaseProcessIDBDatabaseBackend.h.
(WebKit::DatabaseProcessIDBConnection::create):
* DatabaseProcess/IndexedDB/DatabaseProcessIDBConnection.messages.in: Renamed from Source/WebKit2/DatabaseProcess/IndexedDB/DatabaseProcessIDBDatabaseBackend.messages.in.

* Shared/Databases/IndexedDB/IDBUtilities.cpp:
(WebKit::uniqueDatabaseIdentifier): Modified to take two security origin arguments.
* Shared/Databases/IndexedDB/IDBUtilities.h:

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

* WebProcess/Databases/IndexedDB/WebIDBServerConnection.cpp: Added. Stubbed out all the pure virtual methods.
(WebKit::generateBackendIdentifier):
(WebKit::WebIDBServerConnection::WebIDBServerConnection):
(WebKit::WebIDBServerConnection::~WebIDBServerConnection):
(WebKit::WebIDBServerConnection::isClosed):
(WebKit::WebIDBServerConnection::getOrEstablishIDBDatabaseMetadata):
(WebKit::WebIDBServerConnection::deleteDatabase):
(WebKit::WebIDBServerConnection::close):
(WebKit::WebIDBServerConnection::openTransaction):
(WebKit::WebIDBServerConnection::beginTransaction):
(WebKit::WebIDBServerConnection::commitTransaction):
(WebKit::WebIDBServerConnection::resetTransaction):
(WebKit::WebIDBServerConnection::rollbackTransaction):
(WebKit::WebIDBServerConnection::setIndexKeys):
(WebKit::WebIDBServerConnection::createObjectStore):
(WebKit::WebIDBServerConnection::createIndex):
(WebKit::WebIDBServerConnection::deleteIndex):
(WebKit::WebIDBServerConnection::get):
(WebKit::WebIDBServerConnection::put):
(WebKit::WebIDBServerConnection::openCursor):
(WebKit::WebIDBServerConnection::count):
(WebKit::WebIDBServerConnection::deleteRange):
(WebKit::WebIDBServerConnection::clearObjectStore):
(WebKit::WebIDBServerConnection::deleteObjectStore):
(WebKit::WebIDBServerConnection::changeDatabaseVersion):
(WebKit::WebIDBServerConnection::cursorAdvance):
(WebKit::WebIDBServerConnection::cursorIterate):
(WebKit::WebIDBServerConnection::cursorPrefetchIteration):
(WebKit::WebIDBServerConnection::cursorPrefetchReset):
(WebKit::WebIDBServerConnection::messageSenderConnection):
* WebProcess/Databases/IndexedDB/WebIDBServerConnection.h: Added.

* WebProcess/Databases/IndexedDB/WebProcessIDBDatabaseBackend.cpp: Removed.
* WebProcess/Databases/IndexedDB/WebProcessIDBDatabaseBackend.h: Removed.

* WebProcess/Databases/WebToDatabaseProcessConnection.cpp:

* DerivedSources.make:
* WebKit2.xcodeproj/project.pbxproj:

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

20 files changed:
Source/WebCore/ChangeLog
Source/WebCore/WebCore.exp.in
Source/WebCore/WebCore.xcodeproj/project.pbxproj
Source/WebKit2/ChangeLog
Source/WebKit2/DatabaseProcess/DatabaseToWebProcessConnection.cpp
Source/WebKit2/DatabaseProcess/DatabaseToWebProcessConnection.h
Source/WebKit2/DatabaseProcess/DatabaseToWebProcessConnection.messages.in
Source/WebKit2/DatabaseProcess/IndexedDB/DatabaseProcessIDBConnection.cpp [moved from Source/WebKit2/DatabaseProcess/IndexedDB/DatabaseProcessIDBDatabaseBackend.cpp with 83% similarity]
Source/WebKit2/DatabaseProcess/IndexedDB/DatabaseProcessIDBConnection.h [moved from Source/WebKit2/DatabaseProcess/IndexedDB/DatabaseProcessIDBDatabaseBackend.h with 66% similarity]
Source/WebKit2/DatabaseProcess/IndexedDB/DatabaseProcessIDBConnection.messages.in [moved from Source/WebKit2/DatabaseProcess/IndexedDB/DatabaseProcessIDBDatabaseBackend.messages.in with 94% similarity]
Source/WebKit2/DerivedSources.make
Source/WebKit2/Shared/Databases/IndexedDB/IDBUtilities.cpp
Source/WebKit2/Shared/Databases/IndexedDB/IDBUtilities.h
Source/WebKit2/WebKit2.xcodeproj/project.pbxproj
Source/WebKit2/WebProcess/Databases/IndexedDB/WebIDBFactoryBackend.cpp
Source/WebKit2/WebProcess/Databases/IndexedDB/WebIDBServerConnection.cpp [new file with mode: 0644]
Source/WebKit2/WebProcess/Databases/IndexedDB/WebIDBServerConnection.h [new file with mode: 0644]
Source/WebKit2/WebProcess/Databases/IndexedDB/WebProcessIDBDatabaseBackend.cpp [deleted file]
Source/WebKit2/WebProcess/Databases/IndexedDB/WebProcessIDBDatabaseBackend.h [deleted file]
Source/WebKit2/WebProcess/Databases/WebToDatabaseProcessConnection.cpp

index 7831f0a..869c254 100644 (file)
@@ -1,3 +1,15 @@
+2013-11-19  Brady Eidson  <beidson@apple.com>
+
+        Add WebIDBServerConnection and DatabaseProcessIDBConnection stubs
+        https://bugs.webkit.org/show_bug.cgi?id=124562
+
+        Reviewed by Alexey Proskuryakov.
+
+        Export some more symbols and headers for WK2 to use.
+
+        * WebCore.exp.in:
+        * WebCore.xcodeproj/project.pbxproj:
+
 2013-11-19  Frédéric Wang  <fred.wang@free.fr>
 
         Map the dir attribute to the CSS direction property.
index 14242b3..6fa0beb 100644 (file)
@@ -2894,3 +2894,9 @@ __ZN7WebCore25MediaPlayerFactorySupport23callRegisterMediaEngineEPFvPFvPFN3WTF10
 #if ENABLE(MEDIA_SOURCE)
 __ZN7WebCore26MockMediaPlayerMediaSource19registerMediaEngineEPFvPFN3WTF10PassOwnPtrINS_27MediaPlayerPrivateInterfaceEEEPNS_11MediaPlayerEEPFvRNS1_7HashSetINS1_6StringENS1_10StringHashENS1_10HashTraitsISA_EEEEEPFNS5_12SupportsTypeERKNS_28MediaEngineSupportParametersEEPFvRNS1_6VectorISA_Lm0ENS1_15CrashOnOverflowEEEEPFvvEPFvRKSA_EE
 #endif
+
+#if ENABLE(INDEXED_DATABASE)
+__ZN7WebCore18IDBDatabaseBackend14openConnectionEN3WTF10PassRefPtrINS_12IDBCallbacksEEENS2_INS_20IDBDatabaseCallbacksEEExy
+__ZN7WebCore18IDBDatabaseBackend6createERKN3WTF6StringES4_PNS_26IDBFactoryBackendInterfaceERNS_19IDBServerConnectionE
+__ZN7WebCore18IDBDatabaseBackendD1Ev
+#endif
index 875b136..38ff322 100644 (file)
                510194401836D20800925523 /* IDBIndexWriterLevelDB.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5101943E1836D20800925523 /* IDBIndexWriterLevelDB.cpp */; };
                510194411836D20800925523 /* IDBIndexWriterLevelDB.h in Headers */ = {isa = PBXBuildFile; fileRef = 5101943F1836D20800925523 /* IDBIndexWriterLevelDB.h */; };
                510194441836F7E400925523 /* IDBCursorBackendOperations.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 510194421836F7E400925523 /* IDBCursorBackendOperations.cpp */; };
-               510194451836F7E500925523 /* IDBCursorBackendOperations.h in Headers */ = {isa = PBXBuildFile; fileRef = 510194431836F7E400925523 /* IDBCursorBackendOperations.h */; };
+               510194451836F7E500925523 /* IDBCursorBackendOperations.h in Headers */ = {isa = PBXBuildFile; fileRef = 510194431836F7E400925523 /* IDBCursorBackendOperations.h */; settings = {ATTRIBUTES = (Private, ); }; };
                51059DDD1820B17600DFF9B1 /* IDBTransactionBackendOperations.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 51059DD91820B17600DFF9B1 /* IDBTransactionBackendOperations.cpp */; };
-               51059DDE1820B17600DFF9B1 /* IDBTransactionBackendOperations.h in Headers */ = {isa = PBXBuildFile; fileRef = 51059DDA1820B17600DFF9B1 /* IDBTransactionBackendOperations.h */; };
+               51059DDE1820B17600DFF9B1 /* IDBTransactionBackendOperations.h in Headers */ = {isa = PBXBuildFile; fileRef = 51059DDA1820B17600DFF9B1 /* IDBTransactionBackendOperations.h */; settings = {ATTRIBUTES = (Private, ); }; };
                510A326F18318431003C5326 /* IDBServerConnection.h in Headers */ = {isa = PBXBuildFile; fileRef = 510A326E18318431003C5326 /* IDBServerConnection.h */; settings = {ATTRIBUTES = (Private, ); }; };
                510B7DB7182D9F5D009BF957 /* IDBTransactionBackend.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 510B7DB5182D9F5D009BF957 /* IDBTransactionBackend.cpp */; };
                510B7DB8182D9F5D009BF957 /* IDBTransactionBackend.h in Headers */ = {isa = PBXBuildFile; fileRef = 510B7DB6182D9F5D009BF957 /* IDBTransactionBackend.h */; settings = {ATTRIBUTES = (Private, ); }; };
index eed4ff7..ecfcb2e 100644 (file)
@@ -1,3 +1,74 @@
+2013-11-19  Brady Eidson  <beidson@apple.com>
+
+        Add WebIDBServerConnection and DatabaseProcessIDBConnection stubs
+        https://bugs.webkit.org/show_bug.cgi?id=124562
+
+        Reviewed by Alexey Proskuryakov.
+
+        Also remove Web/DatabaseProcessDatabaseBackend stubs, as that is no longer the abstraction layer.
+
+        * DatabaseProcess/DatabaseToWebProcessConnection.cpp:
+        (WebKit::DatabaseToWebProcessConnection::didReceiveMessage):
+        (WebKit::DatabaseToWebProcessConnection::establishIDBConnection):
+        * DatabaseProcess/DatabaseToWebProcessConnection.h:
+        * DatabaseProcess/DatabaseToWebProcessConnection.messages.in:
+
+        * DatabaseProcess/IndexedDB/DatabaseProcessIDBConnection.cpp: Renamed from Source/WebKit2/DatabaseProcess/IndexedDB/DatabaseProcessIDBDatabaseBackend.cpp.
+        (WebKit::DatabaseProcessIDBConnection::DatabaseProcessIDBConnection):
+        (WebKit::DatabaseProcessIDBConnection::~DatabaseProcessIDBConnection):
+        (WebKit::DatabaseProcessIDBConnection::establishConnection):
+        (WebKit::DatabaseProcessIDBConnection::messageSenderConnection):
+        * DatabaseProcess/IndexedDB/DatabaseProcessIDBConnection.h: Renamed from Source/WebKit2/DatabaseProcess/IndexedDB/DatabaseProcessIDBDatabaseBackend.h.
+        (WebKit::DatabaseProcessIDBConnection::create):
+        * DatabaseProcess/IndexedDB/DatabaseProcessIDBConnection.messages.in: Renamed from Source/WebKit2/DatabaseProcess/IndexedDB/DatabaseProcessIDBDatabaseBackend.messages.in.
+
+        * Shared/Databases/IndexedDB/IDBUtilities.cpp:
+        (WebKit::uniqueDatabaseIdentifier): Modified to take two security origin arguments.
+        * Shared/Databases/IndexedDB/IDBUtilities.h:
+
+        * WebProcess/Databases/IndexedDB/WebIDBFactoryBackend.cpp:
+        (WebKit::WebIDBFactoryBackend::open):
+
+        * WebProcess/Databases/IndexedDB/WebIDBServerConnection.cpp: Added. Stubbed out all the pure virtual methods.
+        (WebKit::generateBackendIdentifier):
+        (WebKit::WebIDBServerConnection::WebIDBServerConnection):
+        (WebKit::WebIDBServerConnection::~WebIDBServerConnection):
+        (WebKit::WebIDBServerConnection::isClosed):
+        (WebKit::WebIDBServerConnection::getOrEstablishIDBDatabaseMetadata):
+        (WebKit::WebIDBServerConnection::deleteDatabase):
+        (WebKit::WebIDBServerConnection::close):
+        (WebKit::WebIDBServerConnection::openTransaction):
+        (WebKit::WebIDBServerConnection::beginTransaction):
+        (WebKit::WebIDBServerConnection::commitTransaction):
+        (WebKit::WebIDBServerConnection::resetTransaction):
+        (WebKit::WebIDBServerConnection::rollbackTransaction):
+        (WebKit::WebIDBServerConnection::setIndexKeys):
+        (WebKit::WebIDBServerConnection::createObjectStore):
+        (WebKit::WebIDBServerConnection::createIndex):
+        (WebKit::WebIDBServerConnection::deleteIndex):
+        (WebKit::WebIDBServerConnection::get):
+        (WebKit::WebIDBServerConnection::put):
+        (WebKit::WebIDBServerConnection::openCursor):
+        (WebKit::WebIDBServerConnection::count):
+        (WebKit::WebIDBServerConnection::deleteRange):
+        (WebKit::WebIDBServerConnection::clearObjectStore):
+        (WebKit::WebIDBServerConnection::deleteObjectStore):
+        (WebKit::WebIDBServerConnection::changeDatabaseVersion):
+        (WebKit::WebIDBServerConnection::cursorAdvance):
+        (WebKit::WebIDBServerConnection::cursorIterate):
+        (WebKit::WebIDBServerConnection::cursorPrefetchIteration):
+        (WebKit::WebIDBServerConnection::cursorPrefetchReset):
+        (WebKit::WebIDBServerConnection::messageSenderConnection):
+        * WebProcess/Databases/IndexedDB/WebIDBServerConnection.h: Added.
+
+        * WebProcess/Databases/IndexedDB/WebProcessIDBDatabaseBackend.cpp: Removed.
+        * WebProcess/Databases/IndexedDB/WebProcessIDBDatabaseBackend.h: Removed.
+
+        * WebProcess/Databases/WebToDatabaseProcessConnection.cpp:
+
+        * DerivedSources.make:
+        * WebKit2.xcodeproj/project.pbxproj:
+
 2013-11-19  Michał Pakuła vel Rutka  <m.pakula@samsung.com>
 
         Unreviewed EFL and GTK build fix attempt after r159507
index a6fe73a..56c5f60 100644 (file)
 #include "config.h"
 #include "DatabaseToWebProcessConnection.h"
 
-#include "DatabaseProcessIDBDatabaseBackend.h"
-#include "DatabaseProcessIDBDatabaseBackendMessages.h"
+#include "DatabaseProcessIDBConnection.h"
+#include "DatabaseProcessIDBConnectionMessages.h"
 #include "DatabaseToWebProcessConnectionMessages.h"
 #include <wtf/RunLoop.h>
 
 #if ENABLE(DATABASE_PROCESS)
 
-using namespace WebCore;
-
 namespace WebKit {
 
 PassRefPtr<DatabaseToWebProcessConnection> DatabaseToWebProcessConnection::create(CoreIPC::Connection::Identifier connectionIdentifier)
@@ -61,10 +59,10 @@ void DatabaseToWebProcessConnection::didReceiveMessage(CoreIPC::Connection* conn
         return;
     }
 
-    if (decoder.messageReceiverName() == Messages::DatabaseProcessIDBDatabaseBackend::messageReceiverName()) {
-        IDBDatabaseBackendMap::iterator backendIterator = m_idbDatabaseBackends.find(decoder.destinationID());
-        if (backendIterator != m_idbDatabaseBackends.end())
-            backendIterator->value->didReceiveDatabaseProcessIDBDatabaseBackendMessage(connection, decoder);
+    if (decoder.messageReceiverName() == Messages::DatabaseProcessIDBConnection::messageReceiverName()) {
+        IDBConnectionMap::iterator backendIterator = m_idbConnections.find(decoder.destinationID());
+        if (backendIterator != m_idbConnections.end())
+            backendIterator->value->didReceiveDatabaseProcessIDBConnectionMessage(connection, decoder);
         return;
     }
     
@@ -81,10 +79,10 @@ void DatabaseToWebProcessConnection::didReceiveInvalidMessage(CoreIPC::Connectio
 
 }
 
-void DatabaseToWebProcessConnection::establishIDBDatabaseBackend(uint64_t backendIdentifier)
+void DatabaseToWebProcessConnection::establishIDBConnection(uint64_t backendIdentifier)
 {
-    RefPtr<DatabaseProcessIDBDatabaseBackend> backend = DatabaseProcessIDBDatabaseBackend::create(backendIdentifier);
-    m_idbDatabaseBackends.set(backendIdentifier, backend.release());
+    RefPtr<DatabaseProcessIDBConnection> connection = DatabaseProcessIDBConnection::create(backendIdentifier);
+    m_idbConnections.set(backendIdentifier, connection.release());
 }
 
 } // namespace WebKit
index 67dc96c..aee467b 100644 (file)
@@ -35,7 +35,7 @@
 
 namespace WebKit {
 
-class DatabaseProcessIDBDatabaseBackend;
+class DatabaseProcessIDBConnection;
 
 class DatabaseToWebProcessConnection : public RefCounted<DatabaseToWebProcessConnection>, public CoreIPC::Connection::Client, public CoreIPC::MessageSender {
 public:
@@ -59,10 +59,10 @@ private:
 
 #if ENABLE(INDEXED_DATABASE)
     // Messages handlers
-    void establishIDBDatabaseBackend(uint64_t backendIdentifier);
+    void establishIDBConnection(uint64_t backendIdentifier);
 
-    typedef HashMap<uint64_t, RefPtr<DatabaseProcessIDBDatabaseBackend>> IDBDatabaseBackendMap;
-    IDBDatabaseBackendMap m_idbDatabaseBackends;
+    typedef HashMap<uint64_t, RefPtr<DatabaseProcessIDBConnection>> IDBConnectionMap;
+    IDBConnectionMap m_idbConnections;
 #endif // ENABLE(INDEXED_DATABASE)
 
     RefPtr<CoreIPC::Connection> m_connection;
index 6e96565..63bdde8 100644 (file)
@@ -25,7 +25,7 @@
 messages -> DatabaseToWebProcessConnection LegacyReceiver {
 #if ENABLE(INDEXED_DATABASE)
     # Creates a connection for communication with a WebProcess
-    EstablishIDBDatabaseBackend(uint64_t backendIdentifier)
+    EstablishIDBConnection(uint64_t backendIdentifier)
 #endif
 }
 
@@ -24,7 +24,7 @@
  */
 
 #include "config.h"
-#include "DatabaseProcessIDBDatabaseBackend.h"
+#include "DatabaseProcessIDBConnection.h"
 
 #include "DatabaseToWebProcessConnection.h"
 
 
 namespace WebKit {
 
-DatabaseProcessIDBDatabaseBackend::DatabaseProcessIDBDatabaseBackend(uint64_t backendIdentifier)
+DatabaseProcessIDBConnection::DatabaseProcessIDBConnection(uint64_t backendIdentifier)
     : m_backendIdentifier(backendIdentifier)
 {
 }
 
-DatabaseProcessIDBDatabaseBackend::~DatabaseProcessIDBDatabaseBackend()
+DatabaseProcessIDBConnection::~DatabaseProcessIDBConnection()
 {
 }
 
-void DatabaseProcessIDBDatabaseBackend::openConnection()
+void DatabaseProcessIDBConnection::establishConnection()
 {
     // FIXME: This method is successfully called by messaging from the WebProcess.
     // Now implement it.
 }
 
-CoreIPC::Connection* DatabaseProcessIDBDatabaseBackend::messageSenderConnection()
+CoreIPC::Connection* DatabaseProcessIDBConnection::messageSenderConnection()
 {
     return m_connection->connection();
 }
  * THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#ifndef DatabaseProcessIDBDatabaseBackend_h
-#define DatabaseProcessIDBDatabaseBackend_h
+#ifndef DatabaseProcessIDBConnection_h
+#define DatabaseProcessIDBConnection_h
 
 #include "MessageSender.h"
-#include <WebCore/IDBDatabaseBackend.h>
 
 #if ENABLE(INDEXED_DATABASE) && ENABLE(DATABASE_PROCESS)
 
@@ -35,31 +34,27 @@ namespace WebKit {
 
 class DatabaseToWebProcessConnection;
 
-// FIXME: When adding actual IDB logic, this class will inherit from WebCore::IDBDatabaseBackend
-// instead of inheriting from RefCounted directly.
-// Doing so will also add a large number of interface methods to implement which is why I'm holding off for now.
-
-class DatabaseProcessIDBDatabaseBackend : public RefCounted<DatabaseProcessIDBDatabaseBackend>, public CoreIPC::MessageSender {
+class DatabaseProcessIDBConnection : public RefCounted<DatabaseProcessIDBConnection>, public CoreIPC::MessageSender {
 public:
-    static RefPtr<DatabaseProcessIDBDatabaseBackend> create(uint64_t backendIdentifier)
+    static RefPtr<DatabaseProcessIDBConnection> create(uint64_t backendIdentifier)
     {
-        return adoptRef(new DatabaseProcessIDBDatabaseBackend(backendIdentifier));
+        return adoptRef(new DatabaseProcessIDBConnection(backendIdentifier));
     }
 
-    virtual ~DatabaseProcessIDBDatabaseBackend();
+    virtual ~DatabaseProcessIDBConnection();
 
     // Message handlers.
-    void didReceiveDatabaseProcessIDBDatabaseBackendMessage(CoreIPC::Connection*, CoreIPC::MessageDecoder&);
+    void didReceiveDatabaseProcessIDBConnectionMessage(CoreIPC::Connection*, CoreIPC::MessageDecoder&);
 
 private:
-    DatabaseProcessIDBDatabaseBackend(uint64_t backendIdentifier);
+    DatabaseProcessIDBConnection(uint64_t backendIdentifier);
 
     // CoreIPC::MessageSender
     virtual CoreIPC::Connection* messageSenderConnection() OVERRIDE;
     virtual uint64_t messageSenderDestinationID() OVERRIDE { return m_backendIdentifier; }
 
     // Message handlers.
-    void openConnection();
+    void establishConnection();
 
     RefPtr<DatabaseToWebProcessConnection> m_connection;
     uint64_t m_backendIdentifier;
@@ -68,4 +63,4 @@ private:
 } // namespace WebKit
 
 #endif // ENABLE(INDEXED_DATABASE) && ENABLE(DATABASE_PROCESS)
-#endif // DatabaseProcessIDBDatabaseBackend_h
+#endif // DatabaseProcessIDBConnection_h
@@ -22,8 +22,8 @@
 
 #if ENABLE(INDEXED_DATABASE) && ENABLE(DATABASE_PROCESS)
 
-messages -> DatabaseProcessIDBDatabaseBackend LegacyReceiver {
-    OpenConnection()
+messages -> DatabaseProcessIDBConnection LegacyReceiver {
+    EstablishConnection()
 }
 
 #endif // ENABLE(INDEXED_DATABASE) && ENABLE(DATABASE_PROCESS)
index c43835b..75e9116 100644 (file)
@@ -64,7 +64,7 @@ MESSAGE_RECEIVERS = \
     CustomProtocolManager \
     CustomProtocolManagerProxy \
     DatabaseProcess \
-    DatabaseProcessIDBDatabaseBackend \
+    DatabaseProcessIDBConnection \
     DatabaseProcessProxy \
     DatabaseToWebProcessConnection \
     DrawingArea \
index 011e254..0258f5d 100644 (file)
 #include "IDBUtilities.h"
 
 #include <WebCore/SecurityOrigin.h>
+#include <wtf/text/StringBuilder.h>
 
 #if ENABLE(INDEXED_DATABASE)
 
 namespace WebKit {
 
-String uniqueDatabaseIdentifier(const String& databaseName, const WebCore::SecurityOrigin& securityOrigin)
+String uniqueDatabaseIdentifier(const String& databaseName, const WebCore::SecurityOrigin& openingOrigin, const WebCore::SecurityOrigin& mainFrameOrigin)
 {
-    return securityOrigin.databaseIdentifier() + databaseName;
+    StringBuilder stringBuilder;
+
+    String originString = openingOrigin.toString();
+    if (originString == "null")
+        return String();
+    stringBuilder.append(originString);
+    stringBuilder.append("_");
+
+    originString = mainFrameOrigin.toString();
+    if (originString == "null")
+        return String();
+    stringBuilder.append(originString);
+
+    stringBuilder.append("_");
+    stringBuilder.append(databaseName);
+
+    return stringBuilder.toString();
 }
 
 } // namespace WebKit
index 2edf7eb..916b1ba 100644 (file)
@@ -39,7 +39,7 @@ class SecurityOrigin;
 
 namespace WebKit {
 
-String uniqueDatabaseIdentifier(const String& databaseName, const WebCore::SecurityOrigin&);
+String uniqueDatabaseIdentifier(const String& databaseName, const WebCore::SecurityOrigin& openingOrigin, const WebCore::SecurityOrigin& mainFrameOrigin);
     
 } // namespace WebKit
 
index 4dc7c2b..e0c5097 100644 (file)
                51217465164C21370037A5C1 /* WebResourceBuffer.h in Headers */ = {isa = PBXBuildFile; fileRef = 51217463164C21370037A5C1 /* WebResourceBuffer.h */; };
                5123CF1B133D260A0056F800 /* WKIconDatabaseCG.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5123CF19133D260A0056F800 /* WKIconDatabaseCG.cpp */; };
                5123CF1C133D260A0056F800 /* WKIconDatabaseCG.h in Headers */ = {isa = PBXBuildFile; fileRef = 5123CF1A133D260A0056F800 /* WKIconDatabaseCG.h */; settings = {ATTRIBUTES = (Private, ); }; };
+               51290992183ACEAF005522A6 /* WebIDBServerConnection.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 51290990183ACEAF005522A6 /* WebIDBServerConnection.cpp */; };
+               51290993183ACEAF005522A6 /* WebIDBServerConnection.h in Headers */ = {isa = PBXBuildFile; fileRef = 51290991183ACEAF005522A6 /* WebIDBServerConnection.h */; };
                512935D71288D19400A4B695 /* WebContextMenuItem.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 512935D51288D19400A4B695 /* WebContextMenuItem.cpp */; };
                512935D81288D19400A4B695 /* WebContextMenuItem.h in Headers */ = {isa = PBXBuildFile; fileRef = 512935D61288D19400A4B695 /* WebContextMenuItem.h */; };
                512935E31288D97800A4B695 /* InjectedBundlePageContextMenuClient.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 512935E11288D97800A4B695 /* InjectedBundlePageContextMenuClient.cpp */; };
                51D02F6A132EC73700BEAA96 /* WebIconDatabaseMessages.h in Headers */ = {isa = PBXBuildFile; fileRef = 51D02F67132EC73700BEAA96 /* WebIconDatabaseMessages.h */; };
                51D02F6B132EC73700BEAA96 /* WebIconDatabaseProxyMessageReceiver.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 51D02F68132EC73700BEAA96 /* WebIconDatabaseProxyMessageReceiver.cpp */; };
                51D02F6C132EC73700BEAA96 /* WebIconDatabaseProxyMessages.h in Headers */ = {isa = PBXBuildFile; fileRef = 51D02F69132EC73700BEAA96 /* WebIconDatabaseProxyMessages.h */; };
+               51D0D431183B34130097041D /* DatabaseProcessIDBConnection.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 51D0D42E183B34130097041D /* DatabaseProcessIDBConnection.cpp */; };
+               51D0D436183B353D0097041D /* DatabaseProcessIDBConnectionMessageReceiver.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 51D0D434183B353D0097041D /* DatabaseProcessIDBConnectionMessageReceiver.cpp */; };
+               51D0D437183B353D0097041D /* DatabaseProcessIDBConnectionMessages.h in Headers */ = {isa = PBXBuildFile; fileRef = 51D0D435183B353D0097041D /* DatabaseProcessIDBConnectionMessages.h */; };
                51D1304E1382E5B700351EDD /* Security.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BCF5068412431861005955AE /* Security.framework */; };
                51D130531382EAC000351EDD /* SecItemRequestData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 51D1304F1382EAC000351EDD /* SecItemRequestData.cpp */; };
                51D130541382EAC000351EDD /* SecItemRequestData.h in Headers */ = {isa = PBXBuildFile; fileRef = 51D130501382EAC000351EDD /* SecItemRequestData.h */; };
                51E351CB180F2CCC00E53BE9 /* IDBUtilities.h in Headers */ = {isa = PBXBuildFile; fileRef = 51E351C9180F2CCC00E53BE9 /* IDBUtilities.h */; };
                51E351F5180F5C7500E53BE9 /* WebIDBFactoryBackend.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 51E351F1180F5C7500E53BE9 /* WebIDBFactoryBackend.cpp */; };
                51E351F6180F5C7500E53BE9 /* WebIDBFactoryBackend.h in Headers */ = {isa = PBXBuildFile; fileRef = 51E351F2180F5C7500E53BE9 /* WebIDBFactoryBackend.h */; };
-               51E351F7180F5C7500E53BE9 /* WebProcessIDBDatabaseBackend.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 51E351F3180F5C7500E53BE9 /* WebProcessIDBDatabaseBackend.cpp */; };
-               51E351F8180F5C7500E53BE9 /* WebProcessIDBDatabaseBackend.h in Headers */ = {isa = PBXBuildFile; fileRef = 51E351F4180F5C7500E53BE9 /* WebProcessIDBDatabaseBackend.h */; };
                51E351FF180F5D0F00E53BE9 /* DatabaseProcess.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 51E351FA180F5D0B00E53BE9 /* DatabaseProcess.cpp */; };
                51E35200180F5D0F00E53BE9 /* DatabaseToWebProcessConnection.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 51E351FD180F5D0B00E53BE9 /* DatabaseToWebProcessConnection.cpp */; };
                51E35202180F5D1E00E53BE9 /* DatabaseProcessMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 51E35201180F5D1E00E53BE9 /* DatabaseProcessMac.mm */; };
                51E35205180F5D4F00E53BE9 /* DatabaseProcessMain.mm in Sources */ = {isa = PBXBuildFile; fileRef = 51E35203180F5D4B00E53BE9 /* DatabaseProcessMain.mm */; };
                51E35209180F5D6B00E53BE9 /* DatabaseServiceEntryPoint.mm in Sources */ = {isa = PBXBuildFile; fileRef = 51E35208180F5D6B00E53BE9 /* DatabaseServiceEntryPoint.mm */; };
-               51E3520D180F5DA000E53BE9 /* DatabaseProcessIDBDatabaseBackend.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 51E3520A180F5D9D00E53BE9 /* DatabaseProcessIDBDatabaseBackend.cpp */; };
-               51E35210180F63FB00E53BE9 /* DatabaseProcessIDBDatabaseBackendMessageReceiver.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 51E3520E180F63FB00E53BE9 /* DatabaseProcessIDBDatabaseBackendMessageReceiver.cpp */; };
-               51E35211180F63FB00E53BE9 /* DatabaseProcessIDBDatabaseBackendMessages.h in Headers */ = {isa = PBXBuildFile; fileRef = 51E3520F180F63FB00E53BE9 /* DatabaseProcessIDBDatabaseBackendMessages.h */; };
                51E3B67F16F266B3009968DC /* NetworkResourceLoaderMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 51E3B67E16F266B3009968DC /* NetworkResourceLoaderMac.mm */; };
                51EFC1CF1524E62500C9A938 /* WKBundleDOMWindowExtension.h in Headers */ = {isa = PBXBuildFile; fileRef = 51FA2D541521118600C1BA0B /* WKBundleDOMWindowExtension.h */; settings = {ATTRIBUTES = (Private, ); }; };
                51F060E01654317F00F3281B /* WebResourceLoaderMessages.h in Headers */ = {isa = PBXBuildFile; fileRef = 51F060DE1654317500F3281B /* WebResourceLoaderMessages.h */; };
                51217463164C21370037A5C1 /* WebResourceBuffer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebResourceBuffer.h; sourceTree = "<group>"; };
                5123CF19133D260A0056F800 /* WKIconDatabaseCG.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = WKIconDatabaseCG.cpp; path = cg/WKIconDatabaseCG.cpp; sourceTree = "<group>"; };
                5123CF1A133D260A0056F800 /* WKIconDatabaseCG.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = WKIconDatabaseCG.h; path = cg/WKIconDatabaseCG.h; sourceTree = "<group>"; };
+               51290990183ACEAF005522A6 /* WebIDBServerConnection.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebIDBServerConnection.cpp; sourceTree = "<group>"; };
+               51290991183ACEAF005522A6 /* WebIDBServerConnection.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebIDBServerConnection.h; sourceTree = "<group>"; };
                512935D51288D19400A4B695 /* WebContextMenuItem.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebContextMenuItem.cpp; sourceTree = "<group>"; };
                512935D61288D19400A4B695 /* WebContextMenuItem.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebContextMenuItem.h; sourceTree = "<group>"; };
                512935E11288D97800A4B695 /* InjectedBundlePageContextMenuClient.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InjectedBundlePageContextMenuClient.cpp; sourceTree = "<group>"; };
                51D02F67132EC73700BEAA96 /* WebIconDatabaseMessages.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebIconDatabaseMessages.h; sourceTree = "<group>"; };
                51D02F68132EC73700BEAA96 /* WebIconDatabaseProxyMessageReceiver.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebIconDatabaseProxyMessageReceiver.cpp; sourceTree = "<group>"; };
                51D02F69132EC73700BEAA96 /* WebIconDatabaseProxyMessages.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebIconDatabaseProxyMessages.h; sourceTree = "<group>"; };
+               51D0D42E183B34130097041D /* DatabaseProcessIDBConnection.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DatabaseProcessIDBConnection.cpp; sourceTree = "<group>"; };
+               51D0D42F183B34130097041D /* DatabaseProcessIDBConnection.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DatabaseProcessIDBConnection.h; sourceTree = "<group>"; };
+               51D0D430183B34130097041D /* DatabaseProcessIDBConnection.messages.in */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = DatabaseProcessIDBConnection.messages.in; sourceTree = "<group>"; };
+               51D0D434183B353D0097041D /* DatabaseProcessIDBConnectionMessageReceiver.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DatabaseProcessIDBConnectionMessageReceiver.cpp; sourceTree = "<group>"; };
+               51D0D435183B353D0097041D /* DatabaseProcessIDBConnectionMessages.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DatabaseProcessIDBConnectionMessages.h; sourceTree = "<group>"; };
                51D1304F1382EAC000351EDD /* SecItemRequestData.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SecItemRequestData.cpp; sourceTree = "<group>"; };
                51D130501382EAC000351EDD /* SecItemRequestData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SecItemRequestData.h; sourceTree = "<group>"; };
                51D130511382EAC000351EDD /* SecItemResponseData.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SecItemResponseData.cpp; sourceTree = "<group>"; };
                51E351C9180F2CCC00E53BE9 /* IDBUtilities.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IDBUtilities.h; sourceTree = "<group>"; };
                51E351F1180F5C7500E53BE9 /* WebIDBFactoryBackend.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebIDBFactoryBackend.cpp; sourceTree = "<group>"; };
                51E351F2180F5C7500E53BE9 /* WebIDBFactoryBackend.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebIDBFactoryBackend.h; sourceTree = "<group>"; };
-               51E351F3180F5C7500E53BE9 /* WebProcessIDBDatabaseBackend.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebProcessIDBDatabaseBackend.cpp; sourceTree = "<group>"; };
-               51E351F4180F5C7500E53BE9 /* WebProcessIDBDatabaseBackend.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebProcessIDBDatabaseBackend.h; sourceTree = "<group>"; };
                51E351FA180F5D0B00E53BE9 /* DatabaseProcess.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = DatabaseProcess.cpp; sourceTree = "<group>"; };
                51E351FB180F5D0B00E53BE9 /* DatabaseProcess.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = DatabaseProcess.h; sourceTree = "<group>"; };
                51E351FC180F5D0B00E53BE9 /* DatabaseProcess.messages.in */ = {isa = PBXFileReference; lastKnownFileType = text; path = DatabaseProcess.messages.in; sourceTree = "<group>"; };
                51E35206180F5D5900E53BE9 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
                51E35207180F5D6100E53BE9 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
                51E35208180F5D6B00E53BE9 /* DatabaseServiceEntryPoint.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = DatabaseServiceEntryPoint.mm; sourceTree = "<group>"; };
-               51E3520A180F5D9D00E53BE9 /* DatabaseProcessIDBDatabaseBackend.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = DatabaseProcessIDBDatabaseBackend.cpp; sourceTree = "<group>"; };
-               51E3520B180F5D9D00E53BE9 /* DatabaseProcessIDBDatabaseBackend.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = DatabaseProcessIDBDatabaseBackend.h; sourceTree = "<group>"; };
-               51E3520C180F5D9D00E53BE9 /* DatabaseProcessIDBDatabaseBackend.messages.in */ = {isa = PBXFileReference; lastKnownFileType = text; path = DatabaseProcessIDBDatabaseBackend.messages.in; sourceTree = "<group>"; };
-               51E3520E180F63FB00E53BE9 /* DatabaseProcessIDBDatabaseBackendMessageReceiver.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DatabaseProcessIDBDatabaseBackendMessageReceiver.cpp; sourceTree = "<group>"; };
-               51E3520F180F63FB00E53BE9 /* DatabaseProcessIDBDatabaseBackendMessages.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DatabaseProcessIDBDatabaseBackendMessages.h; sourceTree = "<group>"; };
                51E3B67E16F266B3009968DC /* NetworkResourceLoaderMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = NetworkResourceLoaderMac.mm; sourceTree = "<group>"; };
                51F060DD1654317500F3281B /* WebResourceLoaderMessageReceiver.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = WebResourceLoaderMessageReceiver.cpp; sourceTree = "<group>"; };
                51F060DE1654317500F3281B /* WebResourceLoaderMessages.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = WebResourceLoaderMessages.h; sourceTree = "<group>"; };
                511F8EDA180881660047DA96 /* IndexedDB */ = {
                        isa = PBXGroup;
                        children = (
+                               51290990183ACEAF005522A6 /* WebIDBServerConnection.cpp */,
+                               51290991183ACEAF005522A6 /* WebIDBServerConnection.h */,
                                51E351F1180F5C7500E53BE9 /* WebIDBFactoryBackend.cpp */,
                                51E351F2180F5C7500E53BE9 /* WebIDBFactoryBackend.h */,
-                               51E351F3180F5C7500E53BE9 /* WebProcessIDBDatabaseBackend.cpp */,
-                               51E351F4180F5C7500E53BE9 /* WebProcessIDBDatabaseBackend.h */,
                        );
                        path = IndexedDB;
                        sourceTree = "<group>";
                51E351F9180F5CF600E53BE9 /* IndexedDB */ = {
                        isa = PBXGroup;
                        children = (
-                               51E3520A180F5D9D00E53BE9 /* DatabaseProcessIDBDatabaseBackend.cpp */,
-                               51E3520B180F5D9D00E53BE9 /* DatabaseProcessIDBDatabaseBackend.h */,
-                               51E3520C180F5D9D00E53BE9 /* DatabaseProcessIDBDatabaseBackend.messages.in */,
+                               51D0D42E183B34130097041D /* DatabaseProcessIDBConnection.cpp */,
+                               51D0D42F183B34130097041D /* DatabaseProcessIDBConnection.h */,
+                               51D0D430183B34130097041D /* DatabaseProcessIDBConnection.messages.in */,
                        );
                        path = IndexedDB;
                        sourceTree = "<group>";
                C0CE729D1247E71D00BC0EC4 /* Derived Sources */ = {
                        isa = PBXGroup;
                        children = (
-                               51032F1B180F791700961BB7 /* DatabaseToWebProcessConnectionMessageReceiver.cpp */,
-                               51032F1C180F791700961BB7 /* DatabaseToWebProcessConnectionMessages.h */,
                                75E749E5180DBB9800088BA6 /* WebOriginDataManagerMessageReceiver.cpp */,
                                75E749E6180DBB9800088BA6 /* WebOriginDataManagerMessages.h */,
                                75E749E7180DBB9800088BA6 /* WebOriginDataManagerProxyMessageReceiver.cpp */,
                                2984F587164BA095004BC0C6 /* CustomProtocolManagerMessages.h */,
                                2984F57A164B915F004BC0C6 /* CustomProtocolManagerProxyMessageReceiver.cpp */,
                                2984F57B164B915F004BC0C6 /* CustomProtocolManagerProxyMessages.h */,
-                               51E3520E180F63FB00E53BE9 /* DatabaseProcessIDBDatabaseBackendMessageReceiver.cpp */,
-                               51E3520F180F63FB00E53BE9 /* DatabaseProcessIDBDatabaseBackendMessages.h */,
+                               51D0D434183B353D0097041D /* DatabaseProcessIDBConnectionMessageReceiver.cpp */,
+                               51D0D435183B353D0097041D /* DatabaseProcessIDBConnectionMessages.h */,
                                512A975E180E03160039A149 /* DatabaseProcessMessageReceiver.cpp */,
                                512A975F180E03160039A149 /* DatabaseProcessMessages.h */,
                                512A9767180E09B80039A149 /* DatabaseProcessProxyMessageReceiver.cpp */,
                                512A9768180E09B80039A149 /* DatabaseProcessProxyMessages.h */,
+                               51032F1B180F791700961BB7 /* DatabaseToWebProcessConnectionMessageReceiver.cpp */,
+                               51032F1C180F791700961BB7 /* DatabaseToWebProcessConnectionMessages.h */,
                                1AB7D6171288B9D900CFD08C /* DownloadProxyMessageReceiver.cpp */,
                                1AB7D6181288B9D900CFD08C /* DownloadProxyMessages.h */,
                                1A64229712DD029200CAAE2C /* DrawingAreaMessageReceiver.cpp */,
                                1A2D843A127F65D5001EB962 /* NPObjectMessageReceiverMessages.h in Headers */,
                                1A2D82A7127F4EAB001EB962 /* NPObjectProxy.h in Headers */,
                                1A2D82A9127F4EAB001EB962 /* NPRemoteObjectMap.h in Headers */,
-                               51E351F8180F5C7500E53BE9 /* WebProcessIDBDatabaseBackend.h in Headers */,
                                1A2161B011F37664008AD0F5 /* NPRuntimeObjectMap.h in Headers */,
                                2DA049B8180CCD0A00AAFA9E /* GraphicsLayerCARemote.h in Headers */,
                                2DA049B4180CCCD300AAFA9E /* PlatformCALayerRemote.h in Headers */,
                                BCD25F1711D6BDE100169B0E /* WKBundleFrame.h in Headers */,
                                BCF049E611FE20F600F86A58 /* WKBundleFramePrivate.h in Headers */,
                                BC49862F124D18C100D834E1 /* WKBundleHitTestResult.h in Headers */,
-                               51E35211180F63FB00E53BE9 /* DatabaseProcessIDBDatabaseBackendMessages.h in Headers */,
                                BC204EF211C83EC8008F3375 /* WKBundleInitialize.h in Headers */,
                                65B86F1E12F11DE300B7DD8A /* WKBundleInspector.h in Headers */,
                                BC7043CC12F75EE0006472B9 /* WKBundleNavigationAction.h in Headers */,
                                1A9E328D182165A900F5D04C /* WKRemoteObjectInterface.h in Headers */,
                                293EBEAB1627D9C9005F89F1 /* WKDOMText.h in Headers */,
                                BC017D2116263308007054F5 /* WKDOMTextIterator.h in Headers */,
+                               51290993183ACEAF005522A6 /* WebIDBServerConnection.h in Headers */,
                                370F34A31829BE1E009027C8 /* WKNavigationData.h in Headers */,
                                1AB7D78D1288CD9A00CFD08C /* WKDownload.h in Headers */,
                                BC4075FC124FF0270068F20A /* WKError.h in Headers */,
                                BCD597D0112B56AC00EC8C23 /* WKPreferences.h in Headers */,
                                762B748D120BC75C00819339 /* WKPreferencesPrivate.h in Headers */,
                                37C4C08918149F23003688B9 /* WKBackForwardListItemInternal.h in Headers */,
+                               51D0D437183B353D0097041D /* DatabaseProcessIDBConnectionMessages.h in Headers */,
                                E134F01712EA5D33004EC58D /* WKPrintingView.h in Headers */,
                                BCBAACEB145225E30053F82F /* WKProcessGroup.h in Headers */,
                                BCBAACED145225E30053F82F /* WKProcessGroupPrivate.h in Headers */,
                                51DD9F2816367DA2001578E9 /* NetworkConnectionToWebProcessMessageReceiver.cpp in Sources */,
                                51795568162876CF00FA43B6 /* NetworkProcess.cpp in Sources */,
                                5183DDEC1630BDFC008BE5C7 /* NetworkProcessConnection.cpp in Sources */,
-                               51E351F7180F5C7500E53BE9 /* WebProcessIDBDatabaseBackend.cpp in Sources */,
                                517CF0E3163A486C00C2950E /* NetworkProcessConnectionMessageReceiver.cpp in Sources */,
                                51795570162877CF00FA43B6 /* NetworkProcessCreationParameters.cpp in Sources */,
                                51795567162876CB00FA43B6 /* NetworkProcessMac.mm in Sources */,
                                1A3D610113A7CC2A00F95D4E /* PluginModuleInfo.cpp in Sources */,
                                1A043977124D034800FFBFB5 /* PluginProcess.cpp in Sources */,
                                1A0EC907124C0AB8007EF4A5 /* PluginProcessConnection.cpp in Sources */,
-                               51E3520D180F5DA000E53BE9 /* DatabaseProcessIDBDatabaseBackend.cpp in Sources */,
                                1A0EC910124C0AF5007EF4A5 /* PluginProcessConnectionManager.cpp in Sources */,
                                1A7865B916CAC71500ACE83A /* PluginProcessConnectionManagerMessageReceiver.cpp in Sources */,
                                1A2BB6D014117B4D000F35D4 /* PluginProcessConnectionMessageReceiver.cpp in Sources */,
                                3309344F1315B94D0097A7BC /* WebCookieManager.cpp in Sources */,
                                372CAF0C1833FD910040AC27 /* WKNSError.mm in Sources */,
                                1A9E329A1822E1CC00F5D04C /* WKRemoteObject.mm in Sources */,
-                               51E35210180F63FB00E53BE9 /* DatabaseProcessIDBDatabaseBackendMessageReceiver.cpp in Sources */,
                                F6A90813133C20510082C3F4 /* WebCookieManagerMac.mm in Sources */,
                                330934471315B9220097A7BC /* WebCookieManagerMessageReceiver.cpp in Sources */,
                                330934551315B9750097A7BC /* WebCookieManagerProxy.cpp in Sources */,
                                BCBD3914125BB1A800D2C29F /* WebPageProxyMessageReceiver.cpp in Sources */,
                                1A3E736211CC2659007BD539 /* WebPlatformStrategies.cpp in Sources */,
                                C0337DDD127A521C008FF4F4 /* WebPlatformTouchPoint.cpp in Sources */,
+                               51D0D436183B353D0097041D /* DatabaseProcessIDBConnectionMessageReceiver.cpp in Sources */,
                                31D5929E166E060000E6BF02 /* WebPlugInClient.cpp in Sources */,
                                1AE00D5C182DADE100087DD7 /* KeyedEncoder.cpp in Sources */,
                                1AC8702E130B49A2002C1257 /* WebPluginSiteDataManager.cpp in Sources */,
                                BC646C1C11DD399F006455B0 /* WKBackForwardListItemRef.cpp in Sources */,
                                BCBAAC72144E61990053F82F /* WKBrowsingContextController.mm in Sources */,
                                BCBAACF51452324F0053F82F /* WKBrowsingContextGroup.mm in Sources */,
+                               51290992183ACEAF005522A6 /* WebIDBServerConnection.cpp in Sources */,
                                BC204EEE11C83EC8008F3375 /* WKBundle.cpp in Sources */,
                                935EEB9E127761AC003322B8 /* WKBundleBackForwardList.cpp in Sources */,
                                935EEBA0127761AC003322B8 /* WKBundleBackForwardListItem.cpp in Sources */,
                                BC8F2F2A16273A2C005FACB5 /* WKWebProcessPlugInBrowserContextController.mm in Sources */,
                                BC2E6E8D1141971500A63B1E /* WorkQueue.cpp in Sources */,
                                BC0092F8115837A300E0AE2A /* WorkQueueMac.cpp in Sources */,
+                               51D0D431183B34130097041D /* DatabaseProcessIDBConnection.cpp in Sources */,
                                BCBECDE716B6416800047A1A /* XPCServiceEntryPoint.mm in Sources */,
                                728E86F21795188C0087879E /* WebColorPickerMac.mm in Sources */,
                        );
index 7eeab33..2808d70 100644 (file)
@@ -29,8 +29,8 @@
 
 #include "IDBUtilities.h"
 #include "Logging.h"
+#include "WebIDBServerConnection.h"
 #include "WebProcess.h"
-#include "WebProcessIDBDatabaseBackend.h"
 #include "WebToDatabaseProcessConnection.h"
 #include <WebCore/IDBCallbacks.h>
 #include <WebCore/IDBCursorBackend.h>
@@ -47,7 +47,7 @@ using namespace WebCore;
 
 namespace WebKit {
 
-typedef HashMap<String, RefPtr<WebProcessIDBDatabaseBackend>> IDBDatabaseBackendMap;
+typedef HashMap<String, RefPtr<IDBDatabaseBackend>> IDBDatabaseBackendMap;
 
 static IDBDatabaseBackendMap& sharedDatabaseBackendMap()
 {
@@ -70,24 +70,28 @@ void WebIDBFactoryBackend::getDatabaseNames(PassRefPtr<IDBCallbacks>, PassRefPtr
     notImplemented();
 }
 
-void WebIDBFactoryBackend::open(const String& databaseName, uint64_t version, int64_t transactionId, PassRefPtr<IDBCallbacks> callbacks, PassRefPtr<IDBDatabaseCallbacks> databaseCallbacks, const SecurityOrigin& securityOrigin, const SecurityOrigin&)
+void WebIDBFactoryBackend::open(const String& databaseName, uint64_t version, int64_t transactionId, PassRefPtr<IDBCallbacks> callbacks, PassRefPtr<IDBDatabaseCallbacks> databaseCallbacks, const SecurityOrigin& openingOrigin, const SecurityOrigin& mainFrameOrigin)
 {
     ASSERT(isMainThread());
     LOG(StorageAPI, "WebIDBFactoryBackend::open");
 
-    String databaseIdentifier = uniqueDatabaseIdentifier(databaseName, securityOrigin);
-    
-    RefPtr<WebProcessIDBDatabaseBackend> webProcessDatabaseBackend;
+    String databaseIdentifier = uniqueDatabaseIdentifier(databaseName, openingOrigin, mainFrameOrigin);
+    if (databaseIdentifier.isNull()) {
+        callbacks->onError(IDBDatabaseError::create(IDBDatabaseException::InvalidAccessError, "Document is not allowed to use Indexed Databases"));
+        return;
+    }
+
     IDBDatabaseBackendMap::iterator it = sharedDatabaseBackendMap().find(databaseIdentifier);
 
+    RefPtr<IDBDatabaseBackend> databaseBackend;
     if (it == sharedDatabaseBackendMap().end()) {
-        webProcessDatabaseBackend = WebProcessIDBDatabaseBackend::create(*this, databaseName);
-        webProcessDatabaseBackend->establishDatabaseProcessBackend();
-        sharedDatabaseBackendMap().set(databaseIdentifier, webProcessDatabaseBackend.get());
+        RefPtr<IDBServerConnection> serverConnection = WebIDBServerConnection::create(databaseName, openingOrigin, mainFrameOrigin);
+        databaseBackend = IDBDatabaseBackend::create(databaseName, databaseIdentifier, this, *serverConnection);
+        sharedDatabaseBackendMap().set(databaseIdentifier, databaseBackend);
     } else
-        webProcessDatabaseBackend = it->value;
+        databaseBackend = it->value;
 
-    webProcessDatabaseBackend->openConnection(callbacks, databaseCallbacks, transactionId, version);
+    databaseBackend->openConnection(callbacks, databaseCallbacks, transactionId, version);
 }
 
 void WebIDBFactoryBackend::deleteDatabase(const String&, PassRefPtr<IDBCallbacks>, PassRefPtr<SecurityOrigin>, ScriptExecutionContext*, const String&)
diff --git a/Source/WebKit2/WebProcess/Databases/IndexedDB/WebIDBServerConnection.cpp b/Source/WebKit2/WebProcess/Databases/IndexedDB/WebIDBServerConnection.cpp
new file mode 100644 (file)
index 0000000..9b0b615
--- /dev/null
@@ -0,0 +1,166 @@
+/*
+ * Copyright (C) 2013 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE, INC. ``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 COMPUTER, INC. OR
+ * 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 "WebIDBServerConnection.h"
+
+#if ENABLE(INDEXED_DATABASE) && ENABLE(DATABASE_PROCESS)
+
+#include "DatabaseProcessIDBConnectionMessages.h"
+#include "DatabaseToWebProcessConnectionMessages.h"
+#include "WebProcess.h"
+#include "WebToDatabaseProcessConnection.h"
+
+namespace WebKit {
+
+static uint64_t generateBackendIdentifier()
+{
+    ASSERT(isMainThread());
+    DEFINE_STATIC_LOCAL(uint64_t, identifier, (0));
+    return ++identifier;
+}
+
+WebIDBServerConnection::WebIDBServerConnection(const String& databaseName, const WebCore::SecurityOrigin& openingOrigin, const WebCore::SecurityOrigin& mainFrameOrigin)
+    : m_backendIdentifier(generateBackendIdentifier())
+{
+    send(Messages::DatabaseToWebProcessConnection::EstablishIDBConnection(m_backendIdentifier));
+    send(Messages::DatabaseProcessIDBConnection::EstablishConnection());
+}
+
+WebIDBServerConnection::~WebIDBServerConnection()
+{
+}
+
+bool WebIDBServerConnection::isClosed()
+{
+    return true;
+}
+
+void WebIDBServerConnection::getOrEstablishIDBDatabaseMetadata(const String& name, GetIDBDatabaseMetadataFunction)
+{
+}
+
+void WebIDBServerConnection::deleteDatabase(const String& name, BoolCallbackFunction successCallback)
+{
+}
+
+void WebIDBServerConnection::close()
+{
+}
+
+void WebIDBServerConnection::openTransaction(int64_t transactionID, const HashSet<int64_t>& objectStoreIds, WebCore::IndexedDB::TransactionMode, BoolCallbackFunction successCallback)
+{
+}
+
+void WebIDBServerConnection::beginTransaction(int64_t transactionID, std::function<void()> completionCallback)
+{
+}
+
+void WebIDBServerConnection::commitTransaction(int64_t transactionID, BoolCallbackFunction successCallback)
+{
+}
+
+void WebIDBServerConnection::resetTransaction(int64_t transactionID, std::function<void()> completionCallback)
+{
+}
+
+void WebIDBServerConnection::rollbackTransaction(int64_t transactionID, std::function<void()> completionCallback)
+{
+}
+
+void WebIDBServerConnection::setIndexKeys(int64_t transactionID, int64_t databaseID, int64_t objectStoreID, const WebCore::IDBObjectStoreMetadata&, WebCore::IDBKey& primaryKey, const Vector<int64_t>& indexIDs, const Vector<Vector<RefPtr<WebCore::IDBKey>>>& indexKeys, std::function<void(PassRefPtr<WebCore::IDBDatabaseError>)> completionCallback)
+{
+}
+
+void WebIDBServerConnection::createObjectStore(WebCore::IDBTransactionBackend&, const WebCore::CreateObjectStoreOperation&, std::function<void(PassRefPtr<WebCore::IDBDatabaseError>)> completionCallback)
+{
+}
+
+void WebIDBServerConnection::createIndex(WebCore::IDBTransactionBackend&, const WebCore::CreateIndexOperation&, std::function<void(PassRefPtr<WebCore::IDBDatabaseError>)> completionCallback)
+{
+}
+
+void WebIDBServerConnection::deleteIndex(WebCore::IDBTransactionBackend&, const WebCore::DeleteIndexOperation&, std::function<void(PassRefPtr<WebCore::IDBDatabaseError>)> completionCallback)
+{
+}
+
+void WebIDBServerConnection::get(WebCore::IDBTransactionBackend&, const WebCore::GetOperation&, std::function<void(PassRefPtr<WebCore::IDBDatabaseError>)> completionCallback)
+{
+}
+
+void WebIDBServerConnection::put(WebCore::IDBTransactionBackend&, const WebCore::PutOperation&, std::function<void(PassRefPtr<WebCore::IDBDatabaseError>)> completionCallback)
+{
+}
+
+void WebIDBServerConnection::openCursor(WebCore::IDBTransactionBackend&, const WebCore::OpenCursorOperation&, std::function<void(PassRefPtr<WebCore::IDBDatabaseError>)> completionCallback)
+{
+}
+
+void WebIDBServerConnection::count(WebCore::IDBTransactionBackend&, const WebCore::CountOperation&, std::function<void(PassRefPtr<WebCore::IDBDatabaseError>)> completionCallback)
+{
+}
+
+void WebIDBServerConnection::deleteRange(WebCore::IDBTransactionBackend&, const WebCore::DeleteRangeOperation&, std::function<void(PassRefPtr<WebCore::IDBDatabaseError>)> completionCallback)
+{
+}
+
+void WebIDBServerConnection::clearObjectStore(WebCore::IDBTransactionBackend&, const WebCore::ClearObjectStoreOperation&, std::function<void(PassRefPtr<WebCore::IDBDatabaseError>)> completionCallback)
+{
+}
+
+void WebIDBServerConnection::deleteObjectStore(WebCore::IDBTransactionBackend&, const WebCore::DeleteObjectStoreOperation&, std::function<void(PassRefPtr<WebCore::IDBDatabaseError>)> completionCallback)
+{
+
+}
+void WebIDBServerConnection::changeDatabaseVersion(WebCore::IDBTransactionBackend&, const WebCore::IDBDatabaseBackend::VersionChangeOperation&, std::function<void(PassRefPtr<WebCore::IDBDatabaseError>)> completionCallback)
+{
+}
+
+void WebIDBServerConnection::cursorAdvance(WebCore::IDBCursorBackend&, const WebCore::CursorAdvanceOperation&, std::function<void()> completionCallback)
+{
+}
+
+void WebIDBServerConnection::cursorIterate(WebCore::IDBCursorBackend&, const WebCore::CursorIterationOperation&, std::function<void()> completionCallback)
+{
+}
+
+void WebIDBServerConnection::cursorPrefetchIteration(WebCore::IDBCursorBackend&, const WebCore::CursorPrefetchIterationOperation&, std::function<void()> completionCallback)
+{
+}
+
+void WebIDBServerConnection::cursorPrefetchReset(WebCore::IDBCursorBackend&, int usedPrefetches)
+{
+}
+
+CoreIPC::Connection* WebIDBServerConnection::messageSenderConnection()
+{
+    return WebProcess::shared().webToDatabaseProcessConnection()->connection();
+}
+
+} // namespace WebKit
+
+#endif // ENABLE(INDEXED_DATABASE) && ENABLE(DATABASE_PROCESS)
+
diff --git a/Source/WebKit2/WebProcess/Databases/IndexedDB/WebIDBServerConnection.h b/Source/WebKit2/WebProcess/Databases/IndexedDB/WebIDBServerConnection.h
new file mode 100644 (file)
index 0000000..fd60a84
--- /dev/null
@@ -0,0 +1,96 @@
+/*
+ * Copyright (C) 2013 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE, INC. ``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 COMPUTER, INC. OR
+ * 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 WebIDBServerConnection_h
+#define WebIDBServerConnection_h
+
+#if ENABLE(INDEXED_DATABASE) && ENABLE(DATABASE_PROCESS)
+
+#include "MessageSender.h"
+#include <WebCore/IDBServerConnection.h>
+
+namespace WebKit {
+
+class WebIDBServerConnection FINAL : public WebCore::IDBServerConnection, public CoreIPC::MessageSender {
+public:
+    static PassRefPtr<WebIDBServerConnection> create(const String& databaseName, const WebCore::SecurityOrigin& openingOrigin, const WebCore::SecurityOrigin& mainFrameOrigin)
+    {
+        return adoptRef(new WebIDBServerConnection(databaseName, openingOrigin, mainFrameOrigin));
+    }
+
+    virtual ~WebIDBServerConnection();
+
+    virtual bool isClosed() OVERRIDE;
+
+    typedef std::function<void (bool success)> BoolCallbackFunction;
+
+    // Database-level operations
+    typedef std::function<void (const WebCore::IDBDatabaseMetadata&, bool success)> GetIDBDatabaseMetadataFunction;
+    virtual void getOrEstablishIDBDatabaseMetadata(const String& name, GetIDBDatabaseMetadataFunction) OVERRIDE;
+    virtual void deleteDatabase(const String& name, BoolCallbackFunction successCallback) OVERRIDE;
+    virtual void close() OVERRIDE;
+
+    // Transaction-level operations
+    virtual void openTransaction(int64_t transactionID, const HashSet<int64_t>& objectStoreIds, WebCore::IndexedDB::TransactionMode, BoolCallbackFunction successCallback) OVERRIDE;
+    virtual void beginTransaction(int64_t transactionID, std::function<void()> completionCallback) OVERRIDE;
+    virtual void commitTransaction(int64_t transactionID, BoolCallbackFunction successCallback) OVERRIDE;
+    virtual void resetTransaction(int64_t transactionID, std::function<void()> completionCallback) OVERRIDE;
+    virtual void rollbackTransaction(int64_t transactionID, std::function<void()> completionCallback) OVERRIDE;
+
+    virtual void setIndexKeys(int64_t transactionID, int64_t databaseID, int64_t objectStoreID, const WebCore::IDBObjectStoreMetadata&, WebCore::IDBKey& primaryKey, const Vector<int64_t>& indexIDs, const Vector<Vector<RefPtr<WebCore::IDBKey>>>& indexKeys, std::function<void(PassRefPtr<WebCore::IDBDatabaseError>)> completionCallback) OVERRIDE;
+
+    virtual void createObjectStore(WebCore::IDBTransactionBackend&, const WebCore::CreateObjectStoreOperation&, std::function<void(PassRefPtr<WebCore::IDBDatabaseError>)> completionCallback) OVERRIDE;
+    virtual void createIndex(WebCore::IDBTransactionBackend&, const WebCore::CreateIndexOperation&, std::function<void(PassRefPtr<WebCore::IDBDatabaseError>)> completionCallback) OVERRIDE;
+    virtual void deleteIndex(WebCore::IDBTransactionBackend&, const WebCore::DeleteIndexOperation&, std::function<void(PassRefPtr<WebCore::IDBDatabaseError>)> completionCallback) OVERRIDE;
+    virtual void get(WebCore::IDBTransactionBackend&, const WebCore::GetOperation&, std::function<void(PassRefPtr<WebCore::IDBDatabaseError>)> completionCallback) OVERRIDE;
+    virtual void put(WebCore::IDBTransactionBackend&, const WebCore::PutOperation&, std::function<void(PassRefPtr<WebCore::IDBDatabaseError>)> completionCallback) OVERRIDE;
+    virtual void openCursor(WebCore::IDBTransactionBackend&, const WebCore::OpenCursorOperation&, std::function<void(PassRefPtr<WebCore::IDBDatabaseError>)> completionCallback) OVERRIDE;
+    virtual void count(WebCore::IDBTransactionBackend&, const WebCore::CountOperation&, std::function<void(PassRefPtr<WebCore::IDBDatabaseError>)> completionCallback) OVERRIDE;
+    virtual void deleteRange(WebCore::IDBTransactionBackend&, const WebCore::DeleteRangeOperation&, std::function<void(PassRefPtr<WebCore::IDBDatabaseError>)> completionCallback) OVERRIDE;
+    virtual void clearObjectStore(WebCore::IDBTransactionBackend&, const WebCore::ClearObjectStoreOperation&, std::function<void(PassRefPtr<WebCore::IDBDatabaseError>)> completionCallback) OVERRIDE;
+    virtual void deleteObjectStore(WebCore::IDBTransactionBackend&, const WebCore::DeleteObjectStoreOperation&, std::function<void(PassRefPtr<WebCore::IDBDatabaseError>)> completionCallback) OVERRIDE;
+    virtual void changeDatabaseVersion(WebCore::IDBTransactionBackend&, const WebCore::IDBDatabaseBackend::VersionChangeOperation&, std::function<void(PassRefPtr<WebCore::IDBDatabaseError>)> completionCallback) OVERRIDE;
+
+    // Cursor-level operations
+    virtual void cursorAdvance(WebCore::IDBCursorBackend&, const WebCore::CursorAdvanceOperation&, std::function<void()> completionCallback) OVERRIDE;
+    virtual void cursorIterate(WebCore::IDBCursorBackend&, const WebCore::CursorIterationOperation&, std::function<void()> completionCallback) OVERRIDE;
+    virtual void cursorPrefetchIteration(WebCore::IDBCursorBackend&, const WebCore::CursorPrefetchIterationOperation&, std::function<void()> completionCallback) OVERRIDE;
+    virtual void cursorPrefetchReset(WebCore::IDBCursorBackend&, int usedPrefetches) OVERRIDE;
+
+private:
+    WebIDBServerConnection(const String& databaseName, const WebCore::SecurityOrigin& openingOrigin, const WebCore::SecurityOrigin& mainFrameOrigin);
+
+    // CoreIPC::MessageSender
+    virtual CoreIPC::Connection* messageSenderConnection() OVERRIDE;
+    virtual uint64_t messageSenderDestinationID() OVERRIDE { return m_backendIdentifier; }
+
+    uint64_t m_backendIdentifier;
+};
+
+} // namespace WebKit
+
+#endif // ENABLE(INDEXED_DATABASE) && ENABLE(DATABASE_PROCESS)
+#endif // WebIDBServerConnection_h
diff --git a/Source/WebKit2/WebProcess/Databases/IndexedDB/WebProcessIDBDatabaseBackend.cpp b/Source/WebKit2/WebProcess/Databases/IndexedDB/WebProcessIDBDatabaseBackend.cpp
deleted file mode 100644 (file)
index b84f590..0000000
+++ /dev/null
@@ -1,227 +0,0 @@
-/*
- * Copyright (C) 2013 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE, INC. ``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 COMPUTER, INC. OR
- * 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 "WebProcessIDBDatabaseBackend.h"
-
-#include "DatabaseProcessIDBDatabaseBackendMessages.h"
-#include "DatabaseToWebProcessConnectionMessages.h"
-#include "WebIDBFactoryBackend.h"
-#include "WebProcess.h"
-#include "WebToDatabaseProcessConnection.h"
-#include <WebCore/IDBMetadata.h>
-#include <WebCore/SecurityOrigin.h>
-
-#if ENABLE(INDEXED_DATABASE)
-#if ENABLE(DATABASE_PROCESS)
-
-using namespace WebCore;
-
-namespace WebKit {
-
-static uint64_t generateBackendIdentifier()
-{
-    DEFINE_STATIC_LOCAL(uint64_t, identifier, (1));
-    return identifier++;
-}
-
-WebProcessIDBDatabaseBackend::WebProcessIDBDatabaseBackend(WebIDBFactoryBackend& factory, const String& name)
-    : m_databaseName(name)
-    , m_backendIdentifier(generateBackendIdentifier())
-    , m_factory(&factory)
-{
-}
-
-WebProcessIDBDatabaseBackend::~WebProcessIDBDatabaseBackend()
-{
-}
-
-void WebProcessIDBDatabaseBackend::openConnection(PassRefPtr<IDBCallbacks> prpCallbacks, PassRefPtr<IDBDatabaseCallbacks> prpDatabaseCallbacks, int64_t transactionId, uint64_t version)
-{
-    // FIXME: Make this message include necessary arguments, and save off these callbacks and arguments for later use.
-
-    send(Messages::DatabaseProcessIDBDatabaseBackend::OpenConnection());
-}
-
-void WebProcessIDBDatabaseBackend::createObjectStore(int64_t transactionId, int64_t objectStoreId, const String& name, const IDBKeyPath&, bool autoIncrement)
-{
-    ASSERT_NOT_REACHED();
-}
-
-void WebProcessIDBDatabaseBackend::deleteObjectStore(int64_t transactionId, int64_t objectStoreId)
-{
-    ASSERT_NOT_REACHED();
-}
-
-void WebProcessIDBDatabaseBackend::createTransaction(int64_t transactionId, PassRefPtr<IDBDatabaseCallbacks>, const Vector<int64_t>& objectStoreIds, unsigned short )
-{
-    ASSERT_NOT_REACHED();
-}
-
-void WebProcessIDBDatabaseBackend::close(PassRefPtr<IDBDatabaseCallbacks>)
-{
-    ASSERT_NOT_REACHED();
-}
-
-void WebProcessIDBDatabaseBackend::commit(int64_t transactionId)
-{
-    ASSERT_NOT_REACHED();
-}
-
-void WebProcessIDBDatabaseBackend::abort(int64_t transactionId)
-{
-    ASSERT_NOT_REACHED();
-}
-
-void WebProcessIDBDatabaseBackend::abort(int64_t transactionId, PassRefPtr<IDBDatabaseError>)
-{
-    ASSERT_NOT_REACHED();
-}
-
-void WebProcessIDBDatabaseBackend::createIndex(int64_t transactionId, int64_t objectStoreId, int64_t indexId, const String& name, const IDBKeyPath&, bool unique, bool iEntry)
-{
-    ASSERT_NOT_REACHED();
-}
-
-void WebProcessIDBDatabaseBackend::deleteIndex(int64_t transactionId, int64_t objectStoreId, int64_t indexId)
-{
-    ASSERT_NOT_REACHED();
-}
-
-void WebProcessIDBDatabaseBackend::get(int64_t transactionId, int64_t objectStoreId, int64_t indexId, PassRefPtr<IDBKeyRange>, bool keyOnly, PassRefPtr<IDBCallbacks>)
-{
-    ASSERT_NOT_REACHED();
-}
-
-void WebProcessIDBDatabaseBackend::put(int64_t transactionId, int64_t objectStoreId, PassRefPtr<SharedBuffer> value, PassRefPtr<IDBKey>, IDBDatabaseBackend::PutMode, PassRefPtr<IDBCallbacks>, const Vector<int64_t>& indexIds, const Vector<IndexKeys>&)
-{
-    ASSERT_NOT_REACHED();
-}
-
-void WebProcessIDBDatabaseBackend::setIndexKeys(int64_t transactionId, int64_t objectStoreId, PassRefPtr<IDBKey> prpPrimaryKey, const Vector<int64_t>& indexIds, const Vector<IndexKeys>&)
-{
-    ASSERT_NOT_REACHED();
-}
-
-void WebProcessIDBDatabaseBackend::setIndexesReady(int64_t transactionId, int64_t objectStoreId, const Vector<int64_t>& indexIds)
-{
-    ASSERT_NOT_REACHED();
-}
-
-void WebProcessIDBDatabaseBackend::openCursor(int64_t transactionId, int64_t objectStoreId, int64_t indexId, PassRefPtr<IDBKeyRange>, IndexedDB::CursorDirection, bool keyOnly, IDBDatabaseBackend::TaskType, PassRefPtr<IDBCallbacks>)
-{
-    ASSERT_NOT_REACHED();
-}
-
-void WebProcessIDBDatabaseBackend::count(int64_t transactionId, int64_t objectStoreId, int64_t indexId, PassRefPtr<IDBKeyRange>, PassRefPtr<IDBCallbacks>)
-{
-    ASSERT_NOT_REACHED();
-}
-
-void WebProcessIDBDatabaseBackend::deleteRange(int64_t transactionId, int64_t objectStoreId, PassRefPtr<IDBKeyRange>, PassRefPtr<IDBCallbacks>)
-{
-    ASSERT_NOT_REACHED();
-}
-
-void WebProcessIDBDatabaseBackend::clear(int64_t transactionId, int64_t objectStoreId, PassRefPtr<IDBCallbacks>)
-{
-    ASSERT_NOT_REACHED();
-}
-
-CoreIPC::Connection* WebProcessIDBDatabaseBackend::messageSenderConnection()
-{
-    return WebProcess::shared().webToDatabaseProcessConnection()->connection();
-}
-
-void WebProcessIDBDatabaseBackend::establishDatabaseProcessBackend()
-{
-    send(Messages::DatabaseToWebProcessConnection::EstablishIDBDatabaseBackend(m_backendIdentifier));
-}
-
-IDBBackingStoreInterface* WebProcessIDBDatabaseBackend::backingStore() const
-{
-    ASSERT_NOT_REACHED();
-    return 0;
-}
-
-int64_t WebProcessIDBDatabaseBackend::id() const
-{
-    ASSERT_NOT_REACHED();
-    return 0;
-}
-
-void WebProcessIDBDatabaseBackend::addObjectStore(const IDBObjectStoreMetadata&, int64_t newMaxObjectStoreId)
-{
-    ASSERT_NOT_REACHED();
-}
-
-void WebProcessIDBDatabaseBackend::removeObjectStore(int64_t objectStoreId)
-{
-    ASSERT_NOT_REACHED();
-}
-
-void WebProcessIDBDatabaseBackend::addIndex(int64_t objectStoreId, const IDBIndexMetadata&, int64_t newMaxIndexId)
-{
-    ASSERT_NOT_REACHED();
-}
-
-void WebProcessIDBDatabaseBackend::removeIndex(int64_t objectStoreId, int64_t indexId)
-{
-    ASSERT_NOT_REACHED();
-}
-
-const IDBDatabaseMetadata& WebProcessIDBDatabaseBackend::metadata() const
-{
-    ASSERT_NOT_REACHED();
-    return *((IDBDatabaseMetadata*)0);
-}
-
-void WebProcessIDBDatabaseBackend::setCurrentVersion(uint64_t)
-{
-    ASSERT_NOT_REACHED();
-}
-
-bool WebProcessIDBDatabaseBackend::hasPendingSecondHalfOpen()
-{
-    ASSERT_NOT_REACHED();
-    return false;
-}
-
-void WebProcessIDBDatabaseBackend::setPendingSecondHalfOpen(PassOwnPtr<IDBPendingOpenCall>)
-{
-    ASSERT_NOT_REACHED();
-}
-
-IDBFactoryBackendInterface& WebProcessIDBDatabaseBackend::factoryBackend()
-{
-    ASSERT_NOT_REACHED();
-    return *((IDBFactoryBackendInterface*)0);
-}
-
-} // namespace WebKit
-
-#endif // ENABLE(DATABASE_PROCESS)
-#endif // ENABLE(INDEXED_DATABASE)
diff --git a/Source/WebKit2/WebProcess/Databases/IndexedDB/WebProcessIDBDatabaseBackend.h b/Source/WebKit2/WebProcess/Databases/IndexedDB/WebProcessIDBDatabaseBackend.h
deleted file mode 100644 (file)
index cef0253..0000000
+++ /dev/null
@@ -1,113 +0,0 @@
-/*
- * Copyright (C) 2013 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE, INC. ``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 COMPUTER, INC. OR
- * 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 WebProcessIDBDatabaseBackend_h
-#define WebProcessIDBDatabaseBackend_h
-
-#include "MessageSender.h"
-#include <WebCore/IDBBackingStoreInterface.h>
-#include <WebCore/IDBDatabaseBackend.h>
-
-#if ENABLE(INDEXED_DATABASE)
-#if ENABLE(DATABASE_PROCESS)
-
-namespace WebCore {
-class SecurityOrigin;
-}
-
-namespace WebKit {
-
-class WebIDBFactoryBackend;
-
-class WebProcessIDBDatabaseBackend : public RefCounted<WebProcessIDBDatabaseBackend>, public CoreIPC::MessageSender {
-public:
-    static PassRefPtr<WebProcessIDBDatabaseBackend> create(WebIDBFactoryBackend& factory, const String& name) { return adoptRef(new WebProcessIDBDatabaseBackend(factory, name)); }
-
-    virtual ~WebProcessIDBDatabaseBackend();
-
-    virtual WebCore::IDBBackingStoreInterface* backingStore() const;
-
-    virtual void createObjectStore(int64_t transactionId, int64_t objectStoreId, const String& name, const WebCore::IDBKeyPath&, bool autoIncrement);
-    virtual void deleteObjectStore(int64_t transactionId, int64_t objectStoreId);
-    virtual void createTransaction(int64_t transactionId, PassRefPtr<WebCore::IDBDatabaseCallbacks>, const Vector<int64_t>& objectStoreIds, unsigned short mode);
-    virtual void close(PassRefPtr<WebCore::IDBDatabaseCallbacks>);
-
-    // Transaction-specific operations.
-    virtual void commit(int64_t transactionId);
-    virtual void abort(int64_t transactionId);
-    virtual void abort(int64_t transactionId, PassRefPtr<WebCore::IDBDatabaseError>);
-
-    virtual void createIndex(int64_t transactionId, int64_t objectStoreId, int64_t indexId, const String& name, const WebCore::IDBKeyPath&, bool unique, bool multiEntry);
-    virtual void deleteIndex(int64_t transactionId, int64_t objectStoreId, int64_t indexId);
-
-    virtual void get(int64_t transactionId, int64_t objectStoreId, int64_t indexId, PassRefPtr<WebCore::IDBKeyRange>, bool keyOnly, PassRefPtr<WebCore::IDBCallbacks>);
-    // Note that 'value' may be consumed/adopted by this call.
-    virtual void put(int64_t transactionId, int64_t objectStoreId, PassRefPtr<WebCore::SharedBuffer> value, PassRefPtr<WebCore::IDBKey>, WebCore::IDBDatabaseBackend::PutMode, PassRefPtr<WebCore::IDBCallbacks>, const Vector<int64_t>& indexIds, const Vector<WebCore::IndexKeys>&);
-    virtual void setIndexKeys(int64_t transactionId, int64_t objectStoreId, PassRefPtr<WebCore::IDBKey> prpPrimaryKey, const Vector<int64_t>& indexIds, const Vector<WebCore::IndexKeys>&);
-    virtual void setIndexesReady(int64_t transactionId, int64_t objectStoreId, const Vector<int64_t>& indexIds);
-    virtual void openCursor(int64_t transactionId, int64_t objectStoreId, int64_t indexId, PassRefPtr<WebCore::IDBKeyRange>, WebCore::IndexedDB::CursorDirection, bool keyOnly, WebCore::IDBDatabaseBackend::TaskType, PassRefPtr<WebCore::IDBCallbacks>);
-    virtual void count(int64_t transactionId, int64_t objectStoreId, int64_t indexId, PassRefPtr<WebCore::IDBKeyRange>, PassRefPtr<WebCore::IDBCallbacks>);
-    virtual void deleteRange(int64_t transactionId, int64_t objectStoreId, PassRefPtr<WebCore::IDBKeyRange>, PassRefPtr<WebCore::IDBCallbacks>);
-    virtual void clear(int64_t transactionId, int64_t objectStoreId, PassRefPtr<WebCore::IDBCallbacks>);
-
-    virtual int64_t id() const;
-    virtual void addObjectStore(const WebCore::IDBObjectStoreMetadata&, int64_t newMaxObjectStoreId);
-    virtual void removeObjectStore(int64_t objectStoreId);
-    virtual void addIndex(int64_t objectStoreId, const WebCore::IDBIndexMetadata&, int64_t newMaxIndexId);
-    virtual void removeIndex(int64_t objectStoreId, int64_t indexId);
-
-    virtual const WebCore::IDBDatabaseMetadata& metadata() const;
-    virtual void setCurrentVersion(uint64_t);
-
-    virtual bool hasPendingSecondHalfOpen();
-    virtual void setPendingSecondHalfOpen(PassOwnPtr<WebCore::IDBPendingOpenCall>);
-
-    virtual WebCore::IDBFactoryBackendInterface& factoryBackend();
-
-    void openConnection(PassRefPtr<WebCore::IDBCallbacks>, PassRefPtr<WebCore::IDBDatabaseCallbacks>, int64_t transactionId, uint64_t version);
-
-    void establishDatabaseProcessBackend();
-
-private:
-    WebProcessIDBDatabaseBackend(WebIDBFactoryBackend&, const String& name);
-
-    String m_databaseName;
-    RefPtr<WebCore::SecurityOrigin> m_securityOrigin;
-
-    // CoreIPC::MessageSender
-    virtual CoreIPC::Connection* messageSenderConnection();
-    virtual uint64_t messageSenderDestinationID() OVERRIDE { return m_backendIdentifier; }
-
-    uint64_t m_backendIdentifier;
-
-    RefPtr<WebIDBFactoryBackend> m_factory;
-};
-
-} // namespace WebKit
-
-#endif // ENABLE(DATABASE_PROCESS)
-#endif // ENABLE(INDEXED_DATABASE)
-#endif // WebProcessIDBDatabaseBackend_h
index 44aa65f..b36621b 100644 (file)
@@ -29,7 +29,6 @@
 
 #include "DatabaseToWebProcessConnectionMessages.h"
 #include "WebProcess.h"
-#include "WebProcessIDBDatabaseBackend.h"
 #include <wtf/RunLoop.h>
 
 #if ENABLE(INDEXED_DATABASE)