summaryrefslogtreecommitdiff
path: root/Source/WebKit2/UIProcess/API/C/WKContext.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Source/WebKit2/UIProcess/API/C/WKContext.cpp')
-rw-r--r--Source/WebKit2/UIProcess/API/C/WKContext.cpp391
1 files changed, 281 insertions, 110 deletions
diff --git a/Source/WebKit2/UIProcess/API/C/WKContext.cpp b/Source/WebKit2/UIProcess/API/C/WKContext.cpp
index f5a9cb635..2cce4da50 100644
--- a/Source/WebKit2/UIProcess/API/C/WKContext.cpp
+++ b/Source/WebKit2/UIProcess/API/C/WKContext.cpp
@@ -24,52 +24,64 @@
*/
#include "config.h"
-#include "WKContext.h"
#include "WKContextPrivate.h"
+#include "APIClient.h"
+#include "APIDownloadClient.h"
+#include "APILegacyContextHistoryClient.h"
+#include "APINavigationData.h"
+#include "APIProcessPoolConfiguration.h"
#include "APIURLRequest.h"
+#include "AuthenticationChallengeProxy.h"
+#include "DownloadProxy.h"
#include "WKAPICast.h"
-#include "WebContext.h"
-#include <wtf/PassRefPtr.h>
+#include "WKContextConfigurationRef.h"
+#include "WKRetainPtr.h"
+#include "WebCertificateInfo.h"
+#include "WebIconDatabase.h"
+#include "WebProcessPool.h"
#include <wtf/RefPtr.h>
#include <wtf/text/WTFString.h>
// Supplements
-#include "WebApplicationCacheManagerProxy.h"
#include "WebCookieManagerProxy.h"
#include "WebGeolocationManagerProxy.h"
-#include "WebKeyValueStorageManager.h"
-#include "WebMediaCacheManagerProxy.h"
#include "WebNotificationManagerProxy.h"
-#include "WebOriginDataManagerProxy.h"
-#include "WebResourceCacheManagerProxy.h"
-#if ENABLE(SQL_DATABASE)
-#include "WebDatabaseManagerProxy.h"
-#endif
-#if ENABLE(BATTERY_STATUS)
-#include "WebBatteryManagerProxy.h"
-#endif
-#if ENABLE(NETWORK_INFO)
-#include "WebNetworkInfoManagerProxy.h"
-#endif
+namespace API {
+template<> struct ClientTraits<WKContextDownloadClientBase> {
+ typedef std::tuple<WKContextDownloadClientV0> Versions;
+};
+template<> struct ClientTraits<WKContextHistoryClientBase> {
+ typedef std::tuple<WKContextHistoryClientV0> Versions;
+};
+}
+
+using namespace WebCore;
using namespace WebKit;
WKTypeID WKContextGetTypeID()
{
- return toAPI(WebContext::APIType);
+ return toAPI(WebProcessPool::APIType);
}
WKContextRef WKContextCreate()
{
- RefPtr<WebContext> context = WebContext::create(String());
- return toAPI(context.release().leakRef());
+ auto configuration = API::ProcessPoolConfiguration::createWithLegacyOptions();
+ return toAPI(&WebProcessPool::create(configuration).leakRef());
}
WKContextRef WKContextCreateWithInjectedBundlePath(WKStringRef pathRef)
{
- RefPtr<WebContext> context = WebContext::create(toImpl(pathRef)->string());
- return toAPI(context.release().leakRef());
+ auto configuration = API::ProcessPoolConfiguration::createWithLegacyOptions();
+ configuration->setInjectedBundlePath(toWTFString(pathRef));
+
+ return toAPI(&WebProcessPool::create(configuration).leakRef());
+}
+
+WKContextRef WKContextCreateWithConfiguration(WKContextConfigurationRef configuration)
+{
+ return toAPI(&WebProcessPool::create(*toImpl(configuration)).leakRef());
}
void WKContextSetClient(WKContextRef contextRef, const WKContextClientBase* wkClient)
@@ -84,12 +96,173 @@ void WKContextSetInjectedBundleClient(WKContextRef contextRef, const WKContextIn
void WKContextSetHistoryClient(WKContextRef contextRef, const WKContextHistoryClientBase* wkClient)
{
- toImpl(contextRef)->initializeHistoryClient(wkClient);
+ class HistoryClient final : public API::Client<WKContextHistoryClientBase>, public API::LegacyContextHistoryClient {
+ public:
+ explicit HistoryClient(const WKContextHistoryClientBase* client)
+ {
+ initialize(client);
+ }
+
+ private:
+ void didNavigateWithNavigationData(WebProcessPool& processPool, WebPageProxy& page, const WebNavigationDataStore& navigationDataStore, WebFrameProxy& frame) override
+ {
+ if (!m_client.didNavigateWithNavigationData)
+ return;
+
+ RefPtr<API::NavigationData> navigationData = API::NavigationData::create(navigationDataStore);
+ m_client.didNavigateWithNavigationData(toAPI(&processPool), toAPI(&page), toAPI(navigationData.get()), toAPI(&frame), m_client.base.clientInfo);
+ }
+
+ void didPerformClientRedirect(WebProcessPool& processPool, WebPageProxy& page, const String& sourceURL, const String& destinationURL, WebFrameProxy& frame) override
+ {
+ if (!m_client.didPerformClientRedirect)
+ return;
+
+ m_client.didPerformClientRedirect(toAPI(&processPool), toAPI(&page), toURLRef(sourceURL.impl()), toURLRef(destinationURL.impl()), toAPI(&frame), m_client.base.clientInfo);
+ }
+
+ void didPerformServerRedirect(WebProcessPool& processPool, WebPageProxy& page, const String& sourceURL, const String& destinationURL, WebFrameProxy& frame) override
+ {
+ if (!m_client.didPerformServerRedirect)
+ return;
+
+ m_client.didPerformServerRedirect(toAPI(&processPool), toAPI(&page), toURLRef(sourceURL.impl()), toURLRef(destinationURL.impl()), toAPI(&frame), m_client.base.clientInfo);
+ }
+
+ void didUpdateHistoryTitle(WebProcessPool& processPool, WebPageProxy& page, const String& title, const String& url, WebFrameProxy& frame) override
+ {
+ if (!m_client.didUpdateHistoryTitle)
+ return;
+
+ m_client.didUpdateHistoryTitle(toAPI(&processPool), toAPI(&page), toAPI(title.impl()), toURLRef(url.impl()), toAPI(&frame), m_client.base.clientInfo);
+ }
+
+ void populateVisitedLinks(WebProcessPool& processPool) override
+ {
+ if (!m_client.populateVisitedLinks)
+ return;
+
+ m_client.populateVisitedLinks(toAPI(&processPool), m_client.base.clientInfo);
+ }
+
+ bool addsVisitedLinks() const override
+ {
+ return m_client.populateVisitedLinks;
+ }
+ };
+
+ WebProcessPool& processPool = *toImpl(contextRef);
+ processPool.setHistoryClient(std::make_unique<HistoryClient>(wkClient));
+
+ bool addsVisitedLinks = processPool.historyClient().addsVisitedLinks();
+
+ for (auto& process : processPool.processes()) {
+ for (auto& page : process->pages())
+ page->setAddsVisitedLinks(addsVisitedLinks);
+ }
}
void WKContextSetDownloadClient(WKContextRef contextRef, const WKContextDownloadClientBase* wkClient)
{
- toImpl(contextRef)->initializeDownloadClient(wkClient);
+ class DownloadClient final : public API::Client<WKContextDownloadClientBase>, public API::DownloadClient {
+ public:
+ explicit DownloadClient(const WKContextDownloadClientBase* client)
+ {
+ initialize(client);
+ }
+ private:
+ void didStart(WebProcessPool* processPool, DownloadProxy* downloadProxy) override
+ {
+ if (!m_client.didStart)
+ return;
+
+ m_client.didStart(toAPI(processPool), toAPI(downloadProxy), m_client.base.clientInfo);
+ }
+
+ void didReceiveAuthenticationChallenge(WebProcessPool* processPool, DownloadProxy* downloadProxy, AuthenticationChallengeProxy* authenticationChallengeProxy) override
+ {
+ if (!m_client.didReceiveAuthenticationChallenge)
+ return;
+
+ m_client.didReceiveAuthenticationChallenge(toAPI(processPool), toAPI(downloadProxy), toAPI(authenticationChallengeProxy), m_client.base.clientInfo);
+ }
+
+ void didReceiveResponse(WebProcessPool* processPool, DownloadProxy* downloadProxy, const ResourceResponse& response) override
+ {
+ if (!m_client.didReceiveResponse)
+ return;
+
+ m_client.didReceiveResponse(toAPI(processPool), toAPI(downloadProxy), toAPI(API::URLResponse::create(response).ptr()), m_client.base.clientInfo);
+ }
+
+ void didReceiveData(WebProcessPool* processPool, DownloadProxy* downloadProxy, uint64_t length) override
+ {
+ if (!m_client.didReceiveData)
+ return;
+
+ m_client.didReceiveData(toAPI(processPool), toAPI(downloadProxy), length, m_client.base.clientInfo);
+ }
+
+ bool shouldDecodeSourceDataOfMIMEType(WebProcessPool* processPool, DownloadProxy* downloadProxy, const String& mimeType) override
+ {
+ if (!m_client.shouldDecodeSourceDataOfMIMEType)
+ return true;
+
+ return m_client.shouldDecodeSourceDataOfMIMEType(toAPI(processPool), toAPI(downloadProxy), toAPI(mimeType.impl()), m_client.base.clientInfo);
+ }
+
+ String decideDestinationWithSuggestedFilename(WebProcessPool* processPool, DownloadProxy* downloadProxy, const String& filename, bool& allowOverwrite) override
+ {
+ if (!m_client.decideDestinationWithSuggestedFilename)
+ return String();
+
+ WKRetainPtr<WKStringRef> destination(AdoptWK, m_client.decideDestinationWithSuggestedFilename(toAPI(processPool), toAPI(downloadProxy), toAPI(filename.impl()), &allowOverwrite, m_client.base.clientInfo));
+ return toWTFString(destination.get());
+ }
+
+ void didCreateDestination(WebProcessPool* processPool, DownloadProxy* downloadProxy, const String& path) override
+ {
+ if (!m_client.didCreateDestination)
+ return;
+
+ m_client.didCreateDestination(toAPI(processPool), toAPI(downloadProxy), toAPI(path.impl()), m_client.base.clientInfo);
+ }
+
+ void didFinish(WebProcessPool* processPool, DownloadProxy* downloadProxy) override
+ {
+ if (!m_client.didFinish)
+ return;
+
+ m_client.didFinish(toAPI(processPool), toAPI(downloadProxy), m_client.base.clientInfo);
+ }
+
+ void didFail(WebProcessPool* processPool, DownloadProxy* downloadProxy, const ResourceError& error) override
+ {
+ if (!m_client.didFail)
+ return;
+
+ m_client.didFail(toAPI(processPool), toAPI(downloadProxy), toAPI(error), m_client.base.clientInfo);
+ }
+
+ void didCancel(WebProcessPool* processPool, DownloadProxy* downloadProxy) override
+ {
+ if (!m_client.didCancel)
+ return;
+
+ m_client.didCancel(toAPI(processPool), toAPI(downloadProxy), m_client.base.clientInfo);
+ }
+
+ void processDidCrash(WebProcessPool* processPool, DownloadProxy* downloadProxy) override
+ {
+ if (!m_client.processDidCrash)
+ return;
+
+ m_client.processDidCrash(toAPI(processPool), toAPI(downloadProxy), m_client.base.clientInfo);
+ }
+
+ };
+
+ toImpl(contextRef)->setDownloadClient(std::make_unique<DownloadClient>(wkClient));
}
void WKContextSetConnectionClient(WKContextRef contextRef, const WKContextConnectionClientBase* wkClient)
@@ -97,11 +270,16 @@ void WKContextSetConnectionClient(WKContextRef contextRef, const WKContextConnec
toImpl(contextRef)->initializeConnectionClient(wkClient);
}
-WKDownloadRef WKContextDownloadURLRequest(WKContextRef contextRef, const WKURLRequestRef requestRef)
+WKDownloadRef WKContextDownloadURLRequest(WKContextRef contextRef, WKURLRequestRef requestRef)
{
return toAPI(toImpl(contextRef)->download(0, toImpl(requestRef)->resourceRequest()));
}
+WKDownloadRef WKContextResumeDownload(WKContextRef contextRef, WKDataRef resumeData, WKStringRef path)
+{
+ return toAPI(toImpl(contextRef)->resumeDownload(toImpl(resumeData), toWTFString(path)));
+}
+
void WKContextSetInitializationUserDataForInjectedBundle(WKContextRef contextRef, WKTypeRef userDataRef)
{
toImpl(contextRef)->setInjectedBundleInitializationUserData(toImpl(userDataRef));
@@ -114,7 +292,7 @@ void WKContextPostMessageToInjectedBundle(WKContextRef contextRef, WKStringRef m
void WKContextGetGlobalStatistics(WKContextStatistics* statistics)
{
- const WebContext::Statistics& webContextStatistics = WebContext::statistics();
+ const WebProcessPool::Statistics& webContextStatistics = WebProcessPool::statistics();
statistics->wkViewCount = webContextStatistics.wkViewCount;
statistics->wkPageCount = webContextStatistics.wkPageCount;
@@ -123,27 +301,26 @@ void WKContextGetGlobalStatistics(WKContextStatistics* statistics)
void WKContextAddVisitedLink(WKContextRef contextRef, WKStringRef visitedURL)
{
- toImpl(contextRef)->addVisitedLink(toImpl(visitedURL)->string());
-}
+ String visitedURLString = toImpl(visitedURL)->string();
+ if (visitedURLString.isEmpty())
+ return;
-void WKContextSetCacheModel(WKContextRef contextRef, WKCacheModel cacheModel)
-{
- toImpl(contextRef)->setCacheModel(toCacheModel(cacheModel));
+ toImpl(contextRef)->visitedLinkStore().addVisitedLinkHash(visitedLinkHash(visitedURLString));
}
-WKCacheModel WKContextGetCacheModel(WKContextRef contextRef)
+void WKContextClearVisitedLinks(WKContextRef contextRef)
{
- return toAPI(toImpl(contextRef)->cacheModel());
+ toImpl(contextRef)->visitedLinkStore().removeAll();
}
-void WKContextSetProcessModel(WKContextRef contextRef, WKProcessModel processModel)
+void WKContextSetCacheModel(WKContextRef contextRef, WKCacheModel cacheModel)
{
- toImpl(contextRef)->setProcessModel(toProcessModel(processModel));
+ toImpl(contextRef)->setCacheModel(toCacheModel(cacheModel));
}
-WKProcessModel WKContextGetProcessModel(WKContextRef contextRef)
+WKCacheModel WKContextGetCacheModel(WKContextRef contextRef)
{
- return toAPI(toImpl(contextRef)->processModel());
+ return toAPI(toImpl(contextRef)->cacheModel());
}
void WKContextSetMaximumNumberOfProcesses(WKContextRef contextRef, unsigned numberOfProcesses)
@@ -176,6 +353,15 @@ void WKContextSetAdditionalPluginsDirectory(WKContextRef contextRef, WKStringRef
#endif
}
+void WKContextRefreshPlugIns(WKContextRef context)
+{
+#if ENABLE(NETSCAPE_PLUGIN_API)
+ toImpl(context)->refreshPlugins();
+#else
+ UNUSED_PARAM(context);
+#endif
+}
+
void WKContextRegisterURLSchemeAsEmptyDocument(WKContextRef contextRef, WKStringRef urlScheme)
{
toImpl(contextRef)->registerURLSchemeAsEmptyDocument(toImpl(urlScheme)->string());
@@ -186,94 +372,84 @@ void WKContextRegisterURLSchemeAsSecure(WKContextRef contextRef, WKStringRef url
toImpl(contextRef)->registerURLSchemeAsSecure(toImpl(urlScheme)->string());
}
-void WKContextSetDomainRelaxationForbiddenForURLScheme(WKContextRef contextRef, WKStringRef urlScheme)
+void WKContextRegisterURLSchemeAsBypassingContentSecurityPolicy(WKContextRef contextRef, WKStringRef urlScheme)
{
- toImpl(contextRef)->setDomainRelaxationForbiddenForURLScheme(toImpl(urlScheme)->string());
+ toImpl(contextRef)->registerURLSchemeAsBypassingContentSecurityPolicy(toImpl(urlScheme)->string());
}
-WKCookieManagerRef WKContextGetCookieManager(WKContextRef contextRef)
+void WKContextRegisterURLSchemeAsCachePartitioned(WKContextRef contextRef, WKStringRef urlScheme)
{
- return toAPI(toImpl(contextRef)->supplement<WebCookieManagerProxy>());
+ toImpl(contextRef)->registerURLSchemeAsCachePartitioned(toImpl(urlScheme)->string());
}
-WKApplicationCacheManagerRef WKContextGetApplicationCacheManager(WKContextRef contextRef)
+void WKContextSetDomainRelaxationForbiddenForURLScheme(WKContextRef contextRef, WKStringRef urlScheme)
{
- return toAPI(toImpl(contextRef)->supplement<WebApplicationCacheManagerProxy>());
+ toImpl(contextRef)->setDomainRelaxationForbiddenForURLScheme(toImpl(urlScheme)->string());
}
-WKBatteryManagerRef WKContextGetBatteryManager(WKContextRef contextRef)
+void WKContextSetCanHandleHTTPSServerTrustEvaluation(WKContextRef contextRef, bool value)
{
-#if ENABLE(BATTERY_STATUS)
- return toAPI(toImpl(contextRef)->supplement<WebBatteryManagerProxy>());
-#else
- UNUSED_PARAM(contextRef);
- return 0;
-#endif
+ toImpl(contextRef)->setCanHandleHTTPSServerTrustEvaluation(value);
}
-WKDatabaseManagerRef WKContextGetDatabaseManager(WKContextRef contextRef)
+void WKContextSetDiskCacheSpeculativeValidationEnabled(WKContextRef contextRef, bool value)
{
-#if ENABLE(SQL_DATABASE)
- return toAPI(toImpl(contextRef)->supplement<WebDatabaseManagerProxy>());
-#else
- UNUSED_PARAM(contextRef);
- return 0;
-#endif
+ toImpl(contextRef)->configuration().setDiskCacheSpeculativeValidationEnabled(value);
}
-WKGeolocationManagerRef WKContextGetGeolocationManager(WKContextRef contextRef)
+void WKContextSetUnresponsiveBackgroundProcessesTerminationEnabled(WKContextRef contextRef, bool value)
{
- return toAPI(toImpl(contextRef)->supplement<WebGeolocationManagerProxy>());
+ toImpl(contextRef)->configuration().setUnresponsiveBackgroundProcessesTerminationEnabled(value);
}
-WKNetworkInfoManagerRef WKContextGetNetworkInfoManager(WKContextRef contextRef)
+WKCookieManagerRef WKContextGetCookieManager(WKContextRef contextRef)
{
-#if ENABLE(NETWORK_INFO)
- return toAPI(toImpl(contextRef)->supplement<WebNetworkInfoManagerProxy>());
-#else
- UNUSED_PARAM(contextRef);
- return 0;
-#endif
+ return toAPI(toImpl(contextRef)->supplement<WebCookieManagerProxy>());
}
-WKIconDatabaseRef WKContextGetIconDatabase(WKContextRef contextRef)
+WKWebsiteDataStoreRef WKContextGetWebsiteDataStore(WKContextRef context)
{
- return toAPI(toImpl(contextRef)->iconDatabase());
+ return toAPI(toImpl(context)->websiteDataStore());
}
-WKKeyValueStorageManagerRef WKContextGetKeyValueStorageManager(WKContextRef contextRef)
+WKApplicationCacheManagerRef WKContextGetApplicationCacheManager(WKContextRef context)
{
- return toAPI(toImpl(contextRef)->supplement<WebKeyValueStorageManager>());
+ return reinterpret_cast<WKApplicationCacheManagerRef>(WKContextGetWebsiteDataStore(context));
}
-WKMediaCacheManagerRef WKContextGetMediaCacheManager(WKContextRef contextRef)
+WKGeolocationManagerRef WKContextGetGeolocationManager(WKContextRef contextRef)
{
- return toAPI(toImpl(contextRef)->supplement<WebMediaCacheManagerProxy>());
+ return toAPI(toImpl(contextRef)->supplement<WebGeolocationManagerProxy>());
}
-WKNotificationManagerRef WKContextGetNotificationManager(WKContextRef contextRef)
+WKIconDatabaseRef WKContextGetIconDatabase(WKContextRef contextRef)
{
- return toAPI(toImpl(contextRef)->supplement<WebNotificationManagerProxy>());
+ return toAPI(toImpl(contextRef)->iconDatabase());
}
-WKPluginSiteDataManagerRef WKContextGetPluginSiteDataManager(WKContextRef contextRef)
+WKKeyValueStorageManagerRef WKContextGetKeyValueStorageManager(WKContextRef context)
{
-#if ENABLE(NETSCAPE_PLUGIN_API)
- return toAPI(toImpl(contextRef)->pluginSiteDataManager());
+ return reinterpret_cast<WKKeyValueStorageManagerRef>(WKContextGetWebsiteDataStore(context));
+}
+
+WKMediaSessionFocusManagerRef WKContextGetMediaSessionFocusManager(WKContextRef context)
+{
+#if ENABLE(MEDIA_SESSION)
+ return toAPI(toImpl(context)->supplement<WebMediaSessionFocusManager>());
#else
- UNUSED_PARAM(contextRef);
- return 0;
+ UNUSED_PARAM(context);
+ return nullptr;
#endif
}
-WKResourceCacheManagerRef WKContextGetResourceCacheManager(WKContextRef contextRef)
+WKNotificationManagerRef WKContextGetNotificationManager(WKContextRef contextRef)
{
- return toAPI(toImpl(contextRef)->supplement<WebResourceCacheManagerProxy>());
+ return toAPI(toImpl(contextRef)->supplement<WebNotificationManagerProxy>());
}
-WKOriginDataManagerRef WKContextGetOriginDataManager(WKContextRef contextRef)
+WKResourceCacheManagerRef WKContextGetResourceCacheManager(WKContextRef context)
{
- return toAPI(toImpl(contextRef)->supplement<WebOriginDataManagerProxy>());
+ return reinterpret_cast<WKResourceCacheManagerRef>(WKContextGetWebsiteDataStore(context));
}
void WKContextStartMemorySampler(WKContextRef contextRef, WKDoubleRef interval)
@@ -296,26 +472,6 @@ void WKContextAllowSpecificHTTPSCertificateForHost(WKContextRef contextRef, WKCe
toImpl(contextRef)->allowSpecificHTTPSCertificateForHost(toImpl(certificateRef), toImpl(hostRef)->string());
}
-WK_EXPORT void WKContextSetApplicationCacheDirectory(WKContextRef contextRef, WKStringRef applicationCacheDirectory)
-{
- toImpl(contextRef)->setApplicationCacheDirectory(toImpl(applicationCacheDirectory)->string());
-}
-
-void WKContextSetDatabaseDirectory(WKContextRef contextRef, WKStringRef databaseDirectory)
-{
- toImpl(contextRef)->setDatabaseDirectory(toImpl(databaseDirectory)->string());
-}
-
-void WKContextSetLocalStorageDirectory(WKContextRef contextRef, WKStringRef localStorageDirectory)
-{
- toImpl(contextRef)->setLocalStorageDirectory(toImpl(localStorageDirectory)->string());
-}
-
-WK_EXPORT void WKContextSetDiskCacheDirectory(WKContextRef contextRef, WKStringRef diskCacheDirectory)
-{
- toImpl(contextRef)->setDiskCacheDirectory(toImpl(diskCacheDirectory)->string());
-}
-
WK_EXPORT void WKContextSetCookieStorageDirectory(WKContextRef contextRef, WKStringRef cookieStorageDirectory)
{
toImpl(contextRef)->setCookieStorageDirectory(toImpl(cookieStorageDirectory)->string());
@@ -343,12 +499,12 @@ void WKContextWarmInitialProcess(WKContextRef contextRef)
void WKContextGetStatistics(WKContextRef contextRef, void* context, WKContextGetStatisticsFunction callback)
{
- toImpl(contextRef)->getStatistics(0xFFFFFFFF, DictionaryCallback::create(context, callback));
+ toImpl(contextRef)->getStatistics(0xFFFFFFFF, toGenericCallbackFunction(context, callback));
}
void WKContextGetStatisticsWithOptions(WKContextRef contextRef, WKStatisticsOptions optionsMask, void* context, WKContextGetStatisticsFunction callback)
{
- toImpl(contextRef)->getStatistics(optionsMask, DictionaryCallback::create(context, callback));
+ toImpl(contextRef)->getStatistics(optionsMask, toGenericCallbackFunction(context, callback));
}
void WKContextGarbageCollectJavaScriptObjects(WKContextRef contextRef)
@@ -361,14 +517,14 @@ void WKContextSetJavaScriptGarbageCollectorTimerEnabled(WKContextRef contextRef,
toImpl(contextRef)->setJavaScriptGarbageCollectorTimerEnabled(enable);
}
-void WKContextSetUsesNetworkProcess(WKContextRef contextRef, bool usesNetworkProcess)
+void WKContextUseTestingNetworkSession(WKContextRef context)
{
- toImpl(contextRef)->setUsesNetworkProcess(usesNetworkProcess);
+ toImpl(context)->useTestingNetworkSession();
}
-void WKContextUseTestingNetworkSession(WKContextRef context)
+void WKContextClearCachedCredentials(WKContextRef context)
{
- toImpl(context)->useTestingNetworkSession();
+ toImpl(context)->clearCachedCredentials();
}
WKDictionaryRef WKContextCopyPlugInAutoStartOriginHashes(WKContextRef contextRef)
@@ -399,10 +555,25 @@ void WKContextSetPlugInAutoStartOrigins(WKContextRef contextRef, WKArrayRef arra
void WKContextSetInvalidMessageFunction(WKContextInvalidMessageFunction invalidMessageFunction)
{
- WebContext::setInvalidMessageCallback(invalidMessageFunction);
+ WebProcessPool::setInvalidMessageCallback(invalidMessageFunction);
}
void WKContextSetMemoryCacheDisabled(WKContextRef contextRef, bool disabled)
{
toImpl(contextRef)->setMemoryCacheDisabled(disabled);
}
+
+void WKContextSetFontWhitelist(WKContextRef contextRef, WKArrayRef arrayRef)
+{
+ toImpl(contextRef)->setFontWhitelist(toImpl(arrayRef));
+}
+
+pid_t WKContextGetNetworkProcessIdentifier(WKContextRef contextRef)
+{
+ return toImpl(contextRef)->networkProcessIdentifier();
+}
+
+pid_t WKContextGetDatabaseProcessIdentifier(WKContextRef contextRef)
+{
+ return toImpl(contextRef)->databaseProcessIdentifier();
+}