IndexedDB 2.0: "close pending flag" and firing blocked events all need fixing.
authorbeidson@apple.com <beidson@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 11 Nov 2016 21:57:42 +0000 (21:57 +0000)
committerbeidson@apple.com <beidson@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 11 Nov 2016 21:57:42 +0000 (21:57 +0000)
https://bugs.webkit.org/show_bug.cgi?id=164641

Reviewed by Alex Christensen.

LayoutTests/imported/w3c:

* web-platform-tests/IndexedDB/idbobjectstore-rename-store-expected.txt:

Source/WebCore:

No new tests (Covered by at least 3 existing tests).

* Modules/indexeddb/IDBDatabase.cpp:
(WebCore::IDBDatabase::close):
(WebCore::IDBDatabase::maybeCloseInServer):

* Modules/indexeddb/client/IDBConnectionProxy.cpp:
(WebCore::IDBClient::IDBConnectionProxy::databaseConnectionPendingClose):
* Modules/indexeddb/client/IDBConnectionProxy.h:

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

* Modules/indexeddb/server/IDBServer.cpp:
(WebCore::IDBServer::IDBServer::databaseConnectionPendingClose):
* Modules/indexeddb/server/IDBServer.h:

* Modules/indexeddb/server/ServerOpenDBRequest.cpp:
(WebCore::IDBServer::ServerOpenDBRequest::maybeNotifyRequestBlocked):
(WebCore::IDBServer::ServerOpenDBRequest::notifyRequestBlocked): Deleted.
* Modules/indexeddb/server/ServerOpenDBRequest.h:
(WebCore::IDBServer::ServerOpenDBRequest::hasNotifiedBlocked): Deleted.

* Modules/indexeddb/server/UniqueIDBDatabase.cpp:
(WebCore::IDBServer::UniqueIDBDatabase::allConnectionsAreClosedOrClosing):
(WebCore::IDBServer::UniqueIDBDatabase::maybeNotifyConnectionsOfVersionChange):
(WebCore::IDBServer::UniqueIDBDatabase::notifyCurrentRequestConnectionClosedOrFiredVersionChangeEvent):
* Modules/indexeddb/server/UniqueIDBDatabase.h:

* Modules/indexeddb/server/UniqueIDBDatabaseConnection.cpp:
(WebCore::IDBServer::UniqueIDBDatabaseConnection::connectionPendingCloseFromClient):
(WebCore::IDBServer::UniqueIDBDatabaseConnection::connectionClosedFromClient):
(WebCore::IDBServer::UniqueIDBDatabaseConnection::connectionIsClosing):
* Modules/indexeddb/server/UniqueIDBDatabaseConnection.h:

* Modules/indexeddb/shared/InProcessIDBServer.cpp:
(WebCore::InProcessIDBServer::databaseConnectionPendingClose):
* Modules/indexeddb/shared/InProcessIDBServer.h:

Source/WebKit2:

* DatabaseProcess/IndexedDB/WebIDBConnectionToClient.cpp:
(WebKit::WebIDBConnectionToClient::databaseConnectionPendingClose):
* DatabaseProcess/IndexedDB/WebIDBConnectionToClient.h:
* DatabaseProcess/IndexedDB/WebIDBConnectionToClient.messages.in:

* WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp:
(WebKit::WebIDBConnectionToServer::databaseConnectionPendingClose):
* WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.h:

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

