Use typed identifiers for IDB connection identifiers
authoryouenn@apple.com <youenn@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 12 Sep 2019 08:47:31 +0000 (08:47 +0000)
committeryouenn@apple.com <youenn@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 12 Sep 2019 08:47:31 +0000 (08:47 +0000)
https://bugs.webkit.org/show_bug.cgi?id=201682

Reviewed by Chris Dumez.

Source/WebCore:

Migrate from uint64_t to a typed identifier for IDB connection identifiers.
The identifier is reusing the process identifier type.
No change of behavior.

* Modules/indexeddb/client/IDBConnectionProxy.h:
(WebCore::IDBClient::IDBConnectionProxy::serverConnectionIdentifier const):
* Modules/indexeddb/client/IDBConnectionToServer.cpp:
(WebCore::IDBClient::IDBConnectionToServer::identifier const):
* Modules/indexeddb/client/IDBConnectionToServer.h:
* Modules/indexeddb/client/IDBConnectionToServerDelegate.h:
* Modules/indexeddb/server/IDBConnectionToClient.cpp:
(WebCore::IDBServer::IDBConnectionToClient::identifier const):
* Modules/indexeddb/server/IDBConnectionToClient.h:
* Modules/indexeddb/server/IDBConnectionToClientDelegate.h:
* Modules/indexeddb/server/IDBServer.cpp:
(WebCore::IDBServer::IDBServer::getAllDatabaseNames):
(WebCore::IDBServer::IDBServer::performGetAllDatabaseNames):
(WebCore::IDBServer::IDBServer::didGetAllDatabaseNames):
* Modules/indexeddb/server/IDBServer.h:
* Modules/indexeddb/shared/IDBRequestData.cpp:
(WebCore::IDBRequestData::serverConnectionIdentifier const):
* Modules/indexeddb/shared/IDBRequestData.h:
* Modules/indexeddb/shared/IDBResourceIdentifier.cpp:
(WebCore::IDBResourceIdentifier::IDBResourceIdentifier):
(WebCore::IDBResourceIdentifier::emptyValue):
(WebCore::IDBResourceIdentifier::deletedValue):
(WebCore::IDBResourceIdentifier::isHashTableDeletedValue const):
(WebCore::IDBResourceIdentifier::loggingString const):
* Modules/indexeddb/shared/IDBResourceIdentifier.h:
(WebCore::IDBResourceIdentifier::hash const):
(WebCore::IDBResourceIdentifier::connectionIdentifier const):
(WTF::crossThreadCopy):
* Modules/indexeddb/shared/InProcessIDBServer.cpp:
(WebCore::InProcessIDBServer::identifier const):
* Modules/indexeddb/shared/InProcessIDBServer.h:

Source/WebKit:

Remove no longer needed conversion from process identifier to idb connection identifier.

* NetworkProcess/IndexedDB/WebIDBConnectionToClient.h:
* WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp:
(WebKit::WebIDBConnectionToServer::identifier const):
* WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.h:

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

20 files changed:
Source/WebCore/ChangeLog
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/IDBConnectionToClient.cpp
Source/WebCore/Modules/indexeddb/server/IDBConnectionToClient.h
Source/WebCore/Modules/indexeddb/server/IDBConnectionToClientDelegate.h
Source/WebCore/Modules/indexeddb/server/IDBServer.cpp
Source/WebCore/Modules/indexeddb/server/IDBServer.h
Source/WebCore/Modules/indexeddb/shared/IDBRequestData.cpp
Source/WebCore/Modules/indexeddb/shared/IDBRequestData.h
Source/WebCore/Modules/indexeddb/shared/IDBResourceIdentifier.cpp
Source/WebCore/Modules/indexeddb/shared/IDBResourceIdentifier.h
Source/WebCore/Modules/indexeddb/shared/InProcessIDBServer.cpp
Source/WebCore/Modules/indexeddb/shared/InProcessIDBServer.h
Source/WebKit/ChangeLog
Source/WebKit/NetworkProcess/IndexedDB/WebIDBConnectionToClient.h
Source/WebKit/WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp
Source/WebKit/WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.h

