Title: [158447] trunk
Revision
158447
Author
mark....@apple.com
Date
2013-11-01 12:18:27 -0700 (Fri, 01 Nov 2013)

Log Message

REGRESSION: Crashes in -[UIDelegate webView:frame:exceededDatabaseQuotaForSecurityOrigin:database:].
https://bugs.webkit.org/show_bug.cgi?id=123383.

Reviewed by Geoffrey Garen.

Tools: 

Removed an inappropriate assertion in DumpRenderTree/mac/UIDelegate.mm and
added 2 attributes (databaseDefaultQuota and databaseMaxQuota) to allow
tests to set appropriate quota settings to exercise quota expansion tests
when needed.

* DumpRenderTree/TestRunner.cpp:
(TestRunner::TestRunner):
(getDatabaseDefaultQuotaCallback):
(getDatabaseMaxQuotaCallback):
(setDatabaseDefaultQuotaCallback):
(setDatabaseMaxQuotaCallback):
(TestRunner::staticValues):
* DumpRenderTree/TestRunner.h:
(TestRunner::databaseDefaultQuota):
(TestRunner::setDatabaseDefaultQuota):
(TestRunner::databaseMaxQuota):
(TestRunner::setDatabaseMaxQuota):
* DumpRenderTree/blackberry/DumpRenderTree.cpp:
(BlackBerry::WebKit::DumpRenderTree::exceededDatabaseQuota):
* DumpRenderTree/efl/DumpRenderTreeView.cpp:
(onExceededDatabaseQuota):
* DumpRenderTree/mac/UIDelegate.mm:
(-[UIDelegate webView:frame:exceededDatabaseQuotaForSecurityOrigin:database:]):
* DumpRenderTree/win/UIDelegate.cpp:
(UIDelegate::exceededDatabaseQuota):
* WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl:
* WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp:
(WTR::InjectedBundlePage::didExceedDatabaseQuota):
* WebKitTestRunner/InjectedBundle/TestRunner.cpp:
(WTR::TestRunner::TestRunner):
* WebKitTestRunner/InjectedBundle/TestRunner.h:
(WTR::TestRunner::databaseDefaultQuota):
(WTR::TestRunner::setDatabaseDefaultQuota):
(WTR::TestRunner::databaseMaxQuota):
(WTR::TestRunner::setDatabaseMaxQuota):
* WebKitTestRunner/TestController.cpp:
(WTR::TestController::createOtherPage):
(WTR::TestController::createWebViewWithOptions):

LayoutTests: 

Removed an inappropriate assertion in DumpRenderTree/mac/UIDelegate.mm and
added 2 attributes (databaseDefaultQuota and databaseMaxQuota) to allow
tests to set appropriate quota settings to exercise quota expansion tests
when needed.
        
* storage/websql/open-database-expand-quota.html:
- Set databaseDefaultQuota and databaseMaxQuota as needed for this test.
* storage/websql/open-database-over-quota-expected.txt:
* storage/websql/open-database-over-quota.html:
- Revert the change from r157874 which is no longer needed for this test.

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (158446 => 158447)


--- trunk/LayoutTests/ChangeLog	2013-11-01 19:10:59 UTC (rev 158446)
+++ trunk/LayoutTests/ChangeLog	2013-11-01 19:18:27 UTC (rev 158447)
@@ -1,3 +1,21 @@
+2013-10-31  Mark Lam  <mark....@apple.com>
+
+        REGRESSION: Crashes in -[UIDelegate webView:frame:exceededDatabaseQuotaForSecurityOrigin:database:].
+        https://bugs.webkit.org/show_bug.cgi?id=123383.
+
+        Reviewed by Geoffrey Garen.
+
+        Removed an inappropriate assertion in DumpRenderTree/mac/UIDelegate.mm and
+        added 2 attributes (databaseDefaultQuota and databaseMaxQuota) to allow
+        tests to set appropriate quota settings to exercise quota expansion tests
+        when needed.
+        
+        * storage/websql/open-database-expand-quota.html:
+        - Set databaseDefaultQuota and databaseMaxQuota as needed for this test.
+        * storage/websql/open-database-over-quota-expected.txt:
+        * storage/websql/open-database-over-quota.html:
+        - Revert the change from r157874 which is no longer needed for this test.
+
 2013-11-01  Bem Jones-Bey  <bjone...@adobe.com>
 
         [css shapes] Pull in upstream fixes to shape-outside margin and clipping tests

