Title: [196651] trunk/Source
Revision
196651
Author
beid...@apple.com
Date
2016-02-16 12:58:56 -0800 (Tue, 16 Feb 2016)

Log Message

Modern IDB: WK2 IPC Scaffolding.
https://bugs.webkit.org/show_bug.cgi?id=154296

Reviewed by Alex Christensen.

No change in behavior yet; Just laying the groundwork.

Source/WebCore:

* Modules/indexeddb/client/IDBConnectionToServer.h:
* Modules/indexeddb/server/IDBConnectionToClient.h:
* Modules/indexeddb/shared/IDBResourceIdentifier.h:

Source/WebKit2:

* CMakeLists.txt:
* WebKit2.xcodeproj/project.pbxproj:

* DatabaseProcess/DatabaseToWebProcessConnection.cpp:
(WebKit::DatabaseToWebProcessConnection::establishIDBConnectionToServer):
(WebKit::DatabaseToWebProcessConnection::removeIDBConnectionToServer):
* DatabaseProcess/DatabaseToWebProcessConnection.h:
* DatabaseProcess/DatabaseToWebProcessConnection.messages.in:

* DatabaseProcess/IndexedDB/WebIDBConnectionToClient.cpp: Added.
(WebKit::WebIDBConnectionToClient::create):
(WebKit::WebIDBConnectionToClient::WebIDBConnectionToClient):
(WebKit::WebIDBConnectionToClient::~WebIDBConnectionToClient):
(WebKit::WebIDBConnectionToClient::disconnectedFromWebProcess):
(WebKit::WebIDBConnectionToClient::messageSenderConnection):
(WebKit::WebIDBConnectionToClient::connectionToClient):
(WebKit::WebIDBConnectionToClient::didDeleteDatabase):
(WebKit::WebIDBConnectionToClient::didOpenDatabase):
(WebKit::WebIDBConnectionToClient::didAbortTransaction):
(WebKit::WebIDBConnectionToClient::didCommitTransaction):
(WebKit::WebIDBConnectionToClient::didCreateObjectStore):
(WebKit::WebIDBConnectionToClient::didDeleteObjectStore):
(WebKit::WebIDBConnectionToClient::didClearObjectStore):
(WebKit::WebIDBConnectionToClient::didCreateIndex):
(WebKit::WebIDBConnectionToClient::didDeleteIndex):
(WebKit::WebIDBConnectionToClient::didPutOrAdd):
(WebKit::WebIDBConnectionToClient::didGetRecord):
(WebKit::WebIDBConnectionToClient::didGetCount):
(WebKit::WebIDBConnectionToClient::didDeleteRecord):
(WebKit::WebIDBConnectionToClient::didOpenCursor):
(WebKit::WebIDBConnectionToClient::didIterateCursor):
(WebKit::WebIDBConnectionToClient::fireVersionChangeEvent):
(WebKit::WebIDBConnectionToClient::didStartTransaction):
(WebKit::WebIDBConnectionToClient::notifyOpenDBRequestBlocked):
* DatabaseProcess/IndexedDB/WebIDBConnectionToClient.h: Added.

* Platform/Logging.h:

* WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp: Added.
(WebKit::generateConnectionToServerIdentifier):
(WebKit::WebIDBConnectionToServer::create):
(WebKit::WebIDBConnectionToServer::WebIDBConnectionToServer):
(WebKit::WebIDBConnectionToServer::~WebIDBConnectionToServer):
(WebKit::WebIDBConnectionToServer::messageSenderConnection):
(WebKit::WebIDBConnectionToServer::coreConnectionToServer):
(WebKit::WebIDBConnectionToServer::deleteDatabase):
(WebKit::WebIDBConnectionToServer::openDatabase):
(WebKit::WebIDBConnectionToServer::abortTransaction):
(WebKit::WebIDBConnectionToServer::commitTransaction):
(WebKit::WebIDBConnectionToServer::didFinishHandlingVersionChangeTransaction):
(WebKit::WebIDBConnectionToServer::createObjectStore):
(WebKit::WebIDBConnectionToServer::deleteObjectStore):
(WebKit::WebIDBConnectionToServer::clearObjectStore):
(WebKit::WebIDBConnectionToServer::createIndex):
(WebKit::WebIDBConnectionToServer::deleteIndex):
(WebKit::WebIDBConnectionToServer::putOrAdd):
(WebKit::WebIDBConnectionToServer::getRecord):
(WebKit::WebIDBConnectionToServer::getCount):
(WebKit::WebIDBConnectionToServer::deleteRecord):
(WebKit::WebIDBConnectionToServer::openCursor):
(WebKit::WebIDBConnectionToServer::iterateCursor):
(WebKit::WebIDBConnectionToServer::establishTransaction):
(WebKit::WebIDBConnectionToServer::databaseConnectionClosed):
(WebKit::WebIDBConnectionToServer::abortOpenAndUpgradeNeeded):
(WebKit::WebIDBConnectionToServer::didFireVersionChangeEvent):
* WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.h: Added.

* WebProcess/Databases/WebDatabaseProvider.cpp:
(WebKit::WebDatabaseProvider::idbConnectionToServerForSession):
* WebProcess/Databases/WebDatabaseProvider.h:

* WebProcess/Databases/WebToDatabaseProcessConnection.cpp:
(WebKit::WebToDatabaseProcessConnection::idbConnectionToServerForSession):
* WebProcess/Databases/WebToDatabaseProcessConnection.h:

Modified Paths

Added Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (196650 => 196651)


--- trunk/Source/WebCore/ChangeLog	2016-02-16 20:50:46 UTC (rev 196650)
+++ trunk/Source/WebCore/ChangeLog	2016-02-16 20:58:56 UTC (rev 196651)
@@ -1,3 +1,16 @@
+2016-02-16  Brady Eidson  <beid...@apple.com>
+
+        Modern IDB: WK2 IPC Scaffolding.
+        https://bugs.webkit.org/show_bug.cgi?id=154296
+
+        Reviewed by Alex Christensen.
+        
+        No change in behavior yet; Just laying the groundwork.
+
+        * Modules/indexeddb/client/IDBConnectionToServer.h:
+        * Modules/indexeddb/server/IDBConnectionToClient.h:
+        * Modules/indexeddb/shared/IDBResourceIdentifier.h:
+
 2016-02-16  Chris Dumez  <cdu...@apple.com>
 
         [Web IDL] Operations should be on the instance for global objects or if [Unforgeable]

Modified: trunk/Source/WebCore/Modules/indexeddb/client/IDBConnectionToServer.h (196650 => 196651)


--- trunk/Source/WebCore/Modules/indexeddb/client/IDBConnectionToServer.h	2016-02-16 20:50:46 UTC (rev 196650)
+++ trunk/Source/WebCore/Modules/indexeddb/client/IDBConnectionToServer.h	2016-02-16 20:58:56 UTC (rev 196651)
@@ -52,7 +52,7 @@
 
 class IDBConnectionToServer : public RefCounted<IDBConnectionToServer> {
 public:
-    static Ref<IDBConnectionToServer> create(IDBConnectionToServerDelegate&);
+    WEBCORE_EXPORT static Ref<IDBConnectionToServer> create(IDBConnectionToServerDelegate&);
 
     uint64_t identifier() const;
 

Modified: trunk/Source/WebCore/Modules/indexeddb/server/IDBConnectionToClient.h (196650 => 196651)


--- trunk/Source/WebCore/Modules/indexeddb/server/IDBConnectionToClient.h	2016-02-16 20:50:46 UTC (rev 196650)
+++ trunk/Source/WebCore/Modules/indexeddb/server/IDBConnectionToClient.h	2016-02-16 20:58:56 UTC (rev 196651)
@@ -44,7 +44,7 @@
 
 class IDBConnectionToClient : public RefCounted<IDBConnectionToClient> {
 public:
-    static Ref<IDBConnectionToClient> create(IDBConnectionToClientDelegate&);
+    WEBCORE_EXPORT static Ref<IDBConnectionToClient> create(IDBConnectionToClientDelegate&);
     
     uint64_t identifier() const;
 

Modified: trunk/Source/WebCore/Modules/indexeddb/shared/IDBResourceIdentifier.h (196650 => 196651)


--- trunk/Source/WebCore/Modules/indexeddb/shared/IDBResourceIdentifier.h	2016-02-16 20:50:46 UTC (rev 196650)
+++ trunk/Source/WebCore/Modules/indexeddb/shared/IDBResourceIdentifier.h	2016-02-16 20:58:56 UTC (rev 196651)
@@ -48,7 +48,7 @@
     explicit IDBResourceIdentifier(const IDBServer::IDBConnectionToClient&);
 
     static IDBResourceIdentifier deletedValue();
-    bool isHashTableDeletedValue() const;
+    WEBCORE_EXPORT bool isHashTableDeletedValue() const;
 
     static IDBResourceIdentifier emptyValue();
     bool isEmpty() const

Modified: trunk/Source/WebKit2/CMakeLists.txt (196650 => 196651)


--- trunk/Source/WebKit2/CMakeLists.txt	2016-02-16 20:50:46 UTC (rev 196650)
+++ trunk/Source/WebKit2/CMakeLists.txt	2016-02-16 20:58:56 UTC (rev 196651)
@@ -70,7 +70,10 @@
     "${WEBCORE_DIR}"
     "${WEBCORE_DIR}/Modules/battery"
     "${WEBCORE_DIR}/Modules/indexeddb"
+    "${WEBCORE_DIR}/Modules/indexeddb/client"
     "${WEBCORE_DIR}/Modules/indexeddb/legacy"
+    "${WEBCORE_DIR}/Modules/indexeddb/server"
+    "${WEBCORE_DIR}/Modules/indexeddb/shared"
     "${WEBCORE_DIR}/Modules/mediastream"
     "${WEBCORE_DIR}/Modules/networkinfo"
     "${WEBCORE_DIR}/Modules/notifications"
@@ -195,6 +198,7 @@
     DatabaseProcess/IndexedDB/IDBSerialization.cpp
     DatabaseProcess/IndexedDB/UniqueIDBDatabase.cpp
     DatabaseProcess/IndexedDB/UniqueIDBDatabaseIdentifier.cpp
+    DatabaseProcess/IndexedDB/WebIDBConnectionToClient.cpp
 
     DatabaseProcess/IndexedDB/sqlite/SQLiteIDBCursor.cpp
     DatabaseProcess/IndexedDB/sqlite/SQLiteIDBTransaction.cpp
@@ -508,6 +512,7 @@
     WebProcess/Databases/WebDatabaseProvider.cpp
     WebProcess/Databases/WebToDatabaseProcessConnection.cpp
 
+    WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp
     WebProcess/Databases/IndexedDB/WebIDBFactoryBackend.cpp
     WebProcess/Databases/IndexedDB/WebIDBServerConnection.cpp
 

Modified: trunk/Source/WebKit2/ChangeLog (196650 => 196651)


--- trunk/Source/WebKit2/ChangeLog	2016-02-16 20:50:46 UTC (rev 196650)
+++ trunk/Source/WebKit2/ChangeLog	2016-02-16 20:58:56 UTC (rev 196651)
@@ -1,3 +1,87 @@
+2016-02-16  Brady Eidson  <beid...@apple.com>
+
+        Modern IDB: WK2 IPC Scaffolding.
+        https://bugs.webkit.org/show_bug.cgi?id=154296
+
+        Reviewed by Alex Christensen.
+        
+        No change in behavior yet; Just laying the groundwork.
+
+        * CMakeLists.txt:
+        * WebKit2.xcodeproj/project.pbxproj:
+
+        * DatabaseProcess/DatabaseToWebProcessConnection.cpp:
+        (WebKit::DatabaseToWebProcessConnection::establishIDBConnectionToServer):
+        (WebKit::DatabaseToWebProcessConnection::removeIDBConnectionToServer):
+        * DatabaseProcess/DatabaseToWebProcessConnection.h:
+        * DatabaseProcess/DatabaseToWebProcessConnection.messages.in:
+        
+        * DatabaseProcess/IndexedDB/WebIDBConnectionToClient.cpp: Added.
+        (WebKit::WebIDBConnectionToClient::create):
+        (WebKit::WebIDBConnectionToClient::WebIDBConnectionToClient):
+        (WebKit::WebIDBConnectionToClient::~WebIDBConnectionToClient):
+        (WebKit::WebIDBConnectionToClient::disconnectedFromWebProcess):
+        (WebKit::WebIDBConnectionToClient::messageSenderConnection):
+        (WebKit::WebIDBConnectionToClient::connectionToClient):
+        (WebKit::WebIDBConnectionToClient::didDeleteDatabase):
+        (WebKit::WebIDBConnectionToClient::didOpenDatabase):
+        (WebKit::WebIDBConnectionToClient::didAbortTransaction):
+        (WebKit::WebIDBConnectionToClient::didCommitTransaction):
+        (WebKit::WebIDBConnectionToClient::didCreateObjectStore):
+        (WebKit::WebIDBConnectionToClient::didDeleteObjectStore):
+        (WebKit::WebIDBConnectionToClient::didClearObjectStore):
+        (WebKit::WebIDBConnectionToClient::didCreateIndex):
+        (WebKit::WebIDBConnectionToClient::didDeleteIndex):
+        (WebKit::WebIDBConnectionToClient::didPutOrAdd):
+        (WebKit::WebIDBConnectionToClient::didGetRecord):
+        (WebKit::WebIDBConnectionToClient::didGetCount):
+        (WebKit::WebIDBConnectionToClient::didDeleteRecord):
+        (WebKit::WebIDBConnectionToClient::didOpenCursor):
+        (WebKit::WebIDBConnectionToClient::didIterateCursor):
+        (WebKit::WebIDBConnectionToClient::fireVersionChangeEvent):
+        (WebKit::WebIDBConnectionToClient::didStartTransaction):
+        (WebKit::WebIDBConnectionToClient::notifyOpenDBRequestBlocked):
+        * DatabaseProcess/IndexedDB/WebIDBConnectionToClient.h: Added.
+        
+        * Platform/Logging.h:
+                
+        * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp: Added.
+        (WebKit::generateConnectionToServerIdentifier):
+        (WebKit::WebIDBConnectionToServer::create):
+        (WebKit::WebIDBConnectionToServer::WebIDBConnectionToServer):
+        (WebKit::WebIDBConnectionToServer::~WebIDBConnectionToServer):
+        (WebKit::WebIDBConnectionToServer::messageSenderConnection):
+        (WebKit::WebIDBConnectionToServer::coreConnectionToServer):
+        (WebKit::WebIDBConnectionToServer::deleteDatabase):
+        (WebKit::WebIDBConnectionToServer::openDatabase):
+        (WebKit::WebIDBConnectionToServer::abortTransaction):
+        (WebKit::WebIDBConnectionToServer::commitTransaction):
+        (WebKit::WebIDBConnectionToServer::didFinishHandlingVersionChangeTransaction):
+        (WebKit::WebIDBConnectionToServer::createObjectStore):
+        (WebKit::WebIDBConnectionToServer::deleteObjectStore):
+        (WebKit::WebIDBConnectionToServer::clearObjectStore):
+        (WebKit::WebIDBConnectionToServer::createIndex):
+        (WebKit::WebIDBConnectionToServer::deleteIndex):
+        (WebKit::WebIDBConnectionToServer::putOrAdd):
+        (WebKit::WebIDBConnectionToServer::getRecord):
+        (WebKit::WebIDBConnectionToServer::getCount):
+        (WebKit::WebIDBConnectionToServer::deleteRecord):
+        (WebKit::WebIDBConnectionToServer::openCursor):
+        (WebKit::WebIDBConnectionToServer::iterateCursor):
+        (WebKit::WebIDBConnectionToServer::establishTransaction):
+        (WebKit::WebIDBConnectionToServer::databaseConnectionClosed):
+        (WebKit::WebIDBConnectionToServer::abortOpenAndUpgradeNeeded):
+        (WebKit::WebIDBConnectionToServer::didFireVersionChangeEvent):
+        * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.h: Added.
+
+        * WebProcess/Databases/WebDatabaseProvider.cpp:
+        (WebKit::WebDatabaseProvider::idbConnectionToServerForSession):
+        * WebProcess/Databases/WebDatabaseProvider.h:
+
+        * WebProcess/Databases/WebToDatabaseProcessConnection.cpp:
+        (WebKit::WebToDatabaseProcessConnection::idbConnectionToServerForSession):
+        * WebProcess/Databases/WebToDatabaseProcessConnection.h:
+
 2016-02-16  Sam Weinig  <s...@webkit.org>
 
         Revert r195826.

Modified: trunk/Source/WebKit2/DatabaseProcess/DatabaseToWebProcessConnection.cpp (196650 => 196651)


--- trunk/Source/WebKit2/DatabaseProcess/DatabaseToWebProcessConnection.cpp	2016-02-16 20:50:46 UTC (rev 196650)
+++ trunk/Source/WebKit2/DatabaseProcess/DatabaseToWebProcessConnection.cpp	2016-02-16 20:58:56 UTC (rev 196651)
@@ -29,6 +29,8 @@
 #include "DatabaseProcessIDBConnection.h"
 #include "DatabaseProcessIDBConnectionMessages.h"
 #include "DatabaseToWebProcessConnectionMessages.h"
+#include "Logging.h"
+#include "WebIDBConnectionToClient.h"
 #include <wtf/RunLoop.h>
 
 #if ENABLE(DATABASE_PROCESS)
@@ -113,6 +115,22 @@
     RefPtr<DatabaseProcessIDBConnection> idbConnection = m_idbConnections.take(serverConnectionIdentifier);
     idbConnection->disconnectedFromWebProcess();
 }
+
+void DatabaseToWebProcessConnection::establishIDBConnectionToServer(uint64_t serverConnectionIdentifier)
+{
+    LOG(IndexedDB, "DatabaseToWebProcessConnection::establishIDBConnectionToServer - %" PRIu64, serverConnectionIdentifier);
+    ASSERT(!m_webIDBConnections.contains(serverConnectionIdentifier));
+
+    m_webIDBConnections.set(serverConnectionIdentifier, WebIDBConnectionToClient::create(*this, serverConnectionIdentifier));
+}
+
+void DatabaseToWebProcessConnection::removeIDBConnectionToServer(uint64_t serverConnectionIdentifier)
+{
+    ASSERT(m_webIDBConnections.contains(serverConnectionIdentifier));
+
+    auto connection = m_webIDBConnections.take(serverConnectionIdentifier);
+    connection->disconnectedFromWebProcess();
+}
 #endif
 
 

Modified: trunk/Source/WebKit2/DatabaseProcess/DatabaseToWebProcessConnection.h (196650 => 196651)


--- trunk/Source/WebKit2/DatabaseProcess/DatabaseToWebProcessConnection.h	2016-02-16 20:50:46 UTC (rev 196650)
+++ trunk/Source/WebKit2/DatabaseProcess/DatabaseToWebProcessConnection.h	2016-02-16 20:58:56 UTC (rev 196651)
@@ -36,6 +36,8 @@
 
 namespace WebKit {
 
+class WebIDBConnectionToClient;
+
 class DatabaseToWebProcessConnection : public RefCounted<DatabaseToWebProcessConnection>, public IPC::Connection::Client, public IPC::MessageSender {
 public:
     static Ref<DatabaseToWebProcessConnection> create(IPC::Connection::Identifier);
@@ -60,12 +62,18 @@
     virtual uint64_t messageSenderDestinationID() override { return 0; }
 
 #if ENABLE(INDEXED_DATABASE)
-    // Messages handlers
+    // Messages handlers (Legacy IDB)
     void establishIDBConnection(uint64_t serverConnectionIdentifier);
     void removeDatabaseProcessIDBConnection(uint64_t serverConnectionIdentifier);
 
     typedef HashMap<uint64_t, RefPtr<DatabaseProcessIDBConnection>> IDBConnectionMap;
     IDBConnectionMap m_idbConnections;
+
+    // Messages handlers (Modern IDB)
+    void establishIDBConnectionToServer(uint64_t serverConnectionIdentifier);
+    void removeIDBConnectionToServer(uint64_t serverConnectionIdentifier);
+
+    HashMap<uint64_t, RefPtr<WebIDBConnectionToClient>> m_webIDBConnections;
 #endif // ENABLE(INDEXED_DATABASE)
 
     RefPtr<IPC::Connection> m_connection;

Modified: trunk/Source/WebKit2/DatabaseProcess/DatabaseToWebProcessConnection.messages.in (196650 => 196651)


--- trunk/Source/WebKit2/DatabaseProcess/DatabaseToWebProcessConnection.messages.in	2016-02-16 20:50:46 UTC (rev 196650)
+++ trunk/Source/WebKit2/DatabaseProcess/DatabaseToWebProcessConnection.messages.in	2016-02-16 20:58:56 UTC (rev 196651)
@@ -24,9 +24,13 @@
 
 messages -> DatabaseToWebProcessConnection LegacyReceiver {
 #if ENABLE(INDEXED_DATABASE)
-    # Creates a connection for communication with a WebProcess
+    # Creates a connection for communication with a WebProcess (Legacy IDB)
     EstablishIDBConnection(uint64_t serverConnectionIdentifier)
     RemoveDatabaseProcessIDBConnection(uint64_t serverConnectionIdentifier)
+
+    # Creates a connection for communication with a WebProcess (Modern IDB)
+    EstablishIDBConnectionToServer(uint64_t serverConnectionIdentifier)
+    RemoveIDBConnectionToServer(uint64_t serverConnectionIdentifier)
 #endif
 }
 

Added: trunk/Source/WebKit2/DatabaseProcess/IndexedDB/WebIDBConnectionToClient.cpp (0 => 196651)


--- trunk/Source/WebKit2/DatabaseProcess/IndexedDB/WebIDBConnectionToClient.cpp	                        (rev 0)
+++ trunk/Source/WebKit2/DatabaseProcess/IndexedDB/WebIDBConnectionToClient.cpp	2016-02-16 20:58:56 UTC (rev 196651)
@@ -0,0 +1,139 @@
+/*
+ * Copyright (C) 2016 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "WebIDBConnectionToClient.h"
+
+#if ENABLE(INDEXED_DATABASE)
+
+using namespace WebCore;
+
+namespace WebKit {
+
+Ref<WebIDBConnectionToClient> WebIDBConnectionToClient::create(DatabaseToWebProcessConnection& connection, uint64_t serverConnectionIdentifier)
+{
+    return adoptRef(*new WebIDBConnectionToClient(connection, serverConnectionIdentifier));
+}
+
+WebIDBConnectionToClient::WebIDBConnectionToClient(DatabaseToWebProcessConnection& connection, uint64_t serverConnectionIdentifier)
+    : m_connection(connection)
+{
+    relaxAdoptionRequirement();
+    m_connectionToClient = IDBServer::IDBConnectionToClient::create(*this);
+}
+
+WebIDBConnectionToClient::~WebIDBConnectionToClient()
+{
+}
+
+void WebIDBConnectionToClient::disconnectedFromWebProcess()
+{
+}
+
+IPC::Connection* WebIDBConnectionToClient::messageSenderConnection()
+{
+    return m_connection->connection();
+}
+
+WebCore::IDBServer::IDBConnectionToClient& WebIDBConnectionToClient::connectionToClient()
+{
+    return *m_connectionToClient;
+}
+
+void WebIDBConnectionToClient::didDeleteDatabase(const WebCore::IDBResultData&)
+{
+}
+
+void WebIDBConnectionToClient::didOpenDatabase(const WebCore::IDBResultData&)
+{
+}
+
+void WebIDBConnectionToClient::didAbortTransaction(const WebCore::IDBResourceIdentifier& transactionIdentifier, const WebCore::IDBError&)
+{
+}
+
+void WebIDBConnectionToClient::didCommitTransaction(const WebCore::IDBResourceIdentifier& transactionIdentifier, const WebCore::IDBError&)
+{
+}
+
+void WebIDBConnectionToClient::didCreateObjectStore(const WebCore::IDBResultData&)
+{
+}
+
+void WebIDBConnectionToClient::didDeleteObjectStore(const WebCore::IDBResultData&)
+{
+}
+
+void WebIDBConnectionToClient::didClearObjectStore(const WebCore::IDBResultData&)
+{
+}
+
+void WebIDBConnectionToClient::didCreateIndex(const WebCore::IDBResultData&)
+{
+}
+
+void WebIDBConnectionToClient::didDeleteIndex(const WebCore::IDBResultData&)
+{
+}
+
+void WebIDBConnectionToClient::didPutOrAdd(const WebCore::IDBResultData&)
+{
+}
+
+void WebIDBConnectionToClient::didGetRecord(const WebCore::IDBResultData&)
+{
+}
+
+void WebIDBConnectionToClient::didGetCount(const WebCore::IDBResultData&)
+{
+}
+
+void WebIDBConnectionToClient::didDeleteRecord(const WebCore::IDBResultData&)
+{
+}
+
+void WebIDBConnectionToClient::didOpenCursor(const WebCore::IDBResultData&)
+{
+}
+
+void WebIDBConnectionToClient::didIterateCursor(const WebCore::IDBResultData&)
+{
+}
+
+void WebIDBConnectionToClient::fireVersionChangeEvent(WebCore::IDBServer::UniqueIDBDatabaseConnection&, const WebCore::IDBResourceIdentifier& requestIdentifier, uint64_t requestedVersion)
+{
+}
+
+void WebIDBConnectionToClient::didStartTransaction(const WebCore::IDBResourceIdentifier& transactionIdentifier, const WebCore::IDBError&)
+{
+}
+
+void WebIDBConnectionToClient::notifyOpenDBRequestBlocked(const WebCore::IDBResourceIdentifier& requestIdentifier, uint64_t oldVersion, uint64_t newVersion)
+{
+}
+
+} // namespace WebKit
+
+#endif // ENABLE(INDEXED_DATABASE)

Added: trunk/Source/WebKit2/DatabaseProcess/IndexedDB/WebIDBConnectionToClient.h (0 => 196651)


--- trunk/Source/WebKit2/DatabaseProcess/IndexedDB/WebIDBConnectionToClient.h	                        (rev 0)
+++ trunk/Source/WebKit2/DatabaseProcess/IndexedDB/WebIDBConnectionToClient.h	2016-02-16 20:58:56 UTC (rev 196651)
@@ -0,0 +1,85 @@
+/*
+ * Copyright (C) 2016 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef WebIDBConnectionToClient_h
+#define WebIDBConnectionToClient_h
+
+#if ENABLE(INDEXED_DATABASE)
+
+#include "DatabaseToWebProcessConnection.h"
+#include "MessageSender.h"
+#include <WebCore/IDBConnectionToClient.h>
+
+namespace WebKit {
+
+class WebIDBConnectionToClient final : public WebCore::IDBServer::IDBConnectionToClientDelegate, public IPC::MessageSender, public RefCounted<WebIDBConnectionToClient> {
+public:
+    static Ref<WebIDBConnectionToClient> create(DatabaseToWebProcessConnection&, uint64_t serverConnectionIdentifier);
+
+    virtual ~WebIDBConnectionToClient();
+
+    WebCore::IDBServer::IDBConnectionToClient& connectionToClient();
+    virtual uint64_t identifier() const override final { return m_identifier; }
+    virtual uint64_t messageSenderDestinationID() override final { return m_identifier; }
+
+    virtual void didDeleteDatabase(const WebCore::IDBResultData&) override final;
+    virtual void didOpenDatabase(const WebCore::IDBResultData&) override final;
+    virtual void didAbortTransaction(const WebCore::IDBResourceIdentifier& transactionIdentifier, const WebCore::IDBError&) override final;
+    virtual void didCommitTransaction(const WebCore::IDBResourceIdentifier& transactionIdentifier, const WebCore::IDBError&) override final;
+    virtual void didCreateObjectStore(const WebCore::IDBResultData&) override final;
+    virtual void didDeleteObjectStore(const WebCore::IDBResultData&) override final;
+    virtual void didClearObjectStore(const WebCore::IDBResultData&) override final;
+    virtual void didCreateIndex(const WebCore::IDBResultData&) override final;
+    virtual void didDeleteIndex(const WebCore::IDBResultData&) override final;
+    virtual void didPutOrAdd(const WebCore::IDBResultData&) override final;
+    virtual void didGetRecord(const WebCore::IDBResultData&) override final;
+    virtual void didGetCount(const WebCore::IDBResultData&) override final;
+    virtual void didDeleteRecord(const WebCore::IDBResultData&) override final;
+    virtual void didOpenCursor(const WebCore::IDBResultData&) override final;
+    virtual void didIterateCursor(const WebCore::IDBResultData&) override final;
+
+    virtual void fireVersionChangeEvent(WebCore::IDBServer::UniqueIDBDatabaseConnection&, const WebCore::IDBResourceIdentifier& requestIdentifier, uint64_t requestedVersion) override final;
+    virtual void didStartTransaction(const WebCore::IDBResourceIdentifier& transactionIdentifier, const WebCore::IDBError&) override final;
+    virtual void notifyOpenDBRequestBlocked(const WebCore::IDBResourceIdentifier& requestIdentifier, uint64_t oldVersion, uint64_t newVersion) override final;
+
+    virtual void ref() override { RefCounted<WebIDBConnectionToClient>::ref(); }
+    virtual void deref() override { RefCounted<WebIDBConnectionToClient>::deref(); }
+
+    void disconnectedFromWebProcess();
+
+private:
+    WebIDBConnectionToClient(DatabaseToWebProcessConnection&, uint64_t serverConnectionIdentifier);
+
+    virtual IPC::Connection* messageSenderConnection() override final;
+    Ref<DatabaseToWebProcessConnection> m_connection;
+
+    uint64_t m_identifier;
+    RefPtr<WebCore::IDBServer::IDBConnectionToClient> m_connectionToClient;
+};
+
+} // namespace WebKit
+
+#endif // ENABLE(INDEXED_DATABASE)
+#endif // WebIDBConnectionToClient_h

Modified: trunk/Source/WebKit2/Platform/Logging.h (196650 => 196651)


--- trunk/Source/WebKit2/Platform/Logging.h	2016-02-16 20:50:46 UTC (rev 196650)
+++ trunk/Source/WebKit2/Platform/Logging.h	2016-02-16 20:58:56 UTC (rev 196651)
@@ -41,6 +41,7 @@
     M(ContextMenu) \
     M(IDB) \
     M(IconDatabase) \
+    M(IndexedDB) \
     M(InspectorServer) \
     M(KeyHandling) \
     M(Network) \

Modified: trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj (196650 => 196651)


--- trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj	2016-02-16 20:50:46 UTC (rev 196650)
+++ trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj	2016-02-16 20:58:56 UTC (rev 196651)
@@ -854,6 +854,8 @@
 		51032F19180F73BB00961BB7 /* WebToDatabaseProcessConnection.h in Headers */ = {isa = PBXBuildFile; fileRef = 51032F17180F73BB00961BB7 /* WebToDatabaseProcessConnection.h */; };
 		51032F1D180F791700961BB7 /* DatabaseToWebProcessConnectionMessageReceiver.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 51032F1B180F791700961BB7 /* DatabaseToWebProcessConnectionMessageReceiver.cpp */; };
 		51032F1E180F791700961BB7 /* DatabaseToWebProcessConnectionMessages.h in Headers */ = {isa = PBXBuildFile; fileRef = 51032F1C180F791700961BB7 /* DatabaseToWebProcessConnectionMessages.h */; };
+		5105236F1C739D42007993CB /* WebIDBConnectionToClient.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5105236D1C7393E9007993CB /* WebIDBConnectionToClient.cpp */; };
+		510523701C739D42007993CB /* WebIDBConnectionToClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 5105236E1C7393E9007993CB /* WebIDBConnectionToClient.h */; };
 		51064D35189781C4004B2FEB /* SQLiteIDBCursor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 51064D33189781C4004B2FEB /* SQLiteIDBCursor.cpp */; };
 		51064D36189781C4004B2FEB /* SQLiteIDBCursor.h in Headers */ = {isa = PBXBuildFile; fileRef = 51064D34189781C4004B2FEB /* SQLiteIDBCursor.h */; };
 		5106D7C218BDBE73000AB166 /* ContextMenuContextData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5106D7BF18BDBE73000AB166 /* ContextMenuContextData.cpp */; };
