diff options
Diffstat (limited to 'Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundle.cpp')
-rw-r--r-- | Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundle.cpp | 116 |
1 files changed, 24 insertions, 92 deletions
diff --git a/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundle.cpp b/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundle.cpp index bc0ca142e..b1baace96 100644 --- a/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundle.cpp +++ b/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundle.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010 Apple Inc. All rights reserved. + * Copyright (C) 2010-2016 Apple Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -29,10 +29,17 @@ #include "APIArray.h" #include "APIData.h" #include "InjectedBundle.h" +#include "InjectedBundleScriptWorld.h" #include "WKAPICast.h" #include "WKBundleAPICast.h" #include "WKBundlePrivate.h" +#include "WebConnection.h" +#include "WebFrame.h" +#include "WebPage.h" +#include "WebPageGroupProxy.h" +#include <WebCore/DatabaseTracker.h> +using namespace WebCore; using namespace WebKit; WKTypeID WKBundleGetTypeID() @@ -55,7 +62,7 @@ void WKBundlePostSynchronousMessage(WKBundleRef bundleRef, WKStringRef messageNa RefPtr<API::Object> returnData; toImpl(bundleRef)->postSynchronousMessage(toWTFString(messageNameRef), toImpl(messageBodyRef), returnData); if (returnDataRef) - *returnDataRef = toAPI(returnData.release().leakRef()); + *returnDataRef = toAPI(returnData.leakRef()); } WKConnectionRef WKBundleGetApplicationConnection(WKBundleRef bundleRef) @@ -63,26 +70,6 @@ WKConnectionRef WKBundleGetApplicationConnection(WKBundleRef bundleRef) return toAPI(toImpl(bundleRef)->webConnectionToUIProcess()); } -void WKBundleSetShouldTrackVisitedLinks(WKBundleRef bundleRef, bool shouldTrackVisitedLinks) -{ - toImpl(bundleRef)->setShouldTrackVisitedLinks(shouldTrackVisitedLinks); -} - -void WKBundleRemoveAllVisitedLinks(WKBundleRef bundleRef) -{ - toImpl(bundleRef)->removeAllVisitedLinks(); -} - -void WKBundleActivateMacFontAscentHack(WKBundleRef bundleRef) -{ - toImpl(bundleRef)->activateMacFontAscentHack(); -} - -void WKBundleSetCacheModel(WKBundleRef bundleRef, uint32_t cacheModel) -{ - toImpl(bundleRef)->setCacheModel(cacheModel); -} - void WKBundleGarbageCollectJavaScriptObjects(WKBundleRef bundleRef) { toImpl(bundleRef)->garbageCollectJavaScriptObjects(); @@ -98,12 +85,7 @@ size_t WKBundleGetJavaScriptObjectsCount(WKBundleRef bundleRef) return toImpl(bundleRef)->javaScriptObjectsCount(); } -void WKBundleSetAlwaysAcceptCookies(WKBundleRef bundleRef, bool accept) -{ - toImpl(bundleRef)->setAlwaysAcceptCookies(accept); -} - -void WKBundleAddUserScript(WKBundleRef bundleRef, WKBundlePageGroupRef pageGroupRef, WKBundleScriptWorldRef scriptWorldRef, WKStringRef sourceRef, WKURLRef urlRef, WKArrayRef whitelistRef, WKArrayRef blacklistRef, WKUserScriptInjectionTime injectionTimeRef, WKUserContentInjectedFrames injectedFramesRef) +void WKBundleAddUserScript(WKBundleRef bundleRef, WKBundlePageGroupRef pageGroupRef, WKBundleScriptWorldRef scriptWorldRef, WKStringRef sourceRef, WKURLRef urlRef, WKArrayRef whitelistRef, WKArrayRef blacklistRef, _WKUserScriptInjectionTime injectionTimeRef, WKUserContentInjectedFrames injectedFramesRef) { toImpl(bundleRef)->addUserScript(toImpl(pageGroupRef), toImpl(scriptWorldRef), toWTFString(sourceRef), toWTFString(urlRef), toImpl(whitelistRef), toImpl(blacklistRef), toUserScriptInjectionTime(injectionTimeRef), toUserContentInjectedFrames(injectedFramesRef)); } @@ -153,6 +135,11 @@ void WKBundleSetAllowFileAccessFromFileURLs(WKBundleRef bundleRef, WKBundlePageG toImpl(bundleRef)->setAllowFileAccessFromFileURLs(toImpl(pageGroupRef), enabled); } +void WKBundleSetAllowStorageAccessFromFileURLS(WKBundleRef bundleRef, WKBundlePageGroupRef pageGroupRef, bool needsQuirk) +{ + toImpl(bundleRef)->setNeedsStorageAccessFromFileURLsQuirk(toImpl(pageGroupRef), needsQuirk); +} + void WKBundleSetMinimumLogicalFontSize(WKBundleRef bundleRef, WKBundlePageGroupRef pageGroupRef, int size) { toImpl(bundleRef)->setMinimumLogicalFontSize(toImpl(pageGroupRef), size); @@ -163,11 +150,6 @@ void WKBundleSetFrameFlatteningEnabled(WKBundleRef bundleRef, WKBundlePageGroupR toImpl(bundleRef)->setFrameFlatteningEnabled(toImpl(pageGroupRef), enabled); } -void WKBundleSetPluginsEnabled(WKBundleRef bundleRef, WKBundlePageGroupRef pageGroupRef, bool enabled) -{ - toImpl(bundleRef)->setPluginsEnabled(toImpl(pageGroupRef), enabled); -} - void WKBundleSetJavaScriptCanAccessClipboard(WKBundleRef bundleRef, WKBundlePageGroupRef pageGroupRef, bool enabled) { toImpl(bundleRef)->setJavaScriptCanAccessClipboard(toImpl(pageGroupRef), enabled); @@ -178,6 +160,11 @@ void WKBundleSetPrivateBrowsingEnabled(WKBundleRef bundleRef, WKBundlePageGroupR toImpl(bundleRef)->setPrivateBrowsingEnabled(toImpl(pageGroupRef), enabled); } +void WKBundleSetUseDashboardCompatibilityMode(WKBundleRef bundleRef, WKBundlePageGroupRef pageGroupRef, bool enabled) +{ + toImpl(bundleRef)->setUseDashboardCompatibilityMode(toImpl(pageGroupRef), enabled); +} + void WKBundleSetPopupBlockingEnabled(WKBundleRef bundleRef, WKBundlePageGroupRef pageGroupRef, bool enabled) { toImpl(bundleRef)->setPopupBlockingEnabled(toImpl(pageGroupRef), enabled); @@ -218,50 +205,15 @@ void WKBundleReportException(JSContextRef context, JSValueRef exception) InjectedBundle::reportException(context, exception); } -void WKBundleClearAllDatabases(WKBundleRef bundleRef) +void WKBundleClearAllDatabases(WKBundleRef) { - toImpl(bundleRef)->clearAllDatabases(); + DatabaseTracker::singleton().deleteAllDatabasesImmediately(); } void WKBundleSetDatabaseQuota(WKBundleRef bundleRef, uint64_t quota) { - toImpl(bundleRef)->setDatabaseQuota(quota); -} - -void WKBundleClearApplicationCache(WKBundleRef bundleRef) -{ - toImpl(bundleRef)->clearApplicationCache(); -} - -void WKBundleClearApplicationCacheForOrigin(WKBundleRef bundleRef, WKStringRef origin) -{ - toImpl(bundleRef)->clearApplicationCacheForOrigin(toWTFString(origin)); -} - -void WKBundleSetAppCacheMaximumSize(WKBundleRef bundleRef, uint64_t size) -{ - toImpl(bundleRef)->setAppCacheMaximumSize(size); -} - -uint64_t WKBundleGetAppCacheUsageForOrigin(WKBundleRef bundleRef, WKStringRef origin) -{ - return toImpl(bundleRef)->appCacheUsageForOrigin(toWTFString(origin)); -} - -void WKBundleSetApplicationCacheOriginQuota(WKBundleRef bundleRef, WKStringRef origin, uint64_t bytes) -{ - toImpl(bundleRef)->setApplicationCacheOriginQuota(toWTFString(origin), bytes); -} - -void WKBundleResetApplicationCacheOriginQuota(WKBundleRef bundleRef, WKStringRef origin) -{ - toImpl(bundleRef)->resetApplicationCacheOriginQuota(toWTFString(origin)); -} - -WKArrayRef WKBundleCopyOriginsWithApplicationCache(WKBundleRef bundleRef) -{ - RefPtr<API::Array> origins = toImpl(bundleRef)->originsWithApplicationCache(); - return toAPI(origins.release().leakRef()); + // Historically, we've used the following (somewhat nonsensical) string for the databaseIdentifier of local files. + DatabaseTracker::singleton().setQuota(*SecurityOriginData::fromDatabaseIdentifier("file__0"), quota); } WKDataRef WKBundleCreateWKDataFromUInt8Array(WKBundleRef bundle, JSContextRef context, JSValueRef data) @@ -318,23 +270,3 @@ void WKBundleSetTabKeyCyclesThroughElements(WKBundleRef bundleRef, WKBundlePageR { toImpl(bundleRef)->setTabKeyCyclesThroughElements(toImpl(pageRef), enabled); } - -void WKBundleSetSerialLoadingEnabled(WKBundleRef bundleRef, bool enabled) -{ - toImpl(bundleRef)->setSerialLoadingEnabled(enabled); -} - -void WKBundleSetShadowDOMEnabled(WKBundleRef bundleRef, bool enabled) -{ - toImpl(bundleRef)->setShadowDOMEnabled(enabled); -} - -void WKBundleSetSeamlessIFramesEnabled(WKBundleRef bundleRef, bool enabled) -{ - toImpl(bundleRef)->setSeamlessIFramesEnabled(enabled); -} - -void WKBundleDispatchPendingLoadRequests(WKBundleRef bundleRef) -{ - toImpl(bundleRef)->dispatchPendingLoadRequests(); -} |