25 files changed:
LayoutTests/imported/w3c/ChangeLog
LayoutTests/imported/w3c/web-platform-tests/IndexedDB/idbobjectstore-rename-store-expected.txt
Source/WebCore/ChangeLog
Source/WebCore/Modules/indexeddb/IDBDatabase.cpp
Source/WebCore/Modules/indexeddb/client/IDBConnectionProxy.cpp
Source/WebCore/Modules/indexeddb/client/IDBConnectionProxy.h
Source/WebCore/Modules/indexeddb/client/IDBConnectionToServer.cpp
Source/WebCore/Modules/indexeddb/client/IDBConnectionToServer.h
Source/WebCore/Modules/indexeddb/client/IDBConnectionToServerDelegate.h
Source/WebCore/Modules/indexeddb/server/IDBServer.cpp
Source/WebCore/Modules/indexeddb/server/IDBServer.h
Source/WebCore/Modules/indexeddb/server/ServerOpenDBRequest.cpp
Source/WebCore/Modules/indexeddb/server/ServerOpenDBRequest.h
Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabase.cpp
Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabase.h
Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabaseConnection.cpp
Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabaseConnection.h
Source/WebCore/Modules/indexeddb/shared/InProcessIDBServer.cpp
Source/WebCore/Modules/indexeddb/shared/InProcessIDBServer.h
Source/WebKit2/ChangeLog
Source/WebKit2/DatabaseProcess/IndexedDB/WebIDBConnectionToClient.cpp
Source/WebKit2/DatabaseProcess/IndexedDB/WebIDBConnectionToClient.h
Source/WebKit2/DatabaseProcess/IndexedDB/WebIDBConnectionToClient.messages.in
Source/WebKit2/WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp
Source/WebKit2/WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.h

index f856a4d..7d40f86 100644 (file)
@@ -1,3 +1,12 @@
+2016-11-11  Brady Eidson  <beidson@apple.com>
+
+        IndexedDB 2.0: "close pending flag" and firing blocked events all need fixing.
+        https://bugs.webkit.org/show_bug.cgi?id=164641
+
+        Reviewed by Alex Christensen.
+
+        * web-platform-tests/IndexedDB/idbobjectstore-rename-store-expected.txt:
+
 2016-11-10  Brady Eidson  <beidson@apple.com>
 
         IndexedDB 2.0 Support the IDBDatabase.onclose event.
index 56c98d8..90b142b 100644 (file)
@@ -2,7 +2,7 @@
 PASS IndexedDB object store rename in new transaction 
 PASS IndexedDB object store rename in the transaction where it is created 
 PASS IndexedDB object store rename covers index 
-FAIL IndexedDB object store rename covers key generator assert_equals: Renaming an object store should not change the state of its key generator expected 345680 but got 345679
+PASS IndexedDB object store rename covers key generator 
 PASS IndexedDB object store rename to the same name succeeds 
 PASS IndexedDB object store rename to the name of a deleted store succeeds 
 PASS IndexedDB object store swapping via renames succeeds 
index 93c76af..3ecfd2b 100644 (file)
@@ -1,3 +1,51 @@
+2016-11-11  Brady Eidson  <beidson@apple.com>
+
+        IndexedDB 2.0: "close pending flag" and firing blocked events all need fixing.
+        https://bugs.webkit.org/show_bug.cgi?id=164641
+
+        Reviewed by Alex Christensen.
+
+        No new tests (Covered by at least 3 existing tests).
+
+        * Modules/indexeddb/IDBDatabase.cpp:
+        (WebCore::IDBDatabase::close):
+        (WebCore::IDBDatabase::maybeCloseInServer):
+
+        * Modules/indexeddb/client/IDBConnectionProxy.cpp:
+        (WebCore::IDBClient::IDBConnectionProxy::databaseConnectionPendingClose):
+        * Modules/indexeddb/client/IDBConnectionProxy.h:
+
+        * Modules/indexeddb/client/IDBConnectionToServer.cpp:
+        (WebCore::IDBClient::IDBConnectionToServer::databaseConnectionPendingClose):
+        * Modules/indexeddb/client/IDBConnectionToServer.h:
+        * Modules/indexeddb/client/IDBConnectionToServerDelegate.h:
+
+        * Modules/indexeddb/server/IDBServer.cpp:
+        (WebCore::IDBServer::IDBServer::databaseConnectionPendingClose):
+        * Modules/indexeddb/server/IDBServer.h:
+
+        * Modules/indexeddb/server/ServerOpenDBRequest.cpp:
+        (WebCore::IDBServer::ServerOpenDBRequest::maybeNotifyRequestBlocked):
+        (WebCore::IDBServer::ServerOpenDBRequest::notifyRequestBlocked): Deleted.
+        * Modules/indexeddb/server/ServerOpenDBRequest.h:
+        (WebCore::IDBServer::ServerOpenDBRequest::hasNotifiedBlocked): Deleted.
+
+        * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
+        (WebCore::IDBServer::UniqueIDBDatabase::allConnectionsAreClosedOrClosing):
+        (WebCore::IDBServer::UniqueIDBDatabase::maybeNotifyConnectionsOfVersionChange):
+        (WebCore::IDBServer::UniqueIDBDatabase::notifyCurrentRequestConnectionClosedOrFiredVersionChangeEvent):
+        * Modules/indexeddb/server/UniqueIDBDatabase.h:
+
+        * Modules/indexeddb/server/UniqueIDBDatabaseConnection.cpp:
+        (WebCore::IDBServer::UniqueIDBDatabaseConnection::connectionPendingCloseFromClient):
+        (WebCore::IDBServer::UniqueIDBDatabaseConnection::connectionClosedFromClient):
+        (WebCore::IDBServer::UniqueIDBDatabaseConnection::connectionIsClosing):
+        * Modules/indexeddb/server/UniqueIDBDatabaseConnection.h:
+
+        * Modules/indexeddb/shared/InProcessIDBServer.cpp:
+        (WebCore::InProcessIDBServer::databaseConnectionPendingClose):
+        * Modules/indexeddb/shared/InProcessIDBServer.h:
+
 2016-11-11  Dave Hyatt  <hyatt@apple.com>
 
         [CSS Parser] Fix time unit parsing