index fdb1152..07c1be9 100644 (file)
@@ -1,5 +1,48 @@
 2019-09-12  Youenn Fablet  <youenn@apple.com>
 
+        Use typed identifiers for IDB connection identifiers
+        https://bugs.webkit.org/show_bug.cgi?id=201682
+
+        Reviewed by Chris Dumez.
+
+        Migrate from uint64_t to a typed identifier for IDB connection identifiers.
+        The identifier is reusing the process identifier type.
+        No change of behavior.
+
+        * Modules/indexeddb/client/IDBConnectionProxy.h:
+        (WebCore::IDBClient::IDBConnectionProxy::serverConnectionIdentifier const):
+        * Modules/indexeddb/client/IDBConnectionToServer.cpp:
+        (WebCore::IDBClient::IDBConnectionToServer::identifier const):
+        * Modules/indexeddb/client/IDBConnectionToServer.h:
+        * Modules/indexeddb/client/IDBConnectionToServerDelegate.h:
+        * Modules/indexeddb/server/IDBConnectionToClient.cpp:
+        (WebCore::IDBServer::IDBConnectionToClient::identifier const):
+        * Modules/indexeddb/server/IDBConnectionToClient.h:
+        * Modules/indexeddb/server/IDBConnectionToClientDelegate.h:
+        * Modules/indexeddb/server/IDBServer.cpp:
+        (WebCore::IDBServer::IDBServer::getAllDatabaseNames):
+        (WebCore::IDBServer::IDBServer::performGetAllDatabaseNames):
+        (WebCore::IDBServer::IDBServer::didGetAllDatabaseNames):
+        * Modules/indexeddb/server/IDBServer.h:
+        * Modules/indexeddb/shared/IDBRequestData.cpp:
+        (WebCore::IDBRequestData::serverConnectionIdentifier const):
+        * Modules/indexeddb/shared/IDBRequestData.h:
+        * Modules/indexeddb/shared/IDBResourceIdentifier.cpp:
+        (WebCore::IDBResourceIdentifier::IDBResourceIdentifier):
+        (WebCore::IDBResourceIdentifier::emptyValue):
+        (WebCore::IDBResourceIdentifier::deletedValue):
+        (WebCore::IDBResourceIdentifier::isHashTableDeletedValue const):
+        (WebCore::IDBResourceIdentifier::loggingString const):
+        * Modules/indexeddb/shared/IDBResourceIdentifier.h:
+        (WebCore::IDBResourceIdentifier::hash const):
+        (WebCore::IDBResourceIdentifier::connectionIdentifier const):
+        (WTF::crossThreadCopy):
+        * Modules/indexeddb/shared/InProcessIDBServer.cpp:
+        (WebCore::InProcessIDBServer::identifier const):
+        * Modules/indexeddb/shared/InProcessIDBServer.h:
+
+2019-09-12  Youenn Fablet  <youenn@apple.com>
+
         Use WebProcess processIdentifier to identify Service Worker connections
         https://bugs.webkit.org/show_bug.cgi?id=201459
 
index 588c077..91f93c4 100644 (file)
@@ -111,7 +111,7 @@ public:
 
     void completeOperation(const IDBResultData&);
 
-    uint64_t serverConnectionIdentifier() const { return m_serverConnectionIdentifier; }
+    IDBConnectionIdentifier serverConnectionIdentifier() const { return m_serverConnectionIdentifier; }
 
     void ref();
     void deref();
@@ -153,7 +153,7 @@ private:
     void handleMainThreadTasks();
 
     IDBConnectionToServer& m_connectionToServer;
-    uint64_t m_serverConnectionIdentifier;
+    IDBConnectionIdentifier m_serverConnectionIdentifier;
 
     HashMap<uint64_t, IDBDatabase*> m_databaseConnectionMap;
     Lock m_databaseConnectionMapLock;
