Title: [194433] trunk/Source/WebCore
Revision
194433
Author
beid...@apple.com
Date
2015-12-28 16:50:48 -0800 (Mon, 28 Dec 2015)

Log Message

Modern IDB: Rename IDBServerOperation to ServerOpenDBRequest.
https://bugs.webkit.org/show_bug.cgi?id=152577

Reviewed by Andy Estes.

No new tests (Refactor, no behavior change)

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

* Modules/indexeddb/server/ServerOpenDBRequest.cpp: Renamed from Source/WebCore/Modules/indexeddb/server/IDBServerOperation.cpp.
(WebCore::IDBServer::ServerOpenDBRequest::create):
(WebCore::IDBServer::ServerOpenDBRequest::ServerOpenDBRequest):
(WebCore::IDBServer::ServerOpenDBRequest::isOpenRequest):
(WebCore::IDBServer::ServerOpenDBRequest::isDeleteRequest):
(WebCore::IDBServer::ServerOpenDBRequest::notifyDeleteRequestBlocked):
(WebCore::IDBServer::ServerOpenDBRequest::notifyDidDeleteDatabase):

* Modules/indexeddb/server/ServerOpenDBRequest.h: Renamed from Source/WebCore/Modules/indexeddb/server/IDBServerOperation.h.
(WebCore::IDBServer::ServerOpenDBRequest::connection):
(WebCore::IDBServer::ServerOpenDBRequest::requestData):
(WebCore::IDBServer::ServerOpenDBRequest::hasNotifiedDeleteRequestBlocked):

* Modules/indexeddb/server/UniqueIDBDatabase.cpp:
(WebCore::IDBServer::UniqueIDBDatabase::openDatabaseConnection):
(WebCore::IDBServer::UniqueIDBDatabase::performCurrentOpenOperation):
(WebCore::IDBServer::UniqueIDBDatabase::performCurrentDeleteOperation):
(WebCore::IDBServer::UniqueIDBDatabase::handleDatabaseOperations):
(WebCore::IDBServer::UniqueIDBDatabase::handleCurrentOperation):
(WebCore::IDBServer::UniqueIDBDatabase::handleDelete):
(WebCore::IDBServer::UniqueIDBDatabase::startVersionChangeTransaction):
(WebCore::IDBServer::UniqueIDBDatabase::notifyConnectionsOfVersionChangeForUpgrade):
(WebCore::IDBServer::UniqueIDBDatabase::operationAndTransactionTimerFired):
* Modules/indexeddb/server/UniqueIDBDatabase.h:

Modified Paths

Added Paths

Removed Paths

Diff

Modified: trunk/Source/WebCore/CMakeLists.txt (194432 => 194433)


--- trunk/Source/WebCore/CMakeLists.txt	2015-12-28 23:18:25 UTC (rev 194432)
+++ trunk/Source/WebCore/CMakeLists.txt	2015-12-29 00:50:48 UTC (rev 194433)
@@ -874,7 +874,6 @@
 
     Modules/indexeddb/server/IDBConnectionToClient.cpp
     Modules/indexeddb/server/IDBServer.cpp
-    Modules/indexeddb/server/IDBServerOperation.cpp
     Modules/indexeddb/server/IndexValueEntry.cpp
     Modules/indexeddb/server/IndexValueStore.cpp
     Modules/indexeddb/server/MemoryBackingStoreTransaction.cpp
@@ -884,6 +883,7 @@
     Modules/indexeddb/server/MemoryIndexCursor.cpp
     Modules/indexeddb/server/MemoryObjectStore.cpp
     Modules/indexeddb/server/MemoryObjectStoreCursor.cpp
+    Modules/indexeddb/server/ServerOpenDBRequest.cpp
     Modules/indexeddb/server/UniqueIDBDatabase.cpp
     Modules/indexeddb/server/UniqueIDBDatabaseConnection.cpp
     Modules/indexeddb/server/UniqueIDBDatabaseTransaction.cpp

Modified: trunk/Source/WebCore/ChangeLog (194432 => 194433)