index 952b2f9..673da49 100644 (file)
@@ -237,7 +237,11 @@ void IDBDatabase::close()
 
     ASSERT(currentThread() == originThreadID());
 
-    m_closePending = true;
+    if (!m_closePending) {
+        m_closePending = true;
+        m_connectionProxy->databaseConnectionPendingClose(*this);
+    }
+
     maybeCloseInServer();
 }
 
@@ -287,7 +291,7 @@ void IDBDatabase::maybeCloseInServer()
     // 3.3.9 Database closing steps
     // Wait for all transactions created using this connection to complete.
     // Once they are complete, this connection is closed.
-    if (!m_activeTransactions.isEmpty())
+    if (!m_activeTransactions.isEmpty() || !m_committingTransactions.isEmpty())
         return;
 
     m_closedInServer = true;
index caffd5f..805f30e 100644 (file)
@@ -384,6 +384,11 @@ void IDBConnectionProxy::didFinishHandlingVersionChangeTransaction(uint64_t data
     callConnectionOnMainThread(&IDBConnectionToServer::didFinishHandlingVersionChangeTransaction, databaseConnectionIdentifier, transaction.info().identifier());
 }
 
+void IDBConnectionProxy::databaseConnectionPendingClose(IDBDatabase& database)
+{
+    callConnectionOnMainThread(&IDBConnectionToServer::databaseConnectionPendingClose, database.databaseConnectionIdentifier());
+}
+
 void IDBConnectionProxy::databaseConnectionClosed(IDBDatabase& database)
 {
     callConnectionOnMainThread(&IDBConnectionToServer::databaseConnectionClosed, database.databaseConnectionIdentifier());
index dd954ea..5c01ac3 100644 (file)
@@ -97,6 +97,7 @@ public:
     void didAbortTransaction(const IDBResourceIdentifier& transactionIdentifier, const IDBError&);
 
     void didFinishHandlingVersionChangeTransaction(uint64_t databaseConnectionIdentifier, IDBTransaction&);
+    void databaseConnectionPendingClose(IDBDatabase&);
     void databaseConnectionClosed(IDBDatabase&);
 
     void didCloseFromServer(uint64_t databaseConnectionIdentifier, const IDBError&);
index 3a076fb..75c5773 100644 (file)
@@ -399,6 +399,14 @@ void IDBConnectionToServer::openDBRequestCancelled(const IDBRequestData& request
     m_delegate->openDBRequestCancelled(requestData);
 }
 
+void IDBConnectionToServer::databaseConnectionPendingClose(uint64_t databaseConnectionIdentifier)
+{
+    LOG(IndexedDB, "IDBConnectionToServer::databaseConnectionPendingClose");
+    ASSERT(isMainThread());
+
+    m_delegate->databaseConnectionPendingClose(databaseConnectionIdentifier);
+}
+
 void IDBConnectionToServer::databaseConnectionClosed(uint64_t databaseConnectionIdentifier)
 {
     LOG(IndexedDB, "IDBConnectionToServer::databaseConnectionClosed");
index c898fd4..7651f43 100644 (file)
@@ -129,6 +129,7 @@ public:
 
     void establishTransaction(uint64_t databaseConnectionIdentifier, const IDBTransactionInfo&);
 
+    void databaseConnectionPendingClose(uint64_t databaseConnectionIdentifier);
     void databaseConnectionClosed(uint64_t databaseConnectionIdentifier);
 
     // To be used when an IDBOpenDBRequest gets a new database connection, optionally with a
index c4a6675..a61c283 100644 (file)
@@ -79,6 +79,7 @@ public:
     virtual void iterateCursor(const IDBRequestData&, const IDBIterateCursorData&) = 0;
 
     virtual void establishTransaction(uint64_t databaseConnectionIdentifier, const IDBTransactionInfo&) = 0;
+    virtual void databaseConnectionPendingClose(uint64_t databaseConnectionIdentifier) = 0;
     virtual void databaseConnectionClosed(uint64_t databaseConnectionIdentifier) = 0;
     virtual void abortOpenAndUpgradeNeeded(uint64_t databaseConnectionIdentifier, const IDBResourceIdentifier& transactionIdentifier) = 0;
     virtual void didFireVersionChangeEvent(uint64_t databaseConnectionIdentifier, const IDBResourceIdentifier& requestIdentifier) = 0;
index 7c0d5a5..08a6af4 100644 (file)
@@ -385,6 +385,17 @@ void IDBServer::didFinishHandlingVersionChangeTransaction(uint64_t databaseConne
     connection->didFinishHandlingVersionChange(transactionIdentifier);
 }
 
+void IDBServer::databaseConnectionPendingClose(uint64_t databaseConnectionIdentifier)
+{
+    LOG(IndexedDB, "IDBServer::databaseConnectionPendingClose - %" PRIu64, databaseConnectionIdentifier);
+
+    auto databaseConnection = m_databaseConnections.get(databaseConnectionIdentifier);
+    if (!databaseConnection)
+        return;
+
+    databaseConnection->connectionPendingCloseFromClient();
+}
+
 void IDBServer::databaseConnectionClosed(uint64_t databaseConnectionIdentifier)
 {
     LOG(IndexedDB, "IDBServer::databaseConnectionClosed - %" PRIu64, databaseConnectionIdentifier);
index 1e1b47c..256cd50 100644 (file)
@@ -81,6 +81,7 @@ public:
     WEBCORE_EXPORT void iterateCursor(const IDBRequestData&, const IDBIterateCursorData&);
 
     WEBCORE_EXPORT void establishTransaction(uint64_t databaseConnectionIdentifier, const IDBTransactionInfo&);
+    WEBCORE_EXPORT void databaseConnectionPendingClose(uint64_t databaseConnectionIdentifier);
     WEBCORE_EXPORT void databaseConnectionClosed(uint64_t databaseConnectionIdentifier);
     WEBCORE_EXPORT void abortOpenAndUpgradeNeeded(uint64_t databaseConnectionIdentifier, const IDBResourceIdentifier& transactionIdentifier);
     WEBCORE_EXPORT void didFireVersionChangeEvent(uint64_t databaseConnectionIdentifier, const IDBResourceIdentifier& requestIdentifier);
index 18dcd4d..23adef6 100644 (file)
@@ -55,9 +55,10 @@ bool ServerOpenDBRequest::isDeleteRequest() const
     return m_requestData.isDeleteRequest();
 }
 
-void ServerOpenDBRequest::notifyRequestBlocked(uint64_t currentVersion)
+void ServerOpenDBRequest::maybeNotifyRequestBlocked(uint64_t currentVersion)
 {
-    ASSERT(!m_notifiedBlocked);
+    if (m_notifiedBlocked)
+        return;
 
     uint64_t requestedVersion = isOpenRequest() ?  m_requestData.requestedVersion() : 0;
     m_connection.notifyOpenDBRequestBlocked(m_requestData.requestIdentifier(), currentVersion, requestedVersion);
index fbbcf92..064b0a9 100644 (file)
@@ -50,8 +50,7 @@ public:
     bool isOpenRequest() const;
     bool isDeleteRequest() const;
 
-    bool hasNotifiedBlocked() const { return m_notifiedBlocked; }
-    void notifyRequestBlocked(uint64_t currentVersion);
+    void maybeNotifyRequestBlocked(uint64_t currentVersion);
     void notifyDidDeleteDatabase(const IDBDatabaseInfo&);
 
     uint64_t versionChangeID() const;
index 12708e6..c99ce90 100644 (file)
@@ -366,6 +366,16 @@ bool UniqueIDBDatabase::hasAnyOpenConnections() const
     return !m_openDatabaseConnections.isEmpty();
 }
 
+bool UniqueIDBDatabase::allConnectionsAreClosedOrClosing() const
+{
+    for (auto& connection : m_openDatabaseConnections) {
+        if (!connection->connectionIsClosing())
+            return false;
+    }
+
+    return true;
+}
+
 static uint64_t generateUniqueCallbackIdentifier()
 {
     ASSERT(isMainThread());
@@ -504,7 +514,10 @@ void UniqueIDBDatabase::maybeNotifyConnectionsOfVersionChange()
         connectionIdentifiers.add(connection->identifier());
     }
 
-    m_currentOpenDBRequest->notifiedConnectionsOfVersionChange(WTFMove(connectionIdentifiers));
+    if (!connectionIdentifiers.isEmpty())
+        m_currentOpenDBRequest->notifiedConnectionsOfVersionChange(WTFMove(connectionIdentifiers));
+    else
+        m_currentOpenDBRequest->maybeNotifyRequestBlocked(m_databaseInfo->version());
 }
 
 void UniqueIDBDatabase::notifyCurrentRequestConnectionClosedOrFiredVersionChangeEvent(uint64_t connectionIdentifier)
@@ -518,17 +531,14 @@ void UniqueIDBDatabase::notifyCurrentRequestConnectionClosedOrFiredVersionChange
     if (m_currentOpenDBRequest->hasConnectionsPendingVersionChangeEvent())
         return;
 
-    if (!hasAnyOpenConnections()) {
+    if (!hasAnyOpenConnections() || allConnectionsAreClosedOrClosing()) {
         invokeOperationAndTransactionTimer();
         return;
     }
 
-    if (m_currentOpenDBRequest->hasNotifiedBlocked())
-        return;
-
     // Since all open connections have fired their version change events but not all of them have closed,
     // this request is officially blocked.
-    m_currentOpenDBRequest->notifyRequestBlocked(m_databaseInfo->version());
+    m_currentOpenDBRequest->maybeNotifyRequestBlocked(m_databaseInfo->version());
 }
 
 void UniqueIDBDatabase::didFireVersionChangeEvent(UniqueIDBDatabaseConnection& connection, const IDBResourceIdentifier& requestIdentifier)
index 9c995a3..76aafc9 100644 (file)
@@ -130,6 +130,7 @@ private:
     void performCurrentDeleteOperation();
     void addOpenDatabaseConnection(Ref<UniqueIDBDatabaseConnection>&&);
     bool hasAnyOpenConnections() const;
+    bool allConnectionsAreClosedOrClosing() const;
 
     void startVersionChangeTransaction();
     void maybeNotifyConnectionsOfVersionChange();
index 2b6352d..694b717 100644 (file)
@@ -83,11 +83,17 @@ void UniqueIDBDatabaseConnection::abortTransactionWithoutCallback(UniqueIDBDatab
     });
 }
 