Modified: trunk/LayoutTests/storage/websql/open-database-expand-quota.html (158446 => 158447)


--- trunk/LayoutTests/storage/websql/open-database-expand-quota.html	2013-11-01 19:10:59 UTC (rev 158446)
+++ trunk/LayoutTests/storage/websql/open-database-expand-quota.html	2013-11-01 19:18:27 UTC (rev 158447)
@@ -5,6 +5,8 @@
     if (window.testRunner) {
         testRunner.dumpAsText();
         testRunner.clearAllDatabases();
+        testRunner.databaseDefaultQuota = 5 * 1024 * 1024;
+        testRunner.databaseMaxQuota = 10 * 1024 * 1024;
     }
 
     try {

Modified: trunk/LayoutTests/storage/websql/open-database-over-quota-expected.txt (158446 => 158447)


--- trunk/LayoutTests/storage/websql/open-database-over-quota-expected.txt	2013-11-01 19:10:59 UTC (rev 158446)
+++ trunk/LayoutTests/storage/websql/open-database-over-quota-expected.txt	2013-11-01 19:18:27 UTC (rev 158447)
@@ -1,2 +1,2 @@
-This tests that calling openDatabase with a size greater or equal to the test max quota limit of 10MB doesn't assert on debug builds.
+This tests that calling openDatabase with a size greater or equal to the test max quota limit of 5MB doesn't assert on debug builds.
 PASS

Modified: trunk/LayoutTests/storage/websql/open-database-over-quota.html (158446 => 158447)


--- trunk/LayoutTests/storage/websql/open-database-over-quota.html	2013-11-01 19:10:59 UTC (rev 158446)
+++ trunk/LayoutTests/storage/websql/open-database-over-quota.html	2013-11-01 19:18:27 UTC (rev 158447)
@@ -8,7 +8,7 @@
     }
 
     try {
-        var db = openDatabase('OverQuotaOpen', '', 'Test for bug 36473: missing lock in call to doneCreatingDatabase', 20000000);
+        var db = openDatabase('OverQuotaOpen', '', 'Test for bug 36473: missing lock in call to doneCreatingDatabase', 10000000);
     } catch (err) {
         document.getElementById('result').innerHTML = 'PASS'
     }
@@ -16,7 +16,7 @@
 </script>
 </head>
 <body _onload_="runTest()">
-<div>This tests that calling openDatabase with a size greater or equal to the test max quota limit of 10MB
+<div>This tests that calling openDatabase with a size greater or equal to the test max quota limit of 5MB
 doesn't assert on debug builds.
 <div id="result">
 FAIL: We shouldn't have been able to open the database.

Modified: trunk/Tools/ChangeLog (158446 => 158447)


--- trunk/Tools/ChangeLog	2013-11-01 19:10:59 UTC (rev 158446)
+++ trunk/Tools/ChangeLog	2013-11-01 19:18:27 UTC (rev 158447)
@@ -1,3 +1,49 @@
+2013-10-31  Mark Lam  <mark....@apple.com>
+
+        REGRESSION: Crashes in -[UIDelegate webView:frame:exceededDatabaseQuotaForSecurityOrigin:database:].
+        https://bugs.webkit.org/show_bug.cgi?id=123383.
+
+        Reviewed by Geoffrey Garen.
+
+        Removed an inappropriate assertion in DumpRenderTree/mac/UIDelegate.mm and
+        added 2 attributes (databaseDefaultQuota and databaseMaxQuota) to allow
+        tests to set appropriate quota settings to exercise quota expansion tests
+        when needed.
+
+        * DumpRenderTree/TestRunner.cpp:
+        (TestRunner::TestRunner):
+        (getDatabaseDefaultQuotaCallback):
+        (getDatabaseMaxQuotaCallback):
+        (setDatabaseDefaultQuotaCallback):
+        (setDatabaseMaxQuotaCallback):
+        (TestRunner::staticValues):
+        * DumpRenderTree/TestRunner.h:
+        (TestRunner::databaseDefaultQuota):
+        (TestRunner::setDatabaseDefaultQuota):
+        (TestRunner::databaseMaxQuota):
+        (TestRunner::setDatabaseMaxQuota):
+        * DumpRenderTree/blackberry/DumpRenderTree.cpp:
+        (BlackBerry::WebKit::DumpRenderTree::exceededDatabaseQuota):
+        * DumpRenderTree/efl/DumpRenderTreeView.cpp:
+        (onExceededDatabaseQuota):
+        * DumpRenderTree/mac/UIDelegate.mm:
+        (-[UIDelegate webView:frame:exceededDatabaseQuotaForSecurityOrigin:database:]):
+        * DumpRenderTree/win/UIDelegate.cpp:
+        (UIDelegate::exceededDatabaseQuota):
+        * WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl:
+        * WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp:
+        (WTR::InjectedBundlePage::didExceedDatabaseQuota):
+        * WebKitTestRunner/InjectedBundle/TestRunner.cpp:
+        (WTR::TestRunner::TestRunner):
+        * WebKitTestRunner/InjectedBundle/TestRunner.h:
+        (WTR::TestRunner::databaseDefaultQuota):
+        (WTR::TestRunner::setDatabaseDefaultQuota):
+        (WTR::TestRunner::databaseMaxQuota):
+        (WTR::TestRunner::setDatabaseMaxQuota):
+        * WebKitTestRunner/TestController.cpp:
+        (WTR::TestController::createOtherPage):
+        (WTR::TestController::createWebViewWithOptions):
+
 2013-10-31  Anders Carlsson  <ander...@apple.com>
 
         Add a WKRemoteObject class

Modified: trunk/Tools/DumpRenderTree/TestRunner.cpp (158446 => 158447)


--- trunk/Tools/DumpRenderTree/TestRunner.cpp	2013-11-01 19:10:59 UTC (rev 158446)
+++ trunk/Tools/DumpRenderTree/TestRunner.cpp	2013-11-01 19:18:27 UTC (rev 158447)
@@ -110,6 +110,8 @@
     , m_areLegacyWebNotificationPermissionRequestsIgnored(false)
     , m_customFullScreenBehavior(false) 
     , m_hasPendingWebNotificationClick(false)
+    , m_databaseDefaultQuota(-1)
+    , m_databaseMaxQuota(-1)
     , m_testPathOrURL(testPathOrURL)
     , m_expectedPixelHash(expectedPixelHash)
     , m_titleTextDirection("ltr")
@@ -1839,6 +1841,18 @@
     return JSValueMakeBoolean(context, controller->globalFlag());
 }
 
+static JSValueRef getDatabaseDefaultQuotaCallback(JSContextRef context, JSObjectRef thisObject, JSStringRef propertyName, JSValueRef* exception)
+{
+    TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject));
+    return JSValueMakeNumber(context, controller->databaseDefaultQuota());
+}
+
+static JSValueRef getDatabaseMaxQuotaCallback(JSContextRef context, JSObjectRef thisObject, JSStringRef propertyName, JSValueRef* exception)
+{
+    TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject));
+    return JSValueMakeNumber(context, controller->databaseMaxQuota());
+}
+
 static JSValueRef getWebHistoryItemCountCallback(JSContextRef context, JSObjectRef thisObject, JSStringRef propertyName, JSValueRef* exception)
 {
     TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject));
@@ -1879,6 +1893,22 @@
     return true;
 }
 
+static bool setDatabaseDefaultQuotaCallback(JSContextRef context, JSObjectRef thisObject, JSStringRef propertyName, JSValueRef value, JSValueRef* exception)
+{
+    TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject));
+    controller->setDatabaseDefaultQuota(JSValueToNumber(context, value, exception));
+    ASSERT(!*exception);
+    return true;
+}
+
+static bool setDatabaseMaxQuotaCallback(JSContextRef context, JSObjectRef thisObject, JSStringRef propertyName, JSValueRef value, JSValueRef* exception)
+{
+    TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject));
+    controller->setDatabaseMaxQuota(JSValueToNumber(context, value, exception));
+    ASSERT(!*exception);
+    return true;
+}
+
 static JSValueRef ignoreLegacyWebNotificationPermissionRequestsCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
 {
     TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject));