--- trunk/Source/WebCore/ChangeLog	2015-12-28 23:18:25 UTC (rev 194432)
+++ trunk/Source/WebCore/ChangeLog	2015-12-29 00:50:48 UTC (rev 194433)
@@ -1,3 +1,40 @@
+2015-12-28  Brady Eidson  <beid...@apple.com>
+
+        Modern IDB: Rename IDBServerOperation to ServerOpenDBRequest.
+        https://bugs.webkit.org/show_bug.cgi?id=152577
+
+        Reviewed by Andy Estes.
+
+        No new tests (Refactor, no behavior change)
+
+        * CMakeLists.txt:
+        * WebCore.xcodeproj/project.pbxproj:
+
+        * Modules/indexeddb/server/ServerOpenDBRequest.cpp: Renamed from Source/WebCore/Modules/indexeddb/server/IDBServerOperation.cpp.
+        (WebCore::IDBServer::ServerOpenDBRequest::create):
+        (WebCore::IDBServer::ServerOpenDBRequest::ServerOpenDBRequest):
+        (WebCore::IDBServer::ServerOpenDBRequest::isOpenRequest):
+        (WebCore::IDBServer::ServerOpenDBRequest::isDeleteRequest):
+        (WebCore::IDBServer::ServerOpenDBRequest::notifyDeleteRequestBlocked):
+        (WebCore::IDBServer::ServerOpenDBRequest::notifyDidDeleteDatabase):
+        
+        * Modules/indexeddb/server/ServerOpenDBRequest.h: Renamed from Source/WebCore/Modules/indexeddb/server/IDBServerOperation.h.
+        (WebCore::IDBServer::ServerOpenDBRequest::connection):
+        (WebCore::IDBServer::ServerOpenDBRequest::requestData):
+        (WebCore::IDBServer::ServerOpenDBRequest::hasNotifiedDeleteRequestBlocked):
+        
+        * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
+        (WebCore::IDBServer::UniqueIDBDatabase::openDatabaseConnection):
+        (WebCore::IDBServer::UniqueIDBDatabase::performCurrentOpenOperation):
+        (WebCore::IDBServer::UniqueIDBDatabase::performCurrentDeleteOperation):
+        (WebCore::IDBServer::UniqueIDBDatabase::handleDatabaseOperations):
+        (WebCore::IDBServer::UniqueIDBDatabase::handleCurrentOperation):
+        (WebCore::IDBServer::UniqueIDBDatabase::handleDelete):
+        (WebCore::IDBServer::UniqueIDBDatabase::startVersionChangeTransaction):
+        (WebCore::IDBServer::UniqueIDBDatabase::notifyConnectionsOfVersionChangeForUpgrade):
+        (WebCore::IDBServer::UniqueIDBDatabase::operationAndTransactionTimerFired):
+        * Modules/indexeddb/server/UniqueIDBDatabase.h:
+        
 2015-12-28  Gyuyoung Kim  <gyuyoung....@webkit.org>
 
         [CMake][EFL] Fix build breaks when enabling GAMEPAD

Deleted: trunk/Source/WebCore/Modules/indexeddb/server/IDBServerOperation.cpp (194432 => 194433)