+void UniqueIDBDatabaseConnection::connectionPendingCloseFromClient()
+{
+    LOG(IndexedDB, "UniqueIDBDatabaseConnection::connectionPendingCloseFromClient - %s - %" PRIu64, m_openRequestIdentifier.loggingString().utf8().data(), m_identifier);
+
+    m_closePending = true;
+}
+
 void UniqueIDBDatabaseConnection::connectionClosedFromClient()
 {
     LOG(IndexedDB, "UniqueIDBDatabaseConnection::connectionClosedFromClient - %s - %" PRIu64, m_openRequestIdentifier.loggingString().utf8().data(), m_identifier);
 
-    m_closePending = true;
     m_database.connectionClosedFromClient(*this);
 }
 
@@ -219,6 +225,11 @@ void UniqueIDBDatabaseConnection::didRenameIndex(const IDBResultData& resultData
     m_connectionToClient.didRenameIndex(resultData);
 }
 
+bool UniqueIDBDatabaseConnection::connectionIsClosing() const
+{
+    return m_closePending;
+}
+
 } // namespace IDBServer
 } // namespace WebCore
 
index a4f35be..27d5884 100644 (file)
@@ -55,6 +55,7 @@ public:
     UniqueIDBDatabase& database() { return m_database; }
     IDBConnectionToClient& connectionToClient() { return m_connectionToClient; }
 
