CacheStorageProvider::createCacheStorageConnection() does not need to take in a SessionID
authorcdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 18 Sep 2019 18:37:13 +0000 (18:37 +0000)
committercdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 18 Sep 2019 18:37:13 +0000 (18:37 +0000)
https://bugs.webkit.org/show_bug.cgi?id=201920

Reviewed by Geoffrey Garen.

CacheStorageProvider::createCacheStorageConnection() does not need to take in a SessionID.
This sessionID is no longer used now that we have a session per WebProcess.

Source/WebCore:

* Modules/cache/CacheStorageConnection.cpp:
(WebCore::formDataSize):
(WebCore::CacheStorageConnection::computeRealBodySize):
* Modules/cache/CacheStorageConnection.h:
* Modules/cache/DOMWindowCaches.cpp:
(WebCore::DOMWindowCaches::caches const):
* Modules/cache/WorkerCacheStorageConnection.cpp:
(WebCore::WorkerCacheStorageConnection::sessionID const): Deleted.
* Modules/cache/WorkerCacheStorageConnection.h:
* fileapi/Blob.cpp:
(WebCore::Blob::size const):
* fileapi/ThreadableBlobRegistry.cpp:
(WebCore::ThreadableBlobRegistry::blobSize):
* fileapi/ThreadableBlobRegistry.h:
* loader/cache/KeepaliveRequestTracker.cpp:
(WebCore::KeepaliveRequestTracker::tryRegisterRequest):
(WebCore::KeepaliveRequestTracker::registerRequest):
(WebCore::KeepaliveRequestTracker::unregisterRequest):
* page/CacheStorageProvider.h:
(WebCore::CacheStorageProvider::createCacheStorageConnection):
* platform/network/BlobRegistry.h:
* platform/network/FormData.cpp:
(WebCore::FormDataElement::lengthInBytes const):
(WebCore::FormData::lengthInBytes const):
* platform/network/FormData.h:
* testing/Internals.cpp:
(WebCore::Internals::clearCacheStorageMemoryRepresentation):
(WebCore::Internals::cacheStorageEngineRepresentation):
(WebCore::Internals::updateQuotaBasedOnSpaceUsage):
* workers/WorkerMessagingProxy.cpp:
(WebCore::WorkerMessagingProxy::createCacheStorageConnection):
* workers/service/context/ServiceWorkerThreadProxy.cpp:
(WebCore::ServiceWorkerThreadProxy::ServiceWorkerThreadProxy):
(WebCore::ServiceWorkerThreadProxy::createCacheStorageConnection):
* workers/service/context/ServiceWorkerThreadProxy.h:
* xml/XMLHttpRequest.cpp:
(WebCore::XMLHttpRequest::createRequest):

Source/WebKit:

* NetworkProcess/NetworkProcessPlatformStrategies.cpp:
(WebKit::NetworkProcessPlatformStrategies::createBlobRegistry):
* WebProcess/Cache/WebCacheStorageConnection.cpp:
(WebKit::WebCacheStorageConnection::sessionID const): Deleted.
* WebProcess/Cache/WebCacheStorageConnection.h:
* WebProcess/Cache/WebCacheStorageProvider.cpp:
(WebKit::WebCacheStorageProvider::createCacheStorageConnection):
* WebProcess/Cache/WebCacheStorageProvider.h:
* WebProcess/FileAPI/BlobRegistryProxy.cpp:
(WebKit::BlobRegistryProxy::blobSize):
* WebProcess/FileAPI/BlobRegistryProxy.h:

Source/WebKitLegacy/mac:

* WebCoreSupport/WebPlatformStrategies.mm:

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

30 files changed:
Source/WebCore/ChangeLog
Source/WebCore/Modules/cache/CacheStorageConnection.cpp
Source/WebCore/Modules/cache/CacheStorageConnection.h
Source/WebCore/Modules/cache/DOMWindowCaches.cpp
Source/WebCore/Modules/cache/WorkerCacheStorageConnection.cpp
Source/WebCore/Modules/cache/WorkerCacheStorageConnection.h
Source/WebCore/fileapi/Blob.cpp
Source/WebCore/fileapi/ThreadableBlobRegistry.cpp
Source/WebCore/fileapi/ThreadableBlobRegistry.h
Source/WebCore/loader/cache/KeepaliveRequestTracker.cpp
Source/WebCore/page/CacheStorageProvider.h
Source/WebCore/platform/network/BlobRegistry.h
Source/WebCore/platform/network/FormData.cpp
Source/WebCore/platform/network/FormData.h
Source/WebCore/testing/Internals.cpp
Source/WebCore/workers/WorkerMessagingProxy.cpp
Source/WebCore/workers/service/context/ServiceWorkerThreadProxy.cpp
Source/WebCore/workers/service/context/ServiceWorkerThreadProxy.h
Source/WebCore/xml/XMLHttpRequest.cpp
Source/WebKit/ChangeLog
Source/WebKit/NetworkProcess/NetworkProcessPlatformStrategies.cpp
Source/WebKit/WebProcess/Cache/WebCacheStorageConnection.cpp
Source/WebKit/WebProcess/Cache/WebCacheStorageConnection.h
Source/WebKit/WebProcess/Cache/WebCacheStorageProvider.cpp
Source/WebKit/WebProcess/Cache/WebCacheStorageProvider.h
Source/WebKit/WebProcess/FileAPI/BlobRegistryProxy.cpp
Source/WebKit/WebProcess/FileAPI/BlobRegistryProxy.h
Source/WebKitLegacy/mac/ChangeLog
Source/WebKitLegacy/mac/WebCoreSupport/WebPlatformStrategies.mm
Source/WebKitLegacy/win/WebCoreSupport/WebPlatformStrategies.cpp

index 9154aef..248fe49 100644 (file)
@@ -1,5 +1,53 @@
 2019-09-18  Chris Dumez  <cdumez@apple.com>
 
+        CacheStorageProvider::createCacheStorageConnection() does not need to take in a SessionID
+        https://bugs.webkit.org/show_bug.cgi?id=201920
+
+        Reviewed by Geoffrey Garen.
+
+        CacheStorageProvider::createCacheStorageConnection() does not need to take in a SessionID.
+        This sessionID is no longer used now that we have a session per WebProcess.
+
+        * Modules/cache/CacheStorageConnection.cpp:
+        (WebCore::formDataSize):
+        (WebCore::CacheStorageConnection::computeRealBodySize):
+        * Modules/cache/CacheStorageConnection.h:
+        * Modules/cache/DOMWindowCaches.cpp:
+        (WebCore::DOMWindowCaches::caches const):
+        * Modules/cache/WorkerCacheStorageConnection.cpp:
+        (WebCore::WorkerCacheStorageConnection::sessionID const): Deleted.
+        * Modules/cache/WorkerCacheStorageConnection.h:
+        * fileapi/Blob.cpp:
+        (WebCore::Blob::size const):
+        * fileapi/ThreadableBlobRegistry.cpp:
+        (WebCore::ThreadableBlobRegistry::blobSize):
+        * fileapi/ThreadableBlobRegistry.h:
+        * loader/cache/KeepaliveRequestTracker.cpp:
+        (WebCore::KeepaliveRequestTracker::tryRegisterRequest):
+        (WebCore::KeepaliveRequestTracker::registerRequest):
+        (WebCore::KeepaliveRequestTracker::unregisterRequest):
+        * page/CacheStorageProvider.h:
+        (WebCore::CacheStorageProvider::createCacheStorageConnection):
+        * platform/network/BlobRegistry.h:
+        * platform/network/FormData.cpp:
+        (WebCore::FormDataElement::lengthInBytes const):
+        (WebCore::FormData::lengthInBytes const):
+        * platform/network/FormData.h:
+        * testing/Internals.cpp:
+        (WebCore::Internals::clearCacheStorageMemoryRepresentation):
+        (WebCore::Internals::cacheStorageEngineRepresentation):
+        (WebCore::Internals::updateQuotaBasedOnSpaceUsage):
+        * workers/WorkerMessagingProxy.cpp:
+        (WebCore::WorkerMessagingProxy::createCacheStorageConnection):
+        * workers/service/context/ServiceWorkerThreadProxy.cpp:
+        (WebCore::ServiceWorkerThreadProxy::ServiceWorkerThreadProxy):
+        (WebCore::ServiceWorkerThreadProxy::createCacheStorageConnection):
+        * workers/service/context/ServiceWorkerThreadProxy.h:
+        * xml/XMLHttpRequest.cpp:
+        (WebCore::XMLHttpRequest::createRequest):
+
+2019-09-18  Chris Dumez  <cdumez@apple.com>
+
         Drop FrameLoaderClient::sessionID()
         https://bugs.webkit.org/show_bug.cgi?id=201916
 
index 9aa67c7..9b3f840 100644 (file)
 namespace WebCore {
 using namespace WebCore::DOMCacheEngine;
 
-static inline uint64_t formDataSize(const FormData& formData, PAL::SessionID sessionID)
+static inline uint64_t formDataSize(const FormData& formData)
 {
     if (isMainThread())
-        return formData.lengthInBytes(sessionID);
+        return formData.lengthInBytes();
 
     uint64_t resultSize;
-    callOnMainThreadAndWait([sessionID, formData = formData.isolatedCopy(), &resultSize] {
-        resultSize = formData->lengthInBytes(sessionID);
+    callOnMainThreadAndWait([formData = formData.isolatedCopy(), &resultSize] {
+        resultSize = formData->lengthInBytes();
     });
     return resultSize;
 }
@@ -49,7 +49,7 @@ uint64_t CacheStorageConnection::computeRealBodySize(const DOMCacheEngine::Respo
 {
     uint64_t result = 0;
     WTF::switchOn(body, [&] (const Ref<FormData>& formData) {
-        result = formDataSize(formData, sessionID());
+        result = formDataSize(formData);
     }, [&] (const Ref<SharedBuffer>& buffer) {
         result = buffer->size();
     }, [] (const std::nullptr_t&) {
index d1dafa8..636f0df 100644 (file)
@@ -57,8 +57,6 @@ public:
     virtual void engineRepresentation(CompletionHandler<void(const String&)>&& callback) { callback(String { }); }
     virtual void updateQuotaBasedOnSpaceUsage(const ClientOrigin&) { }
 
-    virtual PAL::SessionID sessionID() const = 0;
-
 private:
     uint64_t computeRealBodySize(const DOMCacheEngine::ResponseBody&);
 
index 6153943..0986aa2 100644 (file)
@@ -72,7 +72,7 @@ DOMCacheStorage* DOMWindowCaches::caches() const
     ASSERT(frame());
     ASSERT(frame()->document());
     if (!m_caches && frame()->page())
-        m_caches = DOMCacheStorage::create(*frame()->document(), frame()->page()->cacheStorageProvider().createCacheStorageConnection(frame()->page()->sessionID()));
+        m_caches = DOMCacheStorage::create(*frame()->document(), frame()->page()->cacheStorageProvider().createCacheStorageConnection());
     return m_caches.get();
 }
 
index ff06a6b..206c241 100644 (file)
@@ -134,11 +134,6 @@ WorkerCacheStorageConnection::~WorkerCacheStorageConnection()
         callOnMainThread([mainThreadConnection = WTFMove(m_mainThreadConnection)]() mutable { });
 }
 
-PAL::SessionID WorkerCacheStorageConnection::sessionID() const
-{
-    return m_scope.sessionID();
-}
-
 void WorkerCacheStorageConnection::open(const ClientOrigin& origin, const String& cacheName, CacheIdentifierCallback&& callback)
 {
     uint64_t requestIdentifier = ++m_lastRequestIdentifier;
index 2f3afad..119d4cc 100644 (file)
@@ -55,8 +55,6 @@ private:
     void reference(uint64_t cacheIdentifier) final;
     void dereference(uint64_t cacheIdentifier) final;
 
-    PAL::SessionID sessionID() const final;
-
     void doOpen(uint64_t requestIdentifier, const ClientOrigin&, const String& cacheName);
     void doRemove(uint64_t requestIdentifier, uint64_t cacheIdentifier);
     void doRetrieveCaches(uint64_t requestIdentifier, const ClientOrigin&, uint64_t updateCounter);
index 52a5367..d891c70 100644 (file)
@@ -169,7 +169,7 @@ unsigned long long Blob::size() const
     if (!m_size) {
         // FIXME: JavaScript cannot represent sizes as large as unsigned long long, we need to
         // come up with an exception to throw if file size is not representable.
-        unsigned long long actualSize = ThreadableBlobRegistry::blobSize(m_sessionID, m_internalURL);
+        unsigned long long actualSize = ThreadableBlobRegistry::blobSize(m_internalURL);
         m_size = WTF::isInBounds<long long>(actualSize) ? actualSize : 0;
     }
 
index 7610664..a95b249 100644 (file)
@@ -128,15 +128,15 @@ void ThreadableBlobRegistry::registerBlobURLForSlice(PAL::SessionID sessionID, c
     });
 }
 
-unsigned long long ThreadableBlobRegistry::blobSize(PAL::SessionID sessionID, const URL& url)
+unsigned long long ThreadableBlobRegistry::blobSize(const URL& url)
 {
     if (isMainThread())
-        return blobRegistry().blobSize(sessionID, url);
+        return blobRegistry().blobSize(url);
 
     unsigned long long resultSize;
     BinarySemaphore semaphore;
-    callOnMainThread([sessionID, url = url.isolatedCopy(), &semaphore, &resultSize] {
-        resultSize = blobRegistry().blobSize(sessionID, url);
+    callOnMainThread([url = url.isolatedCopy(), &semaphore, &resultSize] {
+        resultSize = blobRegistry().blobSize(url);
         semaphore.signal();
     });
     semaphore.wait();
index 8b8ba06..a160acc 100644 (file)
@@ -51,7 +51,7 @@ public:
     static void registerBlobURLForSlice(PAL::SessionID, const URL& newURL, const URL& srcURL, long long start, long long end);
     static void unregisterBlobURL(PAL::SessionID, const URL&);
 
-    static unsigned long long blobSize(PAL::SessionID, const URL&);
+    static unsigned long long blobSize(const URL&);
 
     // Returns the origin for the given blob URL. This is because we are not able to embed the unique security origin or the origin of file URL
     // in the blob URL.
index 47a3c7b..00c5505 100644 (file)
@@ -44,7 +44,7 @@ bool KeepaliveRequestTracker::tryRegisterRequest(CachedResource& resource)
     if (!body)
         return true;
 
-    uint64_t bodySize = body->lengthInBytes(resource.sessionID());
+    uint64_t bodySize = body->lengthInBytes();
     if (m_inflightKeepaliveBytes + bodySize > maxInflightKeepaliveBytes)
         return false;
 
@@ -60,7 +60,7 @@ void KeepaliveRequestTracker::registerRequest(CachedResource& resource)
         return;
     ASSERT(!m_inflightKeepaliveRequests.contains(&resource));
     m_inflightKeepaliveRequests.append(&resource);
-    m_inflightKeepaliveBytes += body->lengthInBytes(resource.sessionID());
+    m_inflightKeepaliveBytes += body->lengthInBytes();
     ASSERT(m_inflightKeepaliveBytes <= maxInflightKeepaliveBytes);
 
     resource.addClient(*this);
@@ -87,7 +87,7 @@ void KeepaliveRequestTracker::unregisterRequest(CachedResource& resource)
     resource.removeClient(*this);
     bool wasRemoved = m_inflightKeepaliveRequests.removeFirst(&resource);
     ASSERT_UNUSED(wasRemoved, wasRemoved);
-    m_inflightKeepaliveBytes -= resource.resourceRequest().httpBody()->lengthInBytes(resource.sessionID());
+    m_inflightKeepaliveBytes -= resource.resourceRequest().httpBody()->lengthInBytes();
     ASSERT(m_inflightKeepaliveBytes <= maxInflightKeepaliveBytes);
 }
 
index d9f3f3c..1b15d3e 100644 (file)
@@ -35,11 +35,10 @@ class CacheStorageProvider : public RefCounted<CacheStorageProvider> {
 public:
     class DummyCacheStorageConnection final : public WebCore::CacheStorageConnection {
     public:
-        static Ref<DummyCacheStorageConnection> create(PAL::SessionID sessionID) { return adoptRef(*new DummyCacheStorageConnection(sessionID)); }
+        static Ref<DummyCacheStorageConnection> create() { return adoptRef(*new DummyCacheStorageConnection()); }
 
     private:
-        explicit DummyCacheStorageConnection(PAL::SessionID sessionID)
-            : m_sessionID(sessionID)
+        DummyCacheStorageConnection()
         {
         }
 
@@ -51,13 +50,10 @@ public:
         void batchPutOperation(uint64_t, Vector<DOMCacheEngine::Record>&&, DOMCacheEngine::RecordIdentifiersCallback&&) final { }
         void reference(uint64_t) final { }
         void dereference(uint64_t) final { }
-        PAL::SessionID sessionID() const final { return m_sessionID; }
-
-        PAL::SessionID m_sessionID;
     };
 
     static Ref<CacheStorageProvider> create() { return adoptRef(*new CacheStorageProvider); }
-    virtual Ref<CacheStorageConnection> createCacheStorageConnection(PAL::SessionID sessionID) { return DummyCacheStorageConnection::create(sessionID); }
+    virtual Ref<CacheStorageConnection> createCacheStorageConnection() { return DummyCacheStorageConnection::create(); }
     virtual ~CacheStorageProvider() { };
 
 protected:
index 8cd391d..660a796 100644 (file)
@@ -64,7 +64,7 @@ public:
 
     virtual void unregisterBlobURL(PAL::SessionID, const URL&) = 0;
 
-    virtual unsigned long long blobSize(PAL::SessionID, const URL&) = 0;
+    virtual unsigned long long blobSize(const URL&) = 0;
 
     virtual void writeBlobsToTemporaryFiles(PAL::SessionID, const Vector<String>& blobURLs, CompletionHandler<void(Vector<String>&& filePaths)>&&) = 0;
 
index 216cb33..fea4e0e 100644 (file)
@@ -149,10 +149,10 @@ uint64_t FormDataElement::lengthInBytes(BlobRegistryImpl* blobRegistry) const
     });
 }
 
-uint64_t FormDataElement::lengthInBytes(PAL::SessionID sessionID) const
+uint64_t FormDataElement::lengthInBytes() const
 {
-    return computeLengthInBytes(*this, [&](auto& url) {
-        return blobRegistry().blobSize(sessionID, url);
+    return computeLengthInBytes(*this, [](auto& url) {
+        return blobRegistry().blobSize(url);
     });
 }
 
@@ -394,12 +394,12 @@ FormDataForUpload::~FormDataForUpload()
         FileSystem::deleteFile(file);
 }
 
-uint64_t FormData::lengthInBytes(PAL::SessionID sessionID) const
+uint64_t FormData::lengthInBytes() const
 {
     if (!m_lengthInBytes) {
         uint64_t length = 0;
         for (auto& element : m_elements)
-            length += element.lengthInBytes(sessionID);
+            length += element.lengthInBytes();
         m_lengthInBytes = length;
     }
     return *m_lengthInBytes;
index b8ec03d..7d75b96 100644 (file)
@@ -52,7 +52,7 @@ struct FormDataElement {
         : data(EncodedBlobData { blobURL }) { }
 
     uint64_t lengthInBytes(BlobRegistryImpl*) const;
-    uint64_t lengthInBytes(PAL::SessionID) const;
+    uint64_t lengthInBytes() const;
 
     FormDataElement isolatedCopy() const;
 
@@ -251,7 +251,7 @@ public:
         return FormURLEncoded;
     }
 
-    uint64_t lengthInBytes(PAL::SessionID) const;
+    uint64_t lengthInBytes() const;
 
     WEBCORE_EXPORT URL asBlobURL() const;
 
index 0300f9a..b879612 100644 (file)
@@ -4892,7 +4892,7 @@ void Internals::clearCacheStorageMemoryRepresentation(DOMPromiseDeferred<void>&&
 
     if (!m_cacheStorageConnection) {
         if (auto* page = contextDocument()->page())
-            m_cacheStorageConnection = page->cacheStorageProvider().createCacheStorageConnection(page->sessionID());
+            m_cacheStorageConnection = page->cacheStorageProvider().createCacheStorageConnection();
         if (!m_cacheStorageConnection)
             return;
     }
@@ -4910,7 +4910,7 @@ void Internals::cacheStorageEngineRepresentation(DOMPromiseDeferred<IDLDOMString
 
     if (!m_cacheStorageConnection) {
         if (auto* page = contextDocument()->page())
-            m_cacheStorageConnection = page->cacheStorageProvider().createCacheStorageConnection(page->sessionID());
+            m_cacheStorageConnection = page->cacheStorageProvider().createCacheStorageConnection();
         if (!m_cacheStorageConnection)
             return;
     }
@@ -4927,7 +4927,7 @@ void Internals::updateQuotaBasedOnSpaceUsage()
 
     if (!m_cacheStorageConnection) {
         if (auto* page = contextDocument()->page())
-            m_cacheStorageConnection = page->cacheStorageProvider().createCacheStorageConnection(page->sessionID());
+            m_cacheStorageConnection = page->cacheStorageProvider().createCacheStorageConnection();
         if (!m_cacheStorageConnection)
             return;
     }
index 1e4d7db..6bd53a1 100644 (file)
@@ -139,7 +139,7 @@ Ref<CacheStorageConnection> WorkerMessagingProxy::createCacheStorageConnection()
 {
     ASSERT(isMainThread());
     auto& document = downcast<Document>(*m_scriptExecutionContext);
-    return document.page()->cacheStorageProvider().createCacheStorageConnection(document.page()->sessionID());
+    return document.page()->cacheStorageProvider().createCacheStorageConnection();
 }
 
 bool WorkerMessagingProxy::postTaskForModeToWorkerGlobalScope(ScriptExecutionContext::Task&& task, const String& mode)
index 61745a7..791d3a3 100644 (file)
@@ -100,7 +100,6 @@ ServiceWorkerThreadProxy::ServiceWorkerThreadProxy(PageConfiguration&& pageConfi
     , m_document(*m_page->mainFrame().document())
     , m_serviceWorkerThread(ServiceWorkerThread::create(data, sessionID, WTFMove(userAgent), *this, *this, idbConnectionProxy(m_document), m_document->socketProvider()))
     , m_cacheStorageProvider(cacheStorageProvider)
-    , m_sessionID(sessionID)
     , m_inspectorProxy(*this)
 {
     static bool addedListener;
@@ -161,7 +160,7 @@ Ref<CacheStorageConnection> ServiceWorkerThreadProxy::createCacheStorageConnecti
 {
     ASSERT(isMainThread());
     if (!m_cacheStorageConnection)
-        m_cacheStorageConnection = m_cacheStorageProvider.createCacheStorageConnection(m_sessionID);
+        m_cacheStorageConnection = m_cacheStorageProvider.createCacheStorageConnection();
     return *m_cacheStorageConnection;
 }
 
index f46cfd1..09a6409 100644 (file)
@@ -95,7 +95,6 @@ private:
     Ref<ServiceWorkerThread> m_serviceWorkerThread;
     CacheStorageProvider& m_cacheStorageProvider;
     RefPtr<CacheStorageConnection> m_cacheStorageConnection;
-    PAL::SessionID m_sessionID;
     bool m_isTerminatingOrTerminated { false };
 
     ServiceWorkerInspectorProxy m_inspectorProxy;
index 53ac481..f5c6753 100644 (file)
@@ -623,7 +623,7 @@ ExceptionOr<void> XMLHttpRequest::createRequest()
     if (m_async) {
         m_progressEventThrottle.dispatchProgressEvent(eventNames().loadstartEvent);
         if (!m_uploadComplete && m_uploadListenerFlag)
-            m_upload->dispatchProgressEvent(eventNames().loadstartEvent, 0, request.httpBody()->lengthInBytes(scriptExecutionContext()->sessionID()));
+            m_upload->dispatchProgressEvent(eventNames().loadstartEvent, 0, request.httpBody()->lengthInBytes());
 
         if (readyState() != OPENED || !m_sendFlag || m_loader)
             return { };
index 95c113c..57eaa6e 100644 (file)
@@ -1,5 +1,27 @@
 2019-09-18  Chris Dumez  <cdumez@apple.com>
 
+        CacheStorageProvider::createCacheStorageConnection() does not need to take in a SessionID
+        https://bugs.webkit.org/show_bug.cgi?id=201920
+
+        Reviewed by Geoffrey Garen.
+
+        CacheStorageProvider::createCacheStorageConnection() does not need to take in a SessionID.
+        This sessionID is no longer used now that we have a session per WebProcess.
+
+        * NetworkProcess/NetworkProcessPlatformStrategies.cpp:
+        (WebKit::NetworkProcessPlatformStrategies::createBlobRegistry):
+        * WebProcess/Cache/WebCacheStorageConnection.cpp:
+        (WebKit::WebCacheStorageConnection::sessionID const): Deleted.
+        * WebProcess/Cache/WebCacheStorageConnection.h:
+        * WebProcess/Cache/WebCacheStorageProvider.cpp:
+        (WebKit::WebCacheStorageProvider::createCacheStorageConnection):
+        * WebProcess/Cache/WebCacheStorageProvider.h:
+        * WebProcess/FileAPI/BlobRegistryProxy.cpp:
+        (WebKit::BlobRegistryProxy::blobSize):
+        * WebProcess/FileAPI/BlobRegistryProxy.h:
+
+2019-09-18  Chris Dumez  <cdumez@apple.com>
+
         Drop FrameLoaderClient::sessionID()
         https://bugs.webkit.org/show_bug.cgi?id=201916
 
index 4672b3e..0c846db 100644 (file)
@@ -58,7 +58,7 @@ BlobRegistry* NetworkProcessPlatformStrategies::createBlobRegistry()
         void registerBlobURLOptionallyFileBacked(PAL::SessionID, const URL&, const URL& srcURL, RefPtr<BlobDataFileReference>&&, const String& contentType) final { ASSERT_NOT_REACHED(); }
         void registerBlobURLForSlice(PAL::SessionID, const URL&, const URL& srcURL, long long start, long long end) final { ASSERT_NOT_REACHED(); }
         void unregisterBlobURL(PAL::SessionID, const URL&) final { ASSERT_NOT_REACHED(); }
-        unsigned long long blobSize(PAL::SessionID, const URL&) final { ASSERT_NOT_REACHED(); return 0; }
+        unsigned long long blobSize(const URL&) final { ASSERT_NOT_REACHED(); return 0; }
         void writeBlobsToTemporaryFiles(PAL::SessionID, const Vector<String>& blobURLs, CompletionHandler<void(Vector<String>&& filePaths)>&&) final { ASSERT_NOT_REACHED(); }
     };
     static NeverDestroyed<EmptyBlobRegistry> blobRegistry;
index 7c7bb41..f7e7454 100644 (file)
@@ -110,9 +110,4 @@ void WebCacheStorageConnection::updateQuotaBasedOnSpaceUsage(const WebCore::Clie
     connection().send(Messages::NetworkProcess::UpdateQuotaBasedOnSpaceUsageForTesting(WebProcess::singleton().sessionID(), origin), 0);
 }
 
-PAL::SessionID WebCacheStorageConnection::sessionID() const
-{
-    return WebProcess::singleton().sessionID();
-}
-
 }
index f48e5a7..14b8741 100644 (file)
@@ -66,8 +66,6 @@ private:
     void clearMemoryRepresentation(const WebCore::ClientOrigin&, WebCore::DOMCacheEngine::CompletionCallback&&) final;
     void engineRepresentation(CompletionHandler<void(const String&)>&&) final;
     void updateQuotaBasedOnSpaceUsage(const WebCore::ClientOrigin&) final;
-    
-    PAL::SessionID sessionID() const final;
 
     WebCacheStorageProvider& m_provider;
 };
index 2a02253..d5ef539 100644 (file)
@@ -34,9 +34,8 @@
 
 namespace WebKit {
 
-Ref<WebCore::CacheStorageConnection> WebCacheStorageProvider::createCacheStorageConnection(PAL::SessionID sessionID)
+Ref<WebCore::CacheStorageConnection> WebCacheStorageProvider::createCacheStorageConnection()
 {
-    ASSERT_UNUSED(sessionID, WebProcess::singleton().sessionID());
     if (!m_connection)
         m_connection = WebCacheStorageConnection::create(*this);
     return *m_connection;
index 2f5569c..d9aa2aa 100644 (file)
@@ -41,7 +41,7 @@ class WebCacheStorageProvider final : public WebCore::CacheStorageProvider {
 public:
     static Ref<WebCacheStorageProvider> create() { return adoptRef(*new WebCacheStorageProvider); }
 
-    Ref<WebCore::CacheStorageConnection> createCacheStorageConnection(PAL::SessionID) final;
+    Ref<WebCore::CacheStorageConnection> createCacheStorageConnection() final;
 
 private:
     WebCacheStorageProvider() = default;
index 66f442c..5c3a211 100644 (file)
@@ -73,7 +73,7 @@ void BlobRegistryProxy::registerBlobURLForSlice(PAL::SessionID, const URL& url,
     WebProcess::singleton().ensureNetworkProcessConnection().connection().send(Messages::NetworkConnectionToWebProcess::RegisterBlobURLForSlice(url, srcURL, start, end), 0);
 }
 
-unsigned long long BlobRegistryProxy::blobSize(PAL::SessionID, const URL& url)
+unsigned long long BlobRegistryProxy::blobSize(const URL& url)
 {
     uint64_t resultSize;
     if (!WebProcess::singleton().ensureNetworkProcessConnection().connection().sendSync(Messages::NetworkConnectionToWebProcess::BlobSize(url), Messages::NetworkConnectionToWebProcess::BlobSize::Reply(resultSize), 0))
index 80924c0..d766158 100644 (file)
@@ -37,7 +37,7 @@ public:
     void registerBlobURLOptionallyFileBacked(PAL::SessionID, const URL&, const URL& srcURL, RefPtr<WebCore::BlobDataFileReference>&&, const String& contentType) final;
     void unregisterBlobURL(PAL::SessionID, const URL&) final;
     void registerBlobURLForSlice(PAL::SessionID, const URL&, const URL& srcURL, long long start, long long end) final;
-    unsigned long long blobSize(PAL::SessionID, const URL&) final;
+    unsigned long long blobSize(const URL&) final;
     void writeBlobsToTemporaryFiles(PAL::SessionID, const Vector<String>& blobURLs, CompletionHandler<void(Vector<String>&& filePaths)>&&) final;
 };
 
index 033818d..15d58bc 100644 (file)
@@ -1,5 +1,17 @@
 2019-09-18  Chris Dumez  <cdumez@apple.com>
 
+        CacheStorageProvider::createCacheStorageConnection() does not need to take in a SessionID
+        https://bugs.webkit.org/show_bug.cgi?id=201920
+
+        Reviewed by Geoffrey Garen.
+
+        CacheStorageProvider::createCacheStorageConnection() does not need to take in a SessionID.
+        This sessionID is no longer used now that we have a session per WebProcess.
+
+        * WebCoreSupport/WebPlatformStrategies.mm:
+
+2019-09-18  Chris Dumez  <cdumez@apple.com>
+
         Drop FrameLoaderClient::sessionID()
         https://bugs.webkit.org/show_bug.cgi?id=201916
 
index 089e6a7..def98da 100644 (file)
@@ -70,7 +70,7 @@ private:
     void registerBlobURLOptionallyFileBacked(PAL::SessionID, const URL& url, const URL& srcURL, RefPtr<BlobDataFileReference>&& reference, const String& contentType) final { m_blobRegistry.registerBlobURLOptionallyFileBacked(url, srcURL, WTFMove(reference), contentType); }
     void registerBlobURLForSlice(PAL::SessionID, const URL& url, const URL& srcURL, long long start, long long end) final { m_blobRegistry.registerBlobURLForSlice(url, srcURL, start, end); }
     void unregisterBlobURL(PAL::SessionID, const URL& url) final { m_blobRegistry.unregisterBlobURL(url); }
-    unsigned long long blobSize(PAL::SessionID, const URL& url) final { return m_blobRegistry.blobSize(url); }
+    unsigned long long blobSize(const URL& url) final { return m_blobRegistry.blobSize(url); }
     void writeBlobsToTemporaryFiles(PAL::SessionID, const Vector<String>& blobURLs, CompletionHandler<void(Vector<String>&& filePaths)>&& completionHandler) final { m_blobRegistry.writeBlobsToTemporaryFiles(blobURLs, WTFMove(completionHandler)); }
 
     BlobRegistryImpl* blobRegistryImpl() final { return &m_blobRegistry; }
index 5da9ed4..b7690df 100644 (file)
@@ -68,7 +68,7 @@ private:
     void registerBlobURLOptionallyFileBacked(PAL::SessionID, const URL& url, const URL& srcURL, RefPtr<BlobDataFileReference>&& reference, const String& contentType) final { m_blobRegistry.registerBlobURLOptionallyFileBacked(url, srcURL, WTFMove(reference), contentType); }
     void registerBlobURLForSlice(PAL::SessionID, const URL& url, const URL& srcURL, long long start, long long end) final { m_blobRegistry.registerBlobURLForSlice(url, srcURL, start, end); }
     void unregisterBlobURL(PAL::SessionID, const URL& url) final { m_blobRegistry.unregisterBlobURL(url); }
-    unsigned long long blobSize(PAL::SessionID, const URL& url) final { return m_blobRegistry.blobSize(url); }
+    unsigned long long blobSize(const URL& url) final { return m_blobRegistry.blobSize(url); }
     void writeBlobsToTemporaryFiles(PAL::SessionID, const Vector<String>& blobURLs, CompletionHandler<void(Vector<String>&& filePaths)>&& completionHandler) final { m_blobRegistry.writeBlobsToTemporaryFiles(blobURLs, WTFMove(completionHandler)); }
 
     BlobRegistryImpl* blobRegistryImpl() final { return &m_blobRegistry; }