Call DatabaseManager directly from WKBundle.cpp
authorandersca@apple.com <andersca@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 16 Dec 2015 00:52:55 +0000 (00:52 +0000)
committerandersca@apple.com <andersca@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 16 Dec 2015 00:52:55 +0000 (00:52 +0000)
https://bugs.webkit.org/show_bug.cgi?id=152317

Reviewed by Tim Horton.

This is in preparation for getting rid of some old database manager code.

* WebProcess/InjectedBundle/API/c/WKBundle.cpp:
(WKBundleClearAllDatabases):
(WKBundleSetDatabaseQuota):
* WebProcess/InjectedBundle/InjectedBundle.cpp:
(WebKit::InjectedBundle::clearAllDatabases): Deleted.
(WebKit::InjectedBundle::setDatabaseQuota): Deleted.
* WebProcess/InjectedBundle/InjectedBundle.h:

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

Source/WebKit2/ChangeLog
Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundle.cpp
Source/WebKit2/WebProcess/InjectedBundle/InjectedBundle.cpp
Source/WebKit2/WebProcess/InjectedBundle/InjectedBundle.h

index d392b01..d966067 100644 (file)
@@ -1,3 +1,20 @@
+2015-12-15  Anders Carlsson  <andersca@apple.com>
+
+        Call DatabaseManager directly from WKBundle.cpp
+        https://bugs.webkit.org/show_bug.cgi?id=152317
+
+        Reviewed by Tim Horton.
+
+        This is in preparation for getting rid of some old database manager code.
+
+        * WebProcess/InjectedBundle/API/c/WKBundle.cpp:
+        (WKBundleClearAllDatabases):
+        (WKBundleSetDatabaseQuota):
+        * WebProcess/InjectedBundle/InjectedBundle.cpp:
+        (WebKit::InjectedBundle::clearAllDatabases): Deleted.
+        (WebKit::InjectedBundle::setDatabaseQuota): Deleted.
+        * WebProcess/InjectedBundle/InjectedBundle.h:
+
 2015-12-15  Daniel Bates  <dabates@apple.com>
 
         Guard code that uses class LayerTreeHost with USE(COORDINATED_GRAPHICS) or USE(TEXTURE_MAPPER)
index dbe8c15..3320f61 100644 (file)
@@ -37,7 +37,9 @@
 #include "WebFrame.h"
 #include "WebPage.h"
 #include "WebPageGroupProxy.h"
+#include <WebCore/DatabaseManager.h>
 
+using namespace WebCore;
 using namespace WebKit;
 
 WKTypeID WKBundleGetTypeID()
@@ -198,14 +200,16 @@ void WKBundleReportException(JSContextRef context, JSValueRef exception)
     InjectedBundle::reportException(context, exception);
 }
 
-void WKBundleClearAllDatabases(WKBundleRef bundleRef)
+void WKBundleClearAllDatabases(WKBundleRef)
 {
-    toImpl(bundleRef)->clearAllDatabases();
+    DatabaseManager::singleton().deleteAllDatabases();
 }
 
 void WKBundleSetDatabaseQuota(WKBundleRef bundleRef, uint64_t quota)
 {
-    toImpl(bundleRef)->setDatabaseQuota(quota);
+    // Historically, we've used the following (somewhat non-sensical) string
+    // for the databaseIdentifier of local files.
+    DatabaseManager::singleton().setQuota(SecurityOrigin::createFromDatabaseIdentifier("file__0").ptr(), quota);
 }
 
 WKDataRef WKBundleCreateWKDataFromUInt8Array(WKBundleRef bundle, JSContextRef context, JSValueRef data)
index 96976ad..5dec37a 100644 (file)
@@ -342,18 +342,6 @@ void InjectedBundle::setAsynchronousSpellCheckingEnabled(WebPageGroupProxy* page
         (*iter)->settings().setAsynchronousSpellCheckingEnabled(enabled);
 }
 
-void InjectedBundle::clearAllDatabases()
-{
-    WebProcess::singleton().supplement<WebDatabaseManager>()->deleteAllDatabases();
-}
-
-void InjectedBundle::setDatabaseQuota(uint64_t quota)
-{
-    // Historically, we've used the following (somewhat non-sensical) string
-    // for the databaseIdentifier of local files.
-    WebProcess::singleton().supplement<WebDatabaseManager>()->setQuotaForOrigin("file__0", quota);
-}
-
 int InjectedBundle::numberOfPages(WebFrame* frame, double pageWidthInPixels, double pageHeightInPixels)
 {
     Frame* coreFrame = frame ? frame->coreFrame() : 0;
index 138712b..609512f 100644 (file)
@@ -133,10 +133,6 @@ public:
     void removeUserStyleSheets(WebPageGroupProxy*, InjectedBundleScriptWorld*);
     void removeAllUserContent(WebPageGroupProxy*);
 
-    // Local storage API
-    void clearAllDatabases();
-    void setDatabaseQuota(uint64_t);
-
     // Garbage collection API
     void garbageCollectJavaScriptObjects();
     void garbageCollectJavaScriptObjectsOnAlternateThreadForDebugging(bool waitUntilDone);