@@ -2050,6 +2080,8 @@
 #endif
         { "secureEventInputIsEnabled", getSecureEventInputIsEnabledCallback, 0, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
         { "titleTextDirection", getTitleTextDirectionCallback, 0, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
+        { "databaseDefaultQuota", getDatabaseDefaultQuotaCallback, setDatabaseDefaultQuotaCallback, kJSPropertyAttributeNone },
+        { "databaseMaxQuota", getDatabaseMaxQuotaCallback, setDatabaseMaxQuotaCallback, kJSPropertyAttributeNone },
         { 0, 0, 0, 0 }
     };
     return staticValues;

Modified: trunk/Tools/DumpRenderTree/TestRunner.h (158446 => 158447)


--- trunk/Tools/DumpRenderTree/TestRunner.h	2013-11-01 19:10:59 UTC (rev 158446)
+++ trunk/Tools/DumpRenderTree/TestRunner.h	2013-11-01 19:18:27 UTC (rev 158447)
@@ -277,6 +277,12 @@
     bool globalFlag() const { return m_globalFlag; }
     void setGlobalFlag(bool globalFlag) { m_globalFlag = globalFlag; }
     
+    double databaseDefaultQuota() const { return m_databaseDefaultQuota; }
+    void setDatabaseDefaultQuota(double quota) { m_databaseDefaultQuota = quota; }
+
+    double databaseMaxQuota() const { return m_databaseMaxQuota; }
+    void setDatabaseMaxQuota(double quota) { m_databaseMaxQuota = quota; }
+
     bool deferMainResourceDataLoad() const { return m_deferMainResourceDataLoad; }
     void setDeferMainResourceDataLoad(bool flag) { m_deferMainResourceDataLoad = flag; }
 
@@ -411,6 +417,9 @@
     bool m_customFullScreenBehavior;
     bool m_hasPendingWebNotificationClick;
 
+    double m_databaseDefaultQuota;
+    double m_databaseMaxQuota;
+
     std::string m_authenticationUsername;
     std::string m_authenticationPassword; 
     std::string m_testPathOrURL;

Modified: trunk/Tools/DumpRenderTree/blackberry/DumpRenderTree.cpp (158446 => 158447)


--- trunk/Tools/DumpRenderTree/blackberry/DumpRenderTree.cpp	2013-11-01 19:10:59 UTC (rev 158446)
+++ trunk/Tools/DumpRenderTree/blackberry/DumpRenderTree.cpp	2013-11-01 19:18:27 UTC (rev 158447)
@@ -785,12 +785,19 @@
 
     WebCore::DatabaseManager& manager = WebCore::DatabaseManager::manager(); 
     WebCore::DatabaseDetails details = detailsForNameAndOrigin(name, origin);
-    static const unsigned long long defaultQuota = 5 * 1024 * 1024;
-    static const unsigned long long maxQuota = 10 * 1024 * 1024;
+    unsigned long long defaultQuota = 5 * 1024 * 1024;
+    double testDefaultQuota = gTestRunner->databaseDefaultQuota();
+    if (testDefaultQuota >= 0)
+        defaultQuota = testDefaultQuota;
+
     unsigned long long newQuota = defaultQuota;
-    if (defaultQuota < expectedSize && expectedSize <= maxQuota) {
-        newQuota = expectedSize;
-        printf("UI DELEGATE DATABASE CALLBACK: increased quota to %llu\n", newQuota);
+
+    double maxQuota = gTestRunner->databaseMaxQuota();
+    if (maxQuota >= 0) {
+        if (defaultQuota < expectedSize && expectedSize <= maxQuota) {
+            newQuota = expectedSize;
+            printf("UI DELEGATE DATABASE CALLBACK: increased quota to %llu\n", newQuota);
+        }
     }
     manager.setQuota(origin, newQuota);
 }

Modified: trunk/Tools/DumpRenderTree/efl/DumpRenderTreeView.cpp (158446 => 158447)


--- trunk/Tools/DumpRenderTree/efl/DumpRenderTreeView.cpp	2013-11-01 19:10:59 UTC (rev 158446)
+++ trunk/Tools/DumpRenderTree/efl/DumpRenderTreeView.cpp	2013-11-01 19:18:27 UTC (rev 158447)
@@ -134,13 +134,21 @@
             databaseName);
     ewk_security_origin_free(origin);
 
-    static const uint64_t defaultQuota = 5 * 1024 * 1024;
-    static const uint64_t maxQuota = 10 * 1024 * 1024;
-    if (defaultQuota < expectedSize && expectedSize <= maxQuota) {
-        printf("UI DELEGATE DATABASE CALLBACK: increased quota to %" PRIu64 "\n", expectedSize);
-        return expectedSize;
+    uint64_t defaultQuota = 5 * 1024 * 1024;
+    double testDefaultQuota = gTestRunner->databaseDefaultQuota();
+    if (testDefaultQuota >= 0)
+        defaultQuota = testDefaultQuota;
+
+    uint64_t newQuota = defaultQuota;
+
+    double maxQuota = gTestRunner->databaseMaxQuota();
+    if (maxQuota >= 0) {
+        if (defaultQuota < expectedSize && expectedSize <= maxQuota) {
+            newQuota = expectedSize;
+            printf("UI DELEGATE DATABASE CALLBACK: increased quota to %" PRIu64 "\n", expectedSize);
+        }
     }
-    return defaultQuota;
+    return newQuota;
 }
 
 static int64_t onExceededApplicationCacheQuota(Ewk_View_Smart_Data*, Ewk_Security_Origin *origin, int64_t defaultOriginQuota, int64_t totalSpaceNeeded)

Modified: trunk/Tools/DumpRenderTree/mac/UIDelegate.mm (158446 => 158447)


--- trunk/Tools/DumpRenderTree/mac/UIDelegate.mm	2013-11-01 19:10:59 UTC (rev 158446)
+++ trunk/Tools/DumpRenderTree/mac/UIDelegate.mm	2013-11-01 19:18:27 UTC (rev 158447)
@@ -175,14 +175,20 @@
     }
 
     NSDictionary *databaseDetails = [[WebDatabaseManager sharedWebDatabaseManager] detailsForDatabase:databaseIdentifier withOrigin:origin];
-    ASSERT(databaseDetails);
     unsigned long long expectedSize = [[databaseDetails objectForKey:WebDatabaseExpectedSizeKey] unsignedLongLongValue];
-    static const unsigned long long defaultQuota = 5 * 1024 * 1024;
-    static const unsigned long long maxQuota = 10 * 1024 * 1024;
+    unsigned long long defaultQuota = 5 * 1024 * 1024;
+    double testDefaultQuota = gTestRunner->databaseDefaultQuota();
+    if (testDefaultQuota >= 0)
+        defaultQuota = testDefaultQuota;
+
     unsigned long long newQuota = defaultQuota;
-    if (defaultQuota < expectedSize && expectedSize <= maxQuota) {
-        newQuota = expectedSize;
-        printf("UI DELEGATE DATABASE CALLBACK: increased quota to %llu\n", newQuota);
+
+    double maxQuota = gTestRunner->databaseMaxQuota();
+    if (maxQuota >= 0) {
+        if (defaultQuota < expectedSize && expectedSize <= maxQuota) {
+            newQuota = expectedSize;
+            printf("UI DELEGATE DATABASE CALLBACK: increased quota to %llu\n", newQuota);
+        }
     }
     [[origin databaseQuotaManager] setQuota:newQuota];
 }

Modified: trunk/Tools/DumpRenderTree/win/UIDelegate.cpp (158446 => 158447)


--- trunk/Tools/DumpRenderTree/win/UIDelegate.cpp	2013-11-01 19:10:59 UTC (rev 158446)
+++ trunk/Tools/DumpRenderTree/win/UIDelegate.cpp	2013-11-01 19:18:27 UTC (rev 158447)
@@ -595,8 +595,10 @@
     SysFreeString(protocol);
     SysFreeString(host);
 
