Title: [234157] trunk/Source/WebKit
- Revision
- 234157
- Author
- [email protected]
- Date
- 2018-07-24 10:47:25 -0700 (Tue, 24 Jul 2018)
Log Message
WKUIDelegate needs an alternate decideDatabaseQuotaForSecurityOrigin method that provides the database name and display name
https://bugs.webkit.org/show_bug.cgi?id=187567
Reviewed by Alex Christensen.
* UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
Declare alternate decideDatabaseQuotaForSecurityOrigin method, copying the existing FIXME comment
from the old method.
* UIProcess/Cocoa/UIDelegate.h:
Add flag for new delegate method.
* UIProcess/Cocoa/UIDelegate.mm:
(WebKit::UIDelegate::setDelegate):
Initialize new flag.
(WebKit::UIDelegate::UIClient::exceededDatabaseQuota):
Prefer the new UIDelegate method that takes the database name and display name, falling back to the
existing method if the client doesn't implement it.
Modified Paths
Diff
Modified: trunk/Source/WebKit/ChangeLog (234156 => 234157)
--- trunk/Source/WebKit/ChangeLog 2018-07-24 17:40:12 UTC (rev 234156)
+++ trunk/Source/WebKit/ChangeLog 2018-07-24 17:47:25 UTC (rev 234157)
@@ -1,3 +1,25 @@
+2018-07-24 Jeff Miller <[email protected]>
+
+ WKUIDelegate needs an alternate decideDatabaseQuotaForSecurityOrigin method that provides the database name and display name
+ https://bugs.webkit.org/show_bug.cgi?id=187567
+
+ Reviewed by Alex Christensen.
+
+ * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
+ Declare alternate decideDatabaseQuotaForSecurityOrigin method, copying the existing FIXME comment
+ from the old method.
+
+ * UIProcess/Cocoa/UIDelegate.h:
+ Add flag for new delegate method.
+
+ * UIProcess/Cocoa/UIDelegate.mm:
+ (WebKit::UIDelegate::setDelegate):
+ Initialize new flag.
+
+ (WebKit::UIDelegate::UIClient::exceededDatabaseQuota):
+ Prefer the new UIDelegate method that takes the database name and display name, falling back to the
+ existing method if the client doesn't implement it.
+
2018-07-24 Stephan Szabo <[email protected]>
[WinCairo] Add support to WebView for setting tooltips
Modified: trunk/Source/WebKit/UIProcess/API/Cocoa/WKUIDelegatePrivate.h (234156 => 234157)
--- trunk/Source/WebKit/UIProcess/API/Cocoa/WKUIDelegatePrivate.h 2018-07-24 17:40:12 UTC (rev 234156)
+++ trunk/Source/WebKit/UIProcess/API/Cocoa/WKUIDelegatePrivate.h 2018-07-24 17:47:25 UTC (rev 234157)
@@ -86,6 +86,9 @@
- (void)_webView:(WKWebView *)webView decideDatabaseQuotaForSecurityOrigin:(WKSecurityOrigin *)securityOrigin currentQuota:(unsigned long long)currentQuota currentOriginUsage:(unsigned long long)currentOriginUsage currentDatabaseUsage:(unsigned long long)currentUsage expectedUsage:(unsigned long long)expectedUsage decisionHandler:(void (^)(unsigned long long newQuota))decisionHandler;
// FIXME: This should be handled by the WKWebsiteDataStore delegate.
+- (void)_webView:(WKWebView *)webView decideDatabaseQuotaForSecurityOrigin:(WKSecurityOrigin *)securityOrigin databaseName:(NSString *)databaseName displayName:(NSString *)displayName currentQuota:(unsigned long long)currentQuota currentOriginUsage:(unsigned long long)currentOriginUsage currentDatabaseUsage:(unsigned long long)currentUsage expectedUsage:(unsigned long long)expectedUsage decisionHandler:(void (^)(unsigned long long newQuota))decisionHandler;
+
+// FIXME: This should be handled by the WKWebsiteDataStore delegate.
- (void)_webView:(WKWebView *)webView decideWebApplicationCacheQuotaForSecurityOrigin:(WKSecurityOrigin *)securityOrigin currentQuota:(unsigned long long)currentQuota totalBytesNeeded:(unsigned long long)totalBytesNeeded decisionHandler:(void (^)(unsigned long long newQuota))decisionHandler;
- (void)_webView:(WKWebView *)webView printFrame:(_WKFrameHandle *)frame;
Modified: trunk/Source/WebKit/UIProcess/Cocoa/UIDelegate.h (234156 => 234157)
--- trunk/Source/WebKit/UIProcess/Cocoa/UIDelegate.h 2018-07-24 17:40:12 UTC (rev 234156)
+++ trunk/Source/WebKit/UIProcess/Cocoa/UIDelegate.h 2018-07-24 17:47:25 UTC (rev 234157)
@@ -187,6 +187,7 @@
bool webViewRequestNotificationPermissionForSecurityOriginDecisionHandler : 1;
#endif
bool webViewDecideDatabaseQuotaForSecurityOriginCurrentQuotaCurrentOriginUsageCurrentDatabaseUsageExpectedUsageDecisionHandler : 1;
+ bool webViewDecideDatabaseQuotaForSecurityOriginDatabaseNameDisplayNameCurrentQuotaCurrentOriginUsageCurrentDatabaseUsageExpectedUsageDecisionHandler : 1;
bool webViewDecideWebApplicationCacheQuotaForSecurityOriginCurrentQuotaTotalBytesNeeded : 1;
bool webViewPrintFrame : 1;
bool webViewDidClose : 1;
Modified: trunk/Source/WebKit/UIProcess/Cocoa/UIDelegate.mm (234156 => 234157)
--- trunk/Source/WebKit/UIProcess/Cocoa/UIDelegate.mm 2018-07-24 17:40:12 UTC (rev 234156)
+++ trunk/Source/WebKit/UIProcess/Cocoa/UIDelegate.mm 2018-07-24 17:47:25 UTC (rev 234157)
@@ -133,6 +133,7 @@
m_delegateMethods.webViewRequestNotificationPermissionForSecurityOriginDecisionHandler = [delegate respondsToSelector:@selector(_webView:requestNotificationPermissionForSecurityOrigin:decisionHandler:)];
#endif
m_delegateMethods.webViewDecideDatabaseQuotaForSecurityOriginCurrentQuotaCurrentOriginUsageCurrentDatabaseUsageExpectedUsageDecisionHandler = [delegate respondsToSelector:@selector(_webView:decideDatabaseQuotaForSecurityOrigin:currentQuota:currentOriginUsage:currentDatabaseUsage:expectedUsage:decisionHandler:)];
+ m_delegateMethods.webViewDecideDatabaseQuotaForSecurityOriginDatabaseNameDisplayNameCurrentQuotaCurrentOriginUsageCurrentDatabaseUsageExpectedUsageDecisionHandler = [delegate respondsToSelector:@selector(_webView:decideDatabaseQuotaForSecurityOrigin:databaseName:displayName:currentQuota:currentOriginUsage:currentDatabaseUsage:expectedUsage:decisionHandler:)];
m_delegateMethods.webViewDecideWebApplicationCacheQuotaForSecurityOriginCurrentQuotaTotalBytesNeeded = [delegate respondsToSelector:@selector(_webView:decideWebApplicationCacheQuotaForSecurityOrigin:currentQuota:totalBytesNeeded:decisionHandler:)];
m_delegateMethods.webViewPrintFrame = [delegate respondsToSelector:@selector(_webView:printFrame:)];
m_delegateMethods.webViewDidClose = [delegate respondsToSelector:@selector(webViewDidClose:)];
@@ -410,7 +411,7 @@
void UIDelegate::UIClient::exceededDatabaseQuota(WebPageProxy*, WebFrameProxy*, API::SecurityOrigin* securityOrigin, const WTF::String& databaseName, const WTF::String& displayName, unsigned long long currentQuota, unsigned long long currentOriginUsage, unsigned long long currentUsage, unsigned long long expectedUsage, Function<void (unsigned long long)>&& completionHandler)
{
- if (!m_uiDelegate.m_delegateMethods.webViewDecideDatabaseQuotaForSecurityOriginCurrentQuotaCurrentOriginUsageCurrentDatabaseUsageExpectedUsageDecisionHandler) {
+ if (!m_uiDelegate.m_delegateMethods.webViewDecideDatabaseQuotaForSecurityOriginCurrentQuotaCurrentOriginUsageCurrentDatabaseUsageExpectedUsageDecisionHandler && !m_uiDelegate.m_delegateMethods.webViewDecideDatabaseQuotaForSecurityOriginDatabaseNameDisplayNameCurrentQuotaCurrentOriginUsageCurrentDatabaseUsageExpectedUsageDecisionHandler) {
// Use 50 MB as the default database quota.
unsigned long long defaultPerOriginDatabaseQuota = 50 * 1024 * 1024;
@@ -426,6 +427,18 @@
}
ASSERT(securityOrigin);
+
+ if (m_uiDelegate.m_delegateMethods.webViewDecideDatabaseQuotaForSecurityOriginDatabaseNameDisplayNameCurrentQuotaCurrentOriginUsageCurrentDatabaseUsageExpectedUsageDecisionHandler) {
+ auto checker = CompletionHandlerCallChecker::create(delegate.get(), @selector(_webView:decideDatabaseQuotaForSecurityOrigin:databaseName:displayName:currentQuota:currentOriginUsage:currentDatabaseUsage:expectedUsage:decisionHandler:));
+ [(id <WKUIDelegatePrivate>)delegate _webView:m_uiDelegate.m_webView decideDatabaseQuotaForSecurityOrigin:wrapper(*securityOrigin) databaseName:databaseName displayName:displayName currentQuota:currentQuota currentOriginUsage:currentOriginUsage currentDatabaseUsage:currentUsage expectedUsage:expectedUsage decisionHandler:BlockPtr<void(unsigned long long newQuota)>::fromCallable([completionHandler = WTFMove(completionHandler), checker = WTFMove(checker)](unsigned long long newQuota) {
+ if (checker->completionHandlerHasBeenCalled())
+ return;
+ checker->didCallCompletionHandler();
+ completionHandler(newQuota);
+ }).get()];
+ return;
+ }
+
auto checker = CompletionHandlerCallChecker::create(delegate.get(), @selector(_webView:decideDatabaseQuotaForSecurityOrigin:currentQuota:currentOriginUsage:currentDatabaseUsage:expectedUsage:decisionHandler:));
[(id <WKUIDelegatePrivate>)delegate _webView:m_uiDelegate.m_webView decideDatabaseQuotaForSecurityOrigin:wrapper(*securityOrigin) currentQuota:currentQuota currentOriginUsage:currentOriginUsage currentDatabaseUsage:currentUsage expectedUsage:expectedUsage decisionHandler:BlockPtr<void(unsigned long long newQuota)>::fromCallable([completionHandler = WTFMove(completionHandler), checker = WTFMove(checker)](unsigned long long newQuota) {
if (checker->completionHandlerHasBeenCalled())
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes