WebKit Bugzilla
Attachment 359497 Details for
Bug 193323
: Add a new SPI to request for cache storage quota increase
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch for landing
bug-193323-20190118090407.patch (text/plain), 39.38 KB, created by
youenn fablet
on 2019-01-18 09:04:10 PST
(
hide
)
Description:
Patch for landing
Filename:
MIME Type:
Creator:
youenn fablet
Created:
2019-01-18 09:04:10 PST
Size:
39.38 KB
patch
obsolete
>Subversion Revision: 240112 >diff --git a/Source/WebKit/ChangeLog b/Source/WebKit/ChangeLog >index e492f8af27f8e1849826495a30f68393b87ff200..22a7f10675b7642356d3a0b6a6658d88fd4d8f01 100644 >--- a/Source/WebKit/ChangeLog >+++ b/Source/WebKit/ChangeLog >@@ -1,3 +1,35 @@ >+2019-01-17 Youenn Fablet <youenn@apple.com> >+ >+ Add a new SPI to request for cache storage quota increase >+ https://bugs.webkit.org/show_bug.cgi?id=193323 >+ >+ Reviewed by Alex Christensen. >+ >+ Add a delegate on the WebSiteDataStore for WebKit to ask for quota update. >+ The current SPI is currently CacheStorage specific but future work should >+ make it so that other storage like IDB use the same mechanism. >+ By default, quota remains unchanged if delegate is not implemented. >+ >+ * NetworkProcess/NetworkProcess.cpp: >+ * UIProcess/API/Cocoa/WKStorageQuotaDelegatePrivate.h: Added. >+ * UIProcess/API/Cocoa/WKWebsiteDataStore.mm: >+ (WebsiteDataStoreQuotaManager::WebsiteDataStoreQuotaManager): >+ (-[WKWebsiteDataStore _quotaDelegate]): >+ (-[WKWebsiteDataStore set_quotaDelegate:]): >+ * UIProcess/API/Cocoa/WKWebsiteDataStoreInternal.h: >+ * UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h: >+ * UIProcess/Network/NetworkProcessProxy.cpp: >+ (WebKit::NetworkProcessProxy::requestCacheStorageSpace): >+ * UIProcess/WebsiteData/WebsiteDataStore.cpp: >+ (WebKit::WebsiteDataStore::WebsiteDataStore): >+ * UIProcess/WebsiteData/WebsiteDataStore.h: >+ (WebKit::WebsiteDataStore::quotaManager): >+ (WebKit::WebsiteDataStore::setQuotaManager): >+ * UIProcess/WebsiteData/WebsiteDataStoreQuotaManager.h: Added. >+ (WebKit::WebsiteDataStoreQuotaManager::~WebsiteDataStoreQuotaManager): >+ (WebKit::WebsiteDataStoreQuotaManager::requestCacheStorageSpace): >+ * WebKit.xcodeproj/project.pbxproj: >+ > 2019-01-16 Youenn Fablet <youenn@apple.com> > > Add a new SPI for controlling getUserMedia >diff --git a/Source/WebKit/UIProcess/API/Cocoa/WKWebsiteDataStore.mm b/Source/WebKit/UIProcess/API/Cocoa/WKWebsiteDataStore.mm >index 2d160ea3b1288fe84dc1d8293c0a328381feb26a..e1093e4de5ab63107e65488dc6266013ef725b0a 100644 >--- a/Source/WebKit/UIProcess/API/Cocoa/WKWebsiteDataStore.mm >+++ b/Source/WebKit/UIProcess/API/Cocoa/WKWebsiteDataStore.mm >@@ -29,6 +29,7 @@ > #if WK_API_ENABLED > > #import "APIString.h" >+#import "CompletionHandlerCallChecker.h" > #import "WKHTTPCookieStoreInternal.h" > #import "WKNSArray.h" > #import "WKWebViewInternal.h" >@@ -38,9 +39,45 @@ > #import "WebResourceLoadStatisticsTelemetry.h" > #import "WebsiteDataFetchOption.h" > #import "_WKWebsiteDataStoreConfiguration.h" >+#import "_WKWebsiteDataStoreDelegate.h" > #import <WebKit/ServiceWorkerProcessProxy.h> > #import <wtf/BlockPtr.h> > #import <wtf/URL.h> >+#import <wtf/WeakObjCPtr.h> >+ >+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:)]) >+ { >+ } >+ >+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 >+ { >+ if (!m_hasRequestCacheStorageSpaceSelector || !m_delegate) { >+ completionHandler({ }); >+ return; >+ } >+ >+ auto checker = WebKit::CompletionHandlerCallChecker::create(m_delegate.getAutoreleased(), @selector(requestCacheStorageSpace: frameOrigin: quota: currentSize: spaceRequired: decisionHandler:)); >+ auto decisionHandler = makeBlockPtr([completionHandler = WTFMove(completionHandler), checker = WTFMove(checker)](unsigned long long quota) mutable { >+ if (checker->completionHandlerHasBeenCalled()) >+ return; >+ checker->didCallCompletionHandler(); >+ completionHandler(quota); >+ }); >+ >+ 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()]; >+ } >+ >+ WeakObjCPtr<id <_WKWebsiteDataStoreDelegate> > m_delegate; >+ bool m_hasRequestCacheStorageSpaceSelector { false }; >+}; > > @implementation WKWebsiteDataStore > >@@ -383,6 +420,17 @@ - (bool)_hasRegisteredServiceWorker > return WebKit::ServiceWorkerProcessProxy::hasRegisteredServiceWorkers(_websiteDataStore->websiteDataStore().serviceWorkerRegistrationDirectory()); > } > >+- (id <_WKWebsiteDataStoreDelegate>)_delegate >+{ >+ return _delegate.get(); >+} >+ >+- (void)set_delegate:(id <_WKWebsiteDataStoreDelegate>)delegate >+{ >+ _delegate = delegate; >+ _websiteDataStore->websiteDataStore().setClient(makeUniqueRef<WebsiteDataStoreClient>(delegate)); >+} >+ > @end > > #endif // WK_API_ENABLED >diff --git a/Source/WebKit/UIProcess/API/Cocoa/WKWebsiteDataStoreInternal.h b/Source/WebKit/UIProcess/API/Cocoa/WKWebsiteDataStoreInternal.h >index d861875273ba7df67e2866d1455b96b7f3dc47f6..2c5b78e159927debbf45456a123f2bf7fe57e637 100644 >--- a/Source/WebKit/UIProcess/API/Cocoa/WKWebsiteDataStoreInternal.h >+++ b/Source/WebKit/UIProcess/API/Cocoa/WKWebsiteDataStoreInternal.h >@@ -41,6 +41,7 @@ template<> struct WrapperTraits<API::WebsiteDataStore> { > @interface WKWebsiteDataStore () <WKObject> { > @package > API::ObjectStorage<API::WebsiteDataStore> _websiteDataStore; >+ RetainPtr<id <_WKWebsiteDataStoreDelegate> > _delegate; > } > @end > >diff --git a/Source/WebKit/UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h b/Source/WebKit/UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h >index 74a8a02f2f1d9ee95c97af9a96e3c60131920161..fed2425dbb5a89e24ded55d76c561d7c001d0ab2 100644 >--- a/Source/WebKit/UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h >+++ b/Source/WebKit/UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h >@@ -32,6 +32,8 @@ NS_ASSUME_NONNULL_BEGIN > @class _WKWebsiteDataStoreConfiguration; > @class WKWebView; > >+@protocol _WKWebsiteDataStoreDelegate; >+ > typedef NS_OPTIONS(NSUInteger, _WKWebsiteDataStoreFetchOptions) { > _WKWebsiteDataStoreFetchOptionComputeSizes = 1 << 0, > } WK_API_AVAILABLE(macosx(10.12), ios(10.0)); >@@ -62,6 +64,8 @@ typedef NS_OPTIONS(NSUInteger, _WKWebsiteDataStoreFetchOptions) { > + (void)_allowWebsiteDataRecordsForAllOrigins WK_API_AVAILABLE(macosx(10.13.4), ios(11.3)); > - (bool)_hasRegisteredServiceWorker WK_API_AVAILABLE(macosx(10.14), ios(12.0)); > >+@property (nullable, nonatomic, weak) id <_WKWebsiteDataStoreDelegate> _delegate WK_API_AVAILABLE(macosx(WK_MAC_TBA), ios(WK_IOS_TBA)); >+ > @end > > NS_ASSUME_NONNULL_END >diff --git a/Source/WebKit/UIProcess/API/Cocoa/_WKWebsiteDataStoreDelegate.h b/Source/WebKit/UIProcess/API/Cocoa/_WKWebsiteDataStoreDelegate.h >new file mode 100644 >index 0000000000000000000000000000000000000000..66ebad47efeae7b6295c0d6d346d0add7a42551f >--- /dev/null >+++ b/Source/WebKit/UIProcess/API/Cocoa/_WKWebsiteDataStoreDelegate.h >@@ -0,0 +1,41 @@ >+/* >+ * Copyright (C) 2019 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 <WebKit/WKFoundation.h> >+ >+#if WK_API_ENABLED >+ >+#import <Foundation/Foundation.h> >+ >+WK_API_AVAILABLE(macosx(WK_MAC_TBA), ios(WK_IOS_TBA)) >+@protocol _WKWebsiteDataStoreDelegate <NSObject> >+ >+@optional >+ >+- (void)requestCacheStorageSpace:(NSURL *)mainFrameURL frameOrigin:(NSURL *)frameURL quota:(NSUInteger)quota currentSize:(NSUInteger)currentSize spaceRequired:(NSUInteger)spaceRequired decisionHandler:(void (^)(unsigned long long quota))decisionHandler; >+ >+@end >+ >+#endif >diff --git a/Source/WebKit/UIProcess/Network/NetworkProcessProxy.cpp b/Source/WebKit/UIProcess/Network/NetworkProcessProxy.cpp >index 600c0bc39aec39269a8dfed9f5aece90e34224b9..560d6ee08448e3bd6d94d04970541760cd4e49e7 100644 >--- a/Source/WebKit/UIProcess/Network/NetworkProcessProxy.cpp >+++ b/Source/WebKit/UIProcess/Network/NetworkProcessProxy.cpp >@@ -43,6 +43,8 @@ > #include "WebProcessPool.h" > #include "WebUserContentControllerProxy.h" > #include "WebsiteData.h" >+#include "WebsiteDataStoreClient.h" >+#include <WebCore/ClientOrigin.h> > #include <wtf/CompletionHandler.h> > > #if ENABLE(SEC_ITEM_SHIM) >@@ -743,8 +745,7 @@ void NetworkProcessProxy::requestCacheStorageSpace(PAL::SessionID sessionID, con > return; > } > >- // FIXME: Ask WebsiteDataStore about updating the quota for this origin. >- completionHandler(quota); >+ store->client().requestCacheStorageSpace(origin.topOrigin, origin.clientOrigin, quota, currentSize, spaceRequired, WTFMove(completionHandler)); > } > > } // namespace WebKit >diff --git a/Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.cpp b/Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.cpp >index 0aabbe48db135d86bf284b05542143a17bd8e9a0..f75851b1c6ae82cec9a8c9530aeb2b94c2ba47fd 100644 >--- a/Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.cpp >+++ b/Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.cpp >@@ -40,6 +40,7 @@ > #include "WebResourceLoadStatisticsStore.h" > #include "WebResourceLoadStatisticsStoreMessages.h" > #include "WebsiteData.h" >+#include "WebsiteDataStoreClient.h" > #include "WebsiteDataStoreParameters.h" > #include <WebCore/ApplicationCacheStorage.h> > #include <WebCore/DatabaseTracker.h> >@@ -97,6 +98,7 @@ WebsiteDataStore::WebsiteDataStore(Ref<WebsiteDataStoreConfiguration>&& configur > #if ENABLE(WEB_AUTHN) > , m_authenticatorManager(makeUniqueRef<AuthenticatorManager>()) > #endif >+ , m_client(makeUniqueRef<WebsiteDataStoreClient>()) > { > WTF::setProcessPrivileges(allPrivileges()); > maybeRegisterWithSessionIDMap(); >@@ -114,6 +116,7 @@ WebsiteDataStore::WebsiteDataStore(PAL::SessionID sessionID) > #if ENABLE(WEB_AUTHN) > , m_authenticatorManager(makeUniqueRef<AuthenticatorManager>()) > #endif >+ , m_client(makeUniqueRef<WebsiteDataStoreClient>()) > { > maybeRegisterWithSessionIDMap(); > platformInitialize(); >diff --git a/Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.h b/Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.h >index 912d8e475cd6a217999a090178eb658fc2179c69..fa34013a63eddd735627b70dbc35ad2145a23b98 100644 >--- a/Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.h >+++ b/Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.h >@@ -27,6 +27,7 @@ > > #include "NetworkSessionCreationParameters.h" > #include "WebProcessLifetimeObserver.h" >+#include "WebsiteDataStoreClient.h" > #include "WebsiteDataStoreConfiguration.h" > #include <WebCore/Cookie.h> > #include <WebCore/SecurityOriginData.h> >@@ -188,6 +189,9 @@ public: > > const WebsiteDataStoreConfiguration& configuration() { return m_configuration.get(); } > >+ WebsiteDataStoreClient& client() { return m_client.get(); } >+ void setClient(UniqueRef<WebsiteDataStoreClient>&& client) { m_client = WTFMove(client); } >+ > private: > explicit WebsiteDataStore(PAL::SessionID); > explicit WebsiteDataStore(Ref<WebsiteDataStoreConfiguration>&&, PAL::SessionID); >@@ -256,6 +260,8 @@ private: > #if ENABLE(WEB_AUTHN) > UniqueRef<AuthenticatorManager> m_authenticatorManager; > #endif >+ >+ UniqueRef<WebsiteDataStoreClient> m_client; > }; > > } >diff --git a/Source/WebKit/UIProcess/WebsiteData/WebsiteDataStoreClient.h b/Source/WebKit/UIProcess/WebsiteData/WebsiteDataStoreClient.h >new file mode 100644 >index 0000000000000000000000000000000000000000..90ea7d3c178e2772e16094a8d862c3208ed1f636 >--- /dev/null >+++ b/Source/WebKit/UIProcess/WebsiteData/WebsiteDataStoreClient.h >@@ -0,0 +1,46 @@ >+/* >+ * Copyright (C) 2019 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. >+ */ >+ >+#pragma once >+ >+#include <wtf/CompletionHandler.h> >+ >+namespace WebCore { >+struct SecurityOriginData; >+} >+ >+namespace WebKit { >+ >+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) >+ { >+ completionHandler({ }); >+ } >+}; >+ >+} // namespace WebKit >diff --git a/Source/WebKit/WebKit.xcodeproj/project.pbxproj b/Source/WebKit/WebKit.xcodeproj/project.pbxproj >index 97141e837c52bcde0d5429371319f98b871c53df..b9eb0475e2df700f91513cafd2682b236fb0aef9 100644 >--- a/Source/WebKit/WebKit.xcodeproj/project.pbxproj >+++ b/Source/WebKit/WebKit.xcodeproj/project.pbxproj >@@ -876,6 +876,7 @@ > 41897ED11F415D680016FA42 /* WebCacheStorageConnection.h in Headers */ = {isa = PBXBuildFile; fileRef = 41897ECD1F415D5C0016FA42 /* WebCacheStorageConnection.h */; }; > 41897ED81F415D8A0016FA42 /* CacheStorageEngine.h in Headers */ = {isa = PBXBuildFile; fileRef = 41897ED21F415D850016FA42 /* CacheStorageEngine.h */; }; > 41897EDA1F415D8A0016FA42 /* CacheStorageEngineConnection.h in Headers */ = {isa = PBXBuildFile; fileRef = 41897ED41F415D850016FA42 /* CacheStorageEngineConnection.h */; }; >+ 41C5379021F15B55008B1FAD /* _WKWebsiteDataStoreDelegate.h in Headers */ = {isa = PBXBuildFile; fileRef = 41C5378F21F1362D008B1FAD /* _WKWebsiteDataStoreDelegate.h */; settings = {ATTRIBUTES = (Private, ); }; }; > 41D129DA1F3D101800D15E47 /* WebCacheStorageProvider.h in Headers */ = {isa = PBXBuildFile; fileRef = 41D129D91F3D101400D15E47 /* WebCacheStorageProvider.h */; }; > 41DC45961E3D6E2200B11F51 /* NetworkRTCProvider.h in Headers */ = {isa = PBXBuildFile; fileRef = 41DC45941E3D6E1E00B11F51 /* NetworkRTCProvider.h */; }; > 41DC459C1E3DBB2800B11F51 /* LibWebRTCSocketClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 41DC459A1E3DBB2400B11F51 /* LibWebRTCSocketClient.h */; }; >@@ -2989,6 +2990,7 @@ > 4112EDD720E4077500BEA92A /* com.apple.NPSafeSubmit.sb */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = com.apple.NPSafeSubmit.sb; sourceTree = "<group>"; }; > 4112EDD820E4077500BEA92A /* com.apple.NPSafeInput.sb */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = com.apple.NPSafeInput.sb; sourceTree = "<group>"; }; > 4112EDD920E4077500BEA92A /* com.apple.BocomSubmitCtrl.sb */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = com.apple.BocomSubmitCtrl.sb; sourceTree = "<group>"; }; >+ 4118DC1B21E6D11A00DE04C7 /* WebsiteDataStoreClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebsiteDataStoreClient.h; sourceTree = "<group>"; }; > 411A8DD920DDB6050060D34F /* WKMockMediaDevice.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKMockMediaDevice.h; sourceTree = "<group>"; }; > 411A8DDA20DDB6050060D34F /* WKMockMediaDevice.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WKMockMediaDevice.cpp; sourceTree = "<group>"; }; > 411B22621E371244004F7363 /* LibWebRTCNetwork.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = LibWebRTCNetwork.h; path = Network/webrtc/LibWebRTCNetwork.h; sourceTree = "<group>"; }; >@@ -3044,6 +3046,7 @@ > 41B7ED6F206965900087D853 /* NetworkMDNSRegister.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = NetworkMDNSRegister.cpp; sourceTree = "<group>"; }; > 41B7ED70206965900087D853 /* NetworkMDNSRegister.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NetworkMDNSRegister.h; sourceTree = "<group>"; }; > 41B7ED71206965900087D853 /* NetworkMDNSRegister.messages.in */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = NetworkMDNSRegister.messages.in; sourceTree = "<group>"; }; >+ 41C5378F21F1362D008B1FAD /* _WKWebsiteDataStoreDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = _WKWebsiteDataStoreDelegate.h; sourceTree = "<group>"; }; > 41C858191F510DEE0065E085 /* CacheStorageEngineCache.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CacheStorageEngineCache.cpp; sourceTree = "<group>"; }; > 41D0FC7D20E43A5100076AE8 /* Network-OSX-sandbox.entitlements */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.entitlements; path = "Network-OSX-sandbox.entitlements"; sourceTree = "<group>"; }; > 41D129D91F3D101400D15E47 /* WebCacheStorageProvider.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = WebCacheStorageProvider.h; sourceTree = "<group>"; }; >@@ -4844,7 +4847,7 @@ > 1A53C2A51A32569F004E8C70 /* WebsiteDataStore.h */, > 5C46C0AC21B7198B00BC5991 /* WebsiteDataStoreConfiguration.cpp */, > 5C46C0AD21B7198C00BC5991 /* WebsiteDataStoreConfiguration.h */, >- 4118DC1B21E6D11A00DE04C7 /* WebsiteDataStoreQuotaManager.h */, >+ 4118DC1B21E6D11A00DE04C7 /* WebsiteDataStoreClient.h */, > ); > path = WebsiteData; > sourceTree = "<group>"; >@@ -6053,6 +6056,7 @@ > 5120C8331E5B71570025B250 /* _WKWebsiteDataStoreConfiguration.h */, > 5120C8341E5B71570025B250 /* _WKWebsiteDataStoreConfiguration.mm */, > 5C46C0AE21B71AE200BC5991 /* _WKWebsiteDataStoreConfigurationInternal.h */, >+ 41C5378F21F1362D008B1FAD /* _WKWebsiteDataStoreDelegate.h */, > 5CB237891DF0DD4300117AA3 /* _WKWebsitePolicies.h */, > 5CB2378A1DF0DD4300117AA3 /* _WKWebsitePolicies.mm */, > 5CB2378D1DF0E0C200117AA3 /* _WKWebsitePoliciesInternal.h */, >@@ -8923,6 +8927,7 @@ > 7CB365B11D31DD1E007158CA /* APIUserInitiatedAction.h in Headers */, > 7C89D2941A67122F003A5FDE /* APIUserScript.h in Headers */, > 2D8786241BDB58FF00D02ABB /* APIUserStyleSheet.h in Headers */, >+ 41C5379021F15B55008B1FAD /* _WKWebsiteDataStoreDelegate.h in Headers */, > C5E1AFED16B21017006CC1F2 /* APIWebArchive.h in Headers */, > C5E1AFEF16B21029006CC1F2 /* APIWebArchiveResource.h in Headers */, > 1AE286841C7F93860069AC4F /* APIWebsiteDataRecord.h in Headers */, >@@ -9830,7 +9835,6 @@ > 1DB01943211CF002009FB3E8 /* WKShareSheet.h in Headers */, > 513E462D1AD837560016234A /* WKSharingServicePickerDelegate.h in Headers */, > 93F549B41E3174B7000E7239 /* WKSnapshotConfiguration.h in Headers */, >- 4118DC1F21E7BF5D00DE04C7 /* WKStorageQuotaDelegatePrivate.h in Headers */, > BC407606124FF0270068F20A /* WKString.h in Headers */, > BC40761A124FF0370068F20A /* WKStringCF.h in Headers */, > BC9099801256A98200083756 /* WKStringPrivate.h in Headers */, >diff --git a/Tools/ChangeLog b/Tools/ChangeLog >index abbe4c1dc148c60b967d182f84d36a791a88bd91..997e33b8cea054a16cba1e106d23cdf6ebd6feb4 100644 >--- a/Tools/ChangeLog >+++ b/Tools/ChangeLog >@@ -1,3 +1,30 @@ >+2019-01-17 Youenn Fablet <youenn@apple.com> >+ >+ Add a new SPI to request for cache storage quota increase >+ https://bugs.webkit.org/show_bug.cgi?id=193323 >+ >+ Reviewed by Alex Christensen. >+ >+ Implement WebsiteDataStore quota delegate to handle quota requests. >+ By default, do not update quota. >+ Update quota if test calls the new testRunner.allowCacheStorageQuotaIncrease method. >+ >+ * WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl: >+ * WebKitTestRunner/InjectedBundle/TestRunner.cpp: >+ (WTR::TestRunner::allowCacheStorageQuotaIncrease): >+ * WebKitTestRunner/InjectedBundle/TestRunner.h: >+ * WebKitTestRunner/TestController.cpp: >+ (WTR::TestController::allowCacheStorageQuotaIncrease): >+ * WebKitTestRunner/TestController.h: >+ * WebKitTestRunner/TestInvocation.cpp: >+ (WTR::TestInvocation::didReceiveSynchronousMessageFromInjectedBundle): >+ * WebKitTestRunner/cocoa/TestControllerCocoa.mm: >+ (-[CacheStorageQuotaManager init]): >+ (-[CacheStorageQuotaManager _requestCacheStorageSpace:frameOrigin:quota:currentSize:spaceRequired:decisionHandler:]): >+ (WTR::initializeWebViewConfiguration): >+ (WTR::TestController::cocoaResetStateToConsistentValues): >+ (WTR::TestController::allowCacheStorageQuotaIncrease): >+ > 2019-01-17 Zalan Bujtas <zalan@apple.com> > > [LFC][BFC] An element with transform is a containing block for positioned descendants. >diff --git a/Tools/WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl b/Tools/WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl >index 67fc93e91622bdd333185c7f6b208a39fee44516..f15550f530ed0f3d519478022695201e902cbab3 100644 >--- a/Tools/WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl >+++ b/Tools/WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl >@@ -62,6 +62,7 @@ interface TestRunner { > void clearDOMCache(DOMString origin); > boolean hasDOMCache(DOMString origin); > unsigned long domCacheSize(DOMString origin); >+ void allowCacheStorageQuotaIncrease(); > > // Special options. > void keepWebHistory(); >diff --git a/Tools/WebKitTestRunner/InjectedBundle/TestRunner.cpp b/Tools/WebKitTestRunner/InjectedBundle/TestRunner.cpp >index f97ae47b8d5fb2ead1be4f9597e1568f76df016a..d7a9d24829df8b74ad8bcd91ddd96094b2ce5850 100644 >--- a/Tools/WebKitTestRunner/InjectedBundle/TestRunner.cpp >+++ b/Tools/WebKitTestRunner/InjectedBundle/TestRunner.cpp >@@ -2367,6 +2367,12 @@ uint64_t TestRunner::domCacheSize(JSStringRef origin) > return WKUInt64GetValue(static_cast<WKUInt64Ref>(returnData)); > } > >+void TestRunner::allowCacheStorageQuotaIncrease() >+{ >+ WKRetainPtr<WKStringRef> messageName(AdoptWK, WKStringCreateWithUTF8CString("AllowCacheStorageQuotaIncrease")); >+ WKBundlePostSynchronousMessage(InjectedBundle::singleton().bundle(), messageName.get(), nullptr, nullptr); >+} >+ > void TestRunner::getApplicationManifestThen(JSValueRef callback) > { > cacheTestRunnerCallback(GetApplicationManifestCallbackID, callback); >diff --git a/Tools/WebKitTestRunner/InjectedBundle/TestRunner.h b/Tools/WebKitTestRunner/InjectedBundle/TestRunner.h >index 2214d77b8c3979a47c5e8edaa5d32712d14341d9..a401999f412e9bd3932ab81c84b7773d5df073f3 100644 >--- a/Tools/WebKitTestRunner/InjectedBundle/TestRunner.h >+++ b/Tools/WebKitTestRunner/InjectedBundle/TestRunner.h >@@ -175,6 +175,7 @@ public: > void clearDOMCaches(); > bool hasDOMCache(JSStringRef origin); > uint64_t domCacheSize(JSStringRef origin); >+ void allowCacheStorageQuotaIncrease(); > > // IndexedDB > void setIDBPerOriginQuota(uint64_t); >diff --git a/Tools/WebKitTestRunner/TestController.cpp b/Tools/WebKitTestRunner/TestController.cpp >index 7c88e0027f3d750be61567232a881adcdfb4dda8..7cb7f5cd9e85d57f634a70b4117f57f348558d77 100644 >--- a/Tools/WebKitTestRunner/TestController.cpp >+++ b/Tools/WebKitTestRunner/TestController.cpp >@@ -2830,6 +2830,13 @@ uint64_t TestController::domCacheSize(WKStringRef origin) > return context.result; > } > >+#if !PLATFORM(COCOA) >+void TestController::allowCacheStorageQuotaIncrease() >+{ >+ // FIXME: To implement. >+} >+#endif >+ > struct ResourceStatisticsCallbackContext { > explicit ResourceStatisticsCallbackContext(TestController& controller) > : testController(controller) >diff --git a/Tools/WebKitTestRunner/TestController.h b/Tools/WebKitTestRunner/TestController.h >index 13a39c6905f0d87ba87b9db57f8dad5c17ac71bc..1425cbfd51a7604ae10c57944557aa06a20eac80 100644 >--- a/Tools/WebKitTestRunner/TestController.h >+++ b/Tools/WebKitTestRunner/TestController.h >@@ -248,6 +248,7 @@ public: > void clearDOMCaches(); > bool hasDOMCache(WKStringRef origin); > uint64_t domCacheSize(WKStringRef origin); >+ void allowCacheStorageQuotaIncrease(); > > void setIDBPerOriginQuota(uint64_t); > >diff --git a/Tools/WebKitTestRunner/TestInvocation.cpp b/Tools/WebKitTestRunner/TestInvocation.cpp >index 0c6c877ff1dab755ade28e9e234f44e55fd94c27..1d8d7d9be055b48662ad30e33707f027aeec5eb5 100644 >--- a/Tools/WebKitTestRunner/TestInvocation.cpp >+++ b/Tools/WebKitTestRunner/TestInvocation.cpp >@@ -1428,6 +1428,11 @@ WKRetainPtr<WKTypeRef> TestInvocation::didReceiveSynchronousMessageFromInjectedB > return result; > } > >+ if (WKStringIsEqualToUTF8CString(messageName, "AllowCacheStorageQuotaIncrease")) { >+ TestController::singleton().allowCacheStorageQuotaIncrease(); >+ return nullptr; >+ } >+ > if (WKStringIsEqualToUTF8CString(messageName, "SetIDBPerOriginQuota")) { > ASSERT(WKGetTypeID(messageBody) == WKUInt64GetTypeID()); > WKUInt64Ref quota = static_cast<WKUInt64Ref>(messageBody); >diff --git a/Tools/WebKitTestRunner/WebKitTestRunner.xcodeproj/project.pbxproj b/Tools/WebKitTestRunner/WebKitTestRunner.xcodeproj/project.pbxproj >index a5b556bebe1181c9ff31271c2f033e33a65b4e73..c0961653e5de4cac8bbb2997c8298e3a57599bf9 100644 >--- a/Tools/WebKitTestRunner/WebKitTestRunner.xcodeproj/project.pbxproj >+++ b/Tools/WebKitTestRunner/WebKitTestRunner.xcodeproj/project.pbxproj >@@ -84,6 +84,7 @@ > 2E63EDA61891BDC0002A7AFC /* TestRunner.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCC9981711D3F51E0017BCA2 /* TestRunner.cpp */; }; > 2E749BF21891EBFA007FC175 /* EventSenderProxyIOS.mm in Sources */ = {isa = PBXBuildFile; fileRef = 2E63ED7A1891ACE9002A7AFC /* EventSenderProxyIOS.mm */; }; > 31DA8A3D1E7205CC00E1DF2F /* IOSLayoutTestCommunication.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3148A0531E6F85B600D3B316 /* IOSLayoutTestCommunication.cpp */; }; >+ 41C5378E21F13414008B1FAD /* TestWebsiteDataStoreDelegate.mm in Sources */ = {isa = PBXBuildFile; fileRef = 41C5378D21F1333C008B1FAD /* TestWebsiteDataStoreDelegate.mm */; }; > 4430AE191F82C4FD0099915A /* GeneratedTouchesDebugWindow.mm in Sources */ = {isa = PBXBuildFile; fileRef = 4430AE171F82C4EE0099915A /* GeneratedTouchesDebugWindow.mm */; }; > 51058AD51D678820009A538C /* libWebCoreTestSupport.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 41230E16138C78BF00BCCFCA /* libWebCoreTestSupport.dylib */; }; > 51058AD61D678825009A538C /* WebKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0F5169CA1445222D00E0A9D7 /* WebKit.framework */; }; >@@ -286,6 +287,8 @@ > 378D442213346D00006A777B /* config.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = config.h; sourceTree = "<group>"; }; > 41230E16138C78BF00BCCFCA /* libWebCoreTestSupport.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; path = libWebCoreTestSupport.dylib; sourceTree = BUILT_PRODUCTS_DIR; }; > 4181731B138AD39D0057AAA4 /* WebCoreTestSupport.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = WebCoreTestSupport.h; path = WebCoreTestSupport/WebCoreTestSupport.h; sourceTree = BUILT_PRODUCTS_DIR; }; >+ 41C5378C21F1333C008B1FAD /* TestWebsiteDataStoreDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = TestWebsiteDataStoreDelegate.h; path = cocoa/TestWebsiteDataStoreDelegate.h; sourceTree = "<group>"; }; >+ 41C5378D21F1333C008B1FAD /* TestWebsiteDataStoreDelegate.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = TestWebsiteDataStoreDelegate.mm; path = cocoa/TestWebsiteDataStoreDelegate.mm; sourceTree = "<group>"; }; > 4429FC5E1627089600F66D8B /* WorkQueueManager.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WorkQueueManager.cpp; sourceTree = "<group>"; }; > 4429FC611627089600F66D8B /* WorkQueueManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WorkQueueManager.h; sourceTree = "<group>"; }; > 4430AE171F82C4EE0099915A /* GeneratedTouchesDebugWindow.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = GeneratedTouchesDebugWindow.mm; sourceTree = "<group>"; }; >@@ -564,6 +567,8 @@ > 2DCE2CD11B84524500C7F832 /* TestControllerCocoa.mm */, > 0F87B6141BACC4B9004EC572 /* TestRunnerWKWebView.h */, > 0F87B6151BACC4B9004EC572 /* TestRunnerWKWebView.mm */, >+ 41C5378C21F1333C008B1FAD /* TestWebsiteDataStoreDelegate.h */, >+ 41C5378D21F1333C008B1FAD /* TestWebsiteDataStoreDelegate.mm */, > F46240AF2170128300917B16 /* UIScriptControllerCocoa.mm */, > ); > name = cocoa; >@@ -1091,6 +1096,7 @@ > A185103D1B9AE10600744AEB /* TestInvocationCG.cpp in Sources */, > 0F622CE91BBB3A1A00838AD3 /* TestOptions.cpp in Sources */, > 0F87B6171BACC4C0004EC572 /* TestRunnerWKWebView.mm in Sources */, >+ 41C5378E21F13414008B1FAD /* TestWebsiteDataStoreDelegate.mm in Sources */, > 0F18E6E51D6B9B9E0027E547 /* UIScriptContext.cpp in Sources */, > 0F18E6E61D6B9BA20027E547 /* UIScriptController.cpp in Sources */, > F46240B1217013E500917B16 /* UIScriptControllerCocoa.mm in Sources */, >diff --git a/Tools/WebKitTestRunner/cocoa/TestControllerCocoa.mm b/Tools/WebKitTestRunner/cocoa/TestControllerCocoa.mm >index 2c1f6a63c9e49e7cce81dacb60dda2f8f5b18a83..363a2c6e114d57d8baf1781df61a1364c520c209 100644 >--- a/Tools/WebKitTestRunner/cocoa/TestControllerCocoa.mm >+++ b/Tools/WebKitTestRunner/cocoa/TestControllerCocoa.mm >@@ -31,6 +31,7 @@ > #import "StringFunctions.h" > #import "TestInvocation.h" > #import "TestRunnerWKWebView.h" >+#import "TestWebsiteDataStoreDelegate.h" > #import <Foundation/Foundation.h> > #import <Security/SecItem.h> > #import <WebKit/WKContextConfigurationRef.h> >@@ -55,6 +56,10 @@ namespace WTR { > > static WKWebViewConfiguration *globalWebViewConfiguration; > >+#if WK_API_ENABLED >+static TestWebsiteDataStoreDelegate *globalWebsiteDataStoreDelegateClient; >+#endif >+ > void initializeWebViewConfiguration(const char* libraryPath, WKStringRef injectedBundlePath, WKContextRef context, WKContextConfigurationRef contextConfiguration) > { > #if WK_API_ENABLED >@@ -80,6 +85,12 @@ void initializeWebViewConfiguration(const char* libraryPath, WKStringRef injecte > [globalWebViewConfiguration.websiteDataStore _setResourceLoadStatisticsEnabled:YES]; > [globalWebViewConfiguration.websiteDataStore _resourceLoadStatisticsSetShouldSubmitTelemetry:NO]; > >+#if WK_API_ENABLED >+ [globalWebsiteDataStoreDelegateClient release]; >+ globalWebsiteDataStoreDelegateClient = [[TestWebsiteDataStoreDelegate alloc] init]; >+ [globalWebViewConfiguration.websiteDataStore set_delegate:globalWebsiteDataStoreDelegateClient]; >+#endif >+ > #if PLATFORM(IOS_FAMILY) > globalWebViewConfiguration.allowsInlineMediaPlayback = YES; > globalWebViewConfiguration._inlineMediaPlaybackRequiresPlaysInlineAttribute = NO; >@@ -252,6 +263,8 @@ void TestController::cocoaResetStateToConsistentValues(const TestOptions& option > if (options.shouldShowSpellCheckingDots) > [platformView toggleContinuousSpellChecking:nil]; > } >+ >+ [globalWebsiteDataStoreDelegateClient setAllowRaisingQuota: false]; > #endif > } > >@@ -385,4 +398,11 @@ bool TestController::keyExistsInKeychain(const String& attrLabel, const String& > return false; > } > >+void TestController::allowCacheStorageQuotaIncrease() >+{ >+#if WK_API_ENABLED >+ [globalWebsiteDataStoreDelegateClient setAllowRaisingQuota: true]; >+#endif >+} >+ > } // namespace WTR >diff --git a/Tools/WebKitTestRunner/cocoa/TestWebsiteDataStoreDelegate.h b/Tools/WebKitTestRunner/cocoa/TestWebsiteDataStoreDelegate.h >new file mode 100644 >index 0000000000000000000000000000000000000000..e4fa81e13690b1504d16c21a5e5f129e45256cb8 >--- /dev/null >+++ b/Tools/WebKitTestRunner/cocoa/TestWebsiteDataStoreDelegate.h >@@ -0,0 +1,40 @@ >+/* >+ * Copyright (C) 2019 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. >+ */ >+ >+#pragma once >+ >+#include <WebKit/_WKWebsiteDataStoreDelegate.h> >+ >+#if WK_API_ENABLED >+ >+@interface TestWebsiteDataStoreDelegate: NSObject <_WKWebsiteDataStoreDelegate> { >+@private >+ BOOL _shouldAllowRaisingQuota; >+} >+- (instancetype)init; >+- (void)setAllowRaisingQuota:(BOOL)shouldAllowRaisingQuota; >+@end >+ >+#endif >diff --git a/Tools/WebKitTestRunner/cocoa/TestWebsiteDataStoreDelegate.mm b/Tools/WebKitTestRunner/cocoa/TestWebsiteDataStoreDelegate.mm >new file mode 100644 >index 0000000000000000000000000000000000000000..a455b773b8ea489c37ddf3860150a09be5c08559 >--- /dev/null >+++ b/Tools/WebKitTestRunner/cocoa/TestWebsiteDataStoreDelegate.mm >@@ -0,0 +1,49 @@ >+/* >+ * Copyright (C) 2019 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. >+ */ >+ >+#import "config.h" >+#import "TestWebsiteDataStoreDelegate.h" >+ >+#if WK_API_ENABLED >+ >+@implementation TestWebsiteDataStoreDelegate { } >+- (instancetype)init >+{ >+ _shouldAllowRaisingQuota = false; >+ 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 >+{ >+ decisionHandler(_shouldAllowRaisingQuota ? 2 * quota : quota); >+} >+ >+- (void)setAllowRaisingQuota:(BOOL)shouldAllowRaisingQuota >+{ >+ _shouldAllowRaisingQuota = shouldAllowRaisingQuota; >+} >+@end >+ >+#endif >diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog >index e856254f6b5005505f8a1dd3c3c961e87901d7c1..9b2078e8f1ab7d33297b5cf4d6dff762deb417ee 100644 >--- a/LayoutTests/ChangeLog >+++ b/LayoutTests/ChangeLog >@@ -1,3 +1,16 @@ >+2019-01-17 Youenn Fablet <youenn@apple.com> >+ >+ Add a new SPI to request for cache storage quota increase >+ https://bugs.webkit.org/show_bug.cgi?id=193323 >+ >+ Reviewed by Alex Christensen. >+ >+ Use new testRunner method to bump the cache quota and verify adding a >+ cache entry works when bumping the cache quota. >+ >+ * http/wpt/cache-storage/cache-quota.any.js: >+ (promise_test): >+ > 2019-01-16 Alicia Boya GarcÃa <aboya@igalia.com> > > Unreviewed GTK and WPE test gardening. >diff --git a/LayoutTests/http/wpt/cache-storage/cache-quota.any.js b/LayoutTests/http/wpt/cache-storage/cache-quota.any.js >index 5a94d5b78f3b639ca70dcbf13ff288a5db2e2393..f79d32850cc5337da3e7769ffe5a0a2b22c6401a 100644 >--- a/LayoutTests/http/wpt/cache-storage/cache-quota.any.js >+++ b/LayoutTests/http/wpt/cache-storage/cache-quota.any.js >@@ -114,7 +114,7 @@ promise_test((test) => { > return cache.put("1ko-v2", response1ko.clone()).then(assert_unreached, (e) => { > assert_equals(e.name, "QuotaExceededError"); > }); >- }).then(() => { >+ }).then(() => { > return cache.delete("1ko-v1"); > }).then(() => { > return cache.put("1ko-v2", response1ko.clone()); >@@ -151,7 +151,10 @@ promise_test((test) => { > return cache.put("1ko", response1ko.clone()).then(assert_unreached, (e) => { > assert_equals(e.name, "QuotaExceededError"); > }); >- }).then(() => { >+ }).then(() => { >+ testRunner.allowCacheStorageQuotaIncrease(); >+ return cache.put("1ko", response1ko.clone()); >+ }).then(() => { > return cache.delete("1ko-padded-to-200ko"); > }).then(() => { > return cache.put("1ko-v2", response1ko.clone());
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 193323
:
358810
|
359292
|
359293
|
359386
|
359394
|
359400
|
359413
|
359428
| 359497