Rename requestCacheStorageSpace to requestStorageSpace
authoryouenn@apple.com <youenn@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 5 Mar 2019 20:29:14 +0000 (20:29 +0000)
committeryouenn@apple.com <youenn@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 5 Mar 2019 20:29:14 +0000 (20:29 +0000)
https://bugs.webkit.org/show_bug.cgi?id=195282

Reviewed by Chris Dumez.

Source/WebKit:

Make the name more abstract as it might be used in the future for other storage
like IDB or service worker registrations.

* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::requestStorageSpace):
(WebKit::NetworkProcess::requestCacheStorageSpace): Deleted.
* NetworkProcess/NetworkProcess.h:
* NetworkProcess/cache/CacheStorageEngine.cpp:
(WebKit::CacheStorage::Engine::requestSpace):
* UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
(WebsiteDataStoreClient::WebsiteDataStoreClient):
* UIProcess/API/Cocoa/_WKWebsiteDataStoreDelegate.h:
* UIProcess/Network/NetworkProcessProxy.cpp:
(WebKit::NetworkProcessProxy::requestStorageSpace):
(WebKit::NetworkProcessProxy::requestCacheStorageSpace): Deleted.
* UIProcess/Network/NetworkProcessProxy.h:
* UIProcess/Network/NetworkProcessProxy.messages.in:
* UIProcess/WebsiteData/WebsiteDataStoreClient.h:
(WebKit::WebsiteDataStoreClient::requestStorageSpace):
(WebKit::WebsiteDataStoreClient::requestCacheStorageSpace): Deleted.

Tools:

* WebKitTestRunner/cocoa/TestWebsiteDataStoreDelegate.mm:
(-[TestWebsiteDataStoreDelegate requestStorageSpace:frameOrigin:quota:currentSize:spaceRequired:decisionHandler:]):
(-[TestWebsiteDataStoreDelegate requestCacheStorageSpace:frameOrigin:quota:currentSize:spaceRequired:decisionHandler:]): Deleted.

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

12 files changed:
Source/WebKit/ChangeLog
Source/WebKit/NetworkProcess/NetworkProcess.cpp
Source/WebKit/NetworkProcess/NetworkProcess.h
Source/WebKit/NetworkProcess/cache/CacheStorageEngine.cpp
Source/WebKit/UIProcess/API/Cocoa/WKWebsiteDataStore.mm
Source/WebKit/UIProcess/API/Cocoa/_WKWebsiteDataStoreDelegate.h
Source/WebKit/UIProcess/Network/NetworkProcessProxy.cpp
Source/WebKit/UIProcess/Network/NetworkProcessProxy.h
Source/WebKit/UIProcess/Network/NetworkProcessProxy.messages.in
Source/WebKit/UIProcess/WebsiteData/WebsiteDataStoreClient.h
Tools/ChangeLog
Tools/WebKitTestRunner/cocoa/TestWebsiteDataStoreDelegate.mm

index cc0b8cf..bf90db7 100644 (file)
@@ -1,3 +1,31 @@
+2019-03-05  Youenn Fablet  <youenn@apple.com>
+
+        Rename requestCacheStorageSpace to requestStorageSpace
+        https://bugs.webkit.org/show_bug.cgi?id=195282
+
+        Reviewed by Chris Dumez.
+
+        Make the name more abstract as it might be used in the future for other storage
+        like IDB or service worker registrations.
+
+        * NetworkProcess/NetworkProcess.cpp:
+        (WebKit::NetworkProcess::requestStorageSpace):
+        (WebKit::NetworkProcess::requestCacheStorageSpace): Deleted.
+        * NetworkProcess/NetworkProcess.h:
+        * NetworkProcess/cache/CacheStorageEngine.cpp:
+        (WebKit::CacheStorage::Engine::requestSpace):
+        * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
+        (WebsiteDataStoreClient::WebsiteDataStoreClient):
+        * UIProcess/API/Cocoa/_WKWebsiteDataStoreDelegate.h:
+        * UIProcess/Network/NetworkProcessProxy.cpp:
+        (WebKit::NetworkProcessProxy::requestStorageSpace):
+        (WebKit::NetworkProcessProxy::requestCacheStorageSpace): Deleted.
+        * UIProcess/Network/NetworkProcessProxy.h:
+        * UIProcess/Network/NetworkProcessProxy.messages.in:
+        * UIProcess/WebsiteData/WebsiteDataStoreClient.h:
+        (WebKit::WebsiteDataStoreClient::requestStorageSpace):
+        (WebKit::WebsiteDataStoreClient::requestCacheStorageSpace): Deleted.
+
 2019-03-05  Chris Dumez  <cdumez@apple.com>
 
         Drop cached WebProcesses for a given session when this session is destroyed
index facdfd5..9090e3a 100644 (file)
@@ -2296,9 +2296,9 @@ void NetworkProcess::addServiceWorkerSession(PAL::SessionID sessionID, String& s
 }
 #endif // ENABLE(SERVICE_WORKER)
 
-void NetworkProcess::requestCacheStorageSpace(PAL::SessionID sessionID, const ClientOrigin& origin, uint64_t quota, uint64_t currentSize, uint64_t spaceRequired, CompletionHandler<void(Optional<uint64_t>)>&& callback)
+void NetworkProcess::requestStorageSpace(PAL::SessionID sessionID, const ClientOrigin& origin, uint64_t quota, uint64_t currentSize, uint64_t spaceRequired, CompletionHandler<void(Optional<uint64_t>)>&& callback)
 {
-    parentProcessConnection()->sendWithAsyncReply(Messages::NetworkProcessProxy::RequestCacheStorageSpace { sessionID, origin, quota, currentSize, spaceRequired }, WTFMove(callback), 0);
+    parentProcessConnection()->sendWithAsyncReply(Messages::NetworkProcessProxy::RequestStorageSpace { sessionID, origin, quota, currentSize, spaceRequired }, WTFMove(callback), 0);
 }
 
 #if !PLATFORM(COCOA)
index 532f3f7..5a9550d 100644 (file)
@@ -313,7 +313,7 @@ public:
     CacheStorage::Engine* findCacheEngine(const PAL::SessionID&);
     CacheStorage::Engine& ensureCacheEngine(const PAL::SessionID&, Function<Ref<CacheStorage::Engine>()>&&);
     void removeCacheEngine(const PAL::SessionID&);
-    void requestCacheStorageSpace(PAL::SessionID, const WebCore::ClientOrigin&, uint64_t quota, uint64_t currentSize, uint64_t spaceRequired, CompletionHandler<void(Optional<uint64_t>)>&&);
+    void requestStorageSpace(PAL::SessionID, const WebCore::ClientOrigin&, uint64_t quota, uint64_t currentSize, uint64_t spaceRequired, CompletionHandler<void(Optional<uint64_t>)>&&);
 
     NetworkBlobRegistry& networkBlobRegistry() override { return m_networkBlobRegistry; }
 
index 1d2754e..60d20cf 100644 (file)
@@ -656,7 +656,7 @@ void Engine::requestSpace(const WebCore::ClientOrigin& origin, uint64_t quota, u
         callback({ });
         return;
     }
-    m_networkProcess->requestCacheStorageSpace(m_sessionID, origin, quota, currentSize, spaceRequired, WTFMove(callback));
+    m_networkProcess->requestStorageSpace(m_sessionID, origin, quota, currentSize, spaceRequired, WTFMove(callback));
 }
 
 } // namespace CacheStorage
index ea01b2f..2fa3b23 100644 (file)
@@ -47,19 +47,19 @@ class WebsiteDataStoreClient : public WebKit::WebsiteDataStoreClient {
 public:
     explicit WebsiteDataStoreClient(id <_WKWebsiteDataStoreDelegate> delegate)
         : m_delegate(delegate)
-        , m_hasRequestCacheStorageSpaceSelector([m_delegate.get() respondsToSelector:@selector(requestCacheStorageSpace: frameOrigin: quota: currentSize: spaceRequired: decisionHandler:)])
+        , m_hasRequestStorageSpaceSelector([m_delegate.get() respondsToSelector:@selector(requestStorageSpace: frameOrigin: quota: currentSize: spaceRequired: decisionHandler:)])
     {
     }
 
 private:
-    void requestCacheStorageSpace(const WebCore::SecurityOriginData& topOrigin, const WebCore::SecurityOriginData& frameOrigin, uint64_t quota, uint64_t currentSize, uint64_t spaceRequired, CompletionHandler<void(Optional<uint64_t>)>&& completionHandler) final
+    void requestStorageSpace(const WebCore::SecurityOriginData& topOrigin, const WebCore::SecurityOriginData& frameOrigin, uint64_t quota, uint64_t currentSize, uint64_t spaceRequired, CompletionHandler<void(Optional<uint64_t>)>&& completionHandler) final
     {
-        if (!m_hasRequestCacheStorageSpaceSelector || !m_delegate) {
+        if (!m_hasRequestStorageSpaceSelector || !m_delegate) {
             completionHandler({ });
             return;
         }
 
-        auto checker = WebKit::CompletionHandlerCallChecker::create(m_delegate.getAutoreleased(), @selector(requestCacheStorageSpace: frameOrigin: quota: currentSize: spaceRequired: decisionHandler:));
+        auto checker = WebKit::CompletionHandlerCallChecker::create(m_delegate.getAutoreleased(), @selector(requestStorageSpace: frameOrigin: quota: currentSize: spaceRequired: decisionHandler:));
         auto decisionHandler = makeBlockPtr([completionHandler = WTFMove(completionHandler), checker = WTFMove(checker)](unsigned long long quota) mutable {
             if (checker->completionHandlerHasBeenCalled())
                 return;
@@ -70,11 +70,11 @@ private:
         URL mainFrameURL { URL(), topOrigin.toString() };
         URL frameURL { URL(), frameOrigin.toString() };
 
-        [m_delegate.getAutoreleased() requestCacheStorageSpace:mainFrameURL frameOrigin:frameURL quota:quota currentSize:currentSize spaceRequired:spaceRequired decisionHandler:decisionHandler.get()];
+        [m_delegate.getAutoreleased() requestStorageSpace:mainFrameURL frameOrigin:frameURL quota:quota currentSize:currentSize spaceRequired:spaceRequired decisionHandler:decisionHandler.get()];
     }
 
     WeakObjCPtr<id <_WKWebsiteDataStoreDelegate> > m_delegate;
-    bool m_hasRequestCacheStorageSpaceSelector { false };
+    bool m_hasRequestStorageSpaceSelector { false };
 };
 
 @implementation WKWebsiteDataStore
index 895ca57..38083a4 100644 (file)
@@ -32,6 +32,6 @@ WK_API_AVAILABLE(macosx(WK_MAC_TBA), ios(WK_IOS_TBA))
 
 @optional
 
-- (void)requestCacheStorageSpace:(NSURL *)mainFrameURL frameOrigin:(NSURL *)frameURL quota:(NSUInteger)quota currentSize:(NSUInteger)currentSize spaceRequired:(NSUInteger)spaceRequired decisionHandler:(void (^)(unsigned long long quota))decisionHandler;
+- (void)requestStorageSpace:(NSURL *)mainFrameURL frameOrigin:(NSURL *)frameURL quota:(NSUInteger)quota currentSize:(NSUInteger)currentSize spaceRequired:(NSUInteger)spaceRequired decisionHandler:(void (^)(unsigned long long quota))decisionHandler;
 
 @end
index ef07782..a1f9172 100644 (file)
@@ -1159,7 +1159,7 @@ void NetworkProcessProxy::establishWorkerContextConnectionToNetworkProcessForExp
 }
 #endif
 
-void NetworkProcessProxy::requestCacheStorageSpace(PAL::SessionID sessionID, const WebCore::ClientOrigin& origin, uint64_t quota, uint64_t currentSize, uint64_t spaceRequired, CompletionHandler<void(Optional<uint64_t> quota)>&& completionHandler)
+void NetworkProcessProxy::requestStorageSpace(PAL::SessionID sessionID, const WebCore::ClientOrigin& origin, uint64_t quota, uint64_t currentSize, uint64_t spaceRequired, CompletionHandler<void(Optional<uint64_t> quota)>&& completionHandler)
 {
     auto* store = websiteDataStoreFromSessionID(sessionID);
 
@@ -1168,7 +1168,7 @@ void NetworkProcessProxy::requestCacheStorageSpace(PAL::SessionID sessionID, con
         return;
     }
 
-    store->client().requestCacheStorageSpace(origin.topOrigin, origin.clientOrigin, quota, currentSize, spaceRequired, WTFMove(completionHandler));
+    store->client().requestStorageSpace(origin.topOrigin, origin.clientOrigin, quota, currentSize, spaceRequired, WTFMove(completionHandler));
 }
 
 } // namespace WebKit
index e315408..0cfa1f0 100644 (file)
@@ -226,7 +226,7 @@ private:
     void establishWorkerContextConnectionToNetworkProcessForExplicitSession(WebCore::SecurityOriginData&&, PAL::SessionID);
 #endif
 
-    void requestCacheStorageSpace(PAL::SessionID, const WebCore::ClientOrigin&, uint64_t quota, uint64_t currentSize, uint64_t spaceRequired, CompletionHandler<void(Optional<uint64_t> quota)>&&);
+    void requestStorageSpace(PAL::SessionID, const WebCore::ClientOrigin&, uint64_t quota, uint64_t currentSize, uint64_t spaceRequired, CompletionHandler<void(Optional<uint64_t> quota)>&&);
 
     WebsiteDataStore* websiteDataStoreFromSessionID(PAL::SessionID);
 
index 4f768f1..499ac87 100644 (file)
@@ -64,5 +64,5 @@ messages -> NetworkProcessProxy LegacyReceiver {
     EstablishWorkerContextConnectionToNetworkProcessForExplicitSession(struct WebCore::SecurityOriginData origin, PAL::SessionID explicitSession)
 #endif
 
-    RequestCacheStorageSpace(PAL::SessionID sessionID, struct WebCore::ClientOrigin origin, uint64_t quota, uint64_t currentSize, uint64_t spaceRequired) -> (Optional<uint64_t> newQuota) Async
+    RequestStorageSpace(PAL::SessionID sessionID, struct WebCore::ClientOrigin origin, uint64_t quota, uint64_t currentSize, uint64_t spaceRequired) -> (Optional<uint64_t> newQuota) Async
 }
index 90ea7d3..e9fcf00 100644 (file)
@@ -37,7 +37,7 @@ class WebsiteDataStoreClient {
 public:
     virtual ~WebsiteDataStoreClient() { }
 
-    virtual void requestCacheStorageSpace(const WebCore::SecurityOriginData& topOrigin, const WebCore::SecurityOriginData& frameOrigin, uint64_t quota, uint64_t currentSize, uint64_t spaceRequired, CompletionHandler<void(Optional<uint64_t>)>&& completionHandler)
+    virtual void requestStorageSpace(const WebCore::SecurityOriginData& topOrigin, const WebCore::SecurityOriginData& frameOrigin, uint64_t quota, uint64_t currentSize, uint64_t spaceRequired, CompletionHandler<void(Optional<uint64_t>)>&& completionHandler)
     {
         completionHandler({ });
     }
index 3a0e636..8bc12e9 100644 (file)
@@ -1,3 +1,14 @@
+2019-03-05  Youenn Fablet  <youenn@apple.com>
+
+        Rename requestCacheStorageSpace to requestStorageSpace
+        https://bugs.webkit.org/show_bug.cgi?id=195282
+
+        Reviewed by Chris Dumez.
+
+        * WebKitTestRunner/cocoa/TestWebsiteDataStoreDelegate.mm:
+        (-[TestWebsiteDataStoreDelegate requestStorageSpace:frameOrigin:quota:currentSize:spaceRequired:decisionHandler:]):
+        (-[TestWebsiteDataStoreDelegate requestCacheStorageSpace:frameOrigin:quota:currentSize:spaceRequired:decisionHandler:]): Deleted.
+
 2019-03-05  Brady Eidson  <beidson@apple.com>
 
         Correctly handle sandbox extensions when the same WKWebView loads multiple file:// URLs.
index cf3b537..ac8bb31 100644 (file)
@@ -33,7 +33,7 @@
     return self;
 }
 
-- (void)requestCacheStorageSpace:(NSURL *)mainFrameURL frameOrigin:(NSURL *)frameURL quota:(NSUInteger)quota currentSize:(NSUInteger)currentSize spaceRequired:(NSUInteger)spaceRequired decisionHandler:(void (^)(unsigned long long quota))decisionHandler
+- (void)requestStorageSpace:(NSURL *)mainFrameURL frameOrigin:(NSURL *)frameURL quota:(NSUInteger)quota currentSize:(NSUInteger)currentSize spaceRequired:(NSUInteger)spaceRequired decisionHandler:(void (^)(unsigned long long quota))decisionHandler
 {
     decisionHandler(_shouldAllowRaisingQuota ? 2 * quota : quota);
 }