Skip to content
Permalink
Browse files
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:

Canonical link: https://commits.webkit.org/170428@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@194124 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
Anders Carlsson committed Dec 16, 2015
1 parent 11696c7 commit ee18cf015ed64300a962e95cfd056a33314c7c91
@@ -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)
@@ -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)
@@ -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;
@@ -133,10 +133,6 @@ class InjectedBundle : public API::ObjectImpl<API::Object::Type::Bundle> {
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);

0 comments on commit ee18cf0

Please sign in to comment.