--- trunk/Source/WebCore/Modules/indexeddb/server/IDBServerOperation.cpp	2015-12-28 23:18:25 UTC (rev 194432)
+++ trunk/Source/WebCore/Modules/indexeddb/server/IDBServerOperation.cpp	2015-12-29 00:50:48 UTC (rev 194433)
@@ -1,77 +0,0 @@
-/*
- * Copyright (C) 2015 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 "IDBServerOperation.h"
-
-#if ENABLE(INDEXED_DATABASE)
-
-#include "IDBResultData.h"
-#include <wtf/RefCounted.h>
-
-namespace WebCore {
-namespace IDBServer {
-
-Ref<IDBServerOperation> IDBServerOperation::create(IDBConnectionToClient& connection, const IDBRequestData& requestData)
-{
-    return adoptRef(*new IDBServerOperation(connection, requestData));
-}
-
-IDBServerOperation::IDBServerOperation(IDBConnectionToClient& connection, const IDBRequestData& requestData)
-    : m_connection(connection)
-    , m_requestData(requestData)
-{
-}
-
-bool IDBServerOperation::isOpenRequest() const
-{
-    return m_requestData.isOpenRequest();
-}
-
-bool IDBServerOperation::isDeleteRequest() const
-{
-    return m_requestData.isDeleteRequest();
-}
-
-void IDBServerOperation::notifyDeleteRequestBlocked(uint64_t currentVersion)
-{
-    ASSERT(isDeleteRequest());
-    ASSERT(!m_notifiedDeleteRequestBlocked);
-
-    m_connection.notifyOpenDBRequestBlocked(m_requestData.requestIdentifier(), currentVersion, 0);
-    m_notifiedDeleteRequestBlocked = true;
-}
-
-void IDBServerOperation::notifyDidDeleteDatabase(const IDBDatabaseInfo& info)
-{
-    ASSERT(isDeleteRequest());
-
-    m_connection.didDeleteDatabase(IDBResultData::deleteDatabaseSuccess(m_requestData.requestIdentifier(), info));
-}
-
-} // namespace IDBServer
-} // namespace WebCore
-
-#endif // ENABLE(INDEXED_DATABASE)

Deleted: trunk/Source/WebCore/Modules/indexeddb/server/IDBServerOperation.h (194432 => 194433)


--- trunk/Source/WebCore/Modules/indexeddb/server/IDBServerOperation.h	2015-12-28 23:18:25 UTC (rev 194432)
+++ trunk/Source/WebCore/Modules/indexeddb/server/IDBServerOperation.h	2015-12-29 00:50:48 UTC (rev 194433)
@@ -1,69 +0,0 @@
-/*
- * Copyright (C) 2015 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 IDBServerOperation_h
-#define IDBServerOperation_h
-
-#if ENABLE(INDEXED_DATABASE)
-
-#include "IDBConnectionToClient.h"
-#include "IDBRequestData.h"
-#include <wtf/Ref.h>
-#include <wtf/RefCounted.h>
-
-namespace WebCore {
-
-class IDBDatabaseInfo;
-
-namespace IDBServer {
-
-class IDBServerOperation : public RefCounted<IDBServerOperation> {
-public:
-    static Ref<IDBServerOperation> create(IDBConnectionToClient&, const IDBRequestData&);
-
-    IDBConnectionToClient& connection() { return m_connection; }
-    const IDBRequestData& requestData() const { return m_requestData; }
-
-    bool isOpenRequest() const;
-    bool isDeleteRequest() const;
-
-    void notifyDeleteRequestBlocked(uint64_t currentVersion);
-    void notifyDidDeleteDatabase(const IDBDatabaseInfo&);
-    bool hasNotifiedDeleteRequestBlocked() const { return m_notifiedDeleteRequestBlocked; }
-
-private:
-    IDBServerOperation(IDBConnectionToClient&, const IDBRequestData&);
-
-    IDBConnectionToClient& m_connection;
-    IDBRequestData m_requestData;
-
-    bool m_notifiedDeleteRequestBlocked { false };
-};
-
-} // namespace IDBServer
-} // namespace WebCore
-
-#endif // ENABLE(INDEXED_DATABASE)
-#endif // IDBServerOperation_h

Copied: trunk/Source/WebCore/Modules/indexeddb/server/ServerOpenDBRequest.cpp (from rev 194432, trunk/Source/WebCore/Modules/indexeddb/server/IDBServerOperation.cpp) (0 => 194433)


--- trunk/Source/WebCore/Modules/indexeddb/server/ServerOpenDBRequest.cpp	                        (rev 0)
+++ trunk/Source/WebCore/Modules/indexeddb/server/ServerOpenDBRequest.cpp	2015-12-29 00:50:48 UTC (rev 194433)
@@ -0,0 +1,77 @@
+/*
+ * Copyright (C) 2015 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 "ServerOpenDBRequest.h"
+
+#if ENABLE(INDEXED_DATABASE)
+
+#include "IDBResultData.h"
+#include <wtf/RefCounted.h>
+
+namespace WebCore {
+namespace IDBServer {
+
+Ref<ServerOpenDBRequest> ServerOpenDBRequest::create(IDBConnectionToClient& connection, const IDBRequestData& requestData)
+{
+    return adoptRef(*new ServerOpenDBRequest(connection, requestData));
+}
+
+ServerOpenDBRequest::ServerOpenDBRequest(IDBConnectionToClient& connection, const IDBRequestData& requestData)
+    : m_connection(connection)
+    , m_requestData(requestData)
+{
+}
+
+bool ServerOpenDBRequest::isOpenRequest() const
+{
+    return m_requestData.isOpenRequest();
+}
+
+bool ServerOpenDBRequest::isDeleteRequest() const
+{
+    return m_requestData.isDeleteRequest();
+}
+
+void ServerOpenDBRequest::notifyDeleteRequestBlocked(uint64_t currentVersion)
+{
+    ASSERT(isDeleteRequest());
+    ASSERT(!m_notifiedDeleteRequestBlocked);
+
+    m_connection.notifyOpenDBRequestBlocked(m_requestData.requestIdentifier(), currentVersion, 0);
+    m_notifiedDeleteRequestBlocked = true;
+}
+
+void ServerOpenDBRequest::notifyDidDeleteDatabase(const IDBDatabaseInfo& info)
+{
+    ASSERT(isDeleteRequest());
+
+    m_connection.didDeleteDatabase(IDBResultData::deleteDatabaseSuccess(m_requestData.requestIdentifier(), info));
+}
+
+} // namespace IDBServer
+} // namespace WebCore
+
+#endif // ENABLE(INDEXED_DATABASE)

Copied: trunk/Source/WebCore/Modules/indexeddb/server/ServerOpenDBRequest.h (from rev 194432, trunk/Source/WebCore/Modules/indexeddb/server/IDBServerOperation.h) (0 => 194433)


--- trunk/Source/WebCore/Modules/indexeddb/server/ServerOpenDBRequest.h	                        (rev 0)
+++ trunk/Source/WebCore/Modules/indexeddb/server/ServerOpenDBRequest.h	2015-12-29 00:50:48 UTC (rev 194433)
@@ -0,0 +1,69 @@
+/*
+ * Copyright (C) 2015 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 ServerOpenDBRequest_h
+#define ServerOpenDBRequest_h
+
+#if ENABLE(INDEXED_DATABASE)
+
+#include "IDBConnectionToClient.h"
+#include "IDBRequestData.h"
+#include <wtf/Ref.h>
+#include <wtf/RefCounted.h>
+
+namespace WebCore {
+
+class IDBDatabaseInfo;
+
+namespace IDBServer {
+
+class ServerOpenDBRequest : public RefCounted<ServerOpenDBRequest> {
+public:
+    static Ref<ServerOpenDBRequest> create(IDBConnectionToClient&, const IDBRequestData&);
+
+    IDBConnectionToClient& connection() { return m_connection; }
+    const IDBRequestData& requestData() const { return m_requestData; }
+
+    bool isOpenRequest() const;
+    bool isDeleteRequest() const;
+
+    void notifyDeleteRequestBlocked(uint64_t currentVersion);
+    void notifyDidDeleteDatabase(const IDBDatabaseInfo&);
+    bool hasNotifiedDeleteRequestBlocked() const { return m_notifiedDeleteRequestBlocked; }
+
+private:
+    ServerOpenDBRequest(IDBConnectionToClient&, const IDBRequestData&);
+
+    IDBConnectionToClient& m_connection;
+    IDBRequestData m_requestData;
+
+    bool m_notifiedDeleteRequestBlocked { false };
+};
+
+} // namespace IDBServer
+} // namespace WebCore
+
+#endif // ENABLE(INDEXED_DATABASE)
+#endif // ServerOpenDBRequest_h

Modified: trunk/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabase.cpp (194432 => 194433)


--- trunk/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabase.cpp	2015-12-28 23:18:25 UTC (rev 194432)
+++ trunk/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabase.cpp	2015-12-29 00:50:48 UTC (rev 194433)
@@ -68,8 +68,8 @@
 
 void UniqueIDBDatabase::openDatabaseConnection(IDBConnectionToClient& connection, const IDBRequestData& requestData)
 {
-    auto operation = IDBServerOperation::create(connection, requestData);
-    m_pendingDatabaseOperations.append(WTF::move(operation));
+    auto operation = ServerOpenDBRequest::create(connection, requestData);
+    m_pendingOpenDBRequests.append(WTF::move(operation));
 
     // An open operation is already in progress, so we can't possibly handle this one yet.
     if (m_isOpeningBackingStore)
@@ -100,8 +100,8 @@
 {
     LOG(IndexedDB, "(main) UniqueIDBDatabase::performCurrentOpenOperation");
 
-    ASSERT(m_currentOperation);
-    ASSERT(m_currentOperation->isOpenRequest());
+    ASSERT(m_currentOpenDBRequest);
+    ASSERT(m_currentOpenDBRequest->isOpenRequest());
 
     if (!m_databaseInfo) {
         m_isOpeningBackingStore = true;
@@ -120,29 +120,29 @@
     // 3.3.1 Opening a database
     // If requested version is undefined, then let requested version be 1 if db was created in the previous step,
     // or the current version of db otherwise.
-    uint64_t requestedVersion = m_currentOperation->requestData().requestedVersion();
+    uint64_t requestedVersion = m_currentOpenDBRequest->requestData().requestedVersion();
     if (!requestedVersion)
         requestedVersion = m_databaseInfo->version() ? m_databaseInfo->version() : 1;
 
     // 3.3.1 Opening a database
     // If the database version higher than the requested version, abort these steps and return a VersionError.
     if (requestedVersion < m_databaseInfo->version()) {
-        auto result = IDBResultData::error(m_currentOperation->requestData().requestIdentifier(), IDBError(IDBDatabaseException::VersionError));
-        m_currentOperation->connection().didOpenDatabase(result);
-        m_currentOperation = nullptr;
+        auto result = IDBResultData::error(m_currentOpenDBRequest->requestData().requestIdentifier(), IDBError(IDBDatabaseException::VersionError));
+        m_currentOpenDBRequest->connection().didOpenDatabase(result);
+        m_currentOpenDBRequest = nullptr;
 
         return;
     }
 
-    Ref<UniqueIDBDatabaseConnection> connection = UniqueIDBDatabaseConnection::create(*this, m_currentOperation->connection());
+    Ref<UniqueIDBDatabaseConnection> connection = UniqueIDBDatabaseConnection::create(*this, m_currentOpenDBRequest->connection());
     UniqueIDBDatabaseConnection* rawConnection = &connection.get();
 
     if (requestedVersion == m_databaseInfo->version()) {
         addOpenDatabaseConnection(WTF::move(connection));
 
-        auto result = IDBResultData::openDatabaseSuccess(m_currentOperation->requestData().requestIdentifier(), *rawConnection);
-        m_currentOperation->connection().didOpenDatabase(result);
-        m_currentOperation = nullptr;
+        auto result = IDBResultData::openDatabaseSuccess(m_currentOpenDBRequest->requestData().requestIdentifier(), *rawConnection);
+        m_currentOpenDBRequest->connection().didOpenDatabase(result);
+        m_currentOpenDBRequest = nullptr;
 
         return;
     }
@@ -161,7 +161,7 @@
     notifyConnectionsOfVersionChangeForUpgrade();
 
     // And we notify this OpenDBRequest that it is blocked until those connections close.
-    m_versionChangeDatabaseConnection->connectionToClient().notifyOpenDBRequestBlocked(m_currentOperation->requestData().requestIdentifier(), m_databaseInfo->version(), requestedVersion);
+    m_versionChangeDatabaseConnection->connectionToClient().notifyOpenDBRequestBlocked(m_currentOpenDBRequest->requestData().requestIdentifier(), m_databaseInfo->version(), requestedVersion);
 }
 
 void UniqueIDBDatabase::performCurrentDeleteOperation()
@@ -169,8 +169,8 @@
     LOG(IndexedDB, "(main) UniqueIDBDatabase::performCurrentDeleteOperation");
 
     ASSERT(m_databaseInfo);
-    ASSERT(m_currentOperation);
-    ASSERT(m_currentOperation->isDeleteRequest());
+    ASSERT(m_currentOpenDBRequest);
+    ASSERT(m_currentOpenDBRequest->isDeleteRequest());
 
     if (hasAnyOpenConnections()) {
         // Exactly once, notify all open connections of the pending deletion.
@@ -179,8 +179,8 @@
             m_hasNotifiedConnectionsOfDelete = true;
         }
 
-        if (!m_currentOperation->hasNotifiedDeleteRequestBlocked())
-            m_currentOperation->notifyDeleteRequestBlocked(m_databaseInfo->version());
+        if (!m_currentOpenDBRequest->hasNotifiedDeleteRequestBlocked())
+            m_currentOpenDBRequest->notifyDeleteRequestBlocked(m_databaseInfo->version());
 
         return;
     }
@@ -190,12 +190,12 @@
     ASSERT(m_pendingTransactions.isEmpty());
     ASSERT(m_openDatabaseConnections.isEmpty());
 
-    m_currentOperation->notifyDidDeleteDatabase(*m_databaseInfo);
-    m_currentOperation = nullptr;
+    m_currentOpenDBRequest->notifyDidDeleteDatabase(*m_databaseInfo);
+    m_currentOpenDBRequest = nullptr;
     m_hasNotifiedConnectionsOfDelete = false;
     m_deletePending = false;
 
-    if (m_pendingDatabaseOperations.isEmpty())
+    if (m_pendingOpenDBRequests.isEmpty())
         m_server.deleteUniqueIDBDatabase(*this);
     else
         invokeOperationAndTransactionTimer();
@@ -204,43 +204,43 @@
 void UniqueIDBDatabase::handleDatabaseOperations()
 {
     ASSERT(isMainThread());
-    LOG(IndexedDB, "(main) UniqueIDBDatabase::handleDatabaseOperations - There are %zu pending", m_pendingDatabaseOperations.size());
+    LOG(IndexedDB, "(main) UniqueIDBDatabase::handleDatabaseOperations - There are %zu pending", m_pendingOpenDBRequests.size());
 
-    if (m_versionChangeDatabaseConnection || m_versionChangeTransaction || m_currentOperation) {
+    if (m_versionChangeDatabaseConnection || m_versionChangeTransaction || m_currentOpenDBRequest) {
         // We can't start any new open-database operations right now, but we might be able to start handling a delete operation.
-        if (!m_currentOperation && !m_pendingDatabaseOperations.isEmpty() && m_pendingDatabaseOperations.first()->isDeleteRequest())
-            m_currentOperation = m_pendingDatabaseOperations.takeFirst();
+        if (!m_currentOpenDBRequest && !m_pendingOpenDBRequests.isEmpty() && m_pendingOpenDBRequests.first()->isDeleteRequest())
+            m_currentOpenDBRequest = m_pendingOpenDBRequests.takeFirst();
 
         // Some operations (such as the first open operation after a delete) require multiple passes to completely handle
-        if (m_currentOperation)
+        if (m_currentOpenDBRequest)
             handleCurrentOperation();
 
         return;
     }
 
-    if (m_pendingDatabaseOperations.isEmpty())
+    if (m_pendingOpenDBRequests.isEmpty())
         return;
 
-    m_currentOperation = m_pendingDatabaseOperations.takeFirst();
-    LOG(IndexedDB, "UniqueIDBDatabase::handleDatabaseOperations - Popped an operation, now there are %zu pending", m_pendingDatabaseOperations.size());
+    m_currentOpenDBRequest = m_pendingOpenDBRequests.takeFirst();
+    LOG(IndexedDB, "UniqueIDBDatabase::handleDatabaseOperations - Popped an operation, now there are %zu pending", m_pendingOpenDBRequests.size());
 
     handleCurrentOperation();
 }
 
 void UniqueIDBDatabase::handleCurrentOperation()
 {
-    ASSERT(m_currentOperation);
+    ASSERT(m_currentOpenDBRequest);
 
     RefPtr<UniqueIDBDatabase> protector(this);
 
-    if (m_currentOperation->isOpenRequest())
+    if (m_currentOpenDBRequest->isOpenRequest())
         performCurrentOpenOperation();
-    else if (m_currentOperation->isDeleteRequest())
+    else if (m_currentOpenDBRequest->isDeleteRequest())
         performCurrentDeleteOperation();
     else
         ASSERT_NOT_REACHED();
 
-    if (!m_currentOperation)
+    if (!m_currentOpenDBRequest)
         invokeOperationAndTransactionTimer();
 }
 
@@ -292,7 +292,7 @@
 {
     LOG(IndexedDB, "(main) UniqueIDBDatabase::handleDelete");
 
-    m_pendingDatabaseOperations.append(IDBServerOperation::create(connection, requestData));
+    m_pendingOpenDBRequests.append(ServerOpenDBRequest::create(connection, requestData));
     handleDatabaseOperations();
 }
 
@@ -301,11 +301,11 @@
     LOG(IndexedDB, "(main) UniqueIDBDatabase::startVersionChangeTransaction");
 
     ASSERT(!m_versionChangeTransaction);
-    ASSERT(m_currentOperation);
-    ASSERT(m_currentOperation->isOpenRequest());
+    ASSERT(m_currentOpenDBRequest);
+    ASSERT(m_currentOpenDBRequest->isOpenRequest());
     ASSERT(m_versionChangeDatabaseConnection);
 
-    auto operation = WTF::move(m_currentOperation);
+    auto operation = WTF::move(m_currentOpenDBRequest);
 
     uint64_t requestedVersion = operation->requestData().requestedVersion();
     if (!requestedVersion)
@@ -331,11 +331,11 @@
 
 void UniqueIDBDatabase::notifyConnectionsOfVersionChangeForUpgrade()
 {
-    ASSERT(m_currentOperation);
-    ASSERT(m_currentOperation->isOpenRequest());
+    ASSERT(m_currentOpenDBRequest);
+    ASSERT(m_currentOpenDBRequest->isOpenRequest());
     ASSERT(m_versionChangeDatabaseConnection);
 
-    notifyConnectionsOfVersionChange(m_currentOperation->requestData().requestedVersion());
+    notifyConnectionsOfVersionChange(m_currentOpenDBRequest->requestData().requestedVersion());
 }
 
 void UniqueIDBDatabase::notifyConnectionsOfVersionChange(uint64_t requestedVersion)
@@ -984,10 +984,10 @@
 
     // The current operation might require multiple attempts to handle, so try to
     // make further progress on it now.
-    if (m_currentOperation)
+    if (m_currentOpenDBRequest)
         handleCurrentOperation();
 
-    if (!m_currentOperation)
+    if (!m_currentOpenDBRequest)
         handleDatabaseOperations();
 
     bool hadDeferredTransactions = false;

Modified: trunk/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabase.h (194432 => 194433)


--- trunk/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabase.h	2015-12-28 23:18:25 UTC (rev 194432)
+++ trunk/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabase.h	2015-12-29 00:50:48 UTC (rev 194433)
@@ -33,7 +33,7 @@
 #include "IDBDatabaseIdentifier.h"
 #include "IDBDatabaseInfo.h"
 #include "IDBGetResult.h"
-#include "IDBServerOperation.h"
+#include "ServerOpenDBRequest.h"
 #include "ThreadSafeDataBuffer.h"
 #include "Timer.h"
 #include "UniqueIDBDatabaseConnection.h"
@@ -177,8 +177,8 @@
     IDBServer& m_server;
     IDBDatabaseIdentifier m_identifier;
     
-    Deque<Ref<IDBServerOperation>> m_pendingDatabaseOperations;
-    RefPtr<IDBServerOperation> m_currentOperation;
+    Deque<Ref<ServerOpenDBRequest>> m_pendingOpenDBRequests;
+    RefPtr<ServerOpenDBRequest> m_currentOpenDBRequest;
 
     HashSet<RefPtr<UniqueIDBDatabaseConnection>> m_openDatabaseConnections;
     HashSet<RefPtr<UniqueIDBDatabaseConnection>> m_closePendingDatabaseConnections;

Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (194432 => 194433)


--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj	2015-12-28 23:18:25 UTC (rev 194432)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj	2015-12-29 00:50:48 UTC (rev 194433)
@@ -2032,6 +2032,8 @@
 		516D7D701BB5F0BD00AF7C77 /* IDBConnectionToServerDelegate.h in Headers */ = {isa = PBXBuildFile; fileRef = 5185FCBD1BB5CB770012898F /* IDBConnectionToServerDelegate.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		516D7D711BB5F0BD00AF7C77 /* IDBConnectionToClient.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 516D7D6D1BB5F06500AF7C77 /* IDBConnectionToClient.cpp */; };
 		516D7D721BB5F0BD00AF7C77 /* IDBConnectionToClientDelegate.h in Headers */ = {isa = PBXBuildFile; fileRef = 516D7D6E1BB5F06500AF7C77 /* IDBConnectionToClientDelegate.h */; settings = {ATTRIBUTES = (Private, ); }; };
+		516F7F6D1C31E39A00F111DC /* ServerOpenDBRequest.h in Headers */ = {isa = PBXBuildFile; fileRef = 516F7F6C1C31C79D00F111DC /* ServerOpenDBRequest.h */; settings = {ATTRIBUTES = (Private, ); }; };
+		516F7F6E1C31E39C00F111DC /* ServerOpenDBRequest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 516F7F6B1C31C79D00F111DC /* ServerOpenDBRequest.cpp */; };
 		517138EF1BED1D1A000D5F01 /* IndexKey.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 517138ED1BED1D17000D5F01 /* IndexKey.cpp */; };
 		517138F01BED1D1A000D5F01 /* IndexKey.h in Headers */ = {isa = PBXBuildFile; fileRef = 517138EE1BED1D17000D5F01 /* IndexKey.h */; };
 		517138F71BF128BB000D5F01 /* IndexValueStore.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 517138F51BF12262000D5F01 /* IndexValueStore.cpp */; };
@@ -2116,8 +2118,6 @@
 		5185FCBB1BB4CBF80012898F /* IDBServer.h in Headers */ = {isa = PBXBuildFile; fileRef = 510A58F01BAB720F00C19282 /* IDBServer.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		518864E01BBAF57100E540C9 /* UniqueIDBDatabase.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 518864DE1BBAF30F00E540C9 /* UniqueIDBDatabase.cpp */; };
 		518864E11BBAF57400E540C9 /* UniqueIDBDatabase.h in Headers */ = {isa = PBXBuildFile; fileRef = 518864DF1BBAF30F00E540C9 /* UniqueIDBDatabase.h */; settings = {ATTRIBUTES = (Private, ); }; };
-		518864E61BBB4B8300E540C9 /* IDBServerOperation.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 518864E41BBB4B7E00E540C9 /* IDBServerOperation.cpp */; };
-		518864E71BBB4B8300E540C9 /* IDBServerOperation.h in Headers */ = {isa = PBXBuildFile; fileRef = 518864E51BBB4B7E00E540C9 /* IDBServerOperation.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		5189F01D10B37BD900F3C739 /* JSPopStateEvent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5189F01B10B37BD900F3C739 /* JSPopStateEvent.cpp */; };
 		5189F01E10B37BD900F3C739 /* JSPopStateEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = 5189F01C10B37BD900F3C739 /* JSPopStateEvent.h */; };
 		5189F0DE10B46B0E00F3C739 /* PopStateEvent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5189F0DD10B46B0E00F3C739 /* PopStateEvent.cpp */; };
@@ -9485,6 +9485,8 @@
 		516C62241950E2B900337E75 /* JSGamepadEvent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSGamepadEvent.h; sourceTree = "<group>"; };
 		516D7D6D1BB5F06500AF7C77 /* IDBConnectionToClient.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = IDBConnectionToClient.cpp; sourceTree = "<group>"; };
 		516D7D6E1BB5F06500AF7C77 /* IDBConnectionToClientDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IDBConnectionToClientDelegate.h; sourceTree = "<group>"; };
+		516F7F6B1C31C79D00F111DC /* ServerOpenDBRequest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ServerOpenDBRequest.cpp; sourceTree = "<group>"; };
+		516F7F6C1C31C79D00F111DC /* ServerOpenDBRequest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ServerOpenDBRequest.h; sourceTree = "<group>"; };
 		517138ED1BED1D17000D5F01 /* IndexKey.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = IndexKey.cpp; sourceTree = "<group>"; };
 		517138EE1BED1D17000D5F01 /* IndexKey.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IndexKey.h; sourceTree = "<group>"; };
 		517138F51BF12262000D5F01 /* IndexValueStore.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = IndexValueStore.cpp; sourceTree = "<group>"; };
@@ -9518,8 +9520,6 @@
 		5185FCBD1BB5CB770012898F /* IDBConnectionToServerDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IDBConnectionToServerDelegate.h; sourceTree = "<group>"; };
 		518864DE1BBAF30F00E540C9 /* UniqueIDBDatabase.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = UniqueIDBDatabase.cpp; sourceTree = "<group>"; };
 		518864DF1BBAF30F00E540C9 /* UniqueIDBDatabase.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UniqueIDBDatabase.h; sourceTree = "<group>"; };
-		518864E41BBB4B7E00E540C9 /* IDBServerOperation.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = IDBServerOperation.cpp; sourceTree = "<group>"; };
-		518864E51BBB4B7E00E540C9 /* IDBServerOperation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IDBServerOperation.h; sourceTree = "<group>"; };
 		5189F01B10B37BD900F3C739 /* JSPopStateEvent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSPopStateEvent.cpp; sourceTree = "<group>"; };
 		5189F01C10B37BD900F3C739 /* JSPopStateEvent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSPopStateEvent.h; sourceTree = "<group>"; };
 		5189F0DD10B46B0E00F3C739 /* PopStateEvent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PopStateEvent.cpp; sourceTree = "<group>"; };
@@ -16912,8 +16912,6 @@
 				516D7D6E1BB5F06500AF7C77 /* IDBConnectionToClientDelegate.h */,
 				510A58EF1BAB720F00C19282 /* IDBServer.cpp */,
 				510A58F01BAB720F00C19282 /* IDBServer.h */,