-    static const unsigned long long defaultQuota = 5 * 1024 * 1024;
-    static const unsigned long long maxQuota = 10 * 1024 * 1024;
+    unsigned long long defaultQuota = 5 * 1024 * 1024;
+    double testDefaultQuota = gTestRunner->databaseDefaultQuota();
+    if (testDefaultQuota >= 0)
+        defaultQuota = testDefaultQuota;
 
     COMPtr<IWebDatabaseManager> databaseManager;
     COMPtr<IWebDatabaseManager> tmpDatabaseManager;
@@ -618,9 +620,13 @@
     detailsBag->Read(WebDatabaseUsageKey, &var, 0);
     unsigned long long expectedSize = V_UI8(&var);
     unsigned long long newQuota = defaultQuota;
-    if (defaultQuota < expectedSize && expectedSize <= maxQuota) {
-        newQuota = expectedSize;
-        printf("UI DELEGATE DATABASE CALLBACK: increased quota to %llu\n", newQuota);
+
+    double maxQuota = gTestRunner->databaseMaxQuota();
+    if (maxQuota >= 0) {
+        if (defaultQuota < expectedSize && expectedSize <= maxQuota) {
+            newQuota = expectedSize;
+            printf("UI DELEGATE DATABASE CALLBACK: increased quota to %llu\n", newQuota);
+        }
     }
     origin->setQuota(newQuota);
 

Modified: trunk/Tools/WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl (158446 => 158447)


--- trunk/Tools/WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl	2013-11-01 19:10:59 UTC (rev 158446)
+++ trunk/Tools/WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl	2013-11-01 19:18:27 UTC (rev 158447)
@@ -103,6 +103,9 @@
     void setDatabaseQuota(unsigned long long quota);
     DOMString pathToLocalResource(DOMString url);
 
+    attribute double databaseDefaultQuota;
+    attribute double databaseMaxQuota;
+
     // Application Cache API
     void clearAllApplicationCaches();
     void setAppCacheMaximumSize(unsigned long long size);

Modified: trunk/Tools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp (158446 => 158447)


--- trunk/Tools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp	2013-11-01 19:10:59 UTC (rev 158446)
+++ trunk/Tools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp	2013-11-01 19:18:27 UTC (rev 158447)
@@ -1448,17 +1448,24 @@
         InjectedBundle::shared().outputText(stringBuilder.toString());
     }
 
-    static const uint64_t defaultQuota = 5 * 1024 * 1024;
-    static const uint64_t maxQuota = 10 * 1024 * 1024;
-    uint64_t newQuota = defaultQuota;
-    if (defaultQuota < expectedUsageBytes && expectedUsageBytes <= maxQuota) {
-        newQuota = expectedUsageBytes;
+    uint64_t defaultQuota = 5 * 1024 * 1024;
+    double testDefaultQuota = InjectedBundle::shared().testRunner()->databaseDefaultQuota();
+    if (testDefaultQuota >= 0)
+        defaultQuota = testDefaultQuota;
 
-        StringBuilder stringBuilder;
-        stringBuilder.appendLiteral("UI DELEGATE DATABASE CALLBACK: increased quota to ");
-        stringBuilder.appendNumber(newQuota);
-        stringBuilder.append('\n');
-        InjectedBundle::shared().outputText(stringBuilder.toString());
+    unsigned long long newQuota = defaultQuota;
+
+    double maxQuota = InjectedBundle::shared().testRunner()->databaseMaxQuota();
+    if (maxQuota >= 0) {
+        if (defaultQuota < expectedUsageBytes && expectedUsageBytes <= maxQuota) {
+            newQuota = expectedUsageBytes;
+
+            StringBuilder stringBuilder;
+            stringBuilder.appendLiteral("UI DELEGATE DATABASE CALLBACK: increased quota to ");
+            stringBuilder.appendNumber(newQuota);
+            stringBuilder.append('\n');
+            InjectedBundle::shared().outputText(stringBuilder.toString());
+        }
     }
     return newQuota;
 }

Modified: trunk/Tools/WebKitTestRunner/InjectedBundle/TestRunner.cpp (158446 => 158447)


--- trunk/Tools/WebKitTestRunner/InjectedBundle/TestRunner.cpp	2013-11-01 19:10:59 UTC (rev 158446)
+++ trunk/Tools/WebKitTestRunner/InjectedBundle/TestRunner.cpp	2013-11-01 19:18:27 UTC (rev 158447)
@@ -93,6 +93,8 @@
     , m_policyDelegatePermissive(false)
     , m_globalFlag(false)
     , m_customFullScreenBehavior(false)
+    , m_databaseDefaultQuota(-1)
+    , m_databaseMaxQuota(-1)
     , m_userStyleSheetEnabled(false)
     , m_userStyleSheetLocation(adoptWK(WKStringCreateWithUTF8CString("")))
 {

Modified: trunk/Tools/WebKitTestRunner/InjectedBundle/TestRunner.h (158446 => 158447)


--- trunk/Tools/WebKitTestRunner/InjectedBundle/TestRunner.h	2013-11-01 19:10:59 UTC (rev 158446)
+++ trunk/Tools/WebKitTestRunner/InjectedBundle/TestRunner.h	2013-11-01 19:18:27 UTC (rev 158447)
@@ -220,6 +220,12 @@
     bool globalFlag() const { return m_globalFlag; }
     void setGlobalFlag(bool value) { m_globalFlag = value; }
 
+    double databaseDefaultQuota() const { return m_databaseDefaultQuota; }
+    void setDatabaseDefaultQuota(double quota) { m_databaseDefaultQuota = quota; }
+
+    double databaseMaxQuota() const { return m_databaseMaxQuota; }
+    void setDatabaseMaxQuota(double quota) { m_databaseMaxQuota = quota; }
+
     void addChromeInputField(JSValueRef);
     void removeChromeInputField(JSValueRef);
     void focusWebView(JSValueRef);
@@ -321,6 +327,9 @@
 
     int m_timeout;
 
+    double m_databaseDefaultQuota;
+    double m_databaseMaxQuota;
+
     bool m_userStyleSheetEnabled;
     WKRetainPtr<WKStringRef> m_userStyleSheetLocation;
 

Modified: trunk/Tools/WebKitTestRunner/TestController.cpp (158446 => 158447)


--- trunk/Tools/WebKitTestRunner/TestController.cpp	2013-11-01 19:10:59 UTC (rev 158446)
+++ trunk/Tools/WebKitTestRunner/TestController.cpp	2013-11-01 19:18:27 UTC (rev 158447)
@@ -143,19 +143,6 @@
     return TestController::shared().beforeUnloadReturnValue();
 }
 
-static unsigned long long exceededDatabaseQuota(WKPageRef, WKFrameRef, WKSecurityOriginRef, WKStringRef, WKStringRef, unsigned long long, unsigned long long, unsigned long long, unsigned long long expectedUsage, const void*)
-{
-    static const unsigned long long defaultQuota = 5 * 1024 * 1024;
-    static const unsigned long long maxQuota = 10 * 1024 * 1024;
-    unsigned long long newQuota = defaultQuota;
-    if (defaultQuota < expectedUsage && expectedUsage <= maxQuota) {
-        newQuota = expectedUsage;
-        printf("UI DELEGATE DATABASE CALLBACK: increased quota to %llu\n", newQuota);
-    }
-    return newQuota;
-}
-
-
 void TestController::runModal(WKPageRef page, const void* clientInfo)
 {
     PlatformWebView* view = static_cast<PlatformWebView*>(const_cast<void*>(clientInfo));
@@ -233,7 +220,7 @@
         runBeforeUnloadConfirmPanel,
         0, // didDraw
         0, // pageDidScroll
-        exceededDatabaseQuota,
+        0, // exceededDatabaseQuota
         0, // runOpenPanel
         decidePolicyForGeolocationPermissionRequest,
         0, // headerHeight
@@ -434,7 +421,7 @@
         runBeforeUnloadConfirmPanel,
         0, // didDraw
         0, // pageDidScroll
-        exceededDatabaseQuota,
+        0, // exceededDatabaseQuota,
         0, // runOpenPanel
         decidePolicyForGeolocationPermissionRequest,
         0, // headerHeight
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to