Title: [147754] trunk/Source
Revision
147754
Author
[email protected]
Date
2013-04-05 09:40:31 -0700 (Fri, 05 Apr 2013)

Log Message

Allow the Web Inspector to use WebSQL.

This fixes an exception on load in the Safari Web Inspector.

https://webkit.org/b/114040
rdar://problem/13581422

Reviewed by Anders Carlsson.

Source/WebKit/mac:

* WebCoreSupport/WebInspectorClient.mm:
(-[WebInspectorWindowController webView:frame:exceededDatabaseQuotaForSecurityOrigin:database:]): Added.

Source/WebKit2:

* UIProcess/mac/WebInspectorProxyMac.mm:
(WebKit::exceededDatabaseQuota): Added.
(WebKit::WebInspectorProxy::platformCreateInspectorPage): Hook up exceededDatabaseQuota.

Modified Paths

Diff

Modified: trunk/Source/WebKit/mac/ChangeLog (147753 => 147754)


--- trunk/Source/WebKit/mac/ChangeLog	2013-04-05 16:40:05 UTC (rev 147753)
+++ trunk/Source/WebKit/mac/ChangeLog	2013-04-05 16:40:31 UTC (rev 147754)
@@ -1,3 +1,17 @@
+2013-04-05  Timothy Hatcher  <[email protected]>
+
+        Allow the Web Inspector to use WebSQL.
+
+        This fixes an exception on load in the Safari Web Inspector.
+
+        https://webkit.org/b/114040
+        rdar://problem/13581422
+
+        Reviewed by Anders Carlsson.
+
+        * WebCoreSupport/WebInspectorClient.mm:
+        (-[WebInspectorWindowController webView:frame:exceededDatabaseQuotaForSecurityOrigin:database:]): Added.
+
 2013-04-02  Timothy Hatcher  <[email protected]>
 
         Provide a user default that can be used to disable docking of the Web Inspector.

Modified: trunk/Source/WebKit/mac/WebCoreSupport/WebInspectorClient.mm (147753 => 147754)


--- trunk/Source/WebKit/mac/WebCoreSupport/WebInspectorClient.mm	2013-04-05 16:40:05 UTC (rev 147753)
+++ trunk/Source/WebKit/mac/WebCoreSupport/WebInspectorClient.mm	2013-04-05 16:40:31 UTC (rev 147754)
@@ -33,13 +33,16 @@
 #import "WebFrameInternal.h"
 #import "WebFrameView.h"
 #import "WebInspector.h"
+#import "WebInspectorFrontend.h"
 #import "WebInspectorPrivate.h"
-#import "WebInspectorFrontend.h"
 #import "WebLocalizableStringsInternal.h"
 #import "WebNodeHighlighter.h"
+#import "WebPolicyDelegate.h"
+#import "WebQuotaManager.h"
+#import "WebSecurityOriginPrivate.h"
 #import "WebUIDelegate.h"
-#import "WebPolicyDelegate.h"
 #import "WebViewInternal.h"
+#import <algorithm>
 #import <WebCore/Frame.h>
 #import <WebCore/InspectorController.h>
 #import <WebCore/InspectorFrontendClient.h>
@@ -687,6 +690,12 @@
     }];
 }
 
+- (void)webView:(WebView *)sender frame:(WebFrame *)frame exceededDatabaseQuotaForSecurityOrigin:(WebSecurityOrigin *)origin database:(NSString *)databaseIdentifier
+{
+    id <WebQuotaManager> databaseQuotaManager = origin.databaseQuotaManager;
+    databaseQuotaManager.quota = std::max<unsigned long long>(5 * 1024 * 1024, databaseQuotaManager.usage * 1.25);
+}
+
 // MARK: -
 // MARK: Policy delegate
 

Modified: trunk/Source/WebKit2/ChangeLog (147753 => 147754)


--- trunk/Source/WebKit2/ChangeLog	2013-04-05 16:40:05 UTC (rev 147753)
+++ trunk/Source/WebKit2/ChangeLog	2013-04-05 16:40:31 UTC (rev 147754)
@@ -1,3 +1,18 @@
+2013-04-05  Timothy Hatcher  <[email protected]>
+
+        Allow the Web Inspector to use WebSQL.
+
+        This fixes an exception on load in the Safari Web Inspector.
+
+        https://webkit.org/b/114040
+        rdar://problem/13581422
+
+        Reviewed by Anders Carlsson.
+
+        * UIProcess/mac/WebInspectorProxyMac.mm:
+        (WebKit::exceededDatabaseQuota): Added.
+        (WebKit::WebInspectorProxy::platformCreateInspectorPage): Hook up exceededDatabaseQuota.
+
 2013-04-04  Brady Eidson  <[email protected]>
 
         Add SPI to get a copy of the context menu at a given point.

Modified: trunk/Source/WebKit2/UIProcess/mac/WebInspectorProxyMac.mm (147753 => 147754)


--- trunk/Source/WebKit2/UIProcess/mac/WebInspectorProxyMac.mm	2013-04-05 16:40:05 UTC (rev 147753)
+++ trunk/Source/WebKit2/UIProcess/mac/WebInspectorProxyMac.mm	2013-04-05 16:40:31 UTC (rev 147754)
@@ -36,6 +36,7 @@
 #import "WebPageProxy.h"
 #import "WebPreferences.h"
 #import "WebProcessProxy.h"
+#import <algorithm>
 #import <mach-o/dyld.h>
 #import <WebKitSystemInterface.h>
 #import <WebCore/InspectorFrontendClientLocal.h>
@@ -224,6 +225,11 @@
     webInspectorProxy->setInspectorWindowFrame(frame);
 }
 
+static unsigned long long exceededDatabaseQuota(WKPageRef, WKFrameRef, WKSecurityOriginRef, WKStringRef, WKStringRef, unsigned long long, unsigned long long, unsigned long long currentDatabaseUsage, unsigned long long expectedUsage, const void*)
+{
+    return std::max<unsigned long long>(expectedUsage, currentDatabaseUsage * 1.25);
+}
+
 void WebInspectorProxy::setInspectorWindowFrame(WKRect& frame)
 {
     if (m_isAttached)
@@ -410,7 +416,7 @@
         0, // runBeforeUnloadConfirmPanel
         0, // didDraw
         0, // pageDidScroll
-        0, // exceededDatabaseQuota
+        exceededDatabaseQuota,
         0, // runOpenPanel
         0, // decidePolicyForGeolocationPermissionRequest
         0, // headerHeight
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to