-				518864E41BBB4B7E00E540C9 /* IDBServerOperation.cpp */,
-				518864E51BBB4B7E00E540C9 /* IDBServerOperation.h */,
 				51EEAA711BEFFA7900218008 /* IndexValueEntry.cpp */,
 				51EEAA721BEFFA7900218008 /* IndexValueEntry.h */,
 				517138F51BF12262000D5F01 /* IndexValueStore.cpp */,
@@ -16932,6 +16930,8 @@
 				51771DFD1BDB475600CAE8E4 /* MemoryObjectStore.h */,
 				517139031BF64DE3000D5F01 /* MemoryObjectStoreCursor.cpp */,
 				517139041BF64DE3000D5F01 /* MemoryObjectStoreCursor.h */,
+				516F7F6B1C31C79D00F111DC /* ServerOpenDBRequest.cpp */,
+				516F7F6C1C31C79D00F111DC /* ServerOpenDBRequest.h */,
 				518864DE1BBAF30F00E540C9 /* UniqueIDBDatabase.cpp */,
 				518864DF1BBAF30F00E540C9 /* UniqueIDBDatabase.h */,
 				5198F7A21BBDAA2900E2CC5F /* UniqueIDBDatabaseConnection.cpp */,
@@ -25233,6 +25233,7 @@
 				85E711AE0AC5D5350053270F /* DOMHTMLHeadingElementInternal.h in Headers */,
 				85ECBEF10AA7626900544F0B /* DOMHTMLHRElement.h in Headers */,
 				85E711AF0AC5D5350053270F /* DOMHTMLHRElementInternal.h in Headers */,
+				516F7F6D1C31E39A00F111DC /* ServerOpenDBRequest.h in Headers */,
 				85992EBC0AA5069500AC0785 /* DOMHTMLHtmlElement.h in Headers */,
 				85E711B00AC5D5350053270F /* DOMHTMLHtmlElementInternal.h in Headers */,
 				85DF81990AA77E4B00486AD7 /* DOMHTMLIFrameElement.h in Headers */,
@@ -25860,7 +25861,6 @@
 				5185FCBB1BB4CBF80012898F /* IDBServer.h in Headers */,
 				5185FCAB1BB4C4E80012898F /* IDBServerConnection.h in Headers */,
 				517139081BF64DEF000D5F01 /* MemoryCursor.h in Headers */,
-				518864E71BBB4B8300E540C9 /* IDBServerOperation.h in Headers */,
 				5185FCAD1BB4C4E80012898F /* IDBTransaction.h in Headers */,
 				51F41A741BA73B5B002E053B /* IDBTransactionBackend.h in Headers */,
 				51F41A761BA73B5B002E053B /* IDBTransactionBackendOperations.h in Headers */,
@@ -29474,7 +29474,6 @@
 				5145B1091BC48E2E00E86219 /* IDBResourceIdentifier.cpp in Sources */,
 				51D7236C1BB6174900478CA3 /* IDBResultData.cpp in Sources */,
 				5185FCBA1BB4CBF80012898F /* IDBServer.cpp in Sources */,
-				518864E61BBB4B8300E540C9 /* IDBServerOperation.cpp in Sources */,
 				5185FCAC1BB4C4E80012898F /* IDBTransaction.cpp in Sources */,
 				51F41A731BA73B5B002E053B /* IDBTransactionBackend.cpp in Sources */,
 				51F41A751BA73B5B002E053B /* IDBTransactionBackendOperations.cpp in Sources */,
@@ -30406,6 +30405,7 @@
 				CD3A495E17A9D01B00274E42 /* MediaSource.cpp in Sources */,
 				CDC8B5A6180474F70016E685 /* MediaSourcePrivateAVFObjC.mm in Sources */,
 				CD61FE671794AADB004101EB /* MediaSourceRegistry.cpp in Sources */,
+				516F7F6E1C31E39C00F111DC /* ServerOpenDBRequest.cpp in Sources */,
 				07C59B6817F784BA000FBCBB /* MediaSourceSettings.cpp in Sources */,
 				078E08FF17D14CEE00420AA1 /* MediaStream.cpp in Sources */,
 				078E094B17D1709600420AA1 /* MediaStreamAudioDestinationNode.cpp in Sources */,
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to