+    void connectionPendingCloseFromClient();
     void connectionClosedFromClient();
 
     bool closePending() const { return m_closePending; }
@@ -80,6 +81,8 @@ public:
 
     void abortTransactionWithoutCallback(UniqueIDBDatabaseTransaction&);
 
+    bool connectionIsClosing() const;
+
 private:
     UniqueIDBDatabaseConnection(UniqueIDBDatabase&, ServerOpenDBRequest&);
 
index b9afd2f..addd1f8 100644 (file)
@@ -385,6 +385,13 @@ void InProcessIDBServer::notifyOpenDBRequestBlocked(const IDBResourceIdentifier&
     });
 }
 
+void InProcessIDBServer::databaseConnectionPendingClose(uint64_t databaseConnectionIdentifier)
+{
+    RunLoop::current().dispatch([this, protectedThis = makeRef(*this), databaseConnectionIdentifier] {
+        m_server->databaseConnectionPendingClose(databaseConnectionIdentifier);
+    });
+}
+
 void InProcessIDBServer::databaseConnectionClosed(uint64_t databaseConnectionIdentifier)
 {
     RunLoop::current().dispatch([this, protectedThis = makeRef(*this), databaseConnectionIdentifier] {
index 17406c2..d0dc2ec 100644 (file)
@@ -77,6 +77,7 @@ public:
     void openCursor(const IDBRequestData&, const IDBCursorInfo&) final;
     void iterateCursor(const IDBRequestData&, const IDBIterateCursorData&) final;
     void establishTransaction(uint64_t databaseConnectionIdentifier, const IDBTransactionInfo&) final;
+    void databaseConnectionPendingClose(uint64_t databaseConnectionIdentifier) final;
     void databaseConnectionClosed(uint64_t databaseConnectionIdentifier) final;
     void abortOpenAndUpgradeNeeded(uint64_t databaseConnectionIdentifier, const IDBResourceIdentifier& transactionIdentifier) final;
     void didFireVersionChangeEvent(uint64_t databaseConnectionIdentifier, const IDBResourceIdentifier& requestIdentifier) final;
index 81a7fa3..fa00381 100644 (file)
@@ -1,3 +1,19 @@
+2016-11-11  Brady Eidson  <beidson@apple.com>
+
+        IndexedDB 2.0: "close pending flag" and firing blocked events all need fixing.
+        https://bugs.webkit.org/show_bug.cgi?id=164641
+
+        Reviewed by Alex Christensen.
+
+        * DatabaseProcess/IndexedDB/WebIDBConnectionToClient.cpp:
+        (WebKit::WebIDBConnectionToClient::databaseConnectionPendingClose):
+        * DatabaseProcess/IndexedDB/WebIDBConnectionToClient.h:
+        * DatabaseProcess/IndexedDB/WebIDBConnectionToClient.messages.in:
+
+        * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp:
+        (WebKit::WebIDBConnectionToServer::databaseConnectionPendingClose):
+        * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.h:
+
 2016-11-11  Eric Carlson  <eric.carlson@apple.com>
 
         [MediaStream] defer resolution of getUserMedia promise made in a background tab
index cee9aee..274add5 100644 (file)
@@ -331,6 +331,11 @@ void WebIDBConnectionToClient::establishTransaction(uint64_t databaseConnectionI
     DatabaseProcess::singleton().idbServer().establishTransaction(databaseConnectionIdentifier, info);
 }
 
+void WebIDBConnectionToClient::databaseConnectionPendingClose(uint64_t databaseConnectionIdentifier)
+{
+    DatabaseProcess::singleton().idbServer().databaseConnectionPendingClose(databaseConnectionIdentifier);
+}
+
 void WebIDBConnectionToClient::databaseConnectionClosed(uint64_t databaseConnectionIdentifier)
 {
     DatabaseProcess::singleton().idbServer().databaseConnectionClosed(databaseConnectionIdentifier);
index 9b78fe8..11c6cc1 100644 (file)
@@ -111,6 +111,7 @@ public:
     void iterateCursor(const WebCore::IDBRequestData&, const WebCore::IDBIterateCursorData&);
 
     void establishTransaction(uint64_t databaseConnectionIdentifier, const WebCore::IDBTransactionInfo&);
+    void databaseConnectionPendingClose(uint64_t databaseConnectionIdentifier);
     void databaseConnectionClosed(uint64_t databaseConnectionIdentifier);
     void abortOpenAndUpgradeNeeded(uint64_t databaseConnectionIdentifier, const WebCore::IDBResourceIdentifier& transactionIdentifier);
     void didFireVersionChangeEvent(uint64_t databaseConnectionIdentifier, const WebCore::IDBResourceIdentifier& requestIdentifier);
index 1a376bc..d5a747b 100644 (file)
@@ -44,6 +44,7 @@ messages -> WebIDBConnectionToClient {
     IterateCursor(WebCore::IDBRequestData requestData, struct WebCore::IDBIterateCursorData data);
 
     EstablishTransaction(uint64_t databaseConnectionIdentifier, WebCore::IDBTransactionInfo info);
+    DatabaseConnectionPendingClose(uint64_t databaseConnectionIdentifier);
     DatabaseConnectionClosed(uint64_t databaseConnectionIdentifier);
     AbortOpenAndUpgradeNeeded(uint64_t databaseConnectionIdentifier, WebCore::IDBResourceIdentifier transactionIdentifier);
     DidFireVersionChangeEvent(uint64_t databaseConnectionIdentifier, WebCore::IDBResourceIdentifier requestIdentifier);
index c6c6b4b..e6c1aa2 100644 (file)
@@ -185,6 +185,11 @@ void WebIDBConnectionToServer::establishTransaction(uint64_t databaseConnectionI
     send(Messages::WebIDBConnectionToClient::EstablishTransaction(databaseConnectionIdentifier, info));
 }
 
+void WebIDBConnectionToServer::databaseConnectionPendingClose(uint64_t databaseConnectionIdentifier)
+{
+    send(Messages::WebIDBConnectionToClient::DatabaseConnectionPendingClose(databaseConnectionIdentifier));
+}
+
 void WebIDBConnectionToServer::databaseConnectionClosed(uint64_t databaseConnectionIdentifier)
 {
     send(Messages::WebIDBConnectionToClient::DatabaseConnectionClosed(databaseConnectionIdentifier));
index 3071e99..c5ed93f 100644 (file)
@@ -66,6 +66,7 @@ public:
     void openCursor(const WebCore::IDBRequestData&, const WebCore::IDBCursorInfo&) final;
     void iterateCursor(const WebCore::IDBRequestData&, const WebCore::IDBIterateCursorData&) final;
     void establishTransaction(uint64_t databaseConnectionIdentifier, const WebCore::IDBTransactionInfo&) final;
+    void databaseConnectionPendingClose(uint64_t databaseConnectionIdentifier) final;
     void databaseConnectionClosed(uint64_t databaseConnectionIdentifier) final;
     void abortOpenAndUpgradeNeeded(uint64_t databaseConnectionIdentifier, const WebCore::IDBResourceIdentifier& transactionIdentifier) final;
     void didFireVersionChangeEvent(uint64_t databaseConnectionIdentifier, const WebCore::IDBResourceIdentifier& requestIdentifier) final;