@@ -914,6 +916,8 @@
 		513A164D1630A9BF005D7D22 /* NetworkConnectionToWebProcess.h in Headers */ = {isa = PBXBuildFile; fileRef = 513A164A1630A9BF005D7D22 /* NetworkConnectionToWebProcess.h */; };
 		513E462D1AD837560016234A /* WKSharingServicePickerDelegate.h in Headers */ = {isa = PBXBuildFile; fileRef = 513E462B1AD837560016234A /* WKSharingServicePickerDelegate.h */; };
 		513E462E1AD837560016234A /* WKSharingServicePickerDelegate.mm in Sources */ = {isa = PBXBuildFile; fileRef = 513E462C1AD837560016234A /* WKSharingServicePickerDelegate.mm */; };
+		514129941C6428BB0059E714 /* WebIDBConnectionToServer.h in Headers */ = {isa = PBXBuildFile; fileRef = 514129921C6428100059E714 /* WebIDBConnectionToServer.h */; };
+		514129951C6428C20059E714 /* WebIDBConnectionToServer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 514129911C6428100059E714 /* WebIDBConnectionToServer.cpp */; };
 		514BDED316C98EDD00E4E25E /* StatisticsRequest.h in Headers */ = {isa = PBXBuildFile; fileRef = 514BDED216C98EDD00E4E25E /* StatisticsRequest.h */; };
 		514D9F5719119D35000063A7 /* ServicesController.h in Headers */ = {isa = PBXBuildFile; fileRef = 514D9F5519119D35000063A7 /* ServicesController.h */; };
 		514D9F5819119D35000063A7 /* ServicesController.mm in Sources */ = {isa = PBXBuildFile; fileRef = 514D9F5619119D35000063A7 /* ServicesController.mm */; };
@@ -2852,6 +2856,8 @@
 		51032F1A180F74F100961BB7 /* DatabaseToWebProcessConnection.messages.in */ = {isa = PBXFileReference; lastKnownFileType = text; path = DatabaseToWebProcessConnection.messages.in; sourceTree = "<group>"; };
 		51032F1B180F791700961BB7 /* DatabaseToWebProcessConnectionMessageReceiver.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DatabaseToWebProcessConnectionMessageReceiver.cpp; sourceTree = "<group>"; };
 		51032F1C180F791700961BB7 /* DatabaseToWebProcessConnectionMessages.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DatabaseToWebProcessConnectionMessages.h; sourceTree = "<group>"; };
+		5105236D1C7393E9007993CB /* WebIDBConnectionToClient.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebIDBConnectionToClient.cpp; sourceTree = "<group>"; };
+		5105236E1C7393E9007993CB /* WebIDBConnectionToClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebIDBConnectionToClient.h; sourceTree = "<group>"; };
 		5105B0D4162F7A7A00E27709 /* NetworkProcessConnection.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = NetworkProcessConnection.cpp; path = Network/NetworkProcessConnection.cpp; sourceTree = "<group>"; };
 		5105B0D5162F7A7A00E27709 /* NetworkProcessConnection.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = NetworkProcessConnection.h; path = Network/NetworkProcessConnection.h; sourceTree = "<group>"; };
 		5105B0F31630872E00E27709 /* NetworkProcessProxy.messages.in */ = {isa = PBXFileReference; lastKnownFileType = text; path = NetworkProcessProxy.messages.in; sourceTree = "<group>"; };
@@ -2920,6 +2926,8 @@
 		513A164B1630A9BF005D7D22 /* NetworkConnectionToWebProcess.messages.in */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = NetworkConnectionToWebProcess.messages.in; path = NetworkProcess/NetworkConnectionToWebProcess.messages.in; sourceTree = "<group>"; };
 		513E462B1AD837560016234A /* WKSharingServicePickerDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKSharingServicePickerDelegate.h; sourceTree = "<group>"; };
 		513E462C1AD837560016234A /* WKSharingServicePickerDelegate.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WKSharingServicePickerDelegate.mm; sourceTree = "<group>"; };
+		514129911C6428100059E714 /* WebIDBConnectionToServer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebIDBConnectionToServer.cpp; sourceTree = "<group>"; };
+		514129921C6428100059E714 /* WebIDBConnectionToServer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebIDBConnectionToServer.h; sourceTree = "<group>"; };
 		514BDED216C98EDD00E4E25E /* StatisticsRequest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StatisticsRequest.h; sourceTree = "<group>"; };
 		514D9F5519119D35000063A7 /* ServicesController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ServicesController.h; sourceTree = "<group>"; };
 		514D9F5619119D35000063A7 /* ServicesController.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = ServicesController.mm; sourceTree = "<group>"; };
@@ -5300,6 +5308,8 @@
 		511F8EDA180881660047DA96 /* IndexedDB */ = {
 			isa = PBXGroup;
 			children = (
+				514129911C6428100059E714 /* WebIDBConnectionToServer.cpp */,
+				514129921C6428100059E714 /* WebIDBConnectionToServer.h */,
 				51E351F1180F5C7500E53BE9 /* WebIDBFactoryBackend.cpp */,
 				51E351F2180F5C7500E53BE9 /* WebIDBFactoryBackend.h */,
 				51290990183ACEAF005522A6 /* WebIDBServerConnection.cpp */,
@@ -5450,6 +5460,8 @@
 				51654EFF184EF34A007DC837 /* UniqueIDBDatabaseBackingStore.h */,
 				515E773118402D510007203F /* UniqueIDBDatabaseIdentifier.cpp */,
 				515E773218402D510007203F /* UniqueIDBDatabaseIdentifier.h */,
+				5105236D1C7393E9007993CB /* WebIDBConnectionToClient.cpp */,
+				5105236E1C7393E9007993CB /* WebIDBConnectionToClient.h */,
 			);
 			path = IndexedDB;
 			sourceTree = "<group>";
@@ -7766,6 +7778,7 @@
 				1A52C0F81A38CDC70016160A /* WebStorageNamespaceProvider.h in Headers */,
 				BCC5715B115ADAEF001CCAF9 /* WebSystemInterface.h in Headers */,
 				51032F19180F73BB00961BB7 /* WebToDatabaseProcessConnection.h in Headers */,
+				514129941C6428BB0059E714 /* WebIDBConnectionToServer.h in Headers */,
 				BCA0EF7F12331E78007D3CFB /* WebUndoStep.h in Headers */,
 				1AAF08AE1926936700B6390C /* WebUserContentController.h in Headers */,
 				1AAF08B819269E6D00B6390C /* WebUserContentControllerMessages.h in Headers */,
@@ -7789,6 +7802,7 @@
 				512F58F812A88A5400629530 /* WKAuthenticationDecisionListener.h in Headers */,
 				37C4C08D1814AC5C003688B9 /* WKBackForwardList.h in Headers */,
 				37C4C0951814B9E6003688B9 /* WKBackForwardListInternal.h in Headers */,
+				510523701C739D42007993CB /* WebIDBConnectionToClient.h in Headers */,
 				37C4C08718149C5B003688B9 /* WKBackForwardListItem.h in Headers */,
 				37C4C08918149F23003688B9 /* WKBackForwardListItemInternal.h in Headers */,
 				BC646C1D11DD399F006455B0 /* WKBackForwardListItemRef.h in Headers */,
@@ -8796,6 +8810,7 @@
 				1AB7D4CB1288AAA700CFD08C /* DownloadProxy.cpp in Sources */,
 				1AD25E95167AB08100EA9BCD /* DownloadProxyMap.cpp in Sources */,
 				1AB7D6191288B9D900CFD08C /* DownloadProxyMessageReceiver.cpp in Sources */,
+				5105236F1C739D42007993CB /* WebIDBConnectionToClient.cpp in Sources */,
 				BC8452A71162C80900CAB9B5 /* DrawingArea.cpp in Sources */,
 				1A64229912DD029200CAAE2C /* DrawingAreaMessageReceiver.cpp in Sources */,
 				BC2652161182608100243E12 /* DrawingAreaProxy.cpp in Sources */,
@@ -9422,6 +9437,7 @@
 				BCD597D1112B56AC00EC8C23 /* WKPreferences.cpp in Sources */,
 				1AFDD3191891CA1200153970 /* WKPreferences.mm in Sources */,
 				0FCB4E6718BBE3D9000FCFC9 /* WKPrintingView.mm in Sources */,
+				514129951C6428C20059E714 /* WebIDBConnectionToServer.cpp in Sources */,
 				BCBAACEC145225E30053F82F /* WKProcessGroup.mm in Sources */,
 				1A158419189044F50017616C /* WKProcessPool.mm in Sources */,
 				512F58FB12A88A5400629530 /* WKProtectionSpace.cpp in Sources */,

Added: trunk/Source/WebKit2/WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp (0 => 196651)


--- trunk/Source/WebKit2/WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp	                        (rev 0)
+++ trunk/Source/WebKit2/WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp	2016-02-16 20:58:56 UTC (rev 196651)
@@ -0,0 +1,162 @@
+/*
+ * Copyright (C) 2016 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "WebIDBConnectionToServer.h"
+
+#if ENABLE(INDEXED_DATABASE)
+
+#include "DatabaseToWebProcessConnectionMessages.h"
+#include "WebProcess.h"
+#include "WebToDatabaseProcessConnection.h"
+#include <WebCore/IDBConnectionToServer.h>
+#include <WebCore/IDBOpenDBRequestImpl.h>
+
+using namespace WebCore;
+
+namespace WebKit {
+
+static uint64_t generateConnectionToServerIdentifier()
+{
+    ASSERT(RunLoop::isMain());
+    static uint64_t identifier = 0;
+    return ++identifier;
+}
+
+Ref<WebIDBConnectionToServer> WebIDBConnectionToServer::create()
+{
+    return adoptRef(*new WebIDBConnectionToServer);
+}
+
+WebIDBConnectionToServer::WebIDBConnectionToServer()
+    : m_identifier(generateConnectionToServerIdentifier())
+{
+    relaxAdoptionRequirement();
+    m_connectionToServer = IDBClient::IDBConnectionToServer::create(*this);
+
+    send(Messages::DatabaseToWebProcessConnection::EstablishIDBConnectionToServer(m_identifier));
+
+    m_isOpenInServer = true;
+}
+
+WebIDBConnectionToServer::~WebIDBConnectionToServer()
+{
+    if (m_isOpenInServer)
+        send(Messages::DatabaseToWebProcessConnection::RemoveIDBConnectionToServer(m_identifier));
+}
+
+IPC::Connection* WebIDBConnectionToServer::messageSenderConnection()
+{
+    return WebProcess::singleton().webToDatabaseProcessConnection()->connection();
+}
+
+IDBClient::IDBConnectionToServer& WebIDBConnectionToServer::coreConnectionToServer()
+{
+    return *m_connectionToServer;
+}
+
+void WebIDBConnectionToServer::deleteDatabase(IDBRequestData&)
+{
+}
+
+void WebIDBConnectionToServer::openDatabase(IDBRequestData&)
+{
+}
+
+void WebIDBConnectionToServer::abortTransaction(IDBResourceIdentifier&)
+{
+}
+
+void WebIDBConnectionToServer::commitTransaction(IDBResourceIdentifier&)
+{
+}
+
+void WebIDBConnectionToServer::didFinishHandlingVersionChangeTransaction(IDBResourceIdentifier&)
+{
+}
+
+void WebIDBConnectionToServer::createObjectStore(const IDBRequestData&, const IDBObjectStoreInfo&)
+{
+}
+
+void WebIDBConnectionToServer::deleteObjectStore(const IDBRequestData&, const String& objectStoreName)
+{
+}
+
+void WebIDBConnectionToServer::clearObjectStore(const IDBRequestData&, uint64_t objectStoreIdentifier)
+{
+}
+
+void WebIDBConnectionToServer::createIndex(const IDBRequestData&, const IDBIndexInfo&)
+{
+}
+
+void WebIDBConnectionToServer::deleteIndex(const IDBRequestData&, uint64_t objectStoreIdentifier, const String& indexName)
+{
+}
+
+void WebIDBConnectionToServer::putOrAdd(const IDBRequestData&, IDBKey*, SerializedScriptValue&, const IndexedDB::ObjectStoreOverwriteMode)
+{
+}
+
+void WebIDBConnectionToServer::getRecord(const IDBRequestData&, const IDBKeyRangeData&)
+{
+}
+
+void WebIDBConnectionToServer::getCount(const IDBRequestData&, const IDBKeyRangeData&)
+{
+}
+
+void WebIDBConnectionToServer::deleteRecord(const IDBRequestData&, const IDBKeyRangeData&)
+{
+}
+
+void WebIDBConnectionToServer::openCursor(const IDBRequestData&, const IDBCursorInfo&)
+{
+}
+
+void WebIDBConnectionToServer::iterateCursor(const IDBRequestData&, const IDBKeyData&, unsigned long count)
+{
+}
+
+void WebIDBConnectionToServer::establishTransaction(uint64_t databaseConnectionIdentifier, const IDBTransactionInfo&)
+{
+}
+
+void WebIDBConnectionToServer::databaseConnectionClosed(uint64_t databaseConnectionIdentifier)
+{
+}
+
+void WebIDBConnectionToServer::abortOpenAndUpgradeNeeded(uint64_t databaseConnectionIdentifier, const IDBResourceIdentifier& transactionIdentifier)
+{
+}
+
+void WebIDBConnectionToServer::didFireVersionChangeEvent(uint64_t databaseConnectionIdentifier, const IDBResourceIdentifier& requestIdentifier)
+{
+}
+
+} // namespace WebKit
+
+#endif // ENABLE(INDEXED_DATABASE)

Added: trunk/Source/WebKit2/WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.h (0 => 196651)


--- trunk/Source/WebKit2/WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.h	                        (rev 0)
+++ trunk/Source/WebKit2/WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.h	2016-02-16 20:58:56 UTC (rev 196651)
@@ -0,0 +1,83 @@
+/*
+ * Copyright (C) 2016 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef WebIDBConnectionToServer_h
+#define WebIDBConnectionToServer_h
+
+#if ENABLE(INDEXED_DATABASE)
+
+#include "MessageSender.h"
+#include <WebCore/IDBConnectionToServer.h>
+
+namespace WebKit {
+
+class WebIDBConnectionToServer final : public WebCore::IDBClient::IDBConnectionToServerDelegate, public IPC::MessageSender, public RefCounted<WebIDBConnectionToServer> {
+public:
+    static Ref<WebIDBConnectionToServer> create();
+
+    virtual ~WebIDBConnectionToServer();
+
+    WebCore::IDBClient::IDBConnectionToServer& coreConnectionToServer();
+    virtual uint64_t identifier() const override final { return m_identifier; }
+    virtual uint64_t messageSenderDestinationID() override final { return m_identifier; }
+
+    virtual void deleteDatabase(WebCore::IDBRequestData&) override final;
+    virtual void openDatabase(WebCore::IDBRequestData&) override final;
+    virtual void abortTransaction(WebCore::IDBResourceIdentifier&) override final;
+    virtual void commitTransaction(WebCore::IDBResourceIdentifier&) override final;
+    virtual void didFinishHandlingVersionChangeTransaction(WebCore::IDBResourceIdentifier&) override final;
+    virtual void createObjectStore(const WebCore::IDBRequestData&, const WebCore::IDBObjectStoreInfo&) override final;
+    virtual void deleteObjectStore(const WebCore::IDBRequestData&, const String& objectStoreName) override final;
+    virtual void clearObjectStore(const WebCore::IDBRequestData&, uint64_t objectStoreIdentifier) override final;
+    virtual void createIndex(const WebCore::IDBRequestData&, const WebCore::IDBIndexInfo&) override final;
+    virtual void deleteIndex(const WebCore::IDBRequestData&, uint64_t objectStoreIdentifier, const String& indexName) override final;
+    virtual void putOrAdd(const WebCore::IDBRequestData&, WebCore::IDBKey*, WebCore::SerializedScriptValue&, const WebCore::IndexedDB::ObjectStoreOverwriteMode) override final;
+    virtual void getRecord(const WebCore::IDBRequestData&, const WebCore::IDBKeyRangeData&) override final;
+    virtual void getCount(const WebCore::IDBRequestData&, const WebCore::IDBKeyRangeData&) override final;
+    virtual void deleteRecord(const WebCore::IDBRequestData&, const WebCore::IDBKeyRangeData&) override final;
+    virtual void openCursor(const WebCore::IDBRequestData&, const WebCore::IDBCursorInfo&) override final;
+    virtual void iterateCursor(const WebCore::IDBRequestData&, const WebCore::IDBKeyData&, unsigned long count) override final;
+    virtual void establishTransaction(uint64_t databaseConnectionIdentifier, const WebCore::IDBTransactionInfo&) override final;
+    virtual void databaseConnectionClosed(uint64_t databaseConnectionIdentifier) override final;
+    virtual void abortOpenAndUpgradeNeeded(uint64_t databaseConnectionIdentifier, const WebCore::IDBResourceIdentifier& transactionIdentifier) override final;
+    virtual void didFireVersionChangeEvent(uint64_t databaseConnectionIdentifier, const WebCore::IDBResourceIdentifier& requestIdentifier) override final;
+
+    virtual void ref() override { RefCounted<WebIDBConnectionToServer>::ref(); }
+    virtual void deref() override { RefCounted<WebIDBConnectionToServer>::deref(); }
+
+private:
+    WebIDBConnectionToServer();
+
+    virtual IPC::Connection* messageSenderConnection() override final;
+
+    uint64_t m_identifier;
+    bool m_isOpenInServer { false };
+    RefPtr<WebCore::IDBClient::IDBConnectionToServer> m_connectionToServer;
+};
+
+} // namespace WebKit
+
+#endif // ENABLE(INDEXED_DATABASE)
+#endif // WebIDBConnectionToServer_h

Modified: trunk/Source/WebKit2/WebProcess/Databases/WebDatabaseProvider.cpp (196650 => 196651)


--- trunk/Source/WebKit2/WebProcess/Databases/WebDatabaseProvider.cpp	2016-02-16 20:50:46 UTC (rev 196650)
+++ trunk/Source/WebKit2/WebProcess/Databases/WebDatabaseProvider.cpp	2016-02-16 20:58:56 UTC (rev 196651)
@@ -27,6 +27,9 @@
 #include "WebDatabaseProvider.h"
 
 #include "WebIDBFactoryBackend.h"
+#include "WebProcess.h"
+#include "WebToDatabaseProcessConnection.h"
+#include <WebCore/SessionID.h>
 #include <wtf/HashMap.h>
 #include <wtf/NeverDestroyed.h>
 
@@ -66,6 +69,21 @@
 }
 
 #if ENABLE(INDEXED_DATABASE)
+
+WebCore::IDBClient::IDBConnectionToServer& WebDatabaseProvider::idbConnectionToServerForSession(const WebCore::SessionID& sessionID)
+{
+    if (sessionID.isEphemeral()) {
+        auto result = m_idbEphemeralConnectionMap.add(sessionID.sessionID(), nullptr);
+        if (result.isNewEntry)
+            result.iterator->value = WebCore::InProcessIDBServer::create();
+
+        return result.iterator->value->connectionToServer();
+    }
+
+    ASSERT(WebProcess::singleton().webToDatabaseProcessConnection());
+    return WebProcess::singleton().webToDatabaseProcessConnection()->idbConnectionToServerForSession(sessionID).coreConnectionToServer();
+}
+
 RefPtr<WebCore::IDBFactoryBackendInterface> WebDatabaseProvider::createIDBFactoryBackend()
 {
 #if ENABLE(DATABASE_PROCESS)

Modified: trunk/Source/WebKit2/WebProcess/Databases/WebDatabaseProvider.h (196650 => 196651)


--- trunk/Source/WebKit2/WebProcess/Databases/WebDatabaseProvider.h	2016-02-16 20:50:46 UTC (rev 196650)
+++ trunk/Source/WebKit2/WebProcess/Databases/WebDatabaseProvider.h	2016-02-16 20:58:56 UTC (rev 196651)
@@ -27,6 +27,8 @@
 #define WebDatabaseProvider_h
 
 #include <WebCore/DatabaseProvider.h>
+#include <WebCore/InProcessIDBServer.h>
+#include <wtf/HashMap.h>
 
 namespace WebKit {
 
@@ -37,11 +39,7 @@
 
 #if ENABLE(INDEXED_DATABASE)
     virtual bool supportsModernIDB() const override { return false; }
-
-    virtual WebCore::IDBClient::IDBConnectionToServer& idbConnectionToServerForSession(const WebCore::SessionID&) override
-    {
-        RELEASE_ASSERT_NOT_REACHED();
-    }
+    virtual WebCore::IDBClient::IDBConnectionToServer& idbConnectionToServerForSession(const WebCore::SessionID&) override final;
 #endif
 
 private:
@@ -49,6 +47,7 @@
 
 #if ENABLE(INDEXED_DATABASE)
     virtual RefPtr<WebCore::IDBFactoryBackendInterface> createIDBFactoryBackend() override;
+    HashMap<uint64_t, RefPtr<WebCore::InProcessIDBServer>> m_idbEphemeralConnectionMap;
 #endif
 
     const uint64_t m_identifier;

Modified: trunk/Source/WebKit2/WebProcess/Databases/WebToDatabaseProcessConnection.cpp (196650 => 196651)


--- trunk/Source/WebKit2/WebProcess/Databases/WebToDatabaseProcessConnection.cpp	2016-02-16 20:50:46 UTC (rev 196650)
+++ trunk/Source/WebKit2/WebProcess/Databases/WebToDatabaseProcessConnection.cpp	2016-02-16 20:58:56 UTC (rev 196651)
@@ -88,6 +88,15 @@
 
     m_webIDBServerConnections.remove(connection.messageSenderDestinationID());
 }
+
+WebIDBConnectionToServer& WebToDatabaseProcessConnection::idbConnectionToServerForSession(const SessionID& sessionID)
+{
+    auto result = m_webIDBConnections.add(sessionID.sessionID(), nullptr);
+    if (result.isNewEntry)
+        result.iterator->value = WebIDBConnectionToServer::create();
+
+    return *result.iterator->value;
+}
 #endif
 
 } // namespace WebKit

Modified: trunk/Source/WebKit2/WebProcess/Databases/WebToDatabaseProcessConnection.h (196650 => 196651)


--- trunk/Source/WebKit2/WebProcess/Databases/WebToDatabaseProcessConnection.h	2016-02-16 20:50:46 UTC (rev 196650)
+++ trunk/Source/WebKit2/WebProcess/Databases/WebToDatabaseProcessConnection.h	2016-02-16 20:58:56 UTC (rev 196651)
@@ -29,10 +29,15 @@
 
 #include "Connection.h"
 #include "MessageSender.h"
+#include "WebIDBConnectionToServer.h"
 #include <wtf/RefCounted.h>
 
 #if ENABLE(DATABASE_PROCESS)
 
+namespace WebCore {
+class SessionID;
+}
+
 namespace WebKit {
 
 class WebIDBServerConnection;
@@ -51,6 +56,8 @@
 #if ENABLE(INDEXED_DATABASE)
     void registerWebIDBServerConnection(WebIDBServerConnection&);
     void removeWebIDBServerConnection(WebIDBServerConnection&);
+
+    WebIDBConnectionToServer& idbConnectionToServerForSession(const WebCore::SessionID&);
 #endif
 
 private:
@@ -71,6 +78,8 @@
 
 #if ENABLE(INDEXED_DATABASE)
     HashMap<uint64_t, WebIDBServerConnection*> m_webIDBServerConnections;
+
+    HashMap<uint64_t, RefPtr<WebIDBConnectionToServer>> m_webIDBConnections;
 #endif
 };
 
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to