index 37711dc..fc0d9b0 100644 (file)
@@ -54,7 +54,7 @@ IDBConnectionToServer::IDBConnectionToServer(IDBConnectionToServerDelegate& dele
 {
 }
 
-uint64_t IDBConnectionToServer::identifier() const
+IDBConnectionIdentifier IDBConnectionToServer::identifier() const
 {
     return m_delegate->identifier();
 }
index 9cb140d..425e45a 100644 (file)
@@ -55,7 +55,7 @@ class IDBConnectionToServer : public ThreadSafeRefCounted<IDBConnectionToServer>
 public:
     WEBCORE_EXPORT static Ref<IDBConnectionToServer> create(IDBConnectionToServerDelegate&);
 
-    WEBCORE_EXPORT uint64_t identifier() const;
+    WEBCORE_EXPORT IDBConnectionIdentifier identifier() const;
 
     IDBConnectionProxy& proxy();
 
index 2862cbd..dc8a99b 100644 (file)
@@ -27,6 +27,7 @@
 
 #if ENABLE(INDEXED_DATABASE)
 
+#include "IDBResourceIdentifier.h"
 #include <wtf/WeakPtr.h>
 #include <wtf/text/WTFString.h>
 
@@ -37,7 +38,6 @@ class IDBIndexInfo;
 class IDBKeyData;
 class IDBObjectStoreInfo;
 class IDBRequestData;
-class IDBResourceIdentifier;
 class IDBTransactionInfo;
 class IDBValue;
 
@@ -58,7 +58,7 @@ class IDBConnectionToServerDelegate : public CanMakeWeakPtr<IDBConnectionToServe
 public:
     virtual ~IDBConnectionToServerDelegate() = default;
 
-    virtual uint64_t identifier() const = 0;
+    virtual IDBConnectionIdentifier identifier() const = 0;
     virtual void deleteDatabase(const IDBRequestData&) = 0;
     virtual void openDatabase(const IDBRequestData&) = 0;
     virtual void abortTransaction(const IDBResourceIdentifier&) = 0;
index 6be3430..73434c3 100644 (file)
@@ -43,7 +43,7 @@ IDBConnectionToClient::IDBConnectionToClient(IDBConnectionToClientDelegate& dele
 {
 }
 
-uint64_t IDBConnectionToClient::identifier() const
+IDBConnectionIdentifier IDBConnectionToClient::identifier() const
 {
     ASSERT(m_delegate);
     return m_delegate->identifier();
index f10d6f6..f760dff 100644 (file)
@@ -47,8 +47,7 @@ class IDBConnectionToClient : public RefCounted<IDBConnectionToClient> {
 public:
     WEBCORE_EXPORT static Ref<IDBConnectionToClient> create(IDBConnectionToClientDelegate&);
 
-    // FIXME: Use a typed identifier.
-    uint64_t identifier() const;
+    IDBConnectionIdentifier identifier() const;
 
     void didDeleteDatabase(const IDBResultData&);
     void didOpenDatabase(const IDBResultData&);
index fdf6640..83c6fca 100644 (file)
@@ -27,6 +27,7 @@
 
 #if ENABLE(INDEXED_DATABASE)
 
+#include "IDBResourceIdentifier.h"
 #include <wtf/Forward.h>
 #include <wtf/WeakPtr.h>
 #include <wtf/text/WTFString.h>
@@ -34,7 +35,6 @@
 namespace WebCore {
 
 class IDBError;
-class IDBResourceIdentifier;
 class IDBResultData;
 
 namespace IDBServer {
@@ -45,7 +45,7 @@ class IDBConnectionToClientDelegate : public CanMakeWeakPtr<IDBConnectionToClien
 public:
     virtual ~IDBConnectionToClientDelegate() = default;
     
-    virtual uint64_t identifier() const = 0;
+    virtual IDBConnectionIdentifier identifier() const = 0;
 
     virtual void didDeleteDatabase(const IDBResultData&) = 0;
     virtual void didOpenDatabase(const IDBResultData&) = 0;
index e8ff231..b59ed7f 100644 (file)
@@ -460,12 +460,12 @@ void IDBServer::confirmDidCloseFromServer(uint64_t databaseConnectionIdentifier)
         databaseConnection->confirmDidCloseFromServer();
 }
 
-void IDBServer::getAllDatabaseNames(uint64_t serverConnectionIdentifier, const SecurityOriginData& mainFrameOrigin, const SecurityOriginData& openingOrigin, uint64_t callbackID)
+void IDBServer::getAllDatabaseNames(IDBConnectionIdentifier serverConnectionIdentifier, const SecurityOriginData& mainFrameOrigin, const SecurityOriginData& openingOrigin, uint64_t callbackID)
 {
     postDatabaseTask(createCrossThreadTask(*this, &IDBServer::performGetAllDatabaseNames, serverConnectionIdentifier, mainFrameOrigin, openingOrigin, callbackID));
 }
 
-void IDBServer::performGetAllDatabaseNames(uint64_t serverConnectionIdentifier, const SecurityOriginData& mainFrameOrigin, const SecurityOriginData& openingOrigin, uint64_t callbackID)
+void IDBServer::performGetAllDatabaseNames(IDBConnectionIdentifier serverConnectionIdentifier, const SecurityOriginData& mainFrameOrigin, const SecurityOriginData& openingOrigin, uint64_t callbackID)
 {
     auto databaseDirectoryPath = this->databaseDirectoryPathIsolatedCopy();
     String oldDirectory = IDBDatabaseIdentifier::databaseDirectoryRelativeToRoot(mainFrameOrigin, openingOrigin, databaseDirectoryPath, "v0");
@@ -487,7 +487,7 @@ void IDBServer::performGetAllDatabaseNames(uint64_t serverConnectionIdentifier,
     postDatabaseTaskReply(createCrossThreadTask(*this, &IDBServer::didGetAllDatabaseNames, serverConnectionIdentifier, callbackID, databases));
 }
 
-void IDBServer::didGetAllDatabaseNames(uint64_t serverConnectionIdentifier, uint64_t callbackID, const Vector<String>& databaseNames)
+void IDBServer::didGetAllDatabaseNames(IDBConnectionIdentifier serverConnectionIdentifier, uint64_t callbackID, const Vector<String>& databaseNames)
 {
     auto connection = m_connectionMap.get(serverConnectionIdentifier);
     if (!connection)
index cd6babc..19e6962 100644 (file)
@@ -96,7 +96,7 @@ public:
     WEBCORE_EXPORT void openDBRequestCancelled(const IDBRequestData&);
     WEBCORE_EXPORT void confirmDidCloseFromServer(uint64_t databaseConnectionIdentifier);
 
-    WEBCORE_EXPORT void getAllDatabaseNames(uint64_t serverConnectionIdentifier, const SecurityOriginData& mainFrameOrigin, const SecurityOriginData& openingOrigin, uint64_t callbackID);
+    WEBCORE_EXPORT void getAllDatabaseNames(IDBConnectionIdentifier serverConnectionIdentifier, const SecurityOriginData& mainFrameOrigin, const SecurityOriginData& openingOrigin, uint64_t callbackID);
 
     void postDatabaseTask(CrossThreadTask&&);
     void postDatabaseTaskReply(CrossThreadTask&&);
@@ -133,8 +133,8 @@ private:
     
     String databaseDirectoryPathIsolatedCopy() const { return m_databaseDirectoryPath.isolatedCopy(); }
 
-    void performGetAllDatabaseNames(uint64_t serverConnectionIdentifier, const SecurityOriginData& mainFrameOrigin, const SecurityOriginData& openingOrigin, uint64_t callbackID);
-    void didGetAllDatabaseNames(uint64_t serverConnectionIdentifier, uint64_t callbackID, const Vector<String>& databaseNames);
+    void performGetAllDatabaseNames(IDBConnectionIdentifier serverConnectionIdentifier, const SecurityOriginData& mainFrameOrigin, const SecurityOriginData& openingOrigin, uint64_t callbackID);
+    void didGetAllDatabaseNames(IDBConnectionIdentifier serverConnectionIdentifier, uint64_t callbackID, const Vector<String>& databaseNames);
 
     void performCloseAndDeleteDatabasesModifiedSince(WallTime, uint64_t callbackID);
     void performCloseAndDeleteDatabasesForOrigins(const Vector<SecurityOriginData>&, uint64_t callbackID);
@@ -185,7 +185,7 @@ private:
     void finishComputingSpaceUsedForOrigin(const ClientOrigin&, uint64_t spaceUsed);
 
     PAL::SessionID m_sessionID;
-    HashMap<uint64_t, RefPtr<IDBConnectionToClient>> m_connectionMap;
+    HashMap<IDBConnectionIdentifier, RefPtr<IDBConnectionToClient>> m_connectionMap;
     HashMap<IDBDatabaseIdentifier, std::unique_ptr<UniqueIDBDatabase>> m_uniqueIDBDatabaseMap;
 
     HashMap<uint64_t, UniqueIDBDatabaseConnection*> m_databaseConnections;
index 216416a..2668837 100644 (file)
@@ -109,7 +109,7 @@ void IDBRequestData::isolatedCopy(const IDBRequestData& source, IDBRequestData&
         destination.m_cursorIdentifier = makeUnique<IDBResourceIdentifier>(*source.m_cursorIdentifier);
 }
 
-uint64_t IDBRequestData::serverConnectionIdentifier() const
+IDBConnectionIdentifier IDBRequestData::serverConnectionIdentifier() const
 {
     ASSERT(m_serverConnectionIdentifier);
     return m_serverConnectionIdentifier;
index 408b4e4..53b7b62 100644 (file)
@@ -57,7 +57,7 @@ public:
     IDBRequestData(const IDBRequestData&, IsolatedCopyTag);
     IDBRequestData isolatedCopy() const;
 
-    uint64_t serverConnectionIdentifier() const;
+    IDBConnectionIdentifier serverConnectionIdentifier() const;
     IDBResourceIdentifier requestIdentifier() const;
     IDBResourceIdentifier transactionIdentifier() const;
     uint64_t objectStoreIdentifier() const;
@@ -81,7 +81,7 @@ public:
 private:
     static void isolatedCopy(const IDBRequestData& source, IDBRequestData& destination);
 
-    uint64_t m_serverConnectionIdentifier { 0 };
+    IDBConnectionIdentifier m_serverConnectionIdentifier;
     std::unique_ptr<IDBResourceIdentifier> m_requestIdentifier;
     std::unique_ptr<IDBResourceIdentifier> m_transactionIdentifier;
     std::unique_ptr<IDBResourceIdentifier> m_cursorIdentifier;
index 616d54f..9dab870 100644 (file)
@@ -53,7 +53,7 @@ IDBResourceIdentifier::IDBResourceIdentifier()
 {
 }
 
-IDBResourceIdentifier::IDBResourceIdentifier(uint64_t connectionIdentifier, uint64_t resourceIdentifier)
+IDBResourceIdentifier::IDBResourceIdentifier(IDBConnectionIdentifier connectionIdentifier, uint64_t resourceIdentifier)
     : m_idbConnectionIdentifier(connectionIdentifier)
     , m_resourceNumber(resourceIdentifier)
 {
@@ -84,25 +84,24 @@ IDBResourceIdentifier IDBResourceIdentifier::isolatedCopy() const
 
 IDBResourceIdentifier IDBResourceIdentifier::emptyValue()
 {
-    return IDBResourceIdentifier(0, 0);
+    return IDBResourceIdentifier({ }, 0);
 }
 
 IDBResourceIdentifier IDBResourceIdentifier::deletedValue()
 {
-    return IDBResourceIdentifier(std::numeric_limits<uint64_t>::max(), std::numeric_limits<uint64_t>::max());
+    return IDBResourceIdentifier(IDBConnectionIdentifier { WTF::HashTableDeletedValue }, std::numeric_limits<uint64_t>::max());
 }
 
 bool IDBResourceIdentifier::isHashTableDeletedValue() const
 {
-    return m_idbConnectionIdentifier == std::numeric_limits<uint64_t>::max()
-        && m_resourceNumber == std::numeric_limits<uint64_t>::max();
+    return m_idbConnectionIdentifier.isHashTableDeletedValue() && m_resourceNumber == std::numeric_limits<uint64_t>::max();
 }
 
 #if !LOG_DISABLED
 
 String IDBResourceIdentifier::loggingString() const
 {
-    return makeString('<', m_idbConnectionIdentifier, ", ", m_resourceNumber, '>');
+    return makeString('<', m_idbConnectionIdentifier.toUInt64(), ", ", m_resourceNumber, '>');
 }
 
 #endif
index d0dffa0..584a434 100644 (file)
@@ -27,6 +27,7 @@
 
 #if ENABLE(INDEXED_DATABASE)
 
+#include "ProcessIdentifier.h"
 #include <wtf/text/StringHash.h>
 
 namespace WebCore {
@@ -41,6 +42,8 @@ namespace IDBServer {
 class IDBConnectionToClient;
 }
 
+using IDBConnectionIdentifier = ProcessIdentifier;
+
 class IDBResourceIdentifier {
     WTF_MAKE_FAST_ALLOCATED;
 public:
@@ -59,7 +62,7 @@ public:
 
     unsigned hash() const
     {
-        uint64_t hashCodes[2] = { m_idbConnectionIdentifier, m_resourceNumber };
+        uint64_t hashCodes[2] = { m_idbConnectionIdentifier.toUInt64(), m_resourceNumber };
         return StringHasher::hashMemory<sizeof(hashCodes)>(hashCodes);
     }
     
@@ -69,7 +72,7 @@ public:
             && m_resourceNumber == other.m_resourceNumber;
     }
     
-    uint64_t connectionIdentifier() const { return m_idbConnectionIdentifier; }
+    IDBConnectionIdentifier connectionIdentifier() const { return m_idbConnectionIdentifier; }
 
     IDBResourceIdentifier isolatedCopy() const;
 
@@ -83,8 +86,8 @@ public:
     template<class Decoder> static bool decode(Decoder&, IDBResourceIdentifier&);
 
 private:
-    IDBResourceIdentifier(uint64_t connectionIdentifier, uint64_t resourceIdentifier);
-    uint64_t m_idbConnectionIdentifier { 0 };
+    IDBResourceIdentifier(IDBConnectionIdentifier, uint64_t resourceIdentifier);
+    IDBConnectionIdentifier m_idbConnectionIdentifier;
     uint64_t m_resourceNumber { 0 };
 };
 
@@ -146,6 +149,11 @@ template<> struct DefaultHash<WebCore::IDBResourceIdentifier> {
     typedef WebCore::IDBResourceIdentifierHash Hash;
 };
 
+inline WebCore::IDBConnectionIdentifier crossThreadCopy(WebCore::IDBConnectionIdentifier identifier)
+{
+    return identifier;
+}
+
 } // namespace WTF
 
 #endif // ENABLE(INDEXED_DATABASE)
index c968944..c3cf952 100644 (file)
@@ -39,6 +39,7 @@
 #include "IDBResultData.h"
 #include "IDBValue.h"
 #include "Logging.h"
+#include "ProcessIdentifier.h"
 #include <wtf/FileSystem.h>
 #include <wtf/RunLoop.h>
 
@@ -90,11 +91,11 @@ InProcessIDBServer::InProcessIDBServer(PAL::SessionID sessionID, const String& d
     m_connectionToClient = IDBServer::IDBConnectionToClient::create(*this);
 }
 
-uint64_t InProcessIDBServer::identifier() const
+IDBConnectionIdentifier InProcessIDBServer::identifier() const
 {
     // An instance of InProcessIDBServer always has a 1:1 relationship with its instance of IDBServer.
     // Therefore the connection identifier between the two can always be "1".
-    return 1;
+    return Process::identifier();
 }
 
 IDBClient::IDBConnectionToServer& InProcessIDBServer::connectionToServer() const
index 26abe64..0ff9754 100644 (file)
@@ -95,7 +95,7 @@ public:
     void getAllDatabaseNames(const SecurityOriginData& mainFrameOrigin, const SecurityOriginData& openingOrigin, uint64_t callbackID) final;
 
     // IDBConnectionToClient
-    uint64_t identifier() const override;
+    IDBConnectionIdentifier identifier() const final;
     void didDeleteDatabase(const IDBResultData&) final;
     void didOpenDatabase(const IDBResultData&) final;
     void didAbortTransaction(const IDBResourceIdentifier& transactionIdentifier, const IDBError&) final;
index 8611ac6..fa2094e 100644 (file)
@@ -1,3 +1,17 @@
+2019-09-12  Youenn Fablet  <youenn@apple.com>
+
+        Use typed identifiers for IDB connection identifiers
+        https://bugs.webkit.org/show_bug.cgi?id=201682
+
+        Reviewed by Chris Dumez.
+
+        Remove no longer needed conversion from process identifier to idb connection identifier.
+
+        * NetworkProcess/IndexedDB/WebIDBConnectionToClient.h:
+        * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp:
+        (WebKit::WebIDBConnectionToServer::identifier const):
+        * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.h:
+
 2019-09-12  Charlie Turner  <cturner@igalia.com>
 
         [GTK] Allow CacheStore::destroyEngine to destroy default engine for soup.
index 89ffd08..222c93f 100644 (file)
@@ -56,12 +56,12 @@ class NetworkProcess;
 
 class WebIDBConnectionToClient final : public WebCore::IDBServer::IDBConnectionToClientDelegate, public IPC::MessageSender, public RefCounted<WebIDBConnectionToClient> {
 public:
-    static Ref<WebIDBConnectionToClient> create(NetworkProcess&, IPC::Connection&, WebCore::ProcessIdentifier, PAL::SessionID);
+    static Ref<WebIDBConnectionToClient> create(NetworkProcess&, IPC::Connection&, WebCore::IDBConnectionIdentifier, PAL::SessionID);
 
     virtual ~WebIDBConnectionToClient();
 
     WebCore::IDBServer::IDBConnectionToClient& connectionToClient();
-    uint64_t identifier() const final { return m_identifier.toUInt64(); }
+    WebCore::IDBConnectionIdentifier identifier() const final { return m_identifier; }
 
     void ref() override { RefCounted<WebIDBConnectionToClient>::ref(); }
     void deref() override { RefCounted<WebIDBConnectionToClient>::deref(); }
@@ -138,7 +138,7 @@ private:
     Ref<IPC::Connection> m_connection;
     Ref<NetworkProcess> m_networkProcess;
 
-    WebCore::ProcessIdentifier m_identifier;
+    WebCore::IDBConnectionIdentifier m_identifier;
     PAL::SessionID m_sessionID;
     RefPtr<WebCore::IDBServer::IDBConnectionToClient> m_connectionToClient;
 };
index ce1c93e..6c2f13d 100644 (file)
@@ -69,9 +69,9 @@ WebIDBConnectionToServer::~WebIDBConnectionToServer()
 {
 }
 
-uint64_t WebIDBConnectionToServer::identifier() const
+IDBConnectionIdentifier WebIDBConnectionToServer::identifier() const
 {
-    return Process::identifier().toUInt64();
+    return Process::identifier();
 }
 
 IPC::Connection* WebIDBConnectionToServer::messageSenderConnection() const
index e4e94ea..cd9a987 100644 (file)
@@ -43,7 +43,7 @@ public:
     virtual ~WebIDBConnectionToServer();
 
     WebCore::IDBClient::IDBConnectionToServer& coreConnectionToServer();
-    uint64_t identifier() const final;
+    WebCore::IDBConnectionIdentifier identifier() const final;
 
     void didReceiveMessage(IPC::Connection&, IPC::Decoder&);
     void connectionToServerLost();