summaryrefslogtreecommitdiff
path: root/Source/WebKit2/UIProcess/API/C
diff options
context:
space:
mode:
Diffstat (limited to 'Source/WebKit2/UIProcess/API/C')
-rw-r--r--Source/WebKit2/UIProcess/API/C/CoordinatedGraphics/WKView.cpp198
-rw-r--r--Source/WebKit2/UIProcess/API/C/CoordinatedGraphics/WKView.h120
-rw-r--r--Source/WebKit2/UIProcess/API/C/WKAPICast.h192
-rw-r--r--Source/WebKit2/UIProcess/API/C/WKApplicationCacheManager.cpp32
-rw-r--r--Source/WebKit2/UIProcess/API/C/WKApplicationCacheManager.h2
-rw-r--r--Source/WebKit2/UIProcess/API/C/WKAuthenticationChallenge.cpp3
-rw-r--r--Source/WebKit2/UIProcess/API/C/WKAuthenticationChallenge.h2
-rw-r--r--Source/WebKit2/UIProcess/API/C/WKAuthenticationDecisionListener.cpp6
-rw-r--r--Source/WebKit2/UIProcess/API/C/WKAuthenticationDecisionListener.h3
-rw-r--r--Source/WebKit2/UIProcess/API/C/WKBackForwardListItemRef.h2
-rw-r--r--Source/WebKit2/UIProcess/API/C/WKBackForwardListRef.cpp4
-rw-r--r--Source/WebKit2/UIProcess/API/C/WKBackForwardListRef.h2
-rw-r--r--Source/WebKit2/UIProcess/API/C/WKBatteryManager.cpp76
-rw-r--r--Source/WebKit2/UIProcess/API/C/WKContext.cpp391
-rw-r--r--Source/WebKit2/UIProcess/API/C/WKContext.h62
-rw-r--r--Source/WebKit2/UIProcess/API/C/WKContextConfigurationRef.cpp133
-rw-r--r--Source/WebKit2/UIProcess/API/C/WKContextConfigurationRef.h69
-rw-r--r--Source/WebKit2/UIProcess/API/C/WKContextConnectionClient.h11
-rw-r--r--Source/WebKit2/UIProcess/API/C/WKContextDownloadClient.h21
-rw-r--r--Source/WebKit2/UIProcess/API/C/WKContextHistoryClient.h15
-rw-r--r--Source/WebKit2/UIProcess/API/C/WKContextInjectedBundleClient.h15
-rw-r--r--Source/WebKit2/UIProcess/API/C/WKContextMenuListener.cpp (renamed from Source/WebKit2/UIProcess/API/C/WKColorPickerResultListener.cpp)24
-rw-r--r--Source/WebKit2/UIProcess/API/C/WKContextMenuListener.h40
-rw-r--r--Source/WebKit2/UIProcess/API/C/WKContextPrivate.h30
-rw-r--r--Source/WebKit2/UIProcess/API/C/WKCookieManager.cpp20
-rw-r--r--Source/WebKit2/UIProcess/API/C/WKCookieManager.h14
-rw-r--r--Source/WebKit2/UIProcess/API/C/WKCredential.cpp8
-rw-r--r--Source/WebKit2/UIProcess/API/C/WKCredential.h4
-rw-r--r--Source/WebKit2/UIProcess/API/C/WKDatabaseManager.cpp216
-rw-r--r--Source/WebKit2/UIProcess/API/C/WKDatabaseManager.h118
-rw-r--r--Source/WebKit2/UIProcess/API/C/WKDownload.cpp5
-rw-r--r--Source/WebKit2/UIProcess/API/C/WKDownload.h2
-rw-r--r--Source/WebKit2/UIProcess/API/C/WKFormSubmissionListener.h2
-rw-r--r--Source/WebKit2/UIProcess/API/C/WKFrame.cpp29
-rw-r--r--Source/WebKit2/UIProcess/API/C/WKFrame.h10
-rw-r--r--Source/WebKit2/UIProcess/API/C/WKFrameHandleRef.cpp (renamed from Source/WebKit2/UIProcess/API/C/WKSessionRef.cpp)20
-rw-r--r--Source/WebKit2/UIProcess/API/C/WKFrameHandleRef.h (renamed from Source/WebKit2/UIProcess/API/C/WKNetworkInfo.h)14
-rw-r--r--Source/WebKit2/UIProcess/API/C/WKFrameInfoRef.cpp43
-rw-r--r--Source/WebKit2/UIProcess/API/C/WKFrameInfoRef.h (renamed from Source/WebKit2/UIProcess/API/C/WKBatteryStatus.h)14
-rw-r--r--Source/WebKit2/UIProcess/API/C/WKFramePolicyListener.cpp11
-rw-r--r--Source/WebKit2/UIProcess/API/C/WKFramePolicyListener.h16
-rw-r--r--Source/WebKit2/UIProcess/API/C/WKGeolocationManager.cpp1
-rw-r--r--Source/WebKit2/UIProcess/API/C/WKGeolocationManager.h13
-rw-r--r--Source/WebKit2/UIProcess/API/C/WKGeolocationPermissionRequest.h2
-rw-r--r--Source/WebKit2/UIProcess/API/C/WKGeolocationPosition.cpp4
-rw-r--r--Source/WebKit2/UIProcess/API/C/WKGeolocationPosition.h2
-rw-r--r--Source/WebKit2/UIProcess/API/C/WKGrammarDetail.cpp6
-rw-r--r--Source/WebKit2/UIProcess/API/C/WKGrammarDetail.h2
-rw-r--r--Source/WebKit2/UIProcess/API/C/WKHitTestResult.cpp14
-rw-r--r--Source/WebKit2/UIProcess/API/C/WKHitTestResult.h6
-rw-r--r--Source/WebKit2/UIProcess/API/C/WKIconDatabase.cpp17
-rw-r--r--Source/WebKit2/UIProcess/API/C/WKIconDatabase.h19
-rw-r--r--Source/WebKit2/UIProcess/API/C/WKInspector.cpp130
-rw-r--r--Source/WebKit2/UIProcess/API/C/WKInspector.h11
-rw-r--r--Source/WebKit2/UIProcess/API/C/WKKeyValueStorageManager.cpp95
-rw-r--r--Source/WebKit2/UIProcess/API/C/WKKeyValueStorageManager.h14
-rw-r--r--Source/WebKit2/UIProcess/API/C/WKLayoutMode.h47
-rw-r--r--Source/WebKit2/UIProcess/API/C/WKMediaSessionFocusManager.cpp (renamed from Source/WebKit2/UIProcess/API/C/WKNetworkInfoManager.cpp)46
-rw-r--r--Source/WebKit2/UIProcess/API/C/WKMediaSessionFocusManager.h72
-rw-r--r--Source/WebKit2/UIProcess/API/C/WKMediaSessionMetadata.cpp81
-rw-r--r--Source/WebKit2/UIProcess/API/C/WKMediaSessionMetadata.h50
-rw-r--r--Source/WebKit2/UIProcess/API/C/WKNativeEvent.h2
-rw-r--r--Source/WebKit2/UIProcess/API/C/WKNavigationActionRef.cpp37
-rw-r--r--Source/WebKit2/UIProcess/API/C/WKNavigationActionRef.h41
-rw-r--r--Source/WebKit2/UIProcess/API/C/WKNavigationDataRef.cpp2
-rw-r--r--Source/WebKit2/UIProcess/API/C/WKNavigationDataRef.h2
-rw-r--r--Source/WebKit2/UIProcess/API/C/WKNavigationRef.cpp37
-rw-r--r--Source/WebKit2/UIProcess/API/C/WKNavigationRef.h41
-rw-r--r--Source/WebKit2/UIProcess/API/C/WKNavigationResponseRef.cpp42
-rw-r--r--Source/WebKit2/UIProcess/API/C/WKNavigationResponseRef.h43
-rw-r--r--Source/WebKit2/UIProcess/API/C/WKNetworkInfoManager.h65
-rw-r--r--Source/WebKit2/UIProcess/API/C/WKNotification.cpp2
-rw-r--r--Source/WebKit2/UIProcess/API/C/WKNotification.h2
-rw-r--r--Source/WebKit2/UIProcess/API/C/WKNotificationManager.cpp6
-rw-r--r--Source/WebKit2/UIProcess/API/C/WKNotificationManager.h3
-rw-r--r--Source/WebKit2/UIProcess/API/C/WKNotificationPermissionRequest.h2
-rw-r--r--Source/WebKit2/UIProcess/API/C/WKNotificationProvider.h17
-rw-r--r--Source/WebKit2/UIProcess/API/C/WKOpenPanelParametersRef.cpp (renamed from Source/WebKit2/UIProcess/API/C/WKOpenPanelParameters.cpp)22
-rw-r--r--Source/WebKit2/UIProcess/API/C/WKOpenPanelParametersRef.h (renamed from Source/WebKit2/UIProcess/API/C/WKOpenPanelParameters.h)11
-rw-r--r--Source/WebKit2/UIProcess/API/C/WKOpenPanelResultListener.cpp19
-rw-r--r--Source/WebKit2/UIProcess/API/C/WKOpenPanelResultListener.h2
-rw-r--r--Source/WebKit2/UIProcess/API/C/WKOriginDataManager.cpp67
-rw-r--r--Source/WebKit2/UIProcess/API/C/WKOriginDataManager.h87
-rw-r--r--Source/WebKit2/UIProcess/API/C/WKPage.cpp1919
-rw-r--r--Source/WebKit2/UIProcess/API/C/WKPage.h83
-rw-r--r--Source/WebKit2/UIProcess/API/C/WKPageConfigurationRef.cpp110
-rw-r--r--Source/WebKit2/UIProcess/API/C/WKPageConfigurationRef.h63
-rw-r--r--Source/WebKit2/UIProcess/API/C/WKPageContextMenuClient.h17
-rw-r--r--Source/WebKit2/UIProcess/API/C/WKPageDiagnosticLoggingClient.h71
-rw-r--r--Source/WebKit2/UIProcess/API/C/WKPageFindClient.h13
-rw-r--r--Source/WebKit2/UIProcess/API/C/WKPageFindMatchesClient.h10
-rw-r--r--Source/WebKit2/UIProcess/API/C/WKPageFormClient.h11
-rw-r--r--Source/WebKit2/UIProcess/API/C/WKPageGroup.cpp56
-rw-r--r--Source/WebKit2/UIProcess/API/C/WKPageGroup.h14
-rw-r--r--Source/WebKit2/UIProcess/API/C/WKPageInjectedBundleClient.h (renamed from Source/WebKit2/UIProcess/API/C/WKBatteryManager.h)46
-rw-r--r--Source/WebKit2/UIProcess/API/C/WKPageLoaderClient.h109
-rw-r--r--Source/WebKit2/UIProcess/API/C/WKPageNavigationClient.h118
-rw-r--r--Source/WebKit2/UIProcess/API/C/WKPagePolicyClient.h23
-rw-r--r--Source/WebKit2/UIProcess/API/C/WKPagePrivate.h82
-rw-r--r--Source/WebKit2/UIProcess/API/C/WKPageRenderingProgressEvents.h (renamed from Source/WebKit2/UIProcess/API/C/WKSessionRef.h)23
-rw-r--r--Source/WebKit2/UIProcess/API/C/WKPageRenderingProgressEventsInternal.h (renamed from Source/WebKit2/UIProcess/API/C/soup/WKSoupCustomProtocolRequestManager.cpp)42
-rw-r--r--Source/WebKit2/UIProcess/API/C/WKPageUIClient.h580
-rw-r--r--Source/WebKit2/UIProcess/API/C/WKPluginLoadPolicy.h57
-rw-r--r--Source/WebKit2/UIProcess/API/C/WKPluginSiteDataManager.cpp95
-rw-r--r--Source/WebKit2/UIProcess/API/C/WKPluginSiteDataManager.h55
-rw-r--r--Source/WebKit2/UIProcess/API/C/WKPreferences.cpp543
-rw-r--r--Source/WebKit2/UIProcess/API/C/WKPreferencesRef.h56
-rw-r--r--Source/WebKit2/UIProcess/API/C/WKPreferencesRefPrivate.h (renamed from Source/WebKit2/UIProcess/API/C/WKPreferencesPrivate.h)197
-rw-r--r--Source/WebKit2/UIProcess/API/C/WKProtectionSpace.h4
-rw-r--r--Source/WebKit2/UIProcess/API/C/WKProtectionSpaceTypes.h2
-rw-r--r--Source/WebKit2/UIProcess/API/C/WKResourceCacheManager.cpp57
-rw-r--r--Source/WebKit2/UIProcess/API/C/WKResourceCacheManager.h2
-rw-r--r--Source/WebKit2/UIProcess/API/C/WKResourceLoadStatisticsManager.cpp87
-rw-r--r--Source/WebKit2/UIProcess/API/C/WKResourceLoadStatisticsManager.h51
-rw-r--r--Source/WebKit2/UIProcess/API/C/WKSessionStateRef.cpp (renamed from Source/WebKit2/UIProcess/API/C/WKNetworkInfo.cpp)39
-rw-r--r--Source/WebKit2/UIProcess/API/C/WKSessionStateRef.h (renamed from Source/WebKit2/UIProcess/API/C/WKColorPickerResultListener.h)18
-rw-r--r--Source/WebKit2/UIProcess/API/C/WKTextChecker.cpp22
-rw-r--r--Source/WebKit2/UIProcess/API/C/WKTextChecker.h8
-rw-r--r--Source/WebKit2/UIProcess/API/C/WKUserContentControllerRef.cpp74
-rw-r--r--Source/WebKit2/UIProcess/API/C/WKUserContentControllerRef.h50
-rw-r--r--Source/WebKit2/UIProcess/API/C/WKUserContentExtensionStoreRef.cpp41
-rw-r--r--Source/WebKit2/UIProcess/API/C/WKUserContentExtensionStoreRef.h41
-rw-r--r--Source/WebKit2/UIProcess/API/C/WKUserMediaPermissionCheck.cpp47
-rw-r--r--Source/WebKit2/UIProcess/API/C/WKUserMediaPermissionCheck.h44
-rw-r--r--Source/WebKit2/UIProcess/API/C/WKUserMediaPermissionRequest.cpp96
-rw-r--r--Source/WebKit2/UIProcess/API/C/WKUserMediaPermissionRequest.h52
-rw-r--r--Source/WebKit2/UIProcess/API/C/WKUserScriptRef.cpp (renamed from Source/WebKit2/UIProcess/API/C/WKMediaCacheManager.cpp)27
-rw-r--r--Source/WebKit2/UIProcess/API/C/WKUserScriptRef.h48
-rw-r--r--Source/WebKit2/UIProcess/API/C/WKVibration.h2
-rw-r--r--Source/WebKit2/UIProcess/API/C/WKViewportAttributes.cpp37
-rw-r--r--Source/WebKit2/UIProcess/API/C/WKViewportAttributes.h42
-rw-r--r--Source/WebKit2/UIProcess/API/C/WKWebsiteDataStoreRef.cpp62
-rw-r--r--Source/WebKit2/UIProcess/API/C/WKWebsiteDataStoreRef.h48
-rw-r--r--Source/WebKit2/UIProcess/API/C/WKWebsitePolicies.cpp88
-rw-r--r--Source/WebKit2/UIProcess/API/C/WKWebsitePolicies.h (renamed from Source/WebKit2/UIProcess/API/C/WKMediaCacheManager.h)28
-rw-r--r--Source/WebKit2/UIProcess/API/C/WKWindowFeaturesRef.cpp35
-rw-r--r--Source/WebKit2/UIProcess/API/C/WKWindowFeaturesRef.h41
-rw-r--r--Source/WebKit2/UIProcess/API/C/WebKit2_C.h68
-rw-r--r--Source/WebKit2/UIProcess/API/C/cairo/WKIconDatabaseCairo.cpp38
-rw-r--r--Source/WebKit2/UIProcess/API/C/cairo/WKIconDatabaseCairo.h38
-rw-r--r--Source/WebKit2/UIProcess/API/C/gtk/WKAPICastGtk.h12
-rw-r--r--Source/WebKit2/UIProcess/API/C/gtk/WKFullScreenClientGtk.h2
-rw-r--r--Source/WebKit2/UIProcess/API/C/gtk/WKInspectorClientGtk.h4
-rw-r--r--Source/WebKit2/UIProcess/API/C/gtk/WKTextCheckerGtk.cpp39
-rw-r--r--Source/WebKit2/UIProcess/API/C/gtk/WKTextCheckerGtk.h41
-rw-r--r--Source/WebKit2/UIProcess/API/C/gtk/WKView.cpp5
-rw-r--r--Source/WebKit2/UIProcess/API/C/gtk/WKView.h4
-rw-r--r--Source/WebKit2/UIProcess/API/C/gtk/WKViewPrivate.h2
-rw-r--r--Source/WebKit2/UIProcess/API/C/soup/WKCookieManagerSoup.cpp (renamed from Source/WebKit2/UIProcess/API/C/WKBatteryStatus.cpp)38
-rw-r--r--Source/WebKit2/UIProcess/API/C/soup/WKCookieManagerSoup.h (renamed from Source/WebKit2/UIProcess/API/C/soup/WKAPICastSoup.h)31
-rw-r--r--Source/WebKit2/UIProcess/API/C/soup/WKSoupCustomProtocolRequestManager.h58
151 files changed, 7048 insertions, 2101 deletions
diff --git a/Source/WebKit2/UIProcess/API/C/CoordinatedGraphics/WKView.cpp b/Source/WebKit2/UIProcess/API/C/CoordinatedGraphics/WKView.cpp
new file mode 100644
index 000000000..fab02b5e3
--- /dev/null
+++ b/Source/WebKit2/UIProcess/API/C/CoordinatedGraphics/WKView.cpp
@@ -0,0 +1,198 @@
+/*
+ * Copyright (C) 2012 Samsung Electronics
+ * Copyright (C) 2013 Intel Corporation. All rights reserved.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this program; see the file COPYING.LIB. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#include "config.h"
+#if USE(COORDINATED_GRAPHICS)
+
+#include "WKView.h"
+
+#include "APIPageConfiguration.h"
+#include "WKAPICast.h"
+#include "WebView.h"
+
+using namespace WebCore;
+using namespace WebKit;
+
+WKViewRef WKViewCreate(WKPageConfigurationRef pageConfiguration)
+{
+ auto webView = WebView::create(*toImpl(pageConfiguration));
+ return toAPI(&webView.leakRef());
+}
+
+WKSize WKViewGetSize(WKViewRef viewRef)
+{
+ return toAPI(toImpl(viewRef)->size());
+}
+
+void WKViewSetSize(WKViewRef viewRef, WKSize size)
+{
+ toImpl(viewRef)->setSize(toIntSize(size));
+}
+
+void WKViewSetViewClient(WKViewRef viewRef, const WKViewClientBase* client)
+{
+ toImpl(viewRef)->initializeClient(client);
+}
+
+bool WKViewIsActive(WKViewRef viewRef)
+{
+ return toImpl(viewRef)->isActive();
+}
+
+void WKViewSetIsActive(WKViewRef viewRef, bool isActive)
+{
+ toImpl(viewRef)->setActive(isActive);
+}
+
+bool WKViewIsFocused(WKViewRef viewRef)
+{
+ return toImpl(viewRef)->isFocused();
+}
+
+void WKViewSetIsFocused(WKViewRef viewRef, bool isFocused)
+{
+ toImpl(viewRef)->setFocused(isFocused);
+}
+
+bool WKViewIsVisible(WKViewRef viewRef)
+{
+ return toImpl(viewRef)->isVisible();
+}
+
+void WKViewSetIsVisible(WKViewRef viewRef, bool isVisible)
+{
+ toImpl(viewRef)->setVisible(isVisible);
+}
+
+float WKViewGetContentScaleFactor(WKViewRef viewRef)
+{
+ return toImpl(viewRef)->contentScaleFactor();
+}
+
+void WKViewSetContentScaleFactor(WKViewRef viewRef, float scale)
+{
+ toImpl(viewRef)->setContentScaleFactor(scale);
+}
+
+WKPoint WKViewGetContentPosition(WKViewRef viewRef)
+{
+ const WebCore::FloatPoint& result = toImpl(viewRef)->contentPosition();
+ return WKPointMake(result.x(), result.y());
+}
+
+void WKViewSetContentPosition(WKViewRef viewRef, WKPoint position)
+{
+ toImpl(viewRef)->setContentPosition(WebCore::FloatPoint(position.x, position.y));
+}
+
+void WKViewSetUserViewportTranslation(WKViewRef viewRef, double tx, double ty)
+{
+ toImpl(viewRef)->setUserViewportTranslation(tx, ty);
+}
+
+WKPoint WKViewUserViewportToContents(WKViewRef viewRef, WKPoint point)
+{
+ const WebCore::IntPoint& result = toImpl(viewRef)->userViewportToContents(toIntPoint(point));
+ return WKPointMake(result.x(), result.y());
+}
+
+WKPoint WKViewUserViewportToScene(WKViewRef viewRef, WKPoint point)
+{
+ WebCore::IntPoint result = toImpl(viewRef)->userViewportToScene(toIntPoint(point));
+ return WKPointMake(result.x(), result.y());
+}
+
+WKPoint WKViewContentsToUserViewport(WKViewRef viewRef, WKPoint point)
+{
+ WebCore::IntPoint result = toImpl(viewRef)->contentsToUserViewport(toIntPoint(point));
+ return WKPointMake(result.x(), result.y());
+}
+
+void WKViewPaintToCurrentGLContext(WKViewRef viewRef)
+{
+ toImpl(viewRef)->paintToCurrentGLContext();
+}
+
+WKPageRef WKViewGetPage(WKViewRef viewRef)
+{
+ return toImpl(viewRef)->pageRef();
+}
+
+void WKViewSetDrawsBackground(WKViewRef viewRef, bool flag)
+{
+ toImpl(viewRef)->setDrawsBackground(flag);
+}
+
+bool WKViewGetDrawsBackground(WKViewRef viewRef)
+{
+ return toImpl(viewRef)->drawsBackground();
+}
+
+void WKViewSetDrawsTransparentBackground(WKViewRef viewRef, bool flag)
+{
+ toImpl(viewRef)->setDrawsTransparentBackground(flag);
+}
+
+bool WKViewGetDrawsTransparentBackground(WKViewRef viewRef)
+{
+ return toImpl(viewRef)->drawsTransparentBackground();
+}
+
+void WKViewSuspendActiveDOMObjectsAndAnimations(WKViewRef viewRef)
+{
+ toImpl(viewRef)->suspendActiveDOMObjectsAndAnimations();
+}
+
+void WKViewResumeActiveDOMObjectsAndAnimations(WKViewRef viewRef)
+{
+ toImpl(viewRef)->resumeActiveDOMObjectsAndAnimations();
+}
+
+bool WKViewExitFullScreen(WKViewRef viewRef)
+{
+#if ENABLE(FULLSCREEN_API)
+ return toImpl(viewRef)->requestExitFullScreen();
+#else
+ UNUSED_PARAM(viewRef);
+ return false;
+#endif
+}
+
+void WKViewSetOpacity(WKViewRef view, double opacity)
+{
+ toImpl(view)->setOpacity(opacity);
+}
+
+double WKViewOpacity(WKViewRef view)
+{
+ return toImpl(view)->opacity();
+}
+
+void WKViewFindZoomableAreaForRect(WKViewRef, WKRect)
+{
+}
+
+WKSize WKViewGetContentsSize(WKViewRef viewRef)
+{
+ const WebCore::IntSize& size = toImpl(viewRef)->contentsSize();
+ return WKSizeMake(size.width(), size.height());
+}
+
+#endif // USE(COORDINATED_GRAPHICS)
diff --git a/Source/WebKit2/UIProcess/API/C/CoordinatedGraphics/WKView.h b/Source/WebKit2/UIProcess/API/C/CoordinatedGraphics/WKView.h
new file mode 100644
index 000000000..729b26fc3
--- /dev/null
+++ b/Source/WebKit2/UIProcess/API/C/CoordinatedGraphics/WKView.h
@@ -0,0 +1,120 @@
+/*
+ * Copyright (C) 2012 Samsung Electronics
+ * Copyright (C) 2013 Intel Corporation. All rights reserved.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this program; see the file COPYING.LIB. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#ifndef WKView_h
+#define WKView_h
+
+#include <WebKit/WKBase.h>
+#include <WebKit/WKGeometry.h>
+
+#ifndef __cplusplus
+#include <stdbool.h>
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+typedef void (*WKViewCallback)(WKViewRef view, const void* clientInfo);
+typedef void (*WKViewViewNeedsDisplayCallback)(WKViewRef view, WKRect area, const void* clientInfo);
+typedef void (*WKViewPageDidChangeContentsSizeCallback)(WKViewRef view, WKSize size, const void* clientInfo);
+typedef void (*WKViewWebProcessCrashedCallback)(WKViewRef view, WKURLRef url, const void* clientInfo);
+typedef void (*WKViewPageDidChangeContentsPositionCallback)(WKViewRef view, WKPoint position, const void* clientInfo);
+typedef void (*WKViewPageDidRenderFrameCallback)(WKViewRef view, WKSize contentsSize, WKRect coveredRect, const void* clientInfo);
+typedef void (*WKViewPageDidChangeViewportAttributesCallback)(WKViewRef view, WKViewportAttributesRef, const void* clientInfo);
+typedef void (*WKViewPageDidChangeTooltipCallback)(WKViewRef view, WKStringRef newTooltip, const void* clientInfo);
+typedef void (*WKViewDidFindZoomableAreaCallback)(WKViewRef view, WKPoint point, WKRect area, const void* clientInfo);
+typedef void (*WKViewDoneWithTouchEventCallback)(WKViewRef view, WKTouchEventRef touchEvent, bool wasEventHandled, const void* clientInfo);
+
+typedef struct WKViewClientBase {
+ int version;
+ const void* clientInfo;
+} WKViewClientBase;
+
+typedef struct WKViewClientV0 {
+ WKViewClientBase base;
+ // Version 0
+ WKViewViewNeedsDisplayCallback viewNeedsDisplay;
+ WKViewPageDidChangeContentsSizeCallback didChangeContentsSize;
+ WKViewWebProcessCrashedCallback webProcessCrashed;
+ WKViewCallback webProcessDidRelaunch;
+ WKViewPageDidChangeContentsPositionCallback didChangeContentsPosition;
+ WKViewPageDidRenderFrameCallback didRenderFrame;
+ WKViewCallback didCompletePageTransition;
+ WKViewPageDidChangeViewportAttributesCallback didChangeViewportAttributes;
+ WKViewPageDidChangeTooltipCallback didChangeTooltip;
+ WKViewDidFindZoomableAreaCallback didFindZoomableArea;
+ WKViewDoneWithTouchEventCallback doneWithTouchEvent;
+} WKViewClientV0;
+
+WK_EXPORT WKViewRef WKViewCreate(WKPageConfigurationRef pageConfiguration);
+
+WK_EXPORT WKSize WKViewGetSize(WKViewRef);
+WK_EXPORT void WKViewSetSize(WKViewRef, WKSize size);
+
+WK_EXPORT void WKViewSetViewClient(WKViewRef, const WKViewClientBase*);
+
+WK_EXPORT bool WKViewIsActive(WKViewRef);
+WK_EXPORT void WKViewSetIsActive(WKViewRef, bool);
+
+WK_EXPORT bool WKViewIsFocused(WKViewRef);
+WK_EXPORT void WKViewSetIsFocused(WKViewRef, bool);
+
+WK_EXPORT bool WKViewIsVisible(WKViewRef);
+WK_EXPORT void WKViewSetIsVisible(WKViewRef, bool);
+
+WK_EXPORT float WKViewGetContentScaleFactor(WKViewRef);
+WK_EXPORT void WKViewSetContentScaleFactor(WKViewRef, float);
+
+WK_EXPORT WKPoint WKViewGetContentPosition(WKViewRef);
+WK_EXPORT void WKViewSetContentPosition(WKViewRef, WKPoint);
+
+WK_EXPORT void WKViewSetUserViewportTranslation(WKViewRef, double tx, double ty);
+WK_EXPORT WKPoint WKViewUserViewportToContents(WKViewRef, WKPoint);
+WK_EXPORT WKPoint WKViewUserViewportToScene(WKViewRef, WKPoint);
+WK_EXPORT WKPoint WKViewContentsToUserViewport(WKViewRef, WKPoint);
+
+WK_EXPORT void WKViewPaintToCurrentGLContext(WKViewRef);
+
+WK_EXPORT WKPageRef WKViewGetPage(WKViewRef);
+
+WK_EXPORT void WKViewSetDrawsBackground(WKViewRef, bool);
+WK_EXPORT bool WKViewGetDrawsBackground(WKViewRef);
+
+WK_EXPORT void WKViewSetDrawsTransparentBackground(WKViewRef, bool);
+WK_EXPORT bool WKViewGetDrawsTransparentBackground(WKViewRef);
+
+WK_EXPORT void WKViewSuspendActiveDOMObjectsAndAnimations(WKViewRef);
+WK_EXPORT void WKViewResumeActiveDOMObjectsAndAnimations(WKViewRef);
+
+WK_EXPORT bool WKViewExitFullScreen(WKViewRef);
+
+WK_EXPORT void WKViewSetOpacity(WKViewRef view, double opacity);
+WK_EXPORT double WKViewOpacity(WKViewRef view);
+
+WK_EXPORT void WKViewFindZoomableAreaForRect(WKViewRef, WKRect);
+
+WK_EXPORT WKSize WKViewGetContentsSize(WKViewRef);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* WKView_h */
diff --git a/Source/WebKit2/UIProcess/API/C/WKAPICast.h b/Source/WebKit2/UIProcess/API/C/WKAPICast.h
index 71569bbb5..392a342b4 100644
--- a/Source/WebKit2/UIProcess/API/C/WKAPICast.h
+++ b/Source/WebKit2/UIProcess/API/C/WKAPICast.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2010, 2011 Apple Inc. All rights reserved.
+ * Copyright (C) 2010-2017 Apple Inc. All rights reserved.
* Portions Copyright (c) 2010 Motorola Mobility, Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -32,26 +32,43 @@
#include "HTTPCookieAcceptPolicy.h"
#include "InjectedBundleHitTestResultMediaType.h"
#include "PluginModuleInfo.h"
-#include "ProcessModel.h"
#include "ResourceCachesToClear.h"
#include "WKBundleHitTestResult.h"
#include "WKContext.h"
#include "WKCookieManager.h"
#include "WKCredentialTypes.h"
#include "WKPage.h"
-#include "WKPreferencesPrivate.h"
#include "WKPreferencesRef.h"
+#include "WKPreferencesRefPrivate.h"
#include "WKProtectionSpaceTypes.h"
#include "WKResourceCacheManager.h"
#include "WKSharedAPICast.h"
#include "WebGrammarDetail.h"
#include <WebCore/Credential.h>
#include <WebCore/FrameLoaderTypes.h>
+#include <WebCore/PluginData.h>
#include <WebCore/ProtectionSpace.h>
#include <WebCore/Settings.h>
namespace API {
+class ExperimentalFeature;
+class FrameHandle;
+class FrameInfo;
+class HitTestResult;
+class Navigation;
+class NavigationAction;
class NavigationData;
+class NavigationResponse;
+class OpenPanelParameters;
+class PageConfiguration;
+class ProcessPoolConfiguration;
+class SessionState;
+class UserContentExtension;
+class UserContentExtensionStore;
+class UserScript;
+class WebsiteDataStore;
+class WebsitePolicies;
+class WindowFeatures;
}
namespace WebKit {
@@ -61,94 +78,99 @@ class AuthenticationDecisionListener;
class DownloadProxy;
class GeolocationPermissionRequestProxy;
class NotificationPermissionRequest;
-class WebApplicationCacheManagerProxy;
+class UserMediaPermissionCheckProxy;
+class UserMediaPermissionRequestProxy;
class WebBackForwardList;
class WebBackForwardListItem;
-class WebBatteryManagerProxy;
-class WebBatteryStatus;
-class WebResourceCacheManagerProxy;
class WebColorPickerResultListenerProxy;
-class WebContext;
+class WebContextMenuListenerProxy;
class WebCookieManagerProxy;
class WebCredential;
-class WebDatabaseManagerProxy;
class WebFormSubmissionListenerProxy;
class WebFramePolicyListenerProxy;
class WebFrameProxy;
class WebGeolocationManagerProxy;
class WebGeolocationPosition;
class WebGrammarDetail;
-class WebHitTestResult;
class WebIconDatabase;
class WebInspectorProxy;
-class WebKeyValueStorageManager;
-class WebMediaCacheManagerProxy;
-class WebNetworkInfoManagerProxy;
-class WebNetworkInfo;
+class WebMediaSessionFocusManager;
+class WebMediaSessionMetadata;
class WebNotification;
-class WebNotificationProvider;
class WebNotificationManagerProxy;
-class WebOpenPanelParameters;
+class WebNotificationProvider;
class WebOpenPanelResultListenerProxy;
-class WebOriginDataManagerProxy;
class WebPageGroup;
class WebPageProxy;
-class WebPluginSiteDataManager;
class WebPreferences;
+class WebProcessPool;
class WebProtectionSpace;
class WebRenderLayer;
class WebRenderObject;
+class WebResourceLoadStatisticsManager;
class WebTextChecker;
+class WebUserContentControllerProxy;
class WebVibrationProxy;
class WebViewportAttributes;
+struct WebsitePolicies;
-WK_ADD_API_MAPPING(WKApplicationCacheManagerRef, WebApplicationCacheManagerProxy)
WK_ADD_API_MAPPING(WKAuthenticationChallengeRef, AuthenticationChallengeProxy)
WK_ADD_API_MAPPING(WKAuthenticationDecisionListenerRef, AuthenticationDecisionListener)
WK_ADD_API_MAPPING(WKBackForwardListItemRef, WebBackForwardListItem)
WK_ADD_API_MAPPING(WKBackForwardListRef, WebBackForwardList)
-WK_ADD_API_MAPPING(WKBatteryManagerRef, WebBatteryManagerProxy)
-WK_ADD_API_MAPPING(WKBatteryStatusRef, WebBatteryStatus)
WK_ADD_API_MAPPING(WKBundleHitTestResultMediaType, BundleHitTestResultMediaType)
-WK_ADD_API_MAPPING(WKResourceCacheManagerRef, WebResourceCacheManagerProxy)
WK_ADD_API_MAPPING(WKColorPickerResultListenerRef, WebColorPickerResultListenerProxy)
-WK_ADD_API_MAPPING(WKContextRef, WebContext)
+WK_ADD_API_MAPPING(WKContextRef, WebProcessPool)
+WK_ADD_API_MAPPING(WKContextConfigurationRef, API::ProcessPoolConfiguration)
+WK_ADD_API_MAPPING(WKContextMenuListenerRef, WebContextMenuListenerProxy)
WK_ADD_API_MAPPING(WKCookieManagerRef, WebCookieManagerProxy)
WK_ADD_API_MAPPING(WKCredentialRef, WebCredential)
-WK_ADD_API_MAPPING(WKDatabaseManagerRef, WebDatabaseManagerProxy)
WK_ADD_API_MAPPING(WKDownloadRef, DownloadProxy)
WK_ADD_API_MAPPING(WKFormSubmissionListenerRef, WebFormSubmissionListenerProxy)
WK_ADD_API_MAPPING(WKFramePolicyListenerRef, WebFramePolicyListenerProxy)
+WK_ADD_API_MAPPING(WKFrameHandleRef, API::FrameHandle)
+WK_ADD_API_MAPPING(WKFrameInfoRef, API::FrameInfo)
WK_ADD_API_MAPPING(WKFrameRef, WebFrameProxy)
WK_ADD_API_MAPPING(WKGeolocationManagerRef, WebGeolocationManagerProxy)
WK_ADD_API_MAPPING(WKGeolocationPermissionRequestRef, GeolocationPermissionRequestProxy)
WK_ADD_API_MAPPING(WKGeolocationPositionRef, WebGeolocationPosition)
WK_ADD_API_MAPPING(WKGrammarDetailRef, WebGrammarDetail)
-WK_ADD_API_MAPPING(WKHitTestResultRef, WebHitTestResult)
+WK_ADD_API_MAPPING(WKHitTestResultRef, API::HitTestResult)
WK_ADD_API_MAPPING(WKIconDatabaseRef, WebIconDatabase)
-WK_ADD_API_MAPPING(WKKeyValueStorageManagerRef, WebKeyValueStorageManager)
-WK_ADD_API_MAPPING(WKMediaCacheManagerRef, WebMediaCacheManagerProxy)
+WK_ADD_API_MAPPING(WKInspectorRef, WebInspectorProxy)
+WK_ADD_API_MAPPING(WKMediaSessionFocusManagerRef, WebMediaSessionFocusManager)
+WK_ADD_API_MAPPING(WKMediaSessionMetadataRef, WebMediaSessionMetadata)
+WK_ADD_API_MAPPING(WKNavigationActionRef, API::NavigationAction)
WK_ADD_API_MAPPING(WKNavigationDataRef, API::NavigationData)
-WK_ADD_API_MAPPING(WKNetworkInfoManagerRef, WebNetworkInfoManagerProxy)
-WK_ADD_API_MAPPING(WKNetworkInfoRef, WebNetworkInfo)
+WK_ADD_API_MAPPING(WKNavigationRef, API::Navigation)
+WK_ADD_API_MAPPING(WKNavigationResponseRef, API::NavigationResponse)
WK_ADD_API_MAPPING(WKNotificationManagerRef, WebNotificationManagerProxy)
WK_ADD_API_MAPPING(WKNotificationPermissionRequestRef, NotificationPermissionRequest)
WK_ADD_API_MAPPING(WKNotificationProviderRef, WebNotificationProvider)
WK_ADD_API_MAPPING(WKNotificationRef, WebNotification)
-WK_ADD_API_MAPPING(WKOpenPanelParametersRef, WebOpenPanelParameters)
+WK_ADD_API_MAPPING(WKOpenPanelParametersRef, API::OpenPanelParameters)
WK_ADD_API_MAPPING(WKOpenPanelResultListenerRef, WebOpenPanelResultListenerProxy)
-WK_ADD_API_MAPPING(WKOriginDataManagerRef, WebOriginDataManagerProxy)
WK_ADD_API_MAPPING(WKPageGroupRef, WebPageGroup)
+WK_ADD_API_MAPPING(WKPageConfigurationRef, API::PageConfiguration)
WK_ADD_API_MAPPING(WKPageRef, WebPageProxy)
-WK_ADD_API_MAPPING(WKPluginSiteDataManagerRef, WebPluginSiteDataManager)
WK_ADD_API_MAPPING(WKPreferencesRef, WebPreferences)
WK_ADD_API_MAPPING(WKProtectionSpaceRef, WebProtectionSpace)
WK_ADD_API_MAPPING(WKRenderLayerRef, WebRenderLayer)
WK_ADD_API_MAPPING(WKRenderObjectRef, WebRenderObject)
+WK_ADD_API_MAPPING(WKResourceLoadStatisticsManagerRef, WebResourceLoadStatisticsManager)
+WK_ADD_API_MAPPING(WKSessionStateRef, API::SessionState)
WK_ADD_API_MAPPING(WKTextCheckerRef, WebTextChecker)
+WK_ADD_API_MAPPING(WKUserContentControllerRef, WebUserContentControllerProxy)
+WK_ADD_API_MAPPING(WKUserContentExtensionStoreRef, API::UserContentExtensionStore)
+WK_ADD_API_MAPPING(WKUserContentFilterRef, API::UserContentExtension)
+WK_ADD_API_MAPPING(WKUserMediaPermissionCheckRef, UserMediaPermissionCheckProxy)
+WK_ADD_API_MAPPING(WKUserMediaPermissionRequestRef, UserMediaPermissionRequestProxy)
+WK_ADD_API_MAPPING(WKUserScriptRef, API::UserScript)
WK_ADD_API_MAPPING(WKVibrationRef, WebVibrationProxy)
WK_ADD_API_MAPPING(WKViewportAttributesRef, WebViewportAttributes)
-WK_ADD_API_MAPPING(WKInspectorRef, WebInspectorProxy)
+WK_ADD_API_MAPPING(WKWebsiteDataStoreRef, API::WebsiteDataStore)
+WK_ADD_API_MAPPING(WKWebsitePoliciesRef, API::WebsitePolicies)
+WK_ADD_API_MAPPING(WKWindowFeaturesRef, API::WindowFeatures)
/* Enum conversions */
@@ -211,31 +233,6 @@ inline WKCacheModel toAPI(CacheModel cacheModel)
return kWKCacheModelDocumentViewer;
}
-inline ProcessModel toProcessModel(WKProcessModel wkProcessModel)
-{
- switch (wkProcessModel) {
- case kWKProcessModelSharedSecondaryProcess:
- return ProcessModelSharedSecondaryProcess;
- case kWKProcessModelMultipleSecondaryProcesses:
- return ProcessModelMultipleSecondaryProcesses;
- }
-
- ASSERT_NOT_REACHED();
- return ProcessModelSharedSecondaryProcess;
-}
-
-inline WKProcessModel toAPI(ProcessModel processModel)
-{
- switch (processModel) {
- case ProcessModelSharedSecondaryProcess:
- return kWKProcessModelSharedSecondaryProcess;
- case ProcessModelMultipleSecondaryProcesses:
- return kWKProcessModelMultipleSecondaryProcesses;
- }
-
- return kWKProcessModelSharedSecondaryProcess;
-}
-
inline FontSmoothingLevel toFontSmoothingLevel(WKFontSmoothingLevel wkLevel)
{
switch (wkLevel) {
@@ -454,40 +451,99 @@ inline WKPluginLoadPolicy toWKPluginLoadPolicy(PluginModuleLoadPolicy pluginModu
return kWKPluginLoadPolicyLoadNormally;
case PluginModuleLoadUnsandboxed:
return kWKPluginLoadPolicyLoadUnsandboxed;
- case PluginModuleBlocked:
+ case PluginModuleBlockedForSecurity:
return kWKPluginLoadPolicyBlocked;
+ case PluginModuleBlockedForCompatibility:
+ return kWKPluginLoadPolicyBlockedForCompatibility;
}
ASSERT_NOT_REACHED();
return kWKPluginLoadPolicyBlocked;
}
+inline WKPluginLoadClientPolicy toWKPluginLoadClientPolicy(WebCore::PluginLoadClientPolicy PluginLoadClientPolicy)
+{
+ switch (PluginLoadClientPolicy) {
+ case WebCore::PluginLoadClientPolicyUndefined:
+ return kWKPluginLoadClientPolicyUndefined;
+ case WebCore::PluginLoadClientPolicyBlock:
+ return kWKPluginLoadClientPolicyBlock;
+ case WebCore::PluginLoadClientPolicyAsk:
+ return kWKPluginLoadClientPolicyAsk;
+ case WebCore::PluginLoadClientPolicyAllow:
+ return kWKPluginLoadClientPolicyAllow;
+ case WebCore::PluginLoadClientPolicyAllowAlways:
+ return kWKPluginLoadClientPolicyAllowAlways;
+ }
+
+ ASSERT_NOT_REACHED();
+ return kWKPluginLoadClientPolicyBlock;
+}
+
inline PluginModuleLoadPolicy toPluginModuleLoadPolicy(WKPluginLoadPolicy pluginLoadPolicy)
{
switch (pluginLoadPolicy) {
case kWKPluginLoadPolicyLoadNormally:
return PluginModuleLoadNormally;
case kWKPluginLoadPolicyBlocked:
- return PluginModuleBlocked;
+ return PluginModuleBlockedForSecurity;
+ case kWKPluginLoadPolicyBlockedForCompatibility:
+ return PluginModuleBlockedForCompatibility;
case kWKPluginLoadPolicyLoadUnsandboxed:
return PluginModuleLoadUnsandboxed;
}
ASSERT_NOT_REACHED();
- return PluginModuleBlocked;
+ return PluginModuleBlockedForSecurity;
+}
+
+inline WebCore::PluginLoadClientPolicy toPluginLoadClientPolicy(WKPluginLoadClientPolicy pluginLoadClientPolicy)
+{
+ switch (pluginLoadClientPolicy) {
+ case kWKPluginLoadClientPolicyUndefined:
+ return WebCore::PluginLoadClientPolicyUndefined;
+ case kWKPluginLoadClientPolicyBlock:
+ return WebCore::PluginLoadClientPolicyBlock;
+ case kWKPluginLoadClientPolicyAsk:
+ return WebCore::PluginLoadClientPolicyAsk;
+ case kWKPluginLoadClientPolicyAllow:
+ return WebCore::PluginLoadClientPolicyAllow;
+ case kWKPluginLoadClientPolicyAllowAlways:
+ return WebCore::PluginLoadClientPolicyAllowAlways;
+ }
+
+ ASSERT_NOT_REACHED();
+ return WebCore::PluginLoadClientPolicyBlock;
}
inline WebCore::WebGLLoadPolicy toWebGLLoadPolicy(WKWebGLLoadPolicy webGLLoadPolicy)
{
switch (webGLLoadPolicy) {
case kWKWebGLLoadPolicyLoadNormally:
- return WebCore::WebGLAllow;
+ return WebCore::WebGLAllowCreation;
case kWKWebGLLoadPolicyBlocked:
- return WebCore::WebGLBlock;
+ return WebCore::WebGLBlockCreation;
+ case kWKWebGLLoadPolicyPending:
+ return WebCore::WebGLPendingCreation;
}
ASSERT_NOT_REACHED();
- return WebCore::WebGLAllow;
+ return WebCore::WebGLAllowCreation;
+}
+
+inline WKWebGLLoadPolicy toAPI(WebCore::WebGLLoadPolicy webGLLoadPolicy)
+{
+ switch (webGLLoadPolicy) {
+ case WebCore::WebGLAllowCreation:
+ return kWKWebGLLoadPolicyLoadNormally;
+ case WebCore::WebGLBlockCreation:
+ return kWKWebGLLoadPolicyBlocked;
+ case WebCore::WebGLPendingCreation:
+ return kWKWebGLLoadPolicyPending;
+ }
+
+ ASSERT_NOT_REACHED();
+ return kWKWebGLLoadPolicyLoadNormally;
}
inline ProxyingRefPtr<WebGrammarDetail> toAPI(const WebCore::GrammarDetail& grammarDetail)
@@ -501,12 +557,4 @@ inline ProxyingRefPtr<WebGrammarDetail> toAPI(const WebCore::GrammarDetail& gram
#include "WKAPICastGtk.h"
#endif
-#if USE(SOUP)
-#include "WKAPICastSoup.h"
-#endif
-
-#if defined(BUILDING_EFL__)
-#include "WKAPICastEfl.h"
-#endif
-
#endif // WKAPICast_h
diff --git a/Source/WebKit2/UIProcess/API/C/WKApplicationCacheManager.cpp b/Source/WebKit2/UIProcess/API/C/WKApplicationCacheManager.cpp
index 2d95c6721..c67ffb0f2 100644
--- a/Source/WebKit2/UIProcess/API/C/WKApplicationCacheManager.cpp
+++ b/Source/WebKit2/UIProcess/API/C/WKApplicationCacheManager.cpp
@@ -26,27 +26,43 @@
#include "config.h"
#include "WKApplicationCacheManager.h"
+#include "APIWebsiteDataStore.h"
#include "WKAPICast.h"
-#include "WebApplicationCacheManagerProxy.h"
+#include "WebsiteDataRecord.h"
using namespace WebKit;
WKTypeID WKApplicationCacheManagerGetTypeID()
{
- return toAPI(WebApplicationCacheManagerProxy::APIType);
+ return toAPI(API::WebsiteDataStore::APIType);
}
-void WKApplicationCacheManagerGetApplicationCacheOrigins(WKApplicationCacheManagerRef applicationCacheManagerRef, void* context, WKApplicationCacheManagerGetApplicationCacheOriginsFunction callback)
+void WKApplicationCacheManagerGetApplicationCacheOrigins(WKApplicationCacheManagerRef applicationCacheManager, void* context, WKApplicationCacheManagerGetApplicationCacheOriginsFunction callback)
{
- toImpl(applicationCacheManagerRef)->getApplicationCacheOrigins(ArrayCallback::create(context, callback));
+ auto& websiteDataStore = toImpl(reinterpret_cast<WKWebsiteDataStoreRef>(applicationCacheManager))->websiteDataStore();
+ websiteDataStore.fetchData(WebsiteDataType::OfflineWebApplicationCache, { }, [context, callback](auto dataRecords) {
+ Vector<RefPtr<API::Object>> securityOrigins;
+ for (const auto& dataRecord : dataRecords) {
+ for (const auto& origin : dataRecord.origins)
+ securityOrigins.append(API::SecurityOrigin::create(origin.securityOrigin()));
+ }
+
+ callback(toAPI(API::Array::create(WTFMove(securityOrigins)).ptr()), nullptr, context);
+ });
}
-void WKApplicationCacheManagerDeleteEntriesForOrigin(WKApplicationCacheManagerRef applicationCacheManagerRef, WKSecurityOriginRef originRef)
+void WKApplicationCacheManagerDeleteEntriesForOrigin(WKApplicationCacheManagerRef applicationCacheManager, WKSecurityOriginRef origin)
{
- toImpl(applicationCacheManagerRef)->deleteEntriesForOrigin(toImpl(originRef));
+ auto& websiteDataStore = toImpl(reinterpret_cast<WKWebsiteDataStoreRef>(applicationCacheManager))->websiteDataStore();
+
+ WebsiteDataRecord dataRecord;
+ dataRecord.add(WebsiteDataType::OfflineWebApplicationCache, WebCore::SecurityOriginData::fromSecurityOrigin(toImpl(origin)->securityOrigin()));
+
+ websiteDataStore.removeData(WebsiteDataType::OfflineWebApplicationCache, { dataRecord }, [] { });
}
-void WKApplicationCacheManagerDeleteAllEntries(WKApplicationCacheManagerRef applicationCacheManagerRef)
+void WKApplicationCacheManagerDeleteAllEntries(WKApplicationCacheManagerRef applicationCacheManager)
{
- toImpl(applicationCacheManagerRef)->deleteAllEntries();
+ auto& websiteDataStore = toImpl(reinterpret_cast<WKWebsiteDataStoreRef>(applicationCacheManager))->websiteDataStore();
+ websiteDataStore.removeData(WebsiteDataType::OfflineWebApplicationCache, std::chrono::system_clock::time_point::min(), [] { });
}
diff --git a/Source/WebKit2/UIProcess/API/C/WKApplicationCacheManager.h b/Source/WebKit2/UIProcess/API/C/WKApplicationCacheManager.h
index c40039e37..065a462d4 100644
--- a/Source/WebKit2/UIProcess/API/C/WKApplicationCacheManager.h
+++ b/Source/WebKit2/UIProcess/API/C/WKApplicationCacheManager.h
@@ -26,7 +26,7 @@
#ifndef WKApplicationCacheManager_h
#define WKApplicationCacheManager_h
-#include <WebKit2/WKBase.h>
+#include <WebKit/WKBase.h>
#ifdef __cplusplus
extern "C" {
diff --git a/Source/WebKit2/UIProcess/API/C/WKAuthenticationChallenge.cpp b/Source/WebKit2/UIProcess/API/C/WKAuthenticationChallenge.cpp
index c42b85732..17067cc32 100644
--- a/Source/WebKit2/UIProcess/API/C/WKAuthenticationChallenge.cpp
+++ b/Source/WebKit2/UIProcess/API/C/WKAuthenticationChallenge.cpp
@@ -27,10 +27,11 @@
#include "WKAuthenticationChallenge.h"
#include "AuthenticationChallengeProxy.h"
+#include "AuthenticationDecisionListener.h"
+#include "WKAPICast.h"
#include "WebCertificateInfo.h"
#include "WebCredential.h"
#include "WebProtectionSpace.h"
-#include "WKAPICast.h"
using namespace WebKit;
diff --git a/Source/WebKit2/UIProcess/API/C/WKAuthenticationChallenge.h b/Source/WebKit2/UIProcess/API/C/WKAuthenticationChallenge.h
index 3802f417f..bc2cf2e7e 100644
--- a/Source/WebKit2/UIProcess/API/C/WKAuthenticationChallenge.h
+++ b/Source/WebKit2/UIProcess/API/C/WKAuthenticationChallenge.h
@@ -26,7 +26,7 @@
#ifndef WKAuthenticationChallenge_h
#define WKAuthenticationChallenge_h
-#include <WebKit2/WKBase.h>
+#include <WebKit/WKBase.h>
#ifdef __cplusplus
extern "C" {
diff --git a/Source/WebKit2/UIProcess/API/C/WKAuthenticationDecisionListener.cpp b/Source/WebKit2/UIProcess/API/C/WKAuthenticationDecisionListener.cpp
index bcb175dfd..db4adb421 100644
--- a/Source/WebKit2/UIProcess/API/C/WKAuthenticationDecisionListener.cpp
+++ b/Source/WebKit2/UIProcess/API/C/WKAuthenticationDecisionListener.cpp
@@ -28,6 +28,7 @@
#include "AuthenticationDecisionListener.h"
#include "WKAPICast.h"
+#include "WebCredential.h"
using namespace WebKit;
@@ -45,3 +46,8 @@ void WKAuthenticationDecisionListenerCancel(WKAuthenticationDecisionListenerRef
{
toImpl(authenticationListener)->cancel();
}
+
+void WKAuthenticationDecisionListenerRejectProtectionSpaceAndContinue(WKAuthenticationDecisionListenerRef authenticationListener)
+{
+ toImpl(authenticationListener)->rejectProtectionSpaceAndContinue();
+}
diff --git a/Source/WebKit2/UIProcess/API/C/WKAuthenticationDecisionListener.h b/Source/WebKit2/UIProcess/API/C/WKAuthenticationDecisionListener.h
index f0724610b..8c7969c86 100644
--- a/Source/WebKit2/UIProcess/API/C/WKAuthenticationDecisionListener.h
+++ b/Source/WebKit2/UIProcess/API/C/WKAuthenticationDecisionListener.h
@@ -26,7 +26,7 @@
#ifndef WKAuthenticationDecisionListener_h
#define WKAuthenticationDecisionListener_h
-#include <WebKit2/WKBase.h>
+#include <WebKit/WKBase.h>
#ifdef __cplusplus
extern "C" {
@@ -36,6 +36,7 @@ WK_EXPORT WKTypeID WKAuthenticationDecisionListenerGetTypeID();
WK_EXPORT void WKAuthenticationDecisionListenerUseCredential(WKAuthenticationDecisionListenerRef authenticationListener, WKCredentialRef credential);
WK_EXPORT void WKAuthenticationDecisionListenerCancel(WKAuthenticationDecisionListenerRef authenticationListener);
+WK_EXPORT void WKAuthenticationDecisionListenerRejectProtectionSpaceAndContinue(WKAuthenticationDecisionListenerRef);
#ifdef __cplusplus
}
diff --git a/Source/WebKit2/UIProcess/API/C/WKBackForwardListItemRef.h b/Source/WebKit2/UIProcess/API/C/WKBackForwardListItemRef.h
index 7008e9a90..f63ba5f45 100644
--- a/Source/WebKit2/UIProcess/API/C/WKBackForwardListItemRef.h
+++ b/Source/WebKit2/UIProcess/API/C/WKBackForwardListItemRef.h
@@ -26,7 +26,7 @@
#ifndef WKBackForwardListItemRef_h
#define WKBackForwardListItemRef_h
-#include <WebKit2/WKBase.h>
+#include <WebKit/WKBase.h>
#ifdef __cplusplus
extern "C" {
diff --git a/Source/WebKit2/UIProcess/API/C/WKBackForwardListRef.cpp b/Source/WebKit2/UIProcess/API/C/WKBackForwardListRef.cpp
index b3a1d0882..4be7fc369 100644
--- a/Source/WebKit2/UIProcess/API/C/WKBackForwardListRef.cpp
+++ b/Source/WebKit2/UIProcess/API/C/WKBackForwardListRef.cpp
@@ -74,10 +74,10 @@ unsigned WKBackForwardListGetForwardListCount(WKBackForwardListRef listRef)
WKArrayRef WKBackForwardListCopyBackListWithLimit(WKBackForwardListRef listRef, unsigned limit)
{
- return toAPI(toImpl(listRef)->backListAsAPIArrayWithLimit(limit).leakRef());
+ return toAPI(&toImpl(listRef)->backListAsAPIArrayWithLimit(limit).leakRef());
}
WKArrayRef WKBackForwardListCopyForwardListWithLimit(WKBackForwardListRef listRef, unsigned limit)
{
- return toAPI(toImpl(listRef)->forwardListAsAPIArrayWithLimit(limit).leakRef());
+ return toAPI(&toImpl(listRef)->forwardListAsAPIArrayWithLimit(limit).leakRef());
}
diff --git a/Source/WebKit2/UIProcess/API/C/WKBackForwardListRef.h b/Source/WebKit2/UIProcess/API/C/WKBackForwardListRef.h
index 1c7643986..97b2209d2 100644
--- a/Source/WebKit2/UIProcess/API/C/WKBackForwardListRef.h
+++ b/Source/WebKit2/UIProcess/API/C/WKBackForwardListRef.h
@@ -26,7 +26,7 @@
#ifndef WKBackForwardListRef_h
#define WKBackForwardListRef_h
-#include <WebKit2/WKBase.h>
+#include <WebKit/WKBase.h>
#ifdef __cplusplus
extern "C" {
diff --git a/Source/WebKit2/UIProcess/API/C/WKBatteryManager.cpp b/Source/WebKit2/UIProcess/API/C/WKBatteryManager.cpp
deleted file mode 100644
index a9acfa0a4..000000000
--- a/Source/WebKit2/UIProcess/API/C/WKBatteryManager.cpp
+++ /dev/null
@@ -1,76 +0,0 @@
-/*
- * Copyright (C) 2012 Intel Corporation. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-#include "WKBatteryManager.h"
-
-#include "WKAPICast.h"
-#include <wtf/text/AtomicString.h>
-
-#if ENABLE(BATTERY_STATUS)
-#include "WebBatteryManagerProxy.h"
-#endif
-
-using namespace WebKit;
-
-WKTypeID WKBatteryManagerGetTypeID()
-{
-#if ENABLE(BATTERY_STATUS)
- return toAPI(WebBatteryManagerProxy::APIType);
-#else
- return 0;
-#endif
-}
-
-void WKBatteryManagerSetProvider(WKBatteryManagerRef batteryManager, const WKBatteryProviderBase* provider)
-{
-#if ENABLE(BATTERY_STATUS)
- toImpl(batteryManager)->initializeProvider(provider);
-#else
- UNUSED_PARAM(batteryManager);
- UNUSED_PARAM(provider);
-#endif
-}
-
-void WKBatteryManagerProviderDidChangeBatteryStatus(WKBatteryManagerRef batteryManager, WKStringRef eventType, WKBatteryStatusRef status)
-{
-#if ENABLE(BATTERY_STATUS)
- toImpl(batteryManager)->providerDidChangeBatteryStatus(AtomicString(toImpl(eventType)->string()), toImpl(status));
-#else
- UNUSED_PARAM(batteryManager);
- UNUSED_PARAM(eventType);
- UNUSED_PARAM(status);
-#endif
-}
-
-void WKBatteryManagerProviderUpdateBatteryStatus(WKBatteryManagerRef batteryManager, WKBatteryStatusRef status)
-{
-#if ENABLE(BATTERY_STATUS)
- toImpl(batteryManager)->providerUpdateBatteryStatus(toImpl(status));
-#else
- UNUSED_PARAM(batteryManager);
- UNUSED_PARAM(status);
-#endif
-}
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();
+}
diff --git a/Source/WebKit2/UIProcess/API/C/WKContext.h b/Source/WebKit2/UIProcess/API/C/WKContext.h
index 82237a5b4..e5fb6e343 100644
--- a/Source/WebKit2/UIProcess/API/C/WKContext.h
+++ b/Source/WebKit2/UIProcess/API/C/WKContext.h
@@ -26,11 +26,11 @@
#ifndef WKContext_h
#define WKContext_h
-#include <WebKit2/WKBase.h>
-#include <WebKit2/WKContextConnectionClient.h>
-#include <WebKit2/WKContextDownloadClient.h>
-#include <WebKit2/WKContextHistoryClient.h>
-#include <WebKit2/WKContextInjectedBundleClient.h>
+#include <WebKit/WKBase.h>
+#include <WebKit/WKContextConnectionClient.h>
+#include <WebKit/WKContextDownloadClient.h>
+#include <WebKit/WKContextHistoryClient.h>
+#include <WebKit/WKContextInjectedBundleClient.h>
#ifdef __cplusplus
extern "C" {
@@ -45,8 +45,12 @@ typedef uint32_t WKCacheModel;
// Context Client
typedef void (*WKContextPlugInAutoStartOriginHashesChangedCallback)(WKContextRef context, const void *clientInfo);
-typedef void (*WKContextNetworkProcessDidCrashCallback)(WKContextRef context, const void *clientInfo);
typedef void (*WKContextPlugInInformationBecameAvailableCallback)(WKContextRef context, WKArrayRef plugIn, const void *clientInfo);
+typedef WKDataRef (*WKContextCopyWebCryptoMasterKeyCallback)(WKContextRef context, const void *clientInfo);
+
+typedef void (*WKContextChildProcessDidCrashCallback)(WKContextRef context, const void *clientInfo);
+typedef WKContextChildProcessDidCrashCallback WKContextNetworkProcessDidCrashCallback;
+typedef WKContextChildProcessDidCrashCallback WKContextDatabaseProcessDidCrashCallback;
typedef struct WKContextClientBase {
int version;
@@ -62,17 +66,34 @@ typedef struct WKContextClientV0 {
WKContextPlugInInformationBecameAvailableCallback plugInInformationBecameAvailable;
} WKContextClientV0;
-enum { kWKContextClientCurrentVersion WK_ENUM_DEPRECATED("Use an explicit version number instead") = 0 };
-typedef struct WKContextClient {
- int version;
- const void * clientInfo;
+typedef struct WKContextClientV1 {
+ WKContextClientBase base;
// Version 0.
WKContextPlugInAutoStartOriginHashesChangedCallback plugInAutoStartOriginHashesChanged;
WKContextNetworkProcessDidCrashCallback networkProcessDidCrash;
WKContextPlugInInformationBecameAvailableCallback plugInInformationBecameAvailable;
-} WKContextClient WK_DEPRECATED("Use an explicit versioned struct instead");
+ // Version 1.
+ void (*copyWebCryptoMasterKey_unavailable)(void);
+} WKContextClientV1;
+
+typedef struct WKContextClientV2 {
+ WKContextClientBase base;
+
+ // Version 0.
+ WKContextPlugInAutoStartOriginHashesChangedCallback plugInAutoStartOriginHashesChanged;
+ WKContextNetworkProcessDidCrashCallback networkProcessDidCrash;
+ WKContextPlugInInformationBecameAvailableCallback plugInInformationBecameAvailable;
+
+ // Version 1.
+ void (*copyWebCryptoMasterKey_unavailable)(void);
+
+ // Version 2.
+ WKContextDatabaseProcessDidCrashCallback databaseProcessDidCrash;
+} WKContextClientV2;
+
+// FIXME: Remove these once support for Mavericks has been dropped.
enum {
kWKProcessModelSharedSecondaryProcess = 0,
kWKProcessModelMultipleSecondaryProcesses = 1
@@ -89,6 +110,7 @@ WK_EXPORT WKTypeID WKContextGetTypeID();
WK_EXPORT WKContextRef WKContextCreate();
WK_EXPORT WKContextRef WKContextCreateWithInjectedBundlePath(WKStringRef path);
+WK_EXPORT WKContextRef WKContextCreateWithConfiguration(WKContextConfigurationRef configuration);
WK_EXPORT void WKContextSetClient(WKContextRef context, const WKContextClientBase* client);
WK_EXPORT void WKContextSetInjectedBundleClient(WKContextRef context, const WKContextInjectedBundleClientBase* client);
@@ -96,18 +118,20 @@ WK_EXPORT void WKContextSetHistoryClient(WKContextRef context, const WKContextHi
WK_EXPORT void WKContextSetDownloadClient(WKContextRef context, const WKContextDownloadClientBase* client);
WK_EXPORT void WKContextSetConnectionClient(WKContextRef context, const WKContextConnectionClientBase* client);
-WK_EXPORT WKDownloadRef WKContextDownloadURLRequest(WKContextRef context, const WKURLRequestRef request);
+WK_EXPORT WKDownloadRef WKContextDownloadURLRequest(WKContextRef context, WKURLRequestRef request);
+WK_EXPORT WKDownloadRef WKContextResumeDownload(WKContextRef context, WKDataRef resumeData, WKStringRef path);
WK_EXPORT void WKContextSetInitializationUserDataForInjectedBundle(WKContextRef context, WKTypeRef userData);
WK_EXPORT void WKContextPostMessageToInjectedBundle(WKContextRef context, WKStringRef messageName, WKTypeRef messageBody);
WK_EXPORT void WKContextAddVisitedLink(WKContextRef context, WKStringRef visitedURL);
+WK_EXPORT void WKContextClearVisitedLinks(WKContextRef contextRef);
WK_EXPORT void WKContextSetCacheModel(WKContextRef context, WKCacheModel cacheModel);
WK_EXPORT WKCacheModel WKContextGetCacheModel(WKContextRef context);
-WK_EXPORT void WKContextSetProcessModel(WKContextRef context, WKProcessModel processModel);
-WK_EXPORT WKProcessModel WKContextGetProcessModel(WKContextRef context);
+// FIXME: Move these to WKDeprecatedFunctions.cpp once support for Mavericks has been dropped.
+WK_EXPORT void WKContextSetProcessModel(WKContextRef, WKProcessModel);
WK_EXPORT void WKContextSetMaximumNumberOfProcesses(WKContextRef context, unsigned numberOfProcesses);
WK_EXPORT unsigned WKContextGetMaximumNumberOfProcesses(WKContextRef context);
@@ -115,19 +139,16 @@ WK_EXPORT unsigned WKContextGetMaximumNumberOfProcesses(WKContextRef context);
WK_EXPORT void WKContextStartMemorySampler(WKContextRef context, WKDoubleRef interval);
WK_EXPORT void WKContextStopMemorySampler(WKContextRef context);
+WK_EXPORT WKWebsiteDataStoreRef WKContextGetWebsiteDataStore(WKContextRef context);
+
WK_EXPORT WKApplicationCacheManagerRef WKContextGetApplicationCacheManager(WKContextRef context);
-WK_EXPORT WKBatteryManagerRef WKContextGetBatteryManager(WKContextRef context);
WK_EXPORT WKCookieManagerRef WKContextGetCookieManager(WKContextRef context);
-WK_EXPORT WKDatabaseManagerRef WKContextGetDatabaseManager(WKContextRef context);
WK_EXPORT WKGeolocationManagerRef WKContextGetGeolocationManager(WKContextRef context);
WK_EXPORT WKIconDatabaseRef WKContextGetIconDatabase(WKContextRef context);
WK_EXPORT WKKeyValueStorageManagerRef WKContextGetKeyValueStorageManager(WKContextRef context);
-WK_EXPORT WKMediaCacheManagerRef WKContextGetMediaCacheManager(WKContextRef context);
-WK_EXPORT WKNetworkInfoManagerRef WKContextGetNetworkInfoManager(WKContextRef context);
+WK_EXPORT WKMediaSessionFocusManagerRef WKContextGetMediaSessionFocusManager(WKContextRef context);
WK_EXPORT WKNotificationManagerRef WKContextGetNotificationManager(WKContextRef context);
-WK_EXPORT WKPluginSiteDataManagerRef WKContextGetPluginSiteDataManager(WKContextRef context);
WK_EXPORT WKResourceCacheManagerRef WKContextGetResourceCacheManager(WKContextRef context);
-WK_EXPORT WKOriginDataManagerRef WKContextGetOriginDataManager(WKContextRef context);
typedef void (*WKContextGetStatisticsFunction)(WKDictionaryRef statistics, WKErrorRef error, void* functionContext);
WK_EXPORT void WKContextGetStatistics(WKContextRef context, void* functionContext, WKContextGetStatisticsFunction function);
@@ -140,6 +161,7 @@ WK_EXPORT WKDictionaryRef WKContextCopyPlugInAutoStartOriginHashes(WKContextRef
WK_EXPORT void WKContextSetPlugInAutoStartOriginHashes(WKContextRef context, WKDictionaryRef dictionary);
WK_EXPORT void WKContextSetPlugInAutoStartOrigins(WKContextRef contextRef, WKArrayRef arrayRef);
WK_EXPORT void WKContextSetPlugInAutoStartOriginsFilteringOutEntriesAddedAfterTime(WKContextRef contextRef, WKDictionaryRef dictionaryRef, double time);
+WK_EXPORT void WKContextRefreshPlugIns(WKContextRef context);
#ifdef __cplusplus
}
diff --git a/Source/WebKit2/UIProcess/API/C/WKContextConfigurationRef.cpp b/Source/WebKit2/UIProcess/API/C/WKContextConfigurationRef.cpp
new file mode 100644
index 000000000..fe4f9139a
--- /dev/null
+++ b/Source/WebKit2/UIProcess/API/C/WKContextConfigurationRef.cpp
@@ -0,0 +1,133 @@
+/*
+ * Copyright (C) 2014 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "WKContextConfigurationRef.h"
+
+#include "APIProcessPoolConfiguration.h"
+#include "WKAPICast.h"
+
+using namespace WebKit;
+
+WKContextConfigurationRef WKContextConfigurationCreate()
+{
+ auto configuration = API::ProcessPoolConfiguration::create();
+
+ // FIXME: A context created like this shouldn't have a data store,
+ // instead there should be a WKPageConfigurationRef object that specifies the data store.
+ configuration->setShouldHaveLegacyDataStore(true);
+
+ return toAPI(&configuration.leakRef());
+}
+
+WKStringRef WKContextConfigurationCopyDiskCacheDirectory(WKContextConfigurationRef configuration)
+{
+ return toCopiedAPI(toImpl(configuration)->diskCacheDirectory());
+}
+
+void WKContextConfigurationSetDiskCacheDirectory(WKContextConfigurationRef configuration, WKStringRef diskCacheDirectory)
+{
+ toImpl(configuration)->setDiskCacheDirectory(toImpl(diskCacheDirectory)->string());
+}
+
+WKStringRef WKContextConfigurationCopyApplicationCacheDirectory(WKContextConfigurationRef configuration)
+{
+ return toCopiedAPI(toImpl(configuration)->applicationCacheDirectory());
+}
+
+void WKContextConfigurationSetApplicationCacheDirectory(WKContextConfigurationRef configuration, WKStringRef applicationCacheDirectory)
+{
+ toImpl(configuration)->setApplicationCacheDirectory(toImpl(applicationCacheDirectory)->string());
+}
+
+WKStringRef WKContextConfigurationCopyIndexedDBDatabaseDirectory(WKContextConfigurationRef configuration)
+{
+ return toCopiedAPI(toImpl(configuration)->indexedDBDatabaseDirectory());
+}
+
+void WKContextConfigurationSetIndexedDBDatabaseDirectory(WKContextConfigurationRef configuration, WKStringRef indexedDBDatabaseDirectory)
+{
+ toImpl(configuration)->setIndexedDBDatabaseDirectory(toImpl(indexedDBDatabaseDirectory)->string());
+}
+
+WKStringRef WKContextConfigurationCopyInjectedBundlePath(WKContextConfigurationRef configuration)
+{
+ return toCopiedAPI(toImpl(configuration)->injectedBundlePath());
+}
+
+void WKContextConfigurationSetInjectedBundlePath(WKContextConfigurationRef configuration, WKStringRef injectedBundlePath)
+{
+ toImpl(configuration)->setInjectedBundlePath(toImpl(injectedBundlePath)->string());
+}
+
+WKStringRef WKContextConfigurationCopyLocalStorageDirectory(WKContextConfigurationRef configuration)
+{
+ return toCopiedAPI(toImpl(configuration)->localStorageDirectory());
+}
+
+void WKContextConfigurationSetLocalStorageDirectory(WKContextConfigurationRef configuration, WKStringRef localStorageDirectory)
+{
+ toImpl(configuration)->setLocalStorageDirectory(toImpl(localStorageDirectory)->string());
+}
+
+WKStringRef WKContextConfigurationCopyWebSQLDatabaseDirectory(WKContextConfigurationRef configuration)
+{
+ return toCopiedAPI(toImpl(configuration)->webSQLDatabaseDirectory());
+}
+
+void WKContextConfigurationSetWebSQLDatabaseDirectory(WKContextConfigurationRef configuration, WKStringRef webSQLDatabaseDirectory)
+{
+ toImpl(configuration)->setWebSQLDatabaseDirectory(toImpl(webSQLDatabaseDirectory)->string());
+}
+
+WKStringRef WKContextConfigurationCopyMediaKeysStorageDirectory(WKContextConfigurationRef configuration)
+{
+ return toCopiedAPI(toImpl(configuration)->mediaKeysStorageDirectory());
+}
+
+void WKContextConfigurationSetMediaKeysStorageDirectory(WKContextConfigurationRef configuration, WKStringRef mediaKeysStorageDirectory)
+{
+ toImpl(configuration)->setMediaKeysStorageDirectory(toImpl(mediaKeysStorageDirectory)->string());
+}
+
+bool WKContextConfigurationFullySynchronousModeIsAllowedForTesting(WKContextConfigurationRef configuration)
+{
+ return toImpl(configuration)->fullySynchronousModeIsAllowedForTesting();
+}
+
+void WKContextConfigurationSetFullySynchronousModeIsAllowedForTesting(WKContextConfigurationRef configuration, bool allowed)
+{
+ toImpl(configuration)->setFullySynchronousModeIsAllowedForTesting(allowed);
+}
+
+WKArrayRef WKContextConfigurationCopyOverrideLanguages(WKContextConfigurationRef configuration)
+{
+ return toAPI(&API::Array::createStringArray(toImpl(configuration)->overrideLanguages()).leakRef());
+}
+
+void WKContextConfigurationSetOverrideLanguages(WKContextConfigurationRef configuration, WKArrayRef overrideLanguages)
+{
+ toImpl(configuration)->setOverrideLanguages(toImpl(overrideLanguages)->toStringVector());
+}
diff --git a/Source/WebKit2/UIProcess/API/C/WKContextConfigurationRef.h b/Source/WebKit2/UIProcess/API/C/WKContextConfigurationRef.h
new file mode 100644
index 000000000..1ee343a47
--- /dev/null
+++ b/Source/WebKit2/UIProcess/API/C/WKContextConfigurationRef.h
@@ -0,0 +1,69 @@
+/*
+ * Copyright (C) 2014 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef WKContextConfigurationRef_h
+#define WKContextConfigurationRef_h
+
+#include <WebKit/WKBase.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+WK_EXPORT WKContextConfigurationRef WKContextConfigurationCreate();
+
+WK_EXPORT WKStringRef WKContextConfigurationCopyApplicationCacheDirectory(WKContextConfigurationRef configuration);
+WK_EXPORT void WKContextConfigurationSetApplicationCacheDirectory(WKContextConfigurationRef configuration, WKStringRef applicationCacheDirectory);
+
+WK_EXPORT WKStringRef WKContextConfigurationCopyDiskCacheDirectory(WKContextConfigurationRef configuration);
+WK_EXPORT void WKContextConfigurationSetDiskCacheDirectory(WKContextConfigurationRef configuration, WKStringRef diskCacheDirectory);
+
+WK_EXPORT WKStringRef WKContextConfigurationCopyIndexedDBDatabaseDirectory(WKContextConfigurationRef configuration);
+WK_EXPORT void WKContextConfigurationSetIndexedDBDatabaseDirectory(WKContextConfigurationRef configuration, WKStringRef indexedDBDatabaseDirectory);
+
+WK_EXPORT WKStringRef WKContextConfigurationCopyInjectedBundlePath(WKContextConfigurationRef configuration);
+WK_EXPORT void WKContextConfigurationSetInjectedBundlePath(WKContextConfigurationRef configuration, WKStringRef injectedBundlePath);
+
+WK_EXPORT WKStringRef WKContextConfigurationCopyLocalStorageDirectory(WKContextConfigurationRef configuration);
+WK_EXPORT void WKContextConfigurationSetLocalStorageDirectory(WKContextConfigurationRef configuration, WKStringRef localStorageDirectory);
+
+WK_EXPORT WKStringRef WKContextConfigurationCopyWebSQLDatabaseDirectory(WKContextConfigurationRef configuration);
+WK_EXPORT void WKContextConfigurationSetWebSQLDatabaseDirectory(WKContextConfigurationRef configuration, WKStringRef webSQLDatabaseDirectory);
+
+WK_EXPORT WKStringRef WKContextConfigurationCopyMediaKeysStorageDirectory(WKContextConfigurationRef configuration);
+WK_EXPORT void WKContextConfigurationSetMediaKeysStorageDirectory(WKContextConfigurationRef configuration, WKStringRef mediaKeysStorageDirectory);
+
+WK_EXPORT bool WKContextConfigurationFullySynchronousModeIsAllowedForTesting(WKContextConfigurationRef configuration);
+WK_EXPORT void WKContextConfigurationSetFullySynchronousModeIsAllowedForTesting(WKContextConfigurationRef configuration, bool allowed);
+
+WK_EXPORT WKArrayRef WKContextConfigurationCopyOverrideLanguages(WKContextConfigurationRef configuration);
+WK_EXPORT void WKContextConfigurationSetOverrideLanguages(WKContextConfigurationRef configuration, WKArrayRef overrideLanguages);
+
+#ifdef __cplusplus
+}
+#endif
+
+
+#endif // WKContextConfigurationRef_h
diff --git a/Source/WebKit2/UIProcess/API/C/WKContextConnectionClient.h b/Source/WebKit2/UIProcess/API/C/WKContextConnectionClient.h
index 82f79d63e..e7c576310 100644
--- a/Source/WebKit2/UIProcess/API/C/WKContextConnectionClient.h
+++ b/Source/WebKit2/UIProcess/API/C/WKContextConnectionClient.h
@@ -26,7 +26,7 @@
#ifndef WKContextConnectionClient_h
#define WKContextConnectionClient_h
-#include <WebKit2/WKBase.h>
+#include <WebKit/WKBase.h>
typedef void (*WKContextDidCreateConnection)(WKContextRef context, WKConnectionRef connection, const void* clientInfo);
@@ -42,13 +42,4 @@ typedef struct WKContextConnectionClientV0 {
WKContextDidCreateConnection didCreateConnection;
} WKContextConnectionClientV0;
-enum { kWKContextConnectionClientCurrentVersion WK_ENUM_DEPRECATED("Use an explicit version number instead") = 0 };
-typedef struct WKContextConnectionClient {
- int version;
- const void * clientInfo;
-
- // Version 0.
- WKContextDidCreateConnection didCreateConnection;
-} WKContextConnectionClient WK_DEPRECATED("Use an explicit versioned struct instead");
-
#endif // WKContextConnectionClient_h
diff --git a/Source/WebKit2/UIProcess/API/C/WKContextDownloadClient.h b/Source/WebKit2/UIProcess/API/C/WKContextDownloadClient.h
index 0aede7fb6..5bb8d83a8 100644
--- a/Source/WebKit2/UIProcess/API/C/WKContextDownloadClient.h
+++ b/Source/WebKit2/UIProcess/API/C/WKContextDownloadClient.h
@@ -26,7 +26,7 @@
#ifndef WKContextDownloadClient_h
#define WKContextDownloadClient_h
-#include <WebKit2/WKBase.h>
+#include <WebKit/WKBase.h>
typedef void (*WKContextDownloadDidStartCallback)(WKContextRef context, WKDownloadRef download, const void *clientInfo);
typedef void (*WKContextDownloadDidReceiveAuthenticationChallengeCallback)(WKContextRef context, WKDownloadRef download, WKAuthenticationChallengeRef authenticationChallenge, const void *clientInfo);
@@ -62,23 +62,4 @@ typedef struct WKContextDownloadClientV0 {
WKContextDownloadProcessDidCrashCallback processDidCrash;
} WKContextDownloadClientV0;
-enum { kWKContextDownloadClientCurrentVersion WK_ENUM_DEPRECATED("Use an explicit version number instead") = 0 };
-typedef struct WKContextDownloadClient {
- int version;
- const void * clientInfo;
-
- // Version 0.
- WKContextDownloadDidStartCallback didStart;
- WKContextDownloadDidReceiveAuthenticationChallengeCallback didReceiveAuthenticationChallenge;
- WKContextDownloadDidReceiveResponseCallback didReceiveResponse;
- WKContextDownloadDidReceiveDataCallback didReceiveData;
- WKContextDownloadShouldDecodeSourceDataOfMIMETypeCallback shouldDecodeSourceDataOfMIMEType;
- WKContextDownloadDecideDestinationWithSuggestedFilenameCallback decideDestinationWithSuggestedFilename;
- WKContextDownloadDidCreateDestinationCallback didCreateDestination;
- WKContextDownloadDidFinishCallback didFinish;
- WKContextDownloadDidFailCallback didFail;
- WKContextDownloadDidCancel didCancel;
- WKContextDownloadProcessDidCrashCallback processDidCrash;
-} WKContextDownloadClient WK_DEPRECATED("Use an explicit versioned struct instead");
-
#endif // WKContextDownloadClient_h
diff --git a/Source/WebKit2/UIProcess/API/C/WKContextHistoryClient.h b/Source/WebKit2/UIProcess/API/C/WKContextHistoryClient.h
index 821b0ab42..0558efdba 100644
--- a/Source/WebKit2/UIProcess/API/C/WKContextHistoryClient.h
+++ b/Source/WebKit2/UIProcess/API/C/WKContextHistoryClient.h
@@ -26,7 +26,7 @@
#ifndef WKContextHistoryClient_h
#define WKContextHistoryClient_h
-#include <WebKit2/WKBase.h>
+#include <WebKit/WKBase.h>
typedef void (*WKContextDidNavigateWithNavigationDataCallback)(WKContextRef context, WKPageRef page, WKNavigationDataRef navigationData, WKFrameRef frame, const void *clientInfo);
typedef void (*WKContextDidPerformClientRedirectCallback)(WKContextRef context, WKPageRef page, WKURLRef sourceURL, WKURLRef destinationURL, WKFrameRef frame, const void *clientInfo);
@@ -50,17 +50,4 @@ typedef struct WKContextHistoryClientV0 {
WKContextPopulateVisitedLinksCallback populateVisitedLinks;
} WKContextHistoryClientV0;
-enum { kWKContextHistoryClientCurrentVersion WK_ENUM_DEPRECATED("Use an explicit version number instead") = 0 };
-typedef struct WKContextHistoryClient {
- int version;
- const void * clientInfo;
-
- // Version 0.
- WKContextDidNavigateWithNavigationDataCallback didNavigateWithNavigationData;
- WKContextDidPerformClientRedirectCallback didPerformClientRedirect;
- WKContextDidPerformServerRedirectCallback didPerformServerRedirect;
- WKContextDidUpdateHistoryTitleCallback didUpdateHistoryTitle;
- WKContextPopulateVisitedLinksCallback populateVisitedLinks;
-} WKContextHistoryClient WK_DEPRECATED("Use an explicit versioned struct instead");
-
#endif // WKContextHistoryClient_h
diff --git a/Source/WebKit2/UIProcess/API/C/WKContextInjectedBundleClient.h b/Source/WebKit2/UIProcess/API/C/WKContextInjectedBundleClient.h
index d48f8e7bc..d3456aa68 100644
--- a/Source/WebKit2/UIProcess/API/C/WKContextInjectedBundleClient.h
+++ b/Source/WebKit2/UIProcess/API/C/WKContextInjectedBundleClient.h
@@ -26,7 +26,7 @@
#ifndef WKContextInjectedBundleClient_h
#define WKContextInjectedBundleClient_h
-#include <WebKit2/WKBase.h>
+#include <WebKit/WKBase.h>
// Injected Bundle Client
typedef void (*WKContextDidReceiveMessageFromInjectedBundleCallback)(WKContextRef page, WKStringRef messageName, WKTypeRef messageBody, const void *clientInfo);
@@ -57,17 +57,4 @@ typedef struct WKContextInjectedBundleClientV1 {
WKContextGetInjectedBundleInitializationUserDataCallback getInjectedBundleInitializationUserData;
} WKContextInjectedBundleClientV1;
-enum { kWKContextInjectedBundleClientCurrentVersion WK_ENUM_DEPRECATED("Use an explicit version number instead") = 1 };
-typedef struct WKContextInjectedBundleClient {
- int version;
- const void * clientInfo;
-
- // Version 0.
- WKContextDidReceiveMessageFromInjectedBundleCallback didReceiveMessageFromInjectedBundle;
- WKContextDidReceiveSynchronousMessageFromInjectedBundleCallback didReceiveSynchronousMessageFromInjectedBundle;
-
- // Version 1.
- WKContextGetInjectedBundleInitializationUserDataCallback getInjectedBundleInitializationUserData;
-} WKContextInjectedBundleClient WK_DEPRECATED("Use an explicit versioned struct instead");
-
#endif // WKContextInjectedBundleClient_h
diff --git a/Source/WebKit2/UIProcess/API/C/WKColorPickerResultListener.cpp b/Source/WebKit2/UIProcess/API/C/WKContextMenuListener.cpp
index 07bfe3c9e..4d067a7c9 100644
--- a/Source/WebKit2/UIProcess/API/C/WKColorPickerResultListener.cpp
+++ b/Source/WebKit2/UIProcess/API/C/WKContextMenuListener.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2012 Samsung Electronics. All rights reserved.
+ * Copyright (C) 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
@@ -10,7 +10,7 @@
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS AS IS''
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
@@ -24,28 +24,28 @@
*/
#include "config.h"
-#include "WKColorPickerResultListener.h"
+#include "WKContextMenuListener.h"
#include "WKAPICast.h"
-#include "WebColorPickerResultListenerProxy.h"
+#include "WebContextMenuListenerProxy.h"
using namespace WebKit;
-WKTypeID WKColorPickerResultListenerGetTypeID()
+WKTypeID WKContextMenuListenerGetTypeID()
{
-#if ENABLE(INPUT_TYPE_COLOR)
- return toAPI(WebColorPickerResultListenerProxy::APIType);
+#if ENABLE(CONTEXT_MENUS)
+ return toAPI(WebContextMenuListenerProxy::APIType);
#else
- return 0;
+ return toAPI(API::Object::Type::Null);
#endif
}
-void WKColorPickerResultListenerSetColor(WKColorPickerResultListenerRef listenerRef, const WKStringRef color)
+void WKContextMenuListenerUseContextMenuItems(WKContextMenuListenerRef listenerRef, WKArrayRef items)
{
-#if ENABLE(INPUT_TYPE_COLOR)
- toImpl(listenerRef)->setColor(toWTFString(color));
+#if ENABLE(CONTEXT_MENUS)
+ toImpl(listenerRef)->useContextMenuItems(items);
#else
UNUSED_PARAM(listenerRef);
- UNUSED_PARAM(color);
+ UNUSED_PARAM(items);
#endif
}
diff --git a/Source/WebKit2/UIProcess/API/C/WKContextMenuListener.h b/Source/WebKit2/UIProcess/API/C/WKContextMenuListener.h
new file mode 100644
index 000000000..2b50d7dc2
--- /dev/null
+++ b/Source/WebKit2/UIProcess/API/C/WKContextMenuListener.h
@@ -0,0 +1,40 @@
+/*
+ * Copyright (C) 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
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#pragma once
+
+#include <WebKit/WKBase.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+WK_EXPORT WKTypeID WKContextMenuListenerGetTypeID();
+
+WK_EXPORT void WKContextMenuListenerUseContextMenuItems(WKContextMenuListenerRef, WKArrayRef);
+
+#ifdef __cplusplus
+}
+#endif
diff --git a/Source/WebKit2/UIProcess/API/C/WKContextPrivate.h b/Source/WebKit2/UIProcess/API/C/WKContextPrivate.h
index 9189163fd..4d8048afc 100644
--- a/Source/WebKit2/UIProcess/API/C/WKContextPrivate.h
+++ b/Source/WebKit2/UIProcess/API/C/WKContextPrivate.h
@@ -26,8 +26,8 @@
#ifndef WKContextPrivate_h
#define WKContextPrivate_h
-#include <WebKit2/WKBase.h>
-#include <WebKit2/WKContext.h>
+#include <WebKit/WKBase.h>
+#include <WebKit/WKContext.h>
#ifdef __cplusplus
extern "C" {
@@ -52,18 +52,22 @@ WK_EXPORT void WKContextSetShouldUseFontSmoothing(WKContextRef context, bool use
WK_EXPORT void WKContextRegisterURLSchemeAsSecure(WKContextRef context, WKStringRef urlScheme);
+WK_EXPORT void WKContextRegisterURLSchemeAsBypassingContentSecurityPolicy(WKContextRef context, WKStringRef urlScheme);
+
+WK_EXPORT void WKContextRegisterURLSchemeAsCachePartitioned(WKContextRef context, WKStringRef urlScheme);
+
WK_EXPORT void WKContextSetDomainRelaxationForbiddenForURLScheme(WKContextRef context, WKStringRef urlScheme);
+WK_EXPORT void WKContextSetCanHandleHTTPSServerTrustEvaluation(WKContextRef context, bool value);
+
+WK_EXPORT void WKContextSetDiskCacheSpeculativeValidationEnabled(WKContextRef context, bool value);
+
+WK_EXPORT void WKContextSetUnresponsiveBackgroundProcessesTerminationEnabled(WKContextRef context, bool value);
+
WK_EXPORT void WKContextSetIconDatabasePath(WKContextRef context, WKStringRef iconDatabasePath);
WK_EXPORT void WKContextAllowSpecificHTTPSCertificateForHost(WKContextRef context, WKCertificateInfoRef certificate, WKStringRef host);
-// FIXME: These functions are only effective if called before the Web process is launched. But
-// we should really change these settings to be on WebPreferences and changeable at runtime.
-WK_EXPORT void WKContextSetApplicationCacheDirectory(WKContextRef context, WKStringRef applicationCacheDirectory);
-WK_EXPORT void WKContextSetDatabaseDirectory(WKContextRef context, WKStringRef databaseDirectory);
-WK_EXPORT void WKContextSetLocalStorageDirectory(WKContextRef context, WKStringRef localStorageDirectory);
-WK_EXPORT void WKContextSetDiskCacheDirectory(WKContextRef context, WKStringRef diskCacheDirectory);
WK_EXPORT void WKContextSetCookieStorageDirectory(WKContextRef context, WKStringRef cookieStorageDirectory);
// FIXME: This is a workaround for testing purposes only and should be removed once a better
@@ -77,16 +81,24 @@ WK_EXPORT void WKContextWarmInitialProcess(WKContextRef context);
// FIXME: This function is temporary and useful during the development of the NetworkProcess feature.
// At some point it should be removed.
-WK_EXPORT void WKContextSetUsesNetworkProcess(WKContextRef context, bool usesNetworkProcess);
+WK_EXPORT void WKContextSetUsesNetworkProcess(WKContextRef, bool);
// Test only. Should be called before any secondary processes are started.
WK_EXPORT void WKContextUseTestingNetworkSession(WKContextRef context);
+// Test only. Should be called before running a test.
+WK_EXPORT void WKContextClearCachedCredentials(WKContextRef context);
+
typedef void (*WKContextInvalidMessageFunction)(WKStringRef messageName);
WK_EXPORT void WKContextSetInvalidMessageFunction(WKContextInvalidMessageFunction invalidMessageFunction);
WK_EXPORT void WKContextSetMemoryCacheDisabled(WKContextRef, bool disabled);
+WK_EXPORT void WKContextSetFontWhitelist(WKContextRef, WKArrayRef);
+
+WK_EXPORT pid_t WKContextGetNetworkProcessIdentifier(WKContextRef context);
+WK_EXPORT pid_t WKContextGetDatabaseProcessIdentifier(WKContextRef context);
+
#ifdef __cplusplus
}
#endif
diff --git a/Source/WebKit2/UIProcess/API/C/WKCookieManager.cpp b/Source/WebKit2/UIProcess/API/C/WKCookieManager.cpp
index ed2770f5d..7624beee9 100644
--- a/Source/WebKit2/UIProcess/API/C/WKCookieManager.cpp
+++ b/Source/WebKit2/UIProcess/API/C/WKCookieManager.cpp
@@ -43,17 +43,25 @@ void WKCookieManagerSetClient(WKCookieManagerRef cookieManagerRef, const WKCooki
void WKCookieManagerGetHostnamesWithCookies(WKCookieManagerRef cookieManagerRef, void* context, WKCookieManagerGetCookieHostnamesFunction callback)
{
- toImpl(cookieManagerRef)->getHostnamesWithCookies(ArrayCallback::create(context, callback));
+ toImpl(cookieManagerRef)->getHostnamesWithCookies(WebCore::SessionID::defaultSessionID(), toGenericCallbackFunction(context, callback));
}
void WKCookieManagerDeleteCookiesForHostname(WKCookieManagerRef cookieManagerRef, WKStringRef hostname)
{
- toImpl(cookieManagerRef)->deleteCookiesForHostname(toImpl(hostname)->string());
+ toImpl(cookieManagerRef)->deleteCookiesForHostname(WebCore::SessionID::defaultSessionID(), toImpl(hostname)->string());
}
void WKCookieManagerDeleteAllCookies(WKCookieManagerRef cookieManagerRef)
{
- toImpl(cookieManagerRef)->deleteAllCookies();
+ toImpl(cookieManagerRef)->deleteAllCookies(WebCore::SessionID::defaultSessionID());
+}
+
+void WKCookieManagerDeleteAllCookiesModifiedAfterDate(WKCookieManagerRef cookieManagerRef, double date)
+{
+ using namespace std::chrono;
+
+ auto time = system_clock::time_point(duration_cast<system_clock::duration>(duration<double>(date)));
+ toImpl(cookieManagerRef)->deleteAllCookiesModifiedSince(WebCore::SessionID::defaultSessionID(), time);
}
void WKCookieManagerSetHTTPCookieAcceptPolicy(WKCookieManagerRef cookieManager, WKHTTPCookieAcceptPolicy policy)
@@ -63,15 +71,15 @@ void WKCookieManagerSetHTTPCookieAcceptPolicy(WKCookieManagerRef cookieManager,
void WKCookieManagerGetHTTPCookieAcceptPolicy(WKCookieManagerRef cookieManager, void* context, WKCookieManagerGetHTTPCookieAcceptPolicyFunction callback)
{
- toImpl(cookieManager)->getHTTPCookieAcceptPolicy(HTTPCookieAcceptPolicyCallback::create(context, callback));
+ toImpl(cookieManager)->getHTTPCookieAcceptPolicy(toGenericCallbackFunction<WKHTTPCookieAcceptPolicy, HTTPCookieAcceptPolicy>(context, callback));
}
void WKCookieManagerStartObservingCookieChanges(WKCookieManagerRef cookieManager)
{
- toImpl(cookieManager)->startObservingCookieChanges();
+ toImpl(cookieManager)->startObservingCookieChanges(WebCore::SessionID::defaultSessionID());
}
void WKCookieManagerStopObservingCookieChanges(WKCookieManagerRef cookieManager)
{
- toImpl(cookieManager)->stopObservingCookieChanges();
+ toImpl(cookieManager)->stopObservingCookieChanges(WebCore::SessionID::defaultSessionID());
}
diff --git a/Source/WebKit2/UIProcess/API/C/WKCookieManager.h b/Source/WebKit2/UIProcess/API/C/WKCookieManager.h
index 6f302a2ce..8f4111c3f 100644
--- a/Source/WebKit2/UIProcess/API/C/WKCookieManager.h
+++ b/Source/WebKit2/UIProcess/API/C/WKCookieManager.h
@@ -26,7 +26,7 @@
#ifndef WKCookieManager_h
#define WKCookieManager_h
-#include <WebKit2/WKBase.h>
+#include <WebKit/WKBase.h>
#ifdef __cplusplus
extern "C" {
@@ -55,15 +55,6 @@ typedef struct WKCookieManagerClientV0 {
WKCookieManagerCookiesDidChangeCallback cookiesDidChange;
} WKCookieManagerClientV0;
-enum { kWKCookieManagerClientCurrentVersion WK_ENUM_DEPRECATED("Use an explicit version number instead") = 0 };
-typedef struct WKCookieManagerClient {
- int version;
- const void * clientInfo;
-
- // Version 0.
- WKCookieManagerCookiesDidChangeCallback cookiesDidChange;
-} WKCookieManagerClient WK_DEPRECATED("Use an explicit versioned struct instead");
-
WK_EXPORT WKTypeID WKCookieManagerGetTypeID();
WK_EXPORT void WKCookieManagerSetClient(WKCookieManagerRef cookieManager, const WKCookieManagerClientBase* client);
@@ -74,6 +65,9 @@ WK_EXPORT void WKCookieManagerGetHostnamesWithCookies(WKCookieManagerRef cookieM
WK_EXPORT void WKCookieManagerDeleteCookiesForHostname(WKCookieManagerRef cookieManager, WKStringRef hostname);
WK_EXPORT void WKCookieManagerDeleteAllCookies(WKCookieManagerRef cookieManager);
+// The time here is relative to the Unix epoch.
+WK_EXPORT void WKCookieManagerDeleteAllCookiesModifiedAfterDate(WKCookieManagerRef cookieManager, double);
+
WK_EXPORT void WKCookieManagerSetHTTPCookieAcceptPolicy(WKCookieManagerRef cookieManager, WKHTTPCookieAcceptPolicy policy);
typedef void (*WKCookieManagerGetHTTPCookieAcceptPolicyFunction)(WKHTTPCookieAcceptPolicy, WKErrorRef, void*);
WK_EXPORT void WKCookieManagerGetHTTPCookieAcceptPolicy(WKCookieManagerRef cookieManager, void* context, WKCookieManagerGetHTTPCookieAcceptPolicyFunction callback);
diff --git a/Source/WebKit2/UIProcess/API/C/WKCredential.cpp b/Source/WebKit2/UIProcess/API/C/WKCredential.cpp
index 6a956003b..35ecb203b 100644
--- a/Source/WebKit2/UIProcess/API/C/WKCredential.cpp
+++ b/Source/WebKit2/UIProcess/API/C/WKCredential.cpp
@@ -40,18 +40,16 @@ WKTypeID WKCredentialGetTypeID()
WKCredentialRef WKCredentialCreate(WKStringRef username, WKStringRef password, WKCredentialPersistence persistence)
{
- RefPtr<WebCredential> credential = WebCredential::create(toImpl(username), toImpl(password), toCredentialPersistence(persistence));
- return toAPI(credential.release().leakRef());
+ return toAPI(&WebCredential::create(WebCore::Credential(toImpl(username)->string(), toImpl(password)->string(), toCredentialPersistence(persistence))).leakRef());
}
WKCredentialRef WKCredentialCreateWithCertificateInfo(WKCertificateInfoRef certificateInfo)
{
- RefPtr<WebCredential> credential = WebCredential::create(toImpl(certificateInfo));
- return toAPI(credential.release().leakRef());
+ return toAPI(&WebCredential::create(toImpl(certificateInfo)).leakRef());
}
WKStringRef WKCredentialCopyUser(WKCredentialRef credentialRef)
{
- return toCopiedAPI(toImpl(credentialRef)->user());
+ return toCopiedAPI(toImpl(credentialRef)->credential().user());
}
diff --git a/Source/WebKit2/UIProcess/API/C/WKCredential.h b/Source/WebKit2/UIProcess/API/C/WKCredential.h
index 560fc419a..57842fbda 100644
--- a/Source/WebKit2/UIProcess/API/C/WKCredential.h
+++ b/Source/WebKit2/UIProcess/API/C/WKCredential.h
@@ -26,8 +26,8 @@
#ifndef WKCredential_h
#define WKCredential_h
-#include <WebKit2/WKBase.h>
-#include <WebKit2/WKCredentialTypes.h>
+#include <WebKit/WKBase.h>
+#include <WebKit/WKCredentialTypes.h>
#ifdef __cplusplus
extern "C" {
diff --git a/Source/WebKit2/UIProcess/API/C/WKDatabaseManager.cpp b/Source/WebKit2/UIProcess/API/C/WKDatabaseManager.cpp
deleted file mode 100644
index 5aa9dcf6b..000000000
--- a/Source/WebKit2/UIProcess/API/C/WKDatabaseManager.cpp
+++ /dev/null
@@ -1,216 +0,0 @@
-/*
- * Copyright (C) 2010 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-#include "WKDatabaseManager.h"
-
-#include "WebDatabaseManagerProxy.h"
-#include "WKAPICast.h"
-
-using namespace WebKit;
-
-WKTypeID WKDatabaseManagerGetTypeID()
-{
-#if ENABLE(SQL_DATABASE)
- return toAPI(WebDatabaseManagerProxy::APIType);
-#else
- return 0;
-#endif
-}
-
-WKStringRef WKDatabaseManagerGetOriginKey()
-{
-#if ENABLE(SQL_DATABASE)
- static API::String* key = API::String::create(WebDatabaseManagerProxy::originKey()).leakRef();
- return toAPI(key);
-#else
- return 0;
-#endif
-}
-
-WKStringRef WKDatabaseManagerGetOriginQuotaKey()
-{
-#if ENABLE(SQL_DATABASE)
- static API::String* key = API::String::create(WebDatabaseManagerProxy::originQuotaKey()).leakRef();
- return toAPI(key);
-#else
- return 0;
-#endif
-}
-
-WKStringRef WKDatabaseManagerGetOriginUsageKey()
-{
-#if ENABLE(SQL_DATABASE)
- static API::String* key = API::String::create(WebDatabaseManagerProxy::originUsageKey()).leakRef();
- return toAPI(key);
-#else
- return 0;
-#endif
-}
-
-WKStringRef WKDatabaseManagerGetDatabaseDetailsKey()
-{
-#if ENABLE(SQL_DATABASE)
- static API::String* key = API::String::create(WebDatabaseManagerProxy::databaseDetailsKey()).leakRef();
- return toAPI(key);
-#else
- return 0;
-#endif
-}
-
-WKStringRef WKDatabaseManagerGetDatabaseDetailsNameKey()
-{
-#if ENABLE(SQL_DATABASE)
- static API::String* key = API::String::create(WebDatabaseManagerProxy::databaseDetailsNameKey()).leakRef();
- return toAPI(key);
-#else
- return 0;
-#endif
-}
-
-WKStringRef WKDatabaseManagerGetDatabaseDetailsDisplayNameKey()
-{
-#if ENABLE(SQL_DATABASE)
- static API::String* key = API::String::create(WebDatabaseManagerProxy::databaseDetailsDisplayNameKey()).leakRef();
- return toAPI(key);
-#else
- return 0;
-#endif
-}
-
-WKStringRef WKDatabaseManagerGetDatabaseDetailsExpectedUsageKey()
-{
-#if ENABLE(SQL_DATABASE)
- static API::String* key = API::String::create(WebDatabaseManagerProxy::databaseDetailsExpectedUsageKey()).leakRef();
- return toAPI(key);
-#else
- return 0;
-#endif
-}
-
-WKStringRef WKDatabaseManagerGetDatabaseDetailsCurrentUsageKey()
-{
-#if ENABLE(SQL_DATABASE)
- static API::String* key = API::String::create(WebDatabaseManagerProxy::databaseDetailsCurrentUsageKey()).leakRef();
- return toAPI(key);
-#else
- return 0;
-#endif
-}
-
-WKStringRef WKDatabaseManagerGetDatabaseDetailsCreationTimeKey()
-{
-#if ENABLE(SQL_DATABASE)
- static API::String* key = API::String::create(WebDatabaseManagerProxy::databaseDetailsCreationTimeKey()).leakRef();
- return toAPI(key);
-#else
- return 0;
-#endif
-}
-
-WKStringRef WKDatabaseManagerGetDatabaseDetailsModificationTimeKey()
-{
-#if ENABLE(SQL_DATABASE)
- static API::String* key = API::String::create(WebDatabaseManagerProxy::databaseDetailsModificationTimeKey()).leakRef();
- return toAPI(key);
-#else
- return 0;
-#endif
-}
-
-void WKDatabaseManagerSetClient(WKDatabaseManagerRef databaseManagerRef, const WKDatabaseManagerClientBase* wkClient)
-{
-#if ENABLE(SQL_DATABASE)
- if (wkClient && wkClient->version)
- return;
- toImpl(databaseManagerRef)->initializeClient(wkClient);
-#else
- UNUSED_PARAM(databaseManagerRef);
- UNUSED_PARAM(wkClient);
-#endif
-}
-
-void WKDatabaseManagerGetDatabasesByOrigin(WKDatabaseManagerRef databaseManagerRef, void* context, WKDatabaseManagerGetDatabasesByOriginFunction callback)
-{
-#if ENABLE(SQL_DATABASE)
- toImpl(databaseManagerRef)->getDatabasesByOrigin(ArrayCallback::create(context, callback));
-#else
- UNUSED_PARAM(databaseManagerRef);
- UNUSED_PARAM(context);
- UNUSED_PARAM(callback);
-#endif
-}
-
-void WKDatabaseManagerGetDatabaseOrigins(WKDatabaseManagerRef databaseManagerRef, void* context, WKDatabaseManagerGetDatabaseOriginsFunction callback)
-{
-#if ENABLE(SQL_DATABASE)
- toImpl(databaseManagerRef)->getDatabaseOrigins(ArrayCallback::create(context, callback));
-#else
- UNUSED_PARAM(databaseManagerRef);
- UNUSED_PARAM(context);
- UNUSED_PARAM(callback);
-#endif
-}
-
-void WKDatabaseManagerDeleteDatabasesWithNameForOrigin(WKDatabaseManagerRef databaseManagerRef, WKStringRef databaseNameRef, WKSecurityOriginRef originRef)
-{
-#if ENABLE(SQL_DATABASE)
- toImpl(databaseManagerRef)->deleteDatabaseWithNameForOrigin(toWTFString(databaseNameRef), toImpl(originRef));
-#else
- UNUSED_PARAM(databaseManagerRef);
- UNUSED_PARAM(databaseNameRef);
- UNUSED_PARAM(originRef);
-#endif
-}
-
-void WKDatabaseManagerDeleteDatabasesForOrigin(WKDatabaseManagerRef databaseManagerRef, WKSecurityOriginRef originRef)
-{
-#if ENABLE(SQL_DATABASE)
- toImpl(databaseManagerRef)->deleteDatabasesForOrigin(toImpl(originRef));
-#else
- UNUSED_PARAM(databaseManagerRef);
- UNUSED_PARAM(originRef);
-#endif
-}
-
-void WKDatabaseManagerDeleteAllDatabases(WKDatabaseManagerRef databaseManagerRef)
-{
-#if ENABLE(SQL_DATABASE)
- toImpl(databaseManagerRef)->deleteAllDatabases();
-#else
- UNUSED_PARAM(databaseManagerRef);
-#endif
-}
-
-void WKDatabaseManagerSetQuotaForOrigin(WKDatabaseManagerRef databaseManagerRef, WKSecurityOriginRef originRef, uint64_t quota)
-{
-#if ENABLE(SQL_DATABASE)
- toImpl(databaseManagerRef)->setQuotaForOrigin(toImpl(originRef), quota);
-#else
- UNUSED_PARAM(databaseManagerRef);
- UNUSED_PARAM(originRef);
- UNUSED_PARAM(quota);
-#endif
-}
diff --git a/Source/WebKit2/UIProcess/API/C/WKDatabaseManager.h b/Source/WebKit2/UIProcess/API/C/WKDatabaseManager.h
deleted file mode 100644
index 12f2dbc83..000000000
--- a/Source/WebKit2/UIProcess/API/C/WKDatabaseManager.h
+++ /dev/null
@@ -1,118 +0,0 @@
-/*
- * Copyright (C) 2010 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef WKDatabaseManager_h
-#define WKDatabaseManager_h
-
-#include <WebKit2/WKBase.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/* Value type: WKSecurityOriginRef */
-WK_EXPORT WKStringRef WKDatabaseManagerGetOriginKey();
-
-/* Value type: WKUInt64Ref */
-WK_EXPORT WKStringRef WKDatabaseManagerGetOriginQuotaKey();
-
-/* Value type: WKUInt64Ref */
-WK_EXPORT WKStringRef WKDatabaseManagerGetOriginUsageKey();
-
-/* Value type: WKArrayRef (array of WKDictionaryRef's with keys that include:
- - WKDatabaseManagerGetDatabaseNameKey()
- - WKDatabaseManagerGetDatabaseDisplayNameKey()
- - WKDatabaseManagerGetDatabaseExpectedUsageKey()
- - WKDatabaseManagerGetDatabaseCurrentUsageKey()
- */
-WK_EXPORT WKStringRef WKDatabaseManagerGetDatabaseDetailsKey();
-
-/* Value type: WKStringRef */
-WK_EXPORT WKStringRef WKDatabaseManagerGetDatabaseDetailsNameKey();
-
-/* Value type: WKStringRef */
-WK_EXPORT WKStringRef WKDatabaseManagerGetDatabaseDetailsDisplayNameKey();
-
-/* Value type: WKUInt64Ref */
-WK_EXPORT WKStringRef WKDatabaseManagerGetDatabaseDetailsExpectedUsageKey();
-
-/* Value type: WKUInt64Ref */
-WK_EXPORT WKStringRef WKDatabaseManagerGetDatabaseDetailsCurrentUsageKey();
-
-/* Value type: WKDoubleRef, seconds since January 1st, 1970 UTC */
-WK_EXPORT WKStringRef WKDatabaseManagerGetDatabaseDetailsCreationTimeKey();
-
-/* Value type: WKDoubleRef, seconds since January 1st, 1970 UTC */
-WK_EXPORT WKStringRef WKDatabaseManagerGetDatabaseDetailsModificationTimeKey();
-
-
-// Database Manager Client
-typedef void (*WKDatabaseManagerDidModifyOriginCallback)(WKDatabaseManagerRef databaseManager, WKSecurityOriginRef origin, const void *clientInfo);
-typedef void (*WKDatabaseManagerDidModifyDatabaseCallback)(WKDatabaseManagerRef databaseManager, WKSecurityOriginRef origin, WKStringRef databaseIdentifier, const void *clientInfo);
-
-typedef struct WKDatabaseManagerClientBase {
- int version;
- const void * clientInfo;
-} WKDatabaseManagerClientBase;
-
-typedef struct WKDatabaseManagerClientV0 {
- WKDatabaseManagerClientBase base;
-
- // Version 0.
- WKDatabaseManagerDidModifyOriginCallback didModifyOrigin;
- WKDatabaseManagerDidModifyDatabaseCallback didModifyDatabase;
-} WKDatabaseManagerClientV0;
-
-enum { kWKDatabaseManagerClientCurrentVersion WK_ENUM_DEPRECATED("Use an explicit version number instead") = 0 };
-typedef struct WKDatabaseManagerClient {
- int version;
- const void * clientInfo;
-
- // Version 0.
- WKDatabaseManagerDidModifyOriginCallback didModifyOrigin;
- WKDatabaseManagerDidModifyDatabaseCallback didModifyDatabase;
-} WKDatabaseManagerClient WK_DEPRECATED("Use an explicit versioned struct instead");
-
-WK_EXPORT WKTypeID WKDatabaseManagerGetTypeID();
-
-WK_EXPORT void WKDatabaseManagerSetClient(WKDatabaseManagerRef databaseManager, const WKDatabaseManagerClientBase* client);
-
-typedef void (*WKDatabaseManagerGetDatabasesByOriginFunction)(WKArrayRef, WKErrorRef, void*);
-WK_EXPORT void WKDatabaseManagerGetDatabasesByOrigin(WKDatabaseManagerRef databaseManager, void* context, WKDatabaseManagerGetDatabasesByOriginFunction function);
-
-typedef void (*WKDatabaseManagerGetDatabaseOriginsFunction)(WKArrayRef, WKErrorRef, void*);
-WK_EXPORT void WKDatabaseManagerGetDatabaseOrigins(WKDatabaseManagerRef contextRef, void* context, WKDatabaseManagerGetDatabaseOriginsFunction function);
-
-WK_EXPORT void WKDatabaseManagerDeleteDatabasesWithNameForOrigin(WKDatabaseManagerRef databaseManager, WKStringRef databaseName, WKSecurityOriginRef origin);
-WK_EXPORT void WKDatabaseManagerDeleteDatabasesForOrigin(WKDatabaseManagerRef databaseManager, WKSecurityOriginRef origin);
-WK_EXPORT void WKDatabaseManagerDeleteAllDatabases(WKDatabaseManagerRef databaseManager);
-
-WK_EXPORT void WKDatabaseManagerSetQuotaForOrigin(WKDatabaseManagerRef databaseManager, WKSecurityOriginRef origin, uint64_t quota);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif // WKDatabaseManager_h
diff --git a/Source/WebKit2/UIProcess/API/C/WKDownload.cpp b/Source/WebKit2/UIProcess/API/C/WKDownload.cpp
index 84e9103c4..abf93f12f 100644
--- a/Source/WebKit2/UIProcess/API/C/WKDownload.cpp
+++ b/Source/WebKit2/UIProcess/API/C/WKDownload.cpp
@@ -26,6 +26,7 @@
#include "config.h"
#include "WKDownload.h"
+#include "APIData.h"
#include "APIURLRequest.h"
#include "DownloadProxy.h"
#include "WKAPICast.h"
@@ -39,12 +40,12 @@ WKTypeID WKDownloadGetTypeID()
uint64_t WKDownloadGetID(WKDownloadRef download)
{
- return toImpl(download)->downloadID();
+ return toImpl(download)->downloadID().downloadID();
}
WKURLRequestRef WKDownloadCopyRequest(WKDownloadRef download)
{
- return toAPI(API::URLRequest::create(toImpl(download)->request()).leakRef());
+ return toAPI(&API::URLRequest::create(toImpl(download)->request()).leakRef());
}
WKDataRef WKDownloadGetResumeData(WKDownloadRef download)
diff --git a/Source/WebKit2/UIProcess/API/C/WKDownload.h b/Source/WebKit2/UIProcess/API/C/WKDownload.h
index 8acc9106d..5dbea7e44 100644
--- a/Source/WebKit2/UIProcess/API/C/WKDownload.h
+++ b/Source/WebKit2/UIProcess/API/C/WKDownload.h
@@ -26,7 +26,7 @@
#ifndef WKDownload_h
#define WKDownload_h
-#include <WebKit2/WKBase.h>
+#include <WebKit/WKBase.h>
#ifndef __cplusplus
#include <stdbool.h>
diff --git a/Source/WebKit2/UIProcess/API/C/WKFormSubmissionListener.h b/Source/WebKit2/UIProcess/API/C/WKFormSubmissionListener.h
index 4b9b79acb..c320b68d4 100644
--- a/Source/WebKit2/UIProcess/API/C/WKFormSubmissionListener.h
+++ b/Source/WebKit2/UIProcess/API/C/WKFormSubmissionListener.h
@@ -26,7 +26,7 @@
#ifndef WKFormSubmissionListener_h
#define WKFormSubmissionListener_h
-#include <WebKit2/WKBase.h>
+#include <WebKit/WKBase.h>
#ifdef __cplusplus
extern "C" {
diff --git a/Source/WebKit2/UIProcess/API/C/WKFrame.cpp b/Source/WebKit2/UIProcess/API/C/WKFrame.cpp
index 2f74c6df7..a8562ea7f 100644
--- a/Source/WebKit2/UIProcess/API/C/WKFrame.cpp
+++ b/Source/WebKit2/UIProcess/API/C/WKFrame.cpp
@@ -26,8 +26,13 @@
#include "config.h"
#include "WKFrame.h"
+#include "APIData.h"
+#include "APIFrameHandle.h"
+#include "APIFrameInfo.h"
#include "WKAPICast.h"
+#include "WebCertificateInfo.h"
#include "WebFrameProxy.h"
+#include "WebPageProxy.h"
using namespace WebKit;
@@ -44,7 +49,7 @@ bool WKFrameIsMainFrame(WKFrameRef frameRef)
WKFrameLoadState WKFrameGetFrameLoadState(WKFrameRef frameRef)
{
WebFrameProxy* frame = toImpl(frameRef);
- switch (frame->frameLoadState().m_state) {
+ switch (frame->frameLoadState().state()) {
case FrameLoadState::State::Provisional:
return kWKFrameLoadStateProvisional;
case FrameLoadState::State::Committed:
@@ -122,29 +127,27 @@ bool WKFrameIsFrameSet(WKFrameRef frameRef)
return toImpl(frameRef)->isFrameSet();
}
-void WKFrameGetMainResourceData(WKFrameRef frameRef, WKFrameGetResourceDataFunction callback, void* context)
+WKFrameHandleRef WKFrameCreateFrameHandle(WKFrameRef frameRef)
{
- toImpl(frameRef)->getMainResourceData(DataCallback::create(context, callback));
+ return toAPI(&API::FrameHandle::create(toImpl(frameRef)->frameID()).leakRef());
}
-void WKFrameGetResourceData(WKFrameRef frameRef, WKURLRef resourceURL, WKFrameGetResourceDataFunction callback, void* context)
+WKFrameInfoRef WKFrameCreateFrameInfo(WKFrameRef frameRef)
{
- toImpl(frameRef)->getResourceData(toImpl(resourceURL), DataCallback::create(context, callback));
+ return toAPI(&API::FrameInfo::create(*toImpl(frameRef), WebCore::SecurityOrigin::createFromString(toImpl(frameRef)->url())).leakRef());
}
-void WKFrameGetWebArchive(WKFrameRef frameRef, WKFrameGetWebArchiveFunction callback, void* context)
+void WKFrameGetMainResourceData(WKFrameRef frameRef, WKFrameGetResourceDataFunction callback, void* context)
{
- toImpl(frameRef)->getWebArchive(DataCallback::create(context, callback));
+ toImpl(frameRef)->getMainResourceData(toGenericCallbackFunction(context, callback));
}
-// NOTE: These are deprecated and should be removed. They currently do nothing.
-
-WKArrayRef WKFrameCopyChildFrames(WKFrameRef)
+void WKFrameGetResourceData(WKFrameRef frameRef, WKURLRef resourceURL, WKFrameGetResourceDataFunction callback, void* context)
{
- return 0;
+ toImpl(frameRef)->getResourceData(toImpl(resourceURL), toGenericCallbackFunction(context, callback));
}
-WKFrameRef WKFrameGetParentFrame(WKFrameRef)
+void WKFrameGetWebArchive(WKFrameRef frameRef, WKFrameGetWebArchiveFunction callback, void* context)
{
- return 0;
+ toImpl(frameRef)->getWebArchive(toGenericCallbackFunction(context, callback));
}
diff --git a/Source/WebKit2/UIProcess/API/C/WKFrame.h b/Source/WebKit2/UIProcess/API/C/WKFrame.h
index 5f169e48e..b987ddc63 100644
--- a/Source/WebKit2/UIProcess/API/C/WKFrame.h
+++ b/Source/WebKit2/UIProcess/API/C/WKFrame.h
@@ -26,7 +26,7 @@
#ifndef WKFrame_h
#define WKFrame_h
-#include <WebKit2/WKBase.h>
+#include <WebKit/WKBase.h>
#ifndef __cplusplus
#include <stdbool.h>
@@ -68,6 +68,9 @@ WK_EXPORT bool WKFrameIsDisplayingMarkupDocument(WKFrameRef frame);
WK_EXPORT bool WKFrameIsFrameSet(WKFrameRef frame);
+WK_EXPORT WKFrameHandleRef WKFrameCreateFrameHandle(WKFrameRef frame);
+WK_EXPORT WKFrameInfoRef WKFrameCreateFrameInfo(WKFrameRef frame);
+
typedef void (*WKFrameGetResourceDataFunction)(WKDataRef data, WKErrorRef error, void* functionContext);
WK_EXPORT void WKFrameGetMainResourceData(WKFrameRef frame, WKFrameGetResourceDataFunction function, void* functionContext);
WK_EXPORT void WKFrameGetResourceData(WKFrameRef frame, WKURLRef resourceURL, WKFrameGetResourceDataFunction function, void* functionContext);
@@ -75,11 +78,6 @@ WK_EXPORT void WKFrameGetResourceData(WKFrameRef frame, WKURLRef resourceURL, WK
typedef void (*WKFrameGetWebArchiveFunction)(WKDataRef archiveData, WKErrorRef error, void* functionContext);
WK_EXPORT void WKFrameGetWebArchive(WKFrameRef frame, WKFrameGetWebArchiveFunction function, void* functionContext);
-// NOTE: These are deprecated and should be removed. They currently do nothing.
-
-WK_EXPORT WKArrayRef WKFrameCopyChildFrames(WKFrameRef frame);
-WK_EXPORT WKFrameRef WKFrameGetParentFrame(WKFrameRef frame);
-
#ifdef __cplusplus
}
#endif
diff --git a/Source/WebKit2/UIProcess/API/C/WKSessionRef.cpp b/Source/WebKit2/UIProcess/API/C/WKFrameHandleRef.cpp
index 4af2f7bb5..b39fca1be 100644
--- a/Source/WebKit2/UIProcess/API/C/WKSessionRef.cpp
+++ b/Source/WebKit2/UIProcess/API/C/WKFrameHandleRef.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2014 Apple Inc. All rights reserved.
+ * Copyright (C) 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
@@ -24,25 +24,19 @@
*/
#include "config.h"
-#include "WKSessionRef.h"
+#include "WKFrameHandleRef.h"
-#include "APISession.h"
+#include "APIFrameHandle.h"
#include "WKAPICast.h"
using namespace WebKit;
-WKSessionRef WKSessionCreate(bool isEphemeral)
+WKTypeID WKFrameHandleGetTypeID()
{
- RefPtr<API::Session> session = API::Session::create(isEphemeral);
- return toAPI(session.release().leakRef());
+ return toAPI(API::FrameHandle::APIType);
}
-WKTypeID WKSessionGetTypeID()
+uint64_t WKFrameHandleGetFrameID(WKFrameHandleRef frameHandleRef)
{
- return toAPI(API::Session::APIType);
-}
-
-bool WKSessionIsEphemeral(WKSessionRef sessionRef)
-{
- return toAPI(toImpl(sessionRef)->isEphemeral());
+ return toImpl(frameHandleRef)->frameID();
}
diff --git a/Source/WebKit2/UIProcess/API/C/WKNetworkInfo.h b/Source/WebKit2/UIProcess/API/C/WKFrameHandleRef.h
index cff864a75..30791a97e 100644
--- a/Source/WebKit2/UIProcess/API/C/WKNetworkInfo.h
+++ b/Source/WebKit2/UIProcess/API/C/WKFrameHandleRef.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2012 Intel Corporation. All rights reserved.
+ * Copyright (C) 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
@@ -23,21 +23,21 @@
* THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef WKNetworkInfo_h
-#define WKNetworkInfo_h
+#ifndef WKFrameHandleRef_h
+#define WKFrameHandleRef_h
-#include <WebKit2/WKBase.h>
+#include <WebKit/WKBase.h>
#ifdef __cplusplus
extern "C" {
#endif
-WK_EXPORT WKTypeID WKNetworkInfoGetTypeID();
+WK_EXPORT WKTypeID WKFrameHandleGetTypeID();
-WK_EXPORT WKNetworkInfoRef WKNetworkInfoCreate(double bandwidth, bool isMetered);
+WK_EXPORT uint64_t WKFrameHandleGetFrameID(WKFrameHandleRef);
#ifdef __cplusplus
}
#endif
-#endif // WKNetworkInfo_h
+#endif // WKFrameHandleRef_h
diff --git a/Source/WebKit2/UIProcess/API/C/WKFrameInfoRef.cpp b/Source/WebKit2/UIProcess/API/C/WKFrameInfoRef.cpp
new file mode 100644
index 000000000..6ba5175bf
--- /dev/null
+++ b/Source/WebKit2/UIProcess/API/C/WKFrameInfoRef.cpp
@@ -0,0 +1,43 @@
+/*
+ * Copyright (C) 2015 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "WKFrameInfoRef.h"
+
+#include "APIFrameHandle.h"
+#include "APIFrameInfo.h"
+#include "WKAPICast.h"
+
+using namespace WebKit;
+
+WKTypeID WKFrameInfoGetTypeID()
+{
+ return toAPI(API::FrameInfo::APIType);
+}
+
+WKFrameHandleRef WKFrameInfoGetFrameHandleRef(WKFrameInfoRef frameInfoRef)
+{
+ return toAPI(&toImpl(frameInfoRef)->handle());
+}
diff --git a/Source/WebKit2/UIProcess/API/C/WKBatteryStatus.h b/Source/WebKit2/UIProcess/API/C/WKFrameInfoRef.h
index afa1dd931..e95472ecb 100644
--- a/Source/WebKit2/UIProcess/API/C/WKBatteryStatus.h
+++ b/Source/WebKit2/UIProcess/API/C/WKFrameInfoRef.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2012 Intel Corporation. All rights reserved.
+ * Copyright (C) 2015 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -23,21 +23,21 @@
* THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef WKBatteryStatus_h
-#define WKBatteryStatus_h
+#ifndef WKFrameInfoRef_h
+#define WKFrameInfoRef_h
-#include <WebKit2/WKBase.h>
+#include <WebKit/WKBase.h>
#ifdef __cplusplus
extern "C" {
#endif
-WK_EXPORT WKTypeID WKBatteryStatusGetTypeID();
+WK_EXPORT WKTypeID WKFrameInfoGetTypeID();
-WK_EXPORT WKBatteryStatusRef WKBatteryStatusCreate(bool isCharging, double chargingTime, double dischargingTime, double level);
+WK_EXPORT WKFrameHandleRef WKFrameInfoGetFrameHandleRef(WKFrameInfoRef);
#ifdef __cplusplus
}
#endif
-#endif // WKBatteryStatus_h
+#endif // WKFrameInfoRef_h
diff --git a/Source/WebKit2/UIProcess/API/C/WKFramePolicyListener.cpp b/Source/WebKit2/UIProcess/API/C/WKFramePolicyListener.cpp
index 3bb673099..b654beb8b 100644
--- a/Source/WebKit2/UIProcess/API/C/WKFramePolicyListener.cpp
+++ b/Source/WebKit2/UIProcess/API/C/WKFramePolicyListener.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
@@ -26,9 +26,11 @@
#include "config.h"
#include "WKFramePolicyListener.h"
+#include "APIWebsitePolicies.h"
#include "WKAPICast.h"
#include "WebFramePolicyListenerProxy.h"
#include "WebFrameProxy.h"
+#include "WebsitePolicies.h"
using namespace WebKit;
@@ -39,7 +41,12 @@ WKTypeID WKFramePolicyListenerGetTypeID()
void WKFramePolicyListenerUse(WKFramePolicyListenerRef policyListenerRef)
{
- toImpl(policyListenerRef)->use();
+ toImpl(policyListenerRef)->use({ });
+}
+
+void WKFramePolicyListenerUseWithPolicies(WKFramePolicyListenerRef policyListenerRef, WKWebsitePoliciesRef websitePolicies)
+{
+ toImpl(policyListenerRef)->use(toImpl(websitePolicies)->websitePolicies());
}
void WKFramePolicyListenerDownload(WKFramePolicyListenerRef policyListenerRef)
diff --git a/Source/WebKit2/UIProcess/API/C/WKFramePolicyListener.h b/Source/WebKit2/UIProcess/API/C/WKFramePolicyListener.h
index 99b013d54..9d2ccfcad 100644
--- a/Source/WebKit2/UIProcess/API/C/WKFramePolicyListener.h
+++ b/Source/WebKit2/UIProcess/API/C/WKFramePolicyListener.h
@@ -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
@@ -23,10 +23,9 @@
* THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef WKFramePolicyListener_h
-#define WKFramePolicyListener_h
+#pragma once
-#include <WebKit2/WKBase.h>
+#include <WebKit/WKBase.h>
#ifdef __cplusplus
extern "C" {
@@ -34,12 +33,11 @@ extern "C" {
WK_EXPORT WKTypeID WKFramePolicyListenerGetTypeID();
-WK_EXPORT void WKFramePolicyListenerUse(WKFramePolicyListenerRef policyListener);
-WK_EXPORT void WKFramePolicyListenerDownload(WKFramePolicyListenerRef policyListener);
-WK_EXPORT void WKFramePolicyListenerIgnore(WKFramePolicyListenerRef policyListener);
+WK_EXPORT void WKFramePolicyListenerUse(WKFramePolicyListenerRef);
+WK_EXPORT void WKFramePolicyListenerDownload(WKFramePolicyListenerRef);
+WK_EXPORT void WKFramePolicyListenerIgnore(WKFramePolicyListenerRef);
+WK_EXPORT void WKFramePolicyListenerUseWithPolicies(WKFramePolicyListenerRef, WKWebsitePoliciesRef);
#ifdef __cplusplus
}
#endif
-
-#endif /* WKFramePolicyListener_h */
diff --git a/Source/WebKit2/UIProcess/API/C/WKGeolocationManager.cpp b/Source/WebKit2/UIProcess/API/C/WKGeolocationManager.cpp
index 968bd920a..18b1a09bc 100644
--- a/Source/WebKit2/UIProcess/API/C/WKGeolocationManager.cpp
+++ b/Source/WebKit2/UIProcess/API/C/WKGeolocationManager.cpp
@@ -28,6 +28,7 @@
#include "WKAPICast.h"
#include "WebGeolocationManagerProxy.h"
+#include "WebGeolocationPosition.h"
using namespace WebKit;
diff --git a/Source/WebKit2/UIProcess/API/C/WKGeolocationManager.h b/Source/WebKit2/UIProcess/API/C/WKGeolocationManager.h
index f8c191790..581ae0472 100644
--- a/Source/WebKit2/UIProcess/API/C/WKGeolocationManager.h
+++ b/Source/WebKit2/UIProcess/API/C/WKGeolocationManager.h
@@ -26,7 +26,7 @@
#ifndef WKGeolocationManager_h
#define WKGeolocationManager_h
-#include <WebKit2/WKBase.h>
+#include <WebKit/WKBase.h>
#ifdef __cplusplus
extern "C" {
@@ -61,17 +61,6 @@ typedef struct WKGeolocationProviderV1 {
WKGeolocationProviderSetEnableHighAccuracyCallback setEnableHighAccuracy;
} WKGeolocationProviderV1;
-enum { kWKGeolocationProviderCurrentVersion WK_ENUM_DEPRECATED("Use an explicit version number instead") = 1 };
-typedef struct WKGeolocationProvider {
- int version;
- const void * clientInfo;
- WKGeolocationProviderStartUpdatingCallback startUpdating;
- WKGeolocationProviderStopUpdatingCallback stopUpdating;
-
- // Version 1.
- WKGeolocationProviderSetEnableHighAccuracyCallback setEnableHighAccuracy;
-} WKGeolocationProvider WK_DEPRECATED("Use an explicit versioned struct instead");
-
WK_EXPORT WKTypeID WKGeolocationManagerGetTypeID();
diff --git a/Source/WebKit2/UIProcess/API/C/WKGeolocationPermissionRequest.h b/Source/WebKit2/UIProcess/API/C/WKGeolocationPermissionRequest.h
index ee27b66ec..b1391813a 100644
--- a/Source/WebKit2/UIProcess/API/C/WKGeolocationPermissionRequest.h
+++ b/Source/WebKit2/UIProcess/API/C/WKGeolocationPermissionRequest.h
@@ -26,7 +26,7 @@
#ifndef WKGeolocationPermissionRequest_h
#define WKGeolocationPermissionRequest_h
-#include <WebKit2/WKBase.h>
+#include <WebKit/WKBase.h>
#ifdef __cplusplus
extern "C" {
diff --git a/Source/WebKit2/UIProcess/API/C/WKGeolocationPosition.cpp b/Source/WebKit2/UIProcess/API/C/WKGeolocationPosition.cpp
index 5d94f3e86..8b4c5b650 100644
--- a/Source/WebKit2/UIProcess/API/C/WKGeolocationPosition.cpp
+++ b/Source/WebKit2/UIProcess/API/C/WKGeolocationPosition.cpp
@@ -43,6 +43,6 @@ WKGeolocationPositionRef WKGeolocationPositionCreate(double timestamp, double la
WKGeolocationPositionRef WKGeolocationPositionCreate_b(double timestamp, double latitude, double longitude, double accuracy, bool providesAltitude, double altitude, bool providesAltitudeAccuracy, double altitudeAccuracy, bool providesHeading, double heading, bool providesSpeed, double speed)
{
- RefPtr<WebGeolocationPosition> position = WebGeolocationPosition::create(timestamp, latitude, longitude, accuracy, providesAltitude, altitude, providesAltitudeAccuracy, altitudeAccuracy, providesHeading, heading, providesSpeed, speed);
- return toAPI(position.release().leakRef());
+ auto position = WebGeolocationPosition::create(timestamp, latitude, longitude, accuracy, providesAltitude, altitude, providesAltitudeAccuracy, altitudeAccuracy, providesHeading, heading, providesSpeed, speed);
+ return toAPI(position.leakRef());
}
diff --git a/Source/WebKit2/UIProcess/API/C/WKGeolocationPosition.h b/Source/WebKit2/UIProcess/API/C/WKGeolocationPosition.h
index 4727e9763..6d67f1d1e 100644
--- a/Source/WebKit2/UIProcess/API/C/WKGeolocationPosition.h
+++ b/Source/WebKit2/UIProcess/API/C/WKGeolocationPosition.h
@@ -26,7 +26,7 @@
#ifndef WKGeolocationPosition_h
#define WKGeolocationPosition_h
-#include <WebKit2/WKBase.h>
+#include <WebKit/WKBase.h>
#ifdef __cplusplus
extern "C" {
diff --git a/Source/WebKit2/UIProcess/API/C/WKGrammarDetail.cpp b/Source/WebKit2/UIProcess/API/C/WKGrammarDetail.cpp
index 193af2eb7..afd9895dd 100644
--- a/Source/WebKit2/UIProcess/API/C/WKGrammarDetail.cpp
+++ b/Source/WebKit2/UIProcess/API/C/WKGrammarDetail.cpp
@@ -40,8 +40,8 @@ WKTypeID WKGrammarDetailGetTypeID()
WKGrammarDetailRef WKGrammarDetailCreate(int location, int length, WKArrayRef guesses, WKStringRef userDescription)
{
- RefPtr<WebGrammarDetail> detail = WebGrammarDetail::create(location, length, toImpl(guesses), toWTFString(userDescription));
- return toAPI(detail.release().leakRef());
+ auto detail = WebGrammarDetail::create(location, length, toImpl(guesses), toWTFString(userDescription));
+ return toAPI(detail.leakRef());
}
int WKGrammarDetailGetLocation(WKGrammarDetailRef grammarDetailRef)
@@ -56,7 +56,7 @@ int WKGrammarDetailGetLength(WKGrammarDetailRef grammarDetailRef)
WKArrayRef WKGrammarDetailCopyGuesses(WKGrammarDetailRef grammarDetailRef)
{
- return toAPI(toImpl(grammarDetailRef)->guesses().leakRef());
+ return toAPI(&toImpl(grammarDetailRef)->guesses().leakRef());
}
WKStringRef WKGrammarDetailCopyUserDescription(WKGrammarDetailRef grammarDetailRef)
diff --git a/Source/WebKit2/UIProcess/API/C/WKGrammarDetail.h b/Source/WebKit2/UIProcess/API/C/WKGrammarDetail.h
index c187ce6ad..2493c44d4 100644
--- a/Source/WebKit2/UIProcess/API/C/WKGrammarDetail.h
+++ b/Source/WebKit2/UIProcess/API/C/WKGrammarDetail.h
@@ -26,7 +26,7 @@
#ifndef WKGrammarDetail_h
#define WKGrammarDetail_h
-#include <WebKit2/WKBase.h>
+#include <WebKit/WKBase.h>
#ifdef __cplusplus
extern "C" {
diff --git a/Source/WebKit2/UIProcess/API/C/WKHitTestResult.cpp b/Source/WebKit2/UIProcess/API/C/WKHitTestResult.cpp
index 5949091bb..4082002b0 100644
--- a/Source/WebKit2/UIProcess/API/C/WKHitTestResult.cpp
+++ b/Source/WebKit2/UIProcess/API/C/WKHitTestResult.cpp
@@ -27,14 +27,14 @@
#include "config.h"
#include "WKHitTestResult.h"
+#include "APIHitTestResult.h"
#include "WKAPICast.h"
-#include "WebHitTestResult.h"
using namespace WebKit;
WKTypeID WKHitTestResultGetTypeID()
{
- return toAPI(WebHitTestResult::APIType);
+ return toAPI(API::HitTestResult::APIType);
}
WKURLRef WKHitTestResultCopyAbsoluteImageURL(WKHitTestResultRef hitTestResultRef)
@@ -67,7 +67,17 @@ WKStringRef WKHitTestResultCopyLinkTitle(WKHitTestResultRef hitTestResultRef)
return toCopiedAPI(toImpl(hitTestResultRef)->linkTitle());
}
+WKStringRef WKHitTestResultCopyLookupText(WKHitTestResultRef hitTestResult)
+{
+ return toCopiedAPI(toImpl(hitTestResult)->lookupText());
+}
+
bool WKHitTestResultIsContentEditable(WKHitTestResultRef hitTestResultRef)
{
return toImpl(hitTestResultRef)->isContentEditable();
}
+
+WKRect WKHitTestResultGetElementBoundingBox(WKHitTestResultRef hitTestResultRef)
+{
+ return toAPI(toImpl(hitTestResultRef)->elementBoundingBox());
+}
diff --git a/Source/WebKit2/UIProcess/API/C/WKHitTestResult.h b/Source/WebKit2/UIProcess/API/C/WKHitTestResult.h
index 55fd13768..3c7081362 100644
--- a/Source/WebKit2/UIProcess/API/C/WKHitTestResult.h
+++ b/Source/WebKit2/UIProcess/API/C/WKHitTestResult.h
@@ -27,7 +27,8 @@
#ifndef WKHitTestResult_h
#define WKHitTestResult_h
-#include <WebKit2/WKBase.h>
+#include <WebKit/WKBase.h>
+#include <WebKit/WKGeometry.h>
#ifdef __cplusplus
extern "C" {
@@ -42,9 +43,12 @@ WK_EXPORT WKURLRef WKHitTestResultCopyAbsoluteMediaURL(WKHitTestResultRef hitTes
WK_EXPORT WKStringRef WKHitTestResultCopyLinkLabel(WKHitTestResultRef hitTestResult);
WK_EXPORT WKStringRef WKHitTestResultCopyLinkTitle(WKHitTestResultRef hitTestResult);
+WK_EXPORT WKStringRef WKHitTestResultCopyLookupText(WKHitTestResultRef hitTestResult);
WK_EXPORT bool WKHitTestResultIsContentEditable(WKHitTestResultRef hitTestResult);
+WK_EXPORT WKRect WKHitTestResultGetElementBoundingBox(WKHitTestResultRef hitTestResultRef);
+
#ifdef __cplusplus
}
#endif
diff --git a/Source/WebKit2/UIProcess/API/C/WKIconDatabase.cpp b/Source/WebKit2/UIProcess/API/C/WKIconDatabase.cpp
index a47290073..39006631f 100644
--- a/Source/WebKit2/UIProcess/API/C/WKIconDatabase.cpp
+++ b/Source/WebKit2/UIProcess/API/C/WKIconDatabase.cpp
@@ -57,6 +57,23 @@ void WKIconDatabaseSetIconDataForIconURL(WKIconDatabaseRef iconDatabaseRef, WKDa
toImpl(iconDatabaseRef)->setIconDataForIconURL(toImpl(iconDataRef)->dataReference(), toWTFString(iconURLRef));
}
+void WKIconDatabaseSetIconURLForPageURL(WKIconDatabaseRef iconDatabaseRef, WKURLRef iconURLRef, WKURLRef pageURLRef)
+{
+ toImpl(iconDatabaseRef)->setIconURLForPageURL(toWTFString(iconURLRef), toWTFString(pageURLRef));
+}
+
+WKURLRef WKIconDatabaseCopyIconURLForPageURL(WKIconDatabaseRef iconDatabaseRef, WKURLRef pageURLRef)
+{
+ String iconURLString;
+ toImpl(iconDatabaseRef)->synchronousIconURLForPageURL(toWTFString(pageURLRef), iconURLString);
+ return toCopiedURLAPI(iconURLString);
+}
+
+WKDataRef WKIconDatabaseCopyIconDataForPageURL(WKIconDatabaseRef iconDatabaseRef, WKURLRef pageURL)
+{
+ return toAPI(toImpl(iconDatabaseRef)->iconDataForPageURL(toWTFString(pageURL)).leakRef());
+}
+
void WKIconDatabaseEnableDatabaseCleanup(WKIconDatabaseRef iconDatabaseRef)
{
toImpl(iconDatabaseRef)->enableDatabaseCleanup();
diff --git a/Source/WebKit2/UIProcess/API/C/WKIconDatabase.h b/Source/WebKit2/UIProcess/API/C/WKIconDatabase.h
index 0a10f6596..847414179 100644
--- a/Source/WebKit2/UIProcess/API/C/WKIconDatabase.h
+++ b/Source/WebKit2/UIProcess/API/C/WKIconDatabase.h
@@ -26,7 +26,7 @@
#ifndef WKIconDatabase_h
#define WKIconDatabase_h
-#include <WebKit2/WKBase.h>
+#include <WebKit/WKBase.h>
#ifdef __cplusplus
extern "C" {
@@ -61,19 +61,6 @@ typedef struct WKIconDatabaseClientV1 {
WKIconDatabaseIconDataReadyForPageURLCallback iconDataReadyForPageURL;
} WKIconDatabaseClientV1;
-enum { kWKIconDatabaseClientCurrentVersion WK_ENUM_DEPRECATED("Use an explicit version number instead") = 1 };
-typedef struct WKIconDatabaseClient {
- int version;
- const void * clientInfo;
-
- // Version 0.
- WKIconDatabaseDidChangeIconForPageURLCallback didChangeIconForPageURL;
- WKIconDatabaseDidRemoveAllIconsCallback didRemoveAllIcons;
-
- // Version 1.
- WKIconDatabaseIconDataReadyForPageURLCallback iconDataReadyForPageURL;
-} WKIconDatabaseClient WK_DEPRECATED("Use an explicit versioned struct instead");
-
WK_EXPORT WKTypeID WKIconDatabaseGetTypeID();
WK_EXPORT void WKIconDatabaseSetIconDatabaseClient(WKIconDatabaseRef iconDatabase, const WKIconDatabaseClientBase* client);
@@ -81,6 +68,10 @@ WK_EXPORT void WKIconDatabaseSetIconDatabaseClient(WKIconDatabaseRef iconDatabas
WK_EXPORT void WKIconDatabaseRetainIconForURL(WKIconDatabaseRef iconDatabase, WKURLRef pageURL);
WK_EXPORT void WKIconDatabaseReleaseIconForURL(WKIconDatabaseRef iconDatabase, WKURLRef pageURL);
WK_EXPORT void WKIconDatabaseSetIconDataForIconURL(WKIconDatabaseRef iconDatabase, WKDataRef iconData, WKURLRef iconURL);
+WK_EXPORT void WKIconDatabaseSetIconURLForPageURL(WKIconDatabaseRef iconDatabase, WKURLRef iconURL, WKURLRef pageURL);
+WK_EXPORT WKURLRef WKIconDatabaseCopyIconURLForPageURL(WKIconDatabaseRef iconDatabase, WKURLRef pageURL);
+WK_EXPORT WKDataRef WKIconDatabaseCopyIconDataForPageURL(WKIconDatabaseRef iconDatabase, WKURLRef pageURL);
+
WK_EXPORT void WKIconDatabaseEnableDatabaseCleanup(WKIconDatabaseRef iconDatabase);
WK_EXPORT void WKIconDatabaseRemoveAllIcons(WKIconDatabaseRef iconDatabase);
diff --git a/Source/WebKit2/UIProcess/API/C/WKInspector.cpp b/Source/WebKit2/UIProcess/API/C/WKInspector.cpp
index e638609bb..aeb8d57cb 100644
--- a/Source/WebKit2/UIProcess/API/C/WKInspector.cpp
+++ b/Source/WebKit2/UIProcess/API/C/WKInspector.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
@@ -26,205 +26,109 @@
#include "config.h"
#include "WKInspector.h"
+#if !PLATFORM(IOS)
+
#include "WKAPICast.h"
#include "WebInspectorProxy.h"
+#include "WebPageProxy.h"
using namespace WebKit;
WKTypeID WKInspectorGetTypeID()
{
-#if ENABLE(INSPECTOR)
return toAPI(WebInspectorProxy::APIType);
-#else
- return 0;
-#endif
}
WKPageRef WKInspectorGetPage(WKInspectorRef inspectorRef)
{
-#if ENABLE(INSPECTOR)
- return toAPI(toImpl(inspectorRef)->page());
-#else
- UNUSED_PARAM(inspectorRef);
- return 0;
-#endif
+ return toAPI(toImpl(inspectorRef)->inspectedPage());
}
bool WKInspectorIsConnected(WKInspectorRef inspectorRef)
{
-#if ENABLE(INSPECTOR)
return toImpl(inspectorRef)->isConnected();
-#else
- UNUSED_PARAM(inspectorRef);
- return false;
-#endif
}
bool WKInspectorIsVisible(WKInspectorRef inspectorRef)
{
-#if ENABLE(INSPECTOR)
return toImpl(inspectorRef)->isVisible();
-#else
- UNUSED_PARAM(inspectorRef);
- return false;
-#endif
}
bool WKInspectorIsFront(WKInspectorRef inspectorRef)
{
-#if ENABLE(INSPECTOR)
return toImpl(inspectorRef)->isFront();
-#else
- UNUSED_PARAM(inspectorRef);
- return false;
-#endif
}
void WKInspectorConnect(WKInspectorRef inspectorRef)
{
-#if ENABLE(INSPECTOR)
toImpl(inspectorRef)->connect();
-#else
- UNUSED_PARAM(inspectorRef);
-#endif
}
void WKInspectorShow(WKInspectorRef inspectorRef)
{
-#if ENABLE(INSPECTOR)
toImpl(inspectorRef)->show();
-#else
- UNUSED_PARAM(inspectorRef);
-#endif
}
void WKInspectorHide(WKInspectorRef inspectorRef)
{
-#if ENABLE(INSPECTOR)
toImpl(inspectorRef)->hide();
-#else
- UNUSED_PARAM(inspectorRef);
-#endif
}
void WKInspectorClose(WKInspectorRef inspectorRef)
{
-#if ENABLE(INSPECTOR)
toImpl(inspectorRef)->close();
-#else
- UNUSED_PARAM(inspectorRef);
-#endif
}
void WKInspectorShowConsole(WKInspectorRef inspectorRef)
{
-#if ENABLE(INSPECTOR)
toImpl(inspectorRef)->showConsole();
-#else
- UNUSED_PARAM(inspectorRef);
-#endif
}
void WKInspectorShowResources(WKInspectorRef inspectorRef)
{
-#if ENABLE(INSPECTOR)
toImpl(inspectorRef)->showResources();
-#else
- UNUSED_PARAM(inspectorRef);
-#endif
}
void WKInspectorShowMainResourceForFrame(WKInspectorRef inspectorRef, WKFrameRef frameRef)
{
-#if ENABLE(INSPECTOR)
toImpl(inspectorRef)->showMainResourceForFrame(toImpl(frameRef));
-#else
- UNUSED_PARAM(inspectorRef);
- UNUSED_PARAM(frameRef);
-#endif
}
bool WKInspectorIsAttached(WKInspectorRef inspectorRef)
{
-#if ENABLE(INSPECTOR)
return toImpl(inspectorRef)->isAttached();
-#else
- UNUSED_PARAM(inspectorRef);
- return false;
-#endif
}
void WKInspectorAttach(WKInspectorRef inspectorRef)
{
-#if ENABLE(INSPECTOR)
- toImpl(inspectorRef)->attach();
-#else
- UNUSED_PARAM(inspectorRef);
-#endif
+ auto inspector = toImpl(inspectorRef);
+ inspector->attach(inspector->attachmentSide());
}
void WKInspectorDetach(WKInspectorRef inspectorRef)
{
-#if ENABLE(INSPECTOR)
toImpl(inspectorRef)->detach();
-#else
- UNUSED_PARAM(inspectorRef);
-#endif
-}
-
-bool WKInspectorIsDebuggingJavaScript(WKInspectorRef inspectorRef)
-{
-#if ENABLE(INSPECTOR)
- return toImpl(inspectorRef)->isDebuggingJavaScript();
-#else
- UNUSED_PARAM(inspectorRef);
- return false;
-#endif
}
-void WKInspectorToggleJavaScriptDebugging(WKInspectorRef inspectorRef)
+bool WKInspectorIsProfilingPage(WKInspectorRef inspectorRef)
{
-#if ENABLE(INSPECTOR)
- toImpl(inspectorRef)->toggleJavaScriptDebugging();
-#else
- UNUSED_PARAM(inspectorRef);
-#endif
+ return toImpl(inspectorRef)->isProfilingPage();
}
-bool WKInspectorIsProfilingJavaScript(WKInspectorRef inspectorRef)
+void WKInspectorTogglePageProfiling(WKInspectorRef inspectorRef)
{
-#if ENABLE(INSPECTOR)
- return toImpl(inspectorRef)->isProfilingJavaScript();
-#else
- UNUSED_PARAM(inspectorRef);
- return false;
-#endif
+ toImpl(inspectorRef)->showTimelines();
+ toImpl(inspectorRef)->togglePageProfiling();
}
-void WKInspectorToggleJavaScriptProfiling(WKInspectorRef inspectorRef)
+bool WKInspectorIsElementSelectionActive(WKInspectorRef inspectorRef)
{
-#if ENABLE(INSPECTOR)
- toImpl(inspectorRef)->toggleJavaScriptProfiling();
-#else
- UNUSED_PARAM(inspectorRef);
-#endif
+ return toImpl(inspectorRef)->isElementSelectionActive();
}
-bool WKInspectorIsProfilingPage(WKInspectorRef inspectorRef)
+void WKInspectorToggleElementSelection(WKInspectorRef inspectorRef)
{
-#if ENABLE(INSPECTOR)
- return toImpl(inspectorRef)->isProfilingPage();
-#else
- UNUSED_PARAM(inspectorRef);
- return false;
-#endif
+ toImpl(inspectorRef)->toggleElementSelection();
}
-void WKInspectorTogglePageProfiling(WKInspectorRef inspectorRef)
-{
-#if ENABLE(INSPECTOR)
- toImpl(inspectorRef)->togglePageProfiling();
-#else
- UNUSED_PARAM(inspectorRef);
-#endif
-}
+#endif // !PLATFORM(IOS)
diff --git a/Source/WebKit2/UIProcess/API/C/WKInspector.h b/Source/WebKit2/UIProcess/API/C/WKInspector.h
index 203e1b3cf..d0364de5b 100644
--- a/Source/WebKit2/UIProcess/API/C/WKInspector.h
+++ b/Source/WebKit2/UIProcess/API/C/WKInspector.h
@@ -26,7 +26,7 @@
#ifndef WKInspector_h
#define WKInspector_h
-#include <WebKit2/WKBase.h>
+#include <WebKit/WKBase.h>
#ifndef __cplusplus
#include <stdbool.h>
@@ -58,15 +58,12 @@ WK_EXPORT bool WKInspectorIsAttached(WKInspectorRef inspector);
WK_EXPORT void WKInspectorAttach(WKInspectorRef inspector);
WK_EXPORT void WKInspectorDetach(WKInspectorRef inspector);
-WK_EXPORT bool WKInspectorIsDebuggingJavaScript(WKInspectorRef inspector);
-WK_EXPORT void WKInspectorToggleJavaScriptDebugging(WKInspectorRef inspector);
-
-WK_EXPORT bool WKInspectorIsProfilingJavaScript(WKInspectorRef inspector);
-WK_EXPORT void WKInspectorToggleJavaScriptProfiling(WKInspectorRef inspector);
-
WK_EXPORT bool WKInspectorIsProfilingPage(WKInspectorRef inspector);
WK_EXPORT void WKInspectorTogglePageProfiling(WKInspectorRef inspector);
+WK_EXPORT bool WKInspectorIsElementSelectionActive(WKInspectorRef inspector);
+WK_EXPORT void WKInspectorToggleElementSelection(WKInspectorRef inspector);
+
#ifdef __cplusplus
}
#endif
diff --git a/Source/WebKit2/UIProcess/API/C/WKKeyValueStorageManager.cpp b/Source/WebKit2/UIProcess/API/C/WKKeyValueStorageManager.cpp
index d33c056bf..b322e4319 100644
--- a/Source/WebKit2/UIProcess/API/C/WKKeyValueStorageManager.cpp
+++ b/Source/WebKit2/UIProcess/API/C/WKKeyValueStorageManager.cpp
@@ -26,27 +26,106 @@
#include "config.h"
#include "WKKeyValueStorageManager.h"
+#include "APIDictionary.h"
+#include "APIWebsiteDataStore.h"
+#include "StorageManager.h"
#include "WKAPICast.h"
-#include "WebKeyValueStorageManager.h"
+#include "WebsiteDataStore.h"
+#include <wtf/RunLoop.h>
using namespace WebKit;
WKTypeID WKKeyValueStorageManagerGetTypeID()
{
- return toAPI(WebKeyValueStorageManager::APIType);
+ return toAPI(API::WebsiteDataStore::APIType);
}
-void WKKeyValueStorageManagerGetKeyValueStorageOrigins(WKKeyValueStorageManagerRef keyValueStorageManagerRef, void* context, WKKeyValueStorageManagerGetKeyValueStorageOriginsFunction callback)
+WKStringRef WKKeyValueStorageManagerGetOriginKey()
{
- toImpl(keyValueStorageManagerRef)->getKeyValueStorageOrigins(ArrayCallback::create(context, callback));
+ static API::String& key = API::String::create("WebKeyValueStorageManagerStorageDetailsOriginKey").leakRef();
+ return toAPI(&key);
}
-void WKKeyValueStorageManagerDeleteEntriesForOrigin(WKKeyValueStorageManagerRef keyValueStorageManagerRef, WKSecurityOriginRef originRef)
+WKStringRef WKKeyValueStorageManagerGetCreationTimeKey()
{
- toImpl(keyValueStorageManagerRef)->deleteEntriesForOrigin(toImpl(originRef));
+ static API::String& key = API::String::create("WebKeyValueStorageManagerStorageDetailsCreationTimeKey").leakRef();
+ return toAPI(&key);
}
-void WKKeyValueStorageManagerDeleteAllEntries(WKKeyValueStorageManagerRef keyValueStorageManagerRef)
+WKStringRef WKKeyValueStorageManagerGetModificationTimeKey()
{
- toImpl(keyValueStorageManagerRef)->deleteAllEntries();
+ static API::String& key = API::String::create("WebKeyValueStorageManagerStorageDetailsModificationTimeKey").leakRef();
+ return toAPI(&key);
+}
+
+void WKKeyValueStorageManagerGetKeyValueStorageOrigins(WKKeyValueStorageManagerRef keyValueStorageManager, void* context, WKKeyValueStorageManagerGetKeyValueStorageOriginsFunction callback)
+
+{
+ StorageManager* storageManager = toImpl(reinterpret_cast<WKWebsiteDataStoreRef>(keyValueStorageManager))->websiteDataStore().storageManager();
+ if (!storageManager) {
+ RunLoop::main().dispatch([context, callback] {
+ callback(toAPI(API::Array::create().ptr()), nullptr, context);
+ });
+ return;
+ }
+
+ storageManager->getLocalStorageOrigins([context, callback](auto&& securityOrigins) {
+ Vector<RefPtr<API::Object>> webSecurityOrigins;
+ webSecurityOrigins.reserveInitialCapacity(securityOrigins.size());
+ for (auto& origin : securityOrigins)
+ webSecurityOrigins.uncheckedAppend(API::SecurityOrigin::create(origin.securityOrigin()));
+
+ callback(toAPI(API::Array::create(WTFMove(webSecurityOrigins)).ptr()), nullptr, context);
+ });
+}
+
+void WKKeyValueStorageManagerGetStorageDetailsByOrigin(WKKeyValueStorageManagerRef keyValueStorageManager, void* context, WKKeyValueStorageManagerGetStorageDetailsByOriginFunction callback)
+{
+ StorageManager* storageManager = toImpl(reinterpret_cast<WKWebsiteDataStoreRef>(keyValueStorageManager))->websiteDataStore().storageManager();
+ if (!storageManager) {
+ RunLoop::main().dispatch([context, callback] {
+ callback(toAPI(API::Array::create().ptr()), nullptr, context);
+ });
+ return;
+ }
+
+ storageManager->getLocalStorageOriginDetails([context, callback](auto storageDetails) {
+ HashMap<String, RefPtr<API::Object>> detailsMap;
+ Vector<RefPtr<API::Object>> result;
+ result.reserveInitialCapacity(storageDetails.size());
+
+ for (const auto& originDetails : storageDetails) {
+ HashMap<String, RefPtr<API::Object>> detailsMap;
+
+ RefPtr<API::Object> origin = API::SecurityOrigin::create(WebCore::SecurityOriginData::fromDatabaseIdentifier(originDetails.originIdentifier)->securityOrigin());
+
+ detailsMap.set(toImpl(WKKeyValueStorageManagerGetOriginKey())->string(), origin);
+ if (originDetails.creationTime)
+ detailsMap.set(toImpl(WKKeyValueStorageManagerGetCreationTimeKey())->string(), API::Double::create(originDetails.creationTime.value_or(0)));
+ if (originDetails.modificationTime)
+ detailsMap.set(toImpl(WKKeyValueStorageManagerGetModificationTimeKey())->string(), API::Double::create(originDetails.modificationTime.value_or(0)));
+
+ result.uncheckedAppend(API::Dictionary::create(WTFMove(detailsMap)));
+ }
+
+ callback(toAPI(API::Array::create(WTFMove(result)).ptr()), nullptr, context);
+ });
+}
+
+void WKKeyValueStorageManagerDeleteEntriesForOrigin(WKKeyValueStorageManagerRef keyValueStorageManager, WKSecurityOriginRef origin)
+{
+ StorageManager* storageManager = toImpl(reinterpret_cast<WKWebsiteDataStoreRef>(keyValueStorageManager))->websiteDataStore().storageManager();
+ if (!storageManager)
+ return;
+
+ storageManager->deleteLocalStorageEntriesForOrigin(WebCore::SecurityOriginData::fromSecurityOrigin(toImpl(origin)->securityOrigin()));
+}
+
+void WKKeyValueStorageManagerDeleteAllEntries(WKKeyValueStorageManagerRef keyValueStorageManager)
+{
+ StorageManager* storageManager = toImpl(reinterpret_cast<WKWebsiteDataStoreRef>(keyValueStorageManager))->websiteDataStore().storageManager();
+ if (!storageManager)
+ return;
+
+ storageManager->deleteLocalStorageOriginsModifiedSince(std::chrono::system_clock::time_point::min(), [] { });
}
diff --git a/Source/WebKit2/UIProcess/API/C/WKKeyValueStorageManager.h b/Source/WebKit2/UIProcess/API/C/WKKeyValueStorageManager.h
index a0ee27825..d92adadad 100644
--- a/Source/WebKit2/UIProcess/API/C/WKKeyValueStorageManager.h
+++ b/Source/WebKit2/UIProcess/API/C/WKKeyValueStorageManager.h
@@ -26,7 +26,7 @@
#ifndef WKKeyValueStorageManager_h
#define WKKeyValueStorageManager_h
-#include <WebKit2/WKBase.h>
+#include <WebKit/WKBase.h>
#ifdef __cplusplus
extern "C" {
@@ -34,9 +34,21 @@ extern "C" {
WK_EXPORT WKTypeID WKKeyValueStorageManagerGetTypeID();
+/* Value type: WKSecurityOriginRef */
+WK_EXPORT WKStringRef WKKeyValueStorageManagerGetOriginKey();
+
+/* Value type: WKDoubleRef, seconds since January 1st, 1970 UTC */
+WK_EXPORT WKStringRef WKKeyValueStorageManagerGetCreationTimeKey();
+
+/* Value type: WKDoubleRef, seconds since January 1st, 1970 UTC */
+WK_EXPORT WKStringRef WKKeyValueStorageManagerGetModificationTimeKey();
+
typedef void (*WKKeyValueStorageManagerGetKeyValueStorageOriginsFunction)(WKArrayRef, WKErrorRef, void*);
WK_EXPORT void WKKeyValueStorageManagerGetKeyValueStorageOrigins(WKKeyValueStorageManagerRef keyValueStorageManager, void* context, WKKeyValueStorageManagerGetKeyValueStorageOriginsFunction function);
+typedef void (*WKKeyValueStorageManagerGetStorageDetailsByOriginFunction)(WKArrayRef, WKErrorRef, void*);
+WK_EXPORT void WKKeyValueStorageManagerGetStorageDetailsByOrigin(WKKeyValueStorageManagerRef keyValueStorageManager, void* context, WKKeyValueStorageManagerGetStorageDetailsByOriginFunction function);
+
WK_EXPORT void WKKeyValueStorageManagerDeleteEntriesForOrigin(WKKeyValueStorageManagerRef keyValueStorageManager, WKSecurityOriginRef origin);
WK_EXPORT void WKKeyValueStorageManagerDeleteAllEntries(WKKeyValueStorageManagerRef keyValueStorageManager);
diff --git a/Source/WebKit2/UIProcess/API/C/WKLayoutMode.h b/Source/WebKit2/UIProcess/API/C/WKLayoutMode.h
new file mode 100644
index 000000000..bb75f17f9
--- /dev/null
+++ b/Source/WebKit2/UIProcess/API/C/WKLayoutMode.h
@@ -0,0 +1,47 @@
+/*
+ * Copyright (C) 2015 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef WKLayoutMode_h
+#define WKLayoutMode_h
+
+#include <stdint.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+enum {
+ kWKLayoutModeViewSize = 0,
+ kWKLayoutModeFixedSize = 1,
+ kWKLayoutModeDynamicSizeComputedFromViewScale = 2,
+ kWKLayoutModeDynamicSizeComputedFromMinimumDocumentSize = 4
+};
+typedef uint32_t WKLayoutMode;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* WKLayoutMode_h */
diff --git a/Source/WebKit2/UIProcess/API/C/WKNetworkInfoManager.cpp b/Source/WebKit2/UIProcess/API/C/WKMediaSessionFocusManager.cpp
index 6c278a8d9..9603bf072 100644
--- a/Source/WebKit2/UIProcess/API/C/WKNetworkInfoManager.cpp
+++ b/Source/WebKit2/UIProcess/API/C/WKMediaSessionFocusManager.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2012 Intel Corporation. All rights reserved.
+ * Copyright (C) 2015 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -24,39 +24,49 @@
*/
#include "config.h"
-#include "WKNetworkInfoManager.h"
+#include "WKMediaSessionFocusManager.h"
#include "WKAPICast.h"
-#include "WebNetworkInfoManagerProxy.h"
+#include "WebMediaSessionFocusManager.h"
using namespace WebKit;
-WKTypeID WKNetworkInfoManagerGetTypeID()
+WKTypeID WKMediaSessionFocusManagerGetTypeID()
{
-#if ENABLE(NETWORK_INFO)
- return toAPI(WebNetworkInfoManagerProxy::APIType);
+#if ENABLE(MEDIA_SESSION)
+ return toAPI(WebMediaSessionFocusManager::APIType);
#else
- return 0;
+ return toAPI(API::Object::Type::Null);
#endif
}
-void WKNetworkInfoManagerSetProvider(WKNetworkInfoManagerRef networkInfoManager, const WKNetworkInfoProviderBase* provider)
+void WKMediaSessionFocusManagerSetClient(WKMediaSessionFocusManagerRef manager, const WKMediaSessionFocusManagerClientBase* client)
{
-#if ENABLE(NETWORK_INFO)
- toImpl(networkInfoManager)->initializeProvider(provider);
+#if ENABLE(MEDIA_SESSION)
+ toImpl(manager)->initializeClient(client);
#else
- UNUSED_PARAM(networkInfoManager);
- UNUSED_PARAM(provider);
+ UNUSED_PARAM(manager);
+ UNUSED_PARAM(client);
#endif
}
-void WKNetworkInfoManagerProviderDidChangeNetworkInformation(WKNetworkInfoManagerRef networkInfoManager, WKStringRef eventType, WKNetworkInfoRef networkInfo)
+bool WKMediaSessionFocusManagerValueForPlaybackAttribute(WKMediaSessionFocusManagerRef manager, WKMediaSessionFocusManagerPlaybackAttribute attribute)
{
-#if ENABLE(NETWORK_INFO)
- toImpl(networkInfoManager)->providerDidChangeNetworkInformation(AtomicString(toImpl(eventType)->string()), toImpl(networkInfo));
+#if ENABLE(MEDIA_SESSION)
+ return toImpl(manager)->valueForPlaybackAttribute(attribute);
#else
- UNUSED_PARAM(networkInfoManager);
- UNUSED_PARAM(eventType);
- UNUSED_PARAM(networkInfo);
+ UNUSED_PARAM(manager);
+ UNUSED_PARAM(attribute);
+ return false;
+#endif
+}
+
+void WKMediaSessionFocusManagerSetVolumeOfFocusedMediaElement(WKMediaSessionFocusManagerRef manager, double volume)
+{
+#if ENABLE(MEDIA_SESSION)
+ toImpl(manager)->setVolumeOfFocusedMediaElement(volume);
+#else
+ UNUSED_PARAM(manager);
+ UNUSED_PARAM(volume);
#endif
}
diff --git a/Source/WebKit2/UIProcess/API/C/WKMediaSessionFocusManager.h b/Source/WebKit2/UIProcess/API/C/WKMediaSessionFocusManager.h
new file mode 100644
index 000000000..ed39e705a
--- /dev/null
+++ b/Source/WebKit2/UIProcess/API/C/WKMediaSessionFocusManager.h
@@ -0,0 +1,72 @@
+/*
+ * Copyright (C) 2015 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef WKMediaSessionFocusManager_h
+#define WKMediaSessionFocusManager_h
+
+#include <WebKit/WKBase.h>
+
+#ifndef __cplusplus
+#include <stdbool.h>
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+enum WKMediaSessionFocusManagerPlaybackAttribute {
+ IsPlaying = 1 << 0,
+ IsPreviousTrackControlEnabled = 1 << 1,
+ IsNextTrackControlEnabled = 1 << 2,
+};
+typedef uint32_t WKMediaSessionFocusManagerPlaybackAttributes;
+
+// Media Session Focus Manager Client
+typedef void (*WKMediaSessionFocusManagerDidChangePlaybackAttribute)(WKMediaSessionFocusManagerRef manager, WKMediaSessionFocusManagerPlaybackAttribute playbackAttribute, bool value, const void *clientInfo);
+
+typedef struct WKMediaSessionFocusManagerClientBase {
+ int version;
+ const void * clientInfo;
+} WKMediaSessionFocusManagerClientBase;
+
+typedef struct WKMediaSessionFocusManagerClientV0 {
+ WKMediaSessionFocusManagerClientBase base;
+
+ // Version 0.
+ WKMediaSessionFocusManagerDidChangePlaybackAttribute didChangePlaybackAttribute;
+} WKMediaSessionFocusManagerClientV0;
+
+WK_EXPORT WKTypeID WKMediaSessionFocusManagerGetTypeID();
+
+WK_EXPORT void WKMediaSessionFocusManagerSetClient(WKMediaSessionFocusManagerRef manager, const WKMediaSessionFocusManagerClientBase* client);
+
+WK_EXPORT bool WKMediaSessionFocusManagerValueForPlaybackAttribute(WKMediaSessionFocusManagerRef, WKMediaSessionFocusManagerPlaybackAttribute);
+WK_EXPORT void WKMediaSessionFocusManagerSetVolumeOfFocusedMediaElement(WKMediaSessionFocusManagerRef, double);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* WKMediaSessionFocusManager_h */
diff --git a/Source/WebKit2/UIProcess/API/C/WKMediaSessionMetadata.cpp b/Source/WebKit2/UIProcess/API/C/WKMediaSessionMetadata.cpp
new file mode 100644
index 000000000..330ca53aa
--- /dev/null
+++ b/Source/WebKit2/UIProcess/API/C/WKMediaSessionMetadata.cpp
@@ -0,0 +1,81 @@
+/*
+ * Copyright (C) 2015 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "WKMediaSessionMetadata.h"
+
+#include "WKAPICast.h"
+#include "WebMediaSessionMetadata.h"
+
+using namespace WebKit;
+
+WKTypeID WKMediaSessionMetadataGetTypeID()
+{
+#if ENABLE(MEDIA_SESSION)
+ return toAPI(WebMediaSessionMetadata::APIType);
+#else
+ return toAPI(API::Object::Type::Null);
+#endif
+}
+
+WKStringRef WKMediaSessionMetadataCopyTitle(WKMediaSessionMetadataRef metadata)
+{
+#if ENABLE(MEDIA_SESSION)
+ return toCopiedAPI(toImpl(metadata)->title());
+#else
+ UNUSED_PARAM(metadata);
+ return nullptr;
+#endif
+}
+
+WKStringRef WKMediaSessionMetadataCopyArtist(WKMediaSessionMetadataRef metadata)
+{
+#if ENABLE(MEDIA_SESSION)
+ return toCopiedAPI(toImpl(metadata)->artist());
+#else
+ UNUSED_PARAM(metadata);
+ return nullptr;
+#endif
+}
+
+WKStringRef WKMediaSessionMetadataCopyAlbum(WKMediaSessionMetadataRef metadata)
+{
+#if ENABLE(MEDIA_SESSION)
+ return toCopiedAPI(toImpl(metadata)->album());
+#else
+ UNUSED_PARAM(metadata);
+ return nullptr;
+#endif
+}
+
+WKURLRef WKMediaSessionMetadataCopyArtworkURL(WKMediaSessionMetadataRef metadata)
+{
+#if ENABLE(MEDIA_SESSION)
+ return toCopiedURLAPI(toImpl(metadata)->artworkURL());
+#else
+ UNUSED_PARAM(metadata);
+ return nullptr;
+#endif
+}
diff --git a/Source/WebKit2/UIProcess/API/C/WKMediaSessionMetadata.h b/Source/WebKit2/UIProcess/API/C/WKMediaSessionMetadata.h
new file mode 100644
index 000000000..b9430f7e4
--- /dev/null
+++ b/Source/WebKit2/UIProcess/API/C/WKMediaSessionMetadata.h
@@ -0,0 +1,50 @@
+/*
+ * Copyright (C) 2015 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef WKMediaSessionMetadata_h
+#define WKMediaSessionMetadata_h
+
+#include <WebKit/WKBase.h>
+
+#ifndef __cplusplus
+#include <stdbool.h>
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+WK_EXPORT WKTypeID WKMediaSessionMetadataGetTypeID();
+
+WK_EXPORT WKStringRef WKMediaSessionMetadataCopyTitle(WKMediaSessionMetadataRef metadata);
+WK_EXPORT WKStringRef WKMediaSessionMetadataCopyArtist(WKMediaSessionMetadataRef metadata);
+WK_EXPORT WKStringRef WKMediaSessionMetadataCopyAlbum(WKMediaSessionMetadataRef metadata);
+WK_EXPORT WKURLRef WKMediaSessionMetadataCopyArtworkURL(WKMediaSessionMetadataRef metadata);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* WKMediaSessionMetadata_h */
diff --git a/Source/WebKit2/UIProcess/API/C/WKNativeEvent.h b/Source/WebKit2/UIProcess/API/C/WKNativeEvent.h
index 349582628..7d8b6b9dc 100644
--- a/Source/WebKit2/UIProcess/API/C/WKNativeEvent.h
+++ b/Source/WebKit2/UIProcess/API/C/WKNativeEvent.h
@@ -34,7 +34,7 @@
extern "C" {
#endif
-#if defined(__APPLE__) && !TARGET_OS_IPHONE
+#if defined(__APPLE__) && !TARGET_OS_IPHONE && !defined(BUILDING_GTK__)
#ifdef __OBJC__
@class NSEvent;
#elif __cplusplus
diff --git a/Source/WebKit2/UIProcess/API/C/WKNavigationActionRef.cpp b/Source/WebKit2/UIProcess/API/C/WKNavigationActionRef.cpp
new file mode 100644
index 000000000..14a235157
--- /dev/null
+++ b/Source/WebKit2/UIProcess/API/C/WKNavigationActionRef.cpp
@@ -0,0 +1,37 @@
+/*
+ * Copyright (C) 2015 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "WKNavigationActionRef.h"
+
+#include "APINavigationAction.h"
+#include "WKAPICast.h"
+
+using namespace WebKit;
+
+WKTypeID WKNavigationActionGetTypeID()
+{
+ return toAPI(API::NavigationAction::APIType);
+}
diff --git a/Source/WebKit2/UIProcess/API/C/WKNavigationActionRef.h b/Source/WebKit2/UIProcess/API/C/WKNavigationActionRef.h
new file mode 100644
index 000000000..5691eabcd
--- /dev/null
+++ b/Source/WebKit2/UIProcess/API/C/WKNavigationActionRef.h
@@ -0,0 +1,41 @@
+/*
+ * Copyright (C) 2015 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef WKNavigationActionRef_h
+#define WKNavigationActionRef_h
+
+#include <WebKit/WKBase.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+WK_EXPORT WKTypeID WKNavigationActionGetTypeID();
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif // WKNavigationActionRef_h
diff --git a/Source/WebKit2/UIProcess/API/C/WKNavigationDataRef.cpp b/Source/WebKit2/UIProcess/API/C/WKNavigationDataRef.cpp
index 86840e33e..0a815bb82 100644
--- a/Source/WebKit2/UIProcess/API/C/WKNavigationDataRef.cpp
+++ b/Source/WebKit2/UIProcess/API/C/WKNavigationDataRef.cpp
@@ -55,5 +55,5 @@ WKURLRef WKNavigationDataCopyNavigationDestinationURL(WKNavigationDataRef naviga
WKURLRequestRef WKNavigationDataCopyOriginalRequest(WKNavigationDataRef navigationData)
{
- return toAPI(API::URLRequest::create(toImpl(navigationData)->originalRequest()).leakRef());
+ return toAPI(&API::URLRequest::create(toImpl(navigationData)->originalRequest()).leakRef());
}
diff --git a/Source/WebKit2/UIProcess/API/C/WKNavigationDataRef.h b/Source/WebKit2/UIProcess/API/C/WKNavigationDataRef.h
index 8d70b76fa..b2c5f5b2b 100644
--- a/Source/WebKit2/UIProcess/API/C/WKNavigationDataRef.h
+++ b/Source/WebKit2/UIProcess/API/C/WKNavigationDataRef.h
@@ -26,7 +26,7 @@
#ifndef WKNavigationDataRef_h
#define WKNavigationDataRef_h
-#include <WebKit2/WKBase.h>
+#include <WebKit/WKBase.h>
#ifdef __cplusplus
extern "C" {
diff --git a/Source/WebKit2/UIProcess/API/C/WKNavigationRef.cpp b/Source/WebKit2/UIProcess/API/C/WKNavigationRef.cpp
new file mode 100644
index 000000000..591c14660
--- /dev/null
+++ b/Source/WebKit2/UIProcess/API/C/WKNavigationRef.cpp
@@ -0,0 +1,37 @@
+/*
+ * Copyright (C) 2015 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "WKNavigationRef.h"
+
+#include "APINavigation.h"
+#include "WKAPICast.h"
+
+using namespace WebKit;
+
+WKTypeID WKNavigationGetTypeID()
+{
+ return toAPI(API::Navigation::APIType);
+}
diff --git a/Source/WebKit2/UIProcess/API/C/WKNavigationRef.h b/Source/WebKit2/UIProcess/API/C/WKNavigationRef.h
new file mode 100644
index 000000000..ae9a19074
--- /dev/null
+++ b/Source/WebKit2/UIProcess/API/C/WKNavigationRef.h
@@ -0,0 +1,41 @@
+/*
+ * Copyright (C) 2015 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef WKNavigationRef_h
+#define WKNavigationRef_h
+
+#include <WebKit/WKBase.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+WK_EXPORT WKTypeID WKNavigationGetTypeID();
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif // WKNavigationRef_h
diff --git a/Source/WebKit2/UIProcess/API/C/WKNavigationResponseRef.cpp b/Source/WebKit2/UIProcess/API/C/WKNavigationResponseRef.cpp
new file mode 100644
index 000000000..ed6f21b0f
--- /dev/null
+++ b/Source/WebKit2/UIProcess/API/C/WKNavigationResponseRef.cpp
@@ -0,0 +1,42 @@
+/*
+ * Copyright (C) 2015 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "WKNavigationResponseRef.h"
+
+#include "APINavigationResponse.h"
+#include "WKAPICast.h"
+
+using namespace WebKit;
+
+WKTypeID WKNavigationResponseGetTypeID()
+{
+ return toAPI(API::NavigationResponse::APIType);
+}
+
+bool WKNavigationResponseCanShowMIMEType(WKNavigationResponseRef response)
+{
+ return toImpl(response)->canShowMIMEType();
+}
diff --git a/Source/WebKit2/UIProcess/API/C/WKNavigationResponseRef.h b/Source/WebKit2/UIProcess/API/C/WKNavigationResponseRef.h
new file mode 100644
index 000000000..c82b14dc3
--- /dev/null
+++ b/Source/WebKit2/UIProcess/API/C/WKNavigationResponseRef.h
@@ -0,0 +1,43 @@
+/*
+ * Copyright (C) 2015 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef WKNavigationResponseRef_h
+#define WKNavigationResponseRef_h
+
+#include <WebKit/WKBase.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+WK_EXPORT WKTypeID WKNavigationResponseGetTypeID();
+
+WK_EXPORT bool WKNavigationResponseCanShowMIMEType(WKNavigationResponseRef);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif // WKNavigationResponseRef_h
diff --git a/Source/WebKit2/UIProcess/API/C/WKNetworkInfoManager.h b/Source/WebKit2/UIProcess/API/C/WKNetworkInfoManager.h
deleted file mode 100644
index e3bdca671..000000000
--- a/Source/WebKit2/UIProcess/API/C/WKNetworkInfoManager.h
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- * Copyright (C) 2012 Intel Corporation. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef WKNetworkInfoManager_h
-#define WKNetworkInfoManager_h
-
-#include <WebKit2/WKBase.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-// Provider.
-typedef void (*WKNetworkInfoProviderStartUpdatingCallback)(WKNetworkInfoManagerRef networkInfoManager, const void* clientInfo);
-typedef void (*WKNetworkInfoProviderStopUpdatingCallback)(WKNetworkInfoManagerRef networkInfoManager, const void* clientInfo);
-typedef double (*WKNetworkInfoProviderGetBandwidthCallback)(WKNetworkInfoManagerRef networkInfoManager, const void* clientInfo);
-typedef bool (*WKNetworkInfoProviderIsMeteredCallback)(WKNetworkInfoManagerRef networkInfoManager, const void* clientInfo);
-
-typedef struct WKNetworkInfoProviderBase {
- int version;
- const void * clientInfo;
-} WKNetworkInfoProviderBase;
-
-typedef struct WKNetworkInfoProvider {
- WKNetworkInfoProviderBase base;
-
- WKNetworkInfoProviderStartUpdatingCallback startUpdating;
- WKNetworkInfoProviderStopUpdatingCallback stopUpdating;
- WKNetworkInfoProviderGetBandwidthCallback bandwidth;
- WKNetworkInfoProviderIsMeteredCallback isMetered;
-} WKNetworkInfoProviderV0;
-
-WK_EXPORT WKTypeID WKNetworkInfoManagerGetTypeID();
-
-WK_EXPORT void WKNetworkInfoManagerSetProvider(WKNetworkInfoManagerRef networkInfoManager, const WKNetworkInfoProviderBase* provider);
-
-WK_EXPORT void WKNetworkInfoManagerProviderDidChangeNetworkInformation(WKNetworkInfoManagerRef networkInfoManager, WKStringRef eventType, WKNetworkInfoRef networkInfo);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif // WKNetworkInfoManager_h
diff --git a/Source/WebKit2/UIProcess/API/C/WKNotification.cpp b/Source/WebKit2/UIProcess/API/C/WKNotification.cpp
index 78b09e09e..3d1805730 100644
--- a/Source/WebKit2/UIProcess/API/C/WKNotification.cpp
+++ b/Source/WebKit2/UIProcess/API/C/WKNotification.cpp
@@ -26,9 +26,9 @@
#include "config.h"
#include "WKNotification.h"
+#include "APISecurityOrigin.h"
#include "WKAPICast.h"
#include "WebNotification.h"
-#include "WebSecurityOrigin.h"
using namespace WebKit;
diff --git a/Source/WebKit2/UIProcess/API/C/WKNotification.h b/Source/WebKit2/UIProcess/API/C/WKNotification.h
index 7035ef3f8..d3ae98bf7 100644
--- a/Source/WebKit2/UIProcess/API/C/WKNotification.h
+++ b/Source/WebKit2/UIProcess/API/C/WKNotification.h
@@ -26,7 +26,7 @@
#ifndef WKNotification_h
#define WKNotification_h
-#include <WebKit2/WKBase.h>
+#include <WebKit/WKBase.h>
#ifdef __cplusplus
extern "C" {
diff --git a/Source/WebKit2/UIProcess/API/C/WKNotificationManager.cpp b/Source/WebKit2/UIProcess/API/C/WKNotificationManager.cpp
index 1e050a6e6..70f15f02e 100644
--- a/Source/WebKit2/UIProcess/API/C/WKNotificationManager.cpp
+++ b/Source/WebKit2/UIProcess/API/C/WKNotificationManager.cpp
@@ -27,6 +27,7 @@
#include "WKNotificationManager.h"
#include "WKAPICast.h"
+#include "WebNotification.h"
#include "WebNotificationManagerProxy.h"
using namespace WebKit;
@@ -65,3 +66,8 @@ void WKNotificationManagerProviderDidRemoveNotificationPolicies(WKNotificationMa
{
toImpl(managerRef)->providerDidRemoveNotificationPolicies(toImpl(origins));
}
+
+uint64_t WKNotificationManagerGetLocalIDForTesting(WKNotificationManagerRef manager, WKNotificationRef notification)
+{
+ return toImpl(manager)->notificationLocalIDForTesting(toImpl(notification));
+}
diff --git a/Source/WebKit2/UIProcess/API/C/WKNotificationManager.h b/Source/WebKit2/UIProcess/API/C/WKNotificationManager.h
index 50f50d747..b78909c6c 100644
--- a/Source/WebKit2/UIProcess/API/C/WKNotificationManager.h
+++ b/Source/WebKit2/UIProcess/API/C/WKNotificationManager.h
@@ -27,7 +27,7 @@
#define WKNotificationManager_h
#include "WKNotificationProvider.h"
-#include <WebKit2/WKBase.h>
+#include <WebKit/WKBase.h>
#ifdef __cplusplus
extern "C" {
@@ -41,6 +41,7 @@ WK_EXPORT void WKNotificationManagerProviderDidClickNotification(WKNotificationM
WK_EXPORT void WKNotificationManagerProviderDidCloseNotifications(WKNotificationManagerRef managerRef, WKArrayRef notificationIDs);
WK_EXPORT void WKNotificationManagerProviderDidUpdateNotificationPolicy(WKNotificationManagerRef managerRef, WKSecurityOriginRef origin, bool allowed);
WK_EXPORT void WKNotificationManagerProviderDidRemoveNotificationPolicies(WKNotificationManagerRef managerRef, WKArrayRef origins);
+WK_EXPORT uint64_t WKNotificationManagerGetLocalIDForTesting(WKNotificationManagerRef managerRef, WKNotificationRef notification);
#ifdef __cplusplus
}
diff --git a/Source/WebKit2/UIProcess/API/C/WKNotificationPermissionRequest.h b/Source/WebKit2/UIProcess/API/C/WKNotificationPermissionRequest.h
index 1947a06aa..02be0e63c 100644
--- a/Source/WebKit2/UIProcess/API/C/WKNotificationPermissionRequest.h
+++ b/Source/WebKit2/UIProcess/API/C/WKNotificationPermissionRequest.h
@@ -26,7 +26,7 @@
#ifndef WKNotificationPermissionRequest_h
#define WKNotificationPermissionRequest_h
-#include <WebKit2/WKBase.h>
+#include <WebKit/WKBase.h>
#ifdef __cplusplus
extern "C" {
diff --git a/Source/WebKit2/UIProcess/API/C/WKNotificationProvider.h b/Source/WebKit2/UIProcess/API/C/WKNotificationProvider.h
index 920e297b3..8a416c57c 100644
--- a/Source/WebKit2/UIProcess/API/C/WKNotificationProvider.h
+++ b/Source/WebKit2/UIProcess/API/C/WKNotificationProvider.h
@@ -26,7 +26,7 @@
#ifndef WKNotificationProvider_h
#define WKNotificationProvider_h
-#include <WebKit2/WKBase.h>
+#include <WebKit/WKBase.h>
#ifdef __cplusplus
extern "C" {
@@ -58,21 +58,6 @@ typedef struct WKNotificationProviderV0 {
WKNotificationProviderClearNotificationsCallback clearNotifications;
} WKNotificationProviderV0;
-enum { kWKNotificationProviderCurrentVersion WK_ENUM_DEPRECATED("Use an explicit version number instead") = 0, };
-typedef struct WKNotificationProvider {
- int version;
- const void* clientInfo;
-
- // Version 0.
- WKNotificationProviderShowCallback show;
- WKNotificationProviderCancelCallback cancel;
- WKNotificationProviderDidDestroyNotificationCallback didDestroyNotification;
- WKNotificationProviderAddNotificationManagerCallback addNotificationManager;
- WKNotificationProviderRemoveNotificationManagerCallback removeNotificationManager;
- WKNotificationProviderNotificationPermissionsCallback notificationPermissions;
- WKNotificationProviderClearNotificationsCallback clearNotifications;
-} WKNotificationProvider WK_DEPRECATED("Use an explicit versioned struct instead");
-
#ifdef __cplusplus
}
#endif
diff --git a/Source/WebKit2/UIProcess/API/C/WKOpenPanelParameters.cpp b/Source/WebKit2/UIProcess/API/C/WKOpenPanelParametersRef.cpp
index aa3e0b58a..c8ad8da0f 100644
--- a/Source/WebKit2/UIProcess/API/C/WKOpenPanelParameters.cpp
+++ b/Source/WebKit2/UIProcess/API/C/WKOpenPanelParametersRef.cpp
@@ -25,17 +25,17 @@
*/
#include "config.h"
-#include "WKOpenPanelParameters.h"
+#include "WKOpenPanelParametersRef.h"
#include "APIArray.h"
+#include "APIOpenPanelParameters.h"
#include "WKAPICast.h"
-#include "WebOpenPanelParameters.h"
using namespace WebKit;
WKTypeID WKOpenPanelParametersGetTypeID()
{
- return toAPI(WebOpenPanelParameters::APIType);
+ return toAPI(API::OpenPanelParameters::APIType);
}
bool WKOpenPanelParametersGetAllowsMultipleFiles(WKOpenPanelParametersRef parametersRef)
@@ -45,20 +45,26 @@ bool WKOpenPanelParametersGetAllowsMultipleFiles(WKOpenPanelParametersRef parame
WKArrayRef WKOpenPanelParametersCopyAcceptedMIMETypes(WKOpenPanelParametersRef parametersRef)
{
- return toAPI(toImpl(parametersRef)->acceptMIMETypes().leakRef());
+ return toAPI(&toImpl(parametersRef)->acceptMIMETypes().leakRef());
}
-WKStringRef WKOpenPanelParametersCopyCapture(WKOpenPanelParametersRef parametersRef)
+// Deprecated.
+WKStringRef WKOpenPanelParametersCopyCapture(WKOpenPanelParametersRef)
+{
+ return 0;
+}
+
+bool WKOpenPanelParametersGetMediaCaptureType(WKOpenPanelParametersRef parametersRef)
{
#if ENABLE(MEDIA_CAPTURE)
- return toCopiedAPI(toImpl(parametersRef)->capture());
+ return toImpl(parametersRef)->mediaCaptureType();
#else
UNUSED_PARAM(parametersRef);
- return 0;
+ return false;
#endif
}
WKArrayRef WKOpenPanelParametersCopySelectedFileNames(WKOpenPanelParametersRef parametersRef)
{
- return toAPI(toImpl(parametersRef)->selectedFileNames().leakRef());
+ return toAPI(&toImpl(parametersRef)->selectedFileNames().leakRef());
}
diff --git a/Source/WebKit2/UIProcess/API/C/WKOpenPanelParameters.h b/Source/WebKit2/UIProcess/API/C/WKOpenPanelParametersRef.h
index 3801c2f7b..d8ca7c40d 100644
--- a/Source/WebKit2/UIProcess/API/C/WKOpenPanelParameters.h
+++ b/Source/WebKit2/UIProcess/API/C/WKOpenPanelParametersRef.h
@@ -24,10 +24,10 @@
* THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef WKOpenPanelParameters_h
-#define WKOpenPanelParameters_h
+#ifndef WKOpenPanelParametersRef_h
+#define WKOpenPanelParametersRef_h
-#include <WebKit2/WKBase.h>
+#include <WebKit/WKBase.h>
#ifndef __cplusplus
#include <stdbool.h>
@@ -43,12 +43,15 @@ WK_EXPORT bool WKOpenPanelParametersGetAllowsMultipleFiles(WKOpenPanelParameters
WK_EXPORT WKArrayRef WKOpenPanelParametersCopyAcceptedMIMETypes(WKOpenPanelParametersRef parameters);
+/* DEPRECATED - Please use WKOpenPanelParametersGetCaptureEnabled() instead. */
WK_EXPORT WKStringRef WKOpenPanelParametersCopyCapture(WKOpenPanelParametersRef parameters);
+WK_EXPORT bool WKOpenPanelParametersGetMediaCaptureType(WKOpenPanelParametersRef parametersRef);
+
WK_EXPORT WKArrayRef WKOpenPanelParametersCopySelectedFileNames(WKOpenPanelParametersRef parametersRef);
#ifdef __cplusplus
}
#endif
-#endif /* WKOpenPanelParameters_h */
+#endif /* WKOpenPanelParametersRef_h */
diff --git a/Source/WebKit2/UIProcess/API/C/WKOpenPanelResultListener.cpp b/Source/WebKit2/UIProcess/API/C/WKOpenPanelResultListener.cpp
index 8c793182d..b5c48afc6 100644
--- a/Source/WebKit2/UIProcess/API/C/WKOpenPanelResultListener.cpp
+++ b/Source/WebKit2/UIProcess/API/C/WKOpenPanelResultListener.cpp
@@ -28,6 +28,7 @@
#include "WKAPICast.h"
#include "WebOpenPanelResultListenerProxy.h"
+#include <WebCore/URL.h>
using namespace WebKit;
@@ -36,9 +37,25 @@ WKTypeID WKOpenPanelResultListenerGetTypeID()
return toAPI(WebOpenPanelResultListenerProxy::APIType);
}
+static Vector<String> filePathsFromFileURLs(const API::Array& fileURLs)
+{
+ Vector<String> filePaths;
+
+ size_t size = fileURLs.size();
+ filePaths.reserveInitialCapacity(size);
+
+ for (size_t i = 0; i < size; ++i) {
+ API::URL* apiURL = fileURLs.at<API::URL>(i);
+ if (apiURL)
+ filePaths.uncheckedAppend(WebCore::URL(WebCore::URL(), apiURL->string()).fileSystemPath());
+ }
+
+ return filePaths;
+}
+
void WKOpenPanelResultListenerChooseFiles(WKOpenPanelResultListenerRef listenerRef, WKArrayRef fileURLsRef)
{
- toImpl(listenerRef)->chooseFiles(toImpl(fileURLsRef));
+ toImpl(listenerRef)->chooseFiles(filePathsFromFileURLs(*toImpl(fileURLsRef)));
}
void WKOpenPanelResultListenerCancel(WKOpenPanelResultListenerRef listenerRef)
diff --git a/Source/WebKit2/UIProcess/API/C/WKOpenPanelResultListener.h b/Source/WebKit2/UIProcess/API/C/WKOpenPanelResultListener.h
index d581738a5..21c92ee24 100644
--- a/Source/WebKit2/UIProcess/API/C/WKOpenPanelResultListener.h
+++ b/Source/WebKit2/UIProcess/API/C/WKOpenPanelResultListener.h
@@ -26,7 +26,7 @@
#ifndef WKOpenPanelResultListener_h
#define WKOpenPanelResultListener_h
-#include <WebKit2/WKBase.h>
+#include <WebKit/WKBase.h>
#ifdef __cplusplus
extern "C" {
diff --git a/Source/WebKit2/UIProcess/API/C/WKOriginDataManager.cpp b/Source/WebKit2/UIProcess/API/C/WKOriginDataManager.cpp
deleted file mode 100644
index 8ab0f37d7..000000000
--- a/Source/WebKit2/UIProcess/API/C/WKOriginDataManager.cpp
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- * Copyright (C) 2013 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-#include "WKOriginDataManager.h"
-
-#include "WKAPICast.h"
-#include "WebOriginDataManagerProxy.h"
-
-using namespace WebKit;
-
-WKTypeID WKOriginDataManagerGetTypeID()
-{
- return toAPI(WebOriginDataManagerProxy::APIType);
-}
-
-void WKOriginDataManagerGetOrigins(WKOriginDataManagerRef originDataManagerRef, WKOriginDataTypes types, void* context, WKOriginDataManagerGetOriginsFunction callback)
-{
- toImpl(originDataManagerRef)->getOrigins(types, ArrayCallback::create(context, callback));
-}
-
-void WKOriginDataManagerDeleteEntriesForOrigin(WKOriginDataManagerRef originDataManagerRef, WKOriginDataTypes types, WKSecurityOriginRef originRef)
-{
- toImpl(originDataManagerRef)->deleteEntriesForOrigin(types, toImpl(originRef));
-}
-
-void WKOriginDataManagerDeleteAllEntries(WKOriginDataManagerRef originDataManagerRef, WKOriginDataTypes types)
-{
- toImpl(originDataManagerRef)->deleteAllEntries(types);
-}
-
-void WKOriginDataManagerStartObservingChanges(WKOriginDataManagerRef originDataManagerRef, WKOriginDataTypes types)
-{
- toImpl(originDataManagerRef)->startObservingChanges(types);
-}
-
-void WKOriginDataManagerStopObservingChanges(WKOriginDataManagerRef originDataManagerRef, WKOriginDataTypes types)
-{
- toImpl(originDataManagerRef)->stopObservingChanges(types);
-}
-
-void WKOriginDataManagerSetChangeClient(WKOriginDataManagerRef originDataManagerRef, const WKOriginDataManagerChangeClientBase *client)
-{
- toImpl(originDataManagerRef)->setChangeClient(client);
-}
diff --git a/Source/WebKit2/UIProcess/API/C/WKOriginDataManager.h b/Source/WebKit2/UIProcess/API/C/WKOriginDataManager.h
deleted file mode 100644
index f6300593b..000000000
--- a/Source/WebKit2/UIProcess/API/C/WKOriginDataManager.h
+++ /dev/null
@@ -1,87 +0,0 @@
-/*
- * Copyright (C) 2013 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef WKOriginDataManager_h
-#define WKOriginDataManager_h
-
-#include <WebKit2/WKBase.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-enum {
- kWKApplicationCacheOriginData = 1 << 0,
- kWKCookieOriginData = 1 << 1,
- kWKDatabaseOriginData = 1 << 2,
- kWKKeyValueStorageOriginData = 1 << 3,
- kWKMediaCacheOriginData = 1 << 4,
- kWKPluginDataOriginData = 1 << 5,
- kWKResourceCacheOriginData = 1 << 6,
-
- kWKAllOriginData = (1 << 7) - 1
-};
-typedef uint32_t WKOriginDataTypes;
-
-WK_EXPORT WKTypeID WKOriginDataManagerGetTypeID();
-
-typedef void (*WKOriginDataManagerGetOriginsFunction)(WKArrayRef, WKErrorRef, void*);
-WK_EXPORT void WKOriginDataManagerGetOrigins(WKOriginDataManagerRef originDataManager, WKOriginDataTypes types, void* context, WKOriginDataManagerGetOriginsFunction function);
-
-WK_EXPORT void WKOriginDataManagerDeleteEntriesForOrigin(WKOriginDataManagerRef originDataManager, WKOriginDataTypes types, WKSecurityOriginRef origin);
-WK_EXPORT void WKOriginDataManagerDeleteAllEntries(WKOriginDataManagerRef originDataManager, WKOriginDataTypes types);
-
-// OriginDataManager Client
-typedef void (*WKOriginDataManagerChangeCallback)(WKOriginDataManagerRef originDataManager, const void *clientInfo);
-
-typedef struct WKOriginDataManagerChangeClientBase {
- const void * clientInfo;
- int version;
-} WKOriginDataManagerChangeClientBase;
-
-typedef struct WKOriginDataManagerChangeClientV0 {
- WKOriginDataManagerChangeClientBase base;
-
- // Version 0.
- WKOriginDataManagerChangeCallback didChange;
-} WKOriginDataManagerChangeClientV0;
-
-enum { kWKOriginDataManagerChangeClientVersion = 0 };
-typedef struct WKOriginDataManagerChangeClient {
- int version;
- const void * clientInfo;
-
- // Version 0.
- WKOriginDataManagerChangeCallback didChange;
-} WKOriginDataManagerChangeClient WK_DEPRECATED("Use an explicit versioned struct instead");
-
-WK_EXPORT void WKOriginDataManagerStartObservingChanges(WKOriginDataManagerRef originDataManager, WKOriginDataTypes types);
-WK_EXPORT void WKOriginDataManagerStopObservingChanges(WKOriginDataManagerRef originDataManager, WKOriginDataTypes types);
-WK_EXPORT void WKOriginDataManagerSetChangeClient(WKOriginDataManagerRef originDataManger, const WKOriginDataManagerChangeClientBase* client);
-#ifdef __cplusplus
-}
-#endif
-
-#endif // WKOriginDataManager_h
diff --git a/Source/WebKit2/UIProcess/API/C/WKPage.cpp b/Source/WebKit2/UIProcess/API/C/WKPage.cpp
index c398b7060..562bc4a1a 100644
--- a/Source/WebKit2/UIProcess/API/C/WKPage.cpp
+++ b/Source/WebKit2/UIProcess/API/C/WKPage.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2010 Apple Inc. All rights reserved.
+ * Copyright (C) 2010, 2015 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -28,21 +28,53 @@
#include "WKPagePrivate.h"
#include "APIArray.h"
+#include "APIContextMenuClient.h"
#include "APIData.h"
+#include "APIDictionary.h"
+#include "APIFindClient.h"
+#include "APIFindMatchesClient.h"
+#include "APIFrameHandle.h"
+#include "APIFrameInfo.h"
+#include "APIGeometry.h"
+#include "APIHitTestResult.h"
#include "APILoaderClient.h"
+#include "APINavigationAction.h"
+#include "APINavigationClient.h"
+#include "APINavigationResponse.h"
+#include "APIOpenPanelParameters.h"
+#include "APIPageConfiguration.h"
#include "APIPolicyClient.h"
-#include "ImmutableDictionary.h"
+#include "APISessionState.h"
+#include "APIUIClient.h"
+#include "APIWebsitePolicies.h"
+#include "APIWindowFeatures.h"
+#include "AuthenticationChallengeProxy.h"
+#include "LegacySessionStateCoding.h"
+#include "Logging.h"
+#include "NativeWebKeyboardEvent.h"
+#include "NativeWebWheelEvent.h"
#include "NavigationActionData.h"
#include "PluginInformation.h"
#include "PrintInfo.h"
#include "WKAPICast.h"
#include "WKPagePolicyClientInternal.h"
+#include "WKPageRenderingProgressEventsInternal.h"
#include "WKPluginInformation.h"
#include "WebBackForwardList.h"
+#include "WebFormClient.h"
+#include "WebImage.h"
+#include "WebInspectorProxy.h"
+#include "WebOpenPanelResultListenerProxy.h"
+#include "WebPageGroup.h"
#include "WebPageMessages.h"
#include "WebPageProxy.h"
+#include "WebProcessPool.h"
#include "WebProcessProxy.h"
+#include "WebProtectionSpace.h"
#include <WebCore/Page.h>
+#include <WebCore/SecurityOriginData.h>
+#include <WebCore/SerializedCryptoKeyWrap.h>
+#include <WebCore/WindowFeatures.h>
#ifdef __BLOCKS__
#include <Block.h>
@@ -52,17 +84,49 @@
#include "WebContextMenuItem.h"
#endif
+#if ENABLE(VIBRATION)
+#include "WebVibrationProxy.h"
+#endif
+
+#if ENABLE(MEDIA_SESSION)
+#include "WebMediaSessionMetadata.h"
+#include <WebCore/MediaSessionEvents.h>
+#endif
+
using namespace WebCore;
using namespace WebKit;
namespace API {
template<> struct ClientTraits<WKPageLoaderClientBase> {
- typedef std::tuple<WKPageLoaderClientV0, WKPageLoaderClientV1, WKPageLoaderClientV2, WKPageLoaderClientV3, WKPageLoaderClientV4> Versions;
+ typedef std::tuple<WKPageLoaderClientV0, WKPageLoaderClientV1, WKPageLoaderClientV2, WKPageLoaderClientV3, WKPageLoaderClientV4, WKPageLoaderClientV5, WKPageLoaderClientV6> Versions;
+};
+
+template<> struct ClientTraits<WKPageNavigationClientBase> {
+ typedef std::tuple<WKPageNavigationClientV0> Versions;
};
template<> struct ClientTraits<WKPagePolicyClientBase> {
typedef std::tuple<WKPagePolicyClientV0, WKPagePolicyClientV1, WKPagePolicyClientInternal> Versions;
};
+
+template<> struct ClientTraits<WKPageUIClientBase> {
+ typedef std::tuple<WKPageUIClientV0, WKPageUIClientV1, WKPageUIClientV2, WKPageUIClientV3, WKPageUIClientV4, WKPageUIClientV5, WKPageUIClientV6, WKPageUIClientV7, WKPageUIClientV8, WKPageUIClientV9> Versions;
+};
+
+#if ENABLE(CONTEXT_MENUS)
+template<> struct ClientTraits<WKPageContextMenuClientBase> {
+ typedef std::tuple<WKPageContextMenuClientV0, WKPageContextMenuClientV1, WKPageContextMenuClientV2, WKPageContextMenuClientV3, WKPageContextMenuClientV4> Versions;
+};
+#endif
+
+template<> struct ClientTraits<WKPageFindClientBase> {
+ typedef std::tuple<WKPageFindClientV0> Versions;
+};
+
+template<> struct ClientTraits<WKPageFindMatchesClientBase> {
+ typedef std::tuple<WKPageFindMatchesClientV0> Versions;
+};
+
}
WKTypeID WKPageGetTypeID()
@@ -72,7 +136,7 @@ WKTypeID WKPageGetTypeID()
WKContextRef WKPageGetContext(WKPageRef pageRef)
{
- return toAPI(&toImpl(pageRef)->process().context());
+ return toAPI(&toImpl(pageRef)->process().processPool());
}
WKPageGroupRef WKPageGetPageGroup(WKPageRef pageRef)
@@ -80,14 +144,25 @@ WKPageGroupRef WKPageGetPageGroup(WKPageRef pageRef)
return toAPI(&toImpl(pageRef)->pageGroup());
}
+WKPageConfigurationRef WKPageCopyPageConfiguration(WKPageRef pageRef)
+{
+ return toAPI(&toImpl(pageRef)->configuration().copy().leakRef());
+}
+
void WKPageLoadURL(WKPageRef pageRef, WKURLRef URLRef)
{
- toImpl(pageRef)->loadRequest(toWTFString(URLRef));
+ toImpl(pageRef)->loadRequest(URL(URL(), toWTFString(URLRef)));
+}
+
+void WKPageLoadURLWithShouldOpenExternalURLsPolicy(WKPageRef pageRef, WKURLRef URLRef, bool shouldOpenExternalURLs)
+{
+ ShouldOpenExternalURLsPolicy shouldOpenExternalURLsPolicy = shouldOpenExternalURLs ? ShouldOpenExternalURLsPolicy::ShouldAllow : ShouldOpenExternalURLsPolicy::ShouldNotAllow;
+ toImpl(pageRef)->loadRequest(URL(URL(), toWTFString(URLRef)), shouldOpenExternalURLsPolicy);
}
void WKPageLoadURLWithUserData(WKPageRef pageRef, WKURLRef URLRef, WKTypeRef userDataRef)
{
- toImpl(pageRef)->loadRequest(URL(URL(), toWTFString(URLRef)), toImpl(userDataRef));
+ toImpl(pageRef)->loadRequest(URL(URL(), toWTFString(URLRef)), ShouldOpenExternalURLsPolicy::ShouldNotAllow, toImpl(userDataRef));
}
void WKPageLoadURLRequest(WKPageRef pageRef, WKURLRequestRef urlRequestRef)
@@ -97,7 +172,7 @@ void WKPageLoadURLRequest(WKPageRef pageRef, WKURLRequestRef urlRequestRef)
void WKPageLoadURLRequestWithUserData(WKPageRef pageRef, WKURLRequestRef urlRequestRef, WKTypeRef userDataRef)
{
- toImpl(pageRef)->loadRequest(toImpl(urlRequestRef)->resourceRequest(), toImpl(userDataRef));
+ toImpl(pageRef)->loadRequest(toImpl(urlRequestRef)->resourceRequest(), ShouldOpenExternalURLsPolicy::ShouldNotAllow, toImpl(userDataRef));
}
void WKPageLoadFile(WKPageRef pageRef, WKURLRef fileURL, WKURLRef resourceDirectoryURL)
@@ -167,12 +242,23 @@ void WKPageStopLoading(WKPageRef pageRef)
void WKPageReload(WKPageRef pageRef)
{
- toImpl(pageRef)->reload(false);
+ const bool reloadFromOrigin = false;
+ const bool contentBlockersEnabled = true;
+ toImpl(pageRef)->reload(reloadFromOrigin, contentBlockersEnabled);
+}
+
+void WKPageReloadWithoutContentBlockers(WKPageRef pageRef)
+{
+ const bool reloadFromOrigin = false;
+ const bool contentBlockersEnabled = false;
+ toImpl(pageRef)->reload(reloadFromOrigin, contentBlockersEnabled);
}
void WKPageReloadFromOrigin(WKPageRef pageRef)
{
- toImpl(pageRef)->reload(true);
+ const bool reloadFromOrigin = true;
+ const bool contentBlockersEnabled = true;
+ toImpl(pageRef)->reload(reloadFromOrigin, contentBlockersEnabled);
}
bool WKPageTryClose(WKPageRef pageRef)
@@ -230,6 +316,11 @@ bool WKPageWillHandleHorizontalScrollEvents(WKPageRef pageRef)
return toImpl(pageRef)->willHandleHorizontalScrollEvents();
}
+void WKPageUpdateWebsitePolicies(WKPageRef pageRef, WKWebsitePoliciesRef websitePoliciesRef)
+{
+ toImpl(pageRef)->updateWebsitePolicies(toImpl(websitePoliciesRef)->websitePolicies());
+}
+
WKStringRef WKPageCopyTitle(WKPageRef pageRef)
{
return toCopiedAPI(toImpl(pageRef)->pageLoadState().title());
@@ -257,12 +348,7 @@ uint64_t WKPageGetRenderTreeSize(WKPageRef page)
WKInspectorRef WKPageGetInspector(WKPageRef pageRef)
{
-#if defined(ENABLE_INSPECTOR) && ENABLE_INSPECTOR
return toAPI(toImpl(pageRef)->inspector());
-#else
- UNUSED_PARAM(pageRef);
- return 0;
-#endif
}
WKVibrationRef WKPageGetVibration(WKPageRef page)
@@ -280,11 +366,6 @@ double WKPageGetEstimatedProgress(WKPageRef pageRef)
return toImpl(pageRef)->estimatedProgress();
}
-void WKPageSetMemoryCacheClientCallsEnabled(WKPageRef pageRef, bool memoryCacheClientCallsEnabled)
-{
- toImpl(pageRef)->setMemoryCacheClientCallsEnabled(memoryCacheClientCallsEnabled);
-}
-
WKStringRef WKPageCopyUserAgent(WKPageRef pageRef)
{
return toCopiedAPI(toImpl(pageRef)->userAgent());
@@ -310,6 +391,11 @@ void WKPageSetCustomUserAgent(WKPageRef pageRef, WKStringRef userAgentRef)
toImpl(pageRef)->setCustomUserAgent(toWTFString(userAgentRef));
}
+void WKPageSetUserContentExtensionsEnabled(WKPageRef pageRef, bool enabled)
+{
+ // FIXME: Remove this function once it is no longer used.
+}
+
bool WKPageSupportsTextEncoding(WKPageRef pageRef)
{
return toImpl(pageRef)->supportsTextEncoding();
@@ -332,24 +418,65 @@ void WKPageTerminate(WKPageRef pageRef)
WKStringRef WKPageGetSessionHistoryURLValueType()
{
- static API::String* sessionHistoryURLValueType = API::String::create("SessionHistoryURL").leakRef();
- return toAPI(sessionHistoryURLValueType);
+ static API::String& sessionHistoryURLValueType = API::String::create("SessionHistoryURL").leakRef();
+ return toAPI(&sessionHistoryURLValueType);
}
WKStringRef WKPageGetSessionBackForwardListItemValueType()
{
- static API::String* sessionBackForwardListValueType = API::String::create("SessionBackForwardListItem").leakRef();
- return toAPI(sessionBackForwardListValueType);
+ static API::String& sessionBackForwardListValueType = API::String::create("SessionBackForwardListItem").leakRef();
+ return toAPI(&sessionBackForwardListValueType);
+}
+
+WKTypeRef WKPageCopySessionState(WKPageRef pageRef, void* context, WKPageSessionStateFilterCallback filter)
+{
+ // FIXME: This is a hack to make sure we return a WKDataRef to maintain compatibility with older versions of Safari.
+ bool shouldReturnData = !(reinterpret_cast<uintptr_t>(context) & 1);
+ context = reinterpret_cast<void*>(reinterpret_cast<uintptr_t>(context) & ~1);
+
+ auto sessionState = toImpl(pageRef)->sessionState([pageRef, context, filter](WebBackForwardListItem& item) {
+ if (filter) {
+ if (!filter(pageRef, WKPageGetSessionBackForwardListItemValueType(), toAPI(&item), context))
+ return false;
+
+ if (!filter(pageRef, WKPageGetSessionHistoryURLValueType(), toURLRef(item.originalURL().impl()), context))
+ return false;
+ }
+
+ return true;
+ });
+
+ if (shouldReturnData)
+ return toAPI(encodeLegacySessionState(sessionState).leakRef());
+
+ return toAPI(&API::SessionState::create(WTFMove(sessionState)).leakRef());
+}
+
+static void restoreFromSessionState(WKPageRef pageRef, WKTypeRef sessionStateRef, bool navigate)
+{
+ SessionState sessionState;
+
+ // FIXME: This is for backwards compatibility with Safari. Remove it once Safari no longer depends on it.
+ if (toImpl(sessionStateRef)->type() == API::Object::Type::Data) {
+ if (!decodeLegacySessionState(toImpl(static_cast<WKDataRef>(sessionStateRef))->bytes(), toImpl(static_cast<WKDataRef>(sessionStateRef))->size(), sessionState))
+ return;
+ } else {
+ ASSERT(toImpl(sessionStateRef)->type() == API::Object::Type::SessionState);
+
+ sessionState = toImpl(static_cast<WKSessionStateRef>(sessionStateRef))->sessionState();
+ }
+
+ toImpl(pageRef)->restoreFromSessionState(WTFMove(sessionState), navigate);
}
-WKDataRef WKPageCopySessionState(WKPageRef pageRef, void *context, WKPageSessionStateFilterCallback filter)
+void WKPageRestoreFromSessionState(WKPageRef pageRef, WKTypeRef sessionStateRef)
{
- return toAPI(toImpl(pageRef)->sessionStateData(filter, context).leakRef());
+ restoreFromSessionState(pageRef, sessionStateRef, true);
}
-void WKPageRestoreFromSessionState(WKPageRef pageRef, WKDataRef sessionStateData)
+void WKPageRestoreFromSessionStateWithoutNavigation(WKPageRef pageRef, WKTypeRef sessionStateRef)
{
- toImpl(pageRef)->restoreFromSessionStateData(toImpl(sessionStateData));
+ restoreFromSessionState(pageRef, sessionStateRef, false);
}
double WKPageGetTextZoomFactor(WKPageRef pageRef)
@@ -427,12 +554,6 @@ void WKPageListenForLayoutMilestones(WKPageRef pageRef, WKLayoutMilestones miles
toImpl(pageRef)->listenForLayoutMilestones(toLayoutMilestones(milestones));
}
-void WKPageSetVisibilityState(WKPageRef pageRef, WKPageVisibilityState state, bool)
-{
- if (state == kWKPageVisibilityStatePrerender)
- toImpl(pageRef)->setVisibilityStatePrerender();
-}
-
bool WKPageHasHorizontalScrollbar(WKPageRef pageRef)
{
return toImpl(pageRef)->hasHorizontalScrollbar();
@@ -513,6 +634,26 @@ void WKPageSetRubberBandsAtBottom(WKPageRef pageRef, bool rubberBandsAtBottom)
toImpl(pageRef)->setRubberBandsAtBottom(rubberBandsAtBottom);
}
+bool WKPageVerticalRubberBandingIsEnabled(WKPageRef pageRef)
+{
+ return toImpl(pageRef)->verticalRubberBandingIsEnabled();
+}
+
+void WKPageSetEnableVerticalRubberBanding(WKPageRef pageRef, bool enableVerticalRubberBanding)
+{
+ toImpl(pageRef)->setEnableVerticalRubberBanding(enableVerticalRubberBanding);
+}
+
+bool WKPageHorizontalRubberBandingIsEnabled(WKPageRef pageRef)
+{
+ return toImpl(pageRef)->horizontalRubberBandingIsEnabled();
+}
+
+void WKPageSetEnableHorizontalRubberBanding(WKPageRef pageRef, bool enableHorizontalRubberBanding)
+{
+ toImpl(pageRef)->setEnableHorizontalRubberBanding(enableHorizontalRubberBanding);
+}
+
void WKPageSetBackgroundExtendsBeyondPage(WKPageRef pageRef, bool backgroundExtendsBeyondPage)
{
toImpl(pageRef)->setBackgroundExtendsBeyondPage(backgroundExtendsBeyondPage);
@@ -597,6 +738,16 @@ double WKPageGetGapBetweenPages(WKPageRef pageRef)
return toImpl(pageRef)->gapBetweenPages();
}
+void WKPageSetPaginationLineGridEnabled(WKPageRef pageRef, bool lineGridEnabled)
+{
+ toImpl(pageRef)->setPaginationLineGridEnabled(lineGridEnabled);
+}
+
+bool WKPageGetPaginationLineGridEnabled(WKPageRef pageRef)
+{
+ return toImpl(pageRef)->paginationLineGridEnabled();
+}
+
unsigned WKPageGetPageCount(WKPageRef pageRef)
{
return toImpl(pageRef)->pageCount();
@@ -660,26 +811,206 @@ void WKPageCountStringMatches(WKPageRef pageRef, WKStringRef string, WKFindOptio
void WKPageSetPageContextMenuClient(WKPageRef pageRef, const WKPageContextMenuClientBase* wkClient)
{
#if ENABLE(CONTEXT_MENUS)
- toImpl(pageRef)->initializeContextMenuClient(wkClient);
+ class ContextMenuClient final : public API::Client<WKPageContextMenuClientBase>, public API::ContextMenuClient {
+ public:
+ explicit ContextMenuClient(const WKPageContextMenuClientBase* client)
+ {
+ initialize(client);
+ }
+
+ private:
+ bool getContextMenuFromProposedMenu(WebPageProxy& page, const Vector<RefPtr<WebKit::WebContextMenuItem>>& proposedMenuVector, Vector<RefPtr<WebKit::WebContextMenuItem>>& customMenu, const WebHitTestResultData& hitTestResultData, API::Object* userData) override
+ {
+ if (!m_client.getContextMenuFromProposedMenu && !m_client.getContextMenuFromProposedMenu_deprecatedForUseWithV0)
+ return false;
+
+ if (m_client.base.version >= 2 && !m_client.getContextMenuFromProposedMenu)
+ return false;
+
+ Vector<RefPtr<API::Object>> proposedMenuItems;
+ proposedMenuItems.reserveInitialCapacity(proposedMenuVector.size());
+
+ for (const auto& menuItem : proposedMenuVector)
+ proposedMenuItems.uncheckedAppend(menuItem);
+
+ WKArrayRef newMenu = nullptr;
+ if (m_client.base.version >= 2) {
+ RefPtr<API::HitTestResult> webHitTestResult = API::HitTestResult::create(hitTestResultData);
+ m_client.getContextMenuFromProposedMenu(toAPI(&page), toAPI(API::Array::create(WTFMove(proposedMenuItems)).ptr()), &newMenu, toAPI(webHitTestResult.get()), toAPI(userData), m_client.base.clientInfo);
+ } else
+ m_client.getContextMenuFromProposedMenu_deprecatedForUseWithV0(toAPI(&page), toAPI(API::Array::create(WTFMove(proposedMenuItems)).ptr()), &newMenu, toAPI(userData), m_client.base.clientInfo);
+
+ RefPtr<API::Array> array = adoptRef(toImpl(newMenu));
+
+ customMenu.clear();
+
+ size_t newSize = array ? array->size() : 0;
+ for (size_t i = 0; i < newSize; ++i) {
+ WebContextMenuItem* item = array->at<WebContextMenuItem>(i);
+ if (!item) {
+ LOG(ContextMenu, "New menu entry at index %i is not a WebContextMenuItem", (int)i);
+ continue;
+ }
+
+ customMenu.append(item);
+ }
+
+ return true;
+ }
+
+ bool getContextMenuFromProposedMenuAsync(WebPageProxy& page, const Vector<RefPtr<WebKit::WebContextMenuItem>>& proposedMenuVector, WebKit::WebContextMenuListenerProxy* contextMenuListener, const WebHitTestResultData& hitTestResultData, API::Object* userData) override
+ {
+ if (m_client.base.version < 4 || !m_client.getContextMenuFromProposedMenuAsync)
+ return false;
+
+ Vector<RefPtr<API::Object>> proposedMenuItems;
+ proposedMenuItems.reserveInitialCapacity(proposedMenuVector.size());
+
+ for (const auto& menuItem : proposedMenuVector)
+ proposedMenuItems.uncheckedAppend(menuItem);
+
+ RefPtr<API::HitTestResult> webHitTestResult = API::HitTestResult::create(hitTestResultData);
+ m_client.getContextMenuFromProposedMenuAsync(toAPI(&page), toAPI(API::Array::create(WTFMove(proposedMenuItems)).ptr()), toAPI(contextMenuListener), toAPI(webHitTestResult.get()), toAPI(userData), m_client.base.clientInfo);
+
+ return true;
+ }
+
+ void customContextMenuItemSelected(WebPageProxy& page, const WebContextMenuItemData& itemData) override
+ {
+ if (!m_client.customContextMenuItemSelected)
+ return;
+
+ m_client.customContextMenuItemSelected(toAPI(&page), toAPI(WebContextMenuItem::create(itemData).ptr()), m_client.base.clientInfo);
+ }
+
+ bool showContextMenu(WebPageProxy& page, const WebCore::IntPoint& menuLocation, const Vector<RefPtr<WebContextMenuItem>>& menuItemsVector) override
+ {
+ if (!m_client.showContextMenu)
+ return false;
+
+ Vector<RefPtr<API::Object>> menuItems;
+ menuItems.reserveInitialCapacity(menuItemsVector.size());
+
+ for (const auto& menuItem : menuItemsVector)
+ menuItems.uncheckedAppend(menuItem);
+
+ m_client.showContextMenu(toAPI(&page), toAPI(menuLocation), toAPI(API::Array::create(WTFMove(menuItems)).ptr()), m_client.base.clientInfo);
+
+ return true;
+ }
+
+ bool hideContextMenu(WebPageProxy& page) override
+ {
+ if (!m_client.hideContextMenu)
+ return false;
+
+ m_client.hideContextMenu(toAPI(&page), m_client.base.clientInfo);
+
+ return true;
+ }
+ };
+
+ toImpl(pageRef)->setContextMenuClient(std::make_unique<ContextMenuClient>(wkClient));
#else
UNUSED_PARAM(pageRef);
UNUSED_PARAM(wkClient);
#endif
}
+void WKPageSetPageDiagnosticLoggingClient(WKPageRef pageRef, const WKPageDiagnosticLoggingClientBase* wkClient)
+{
+ toImpl(pageRef)->setDiagnosticLoggingClient(std::make_unique<WebPageDiagnosticLoggingClient>(wkClient));
+}
+
void WKPageSetPageFindClient(WKPageRef pageRef, const WKPageFindClientBase* wkClient)
{
- toImpl(pageRef)->initializeFindClient(wkClient);
+ class FindClient : public API::Client<WKPageFindClientBase>, public API::FindClient {
+ public:
+ explicit FindClient(const WKPageFindClientBase* client)
+ {
+ initialize(client);
+ }
+
+ private:
+ void didFindString(WebPageProxy* page, const String& string, const Vector<WebCore::IntRect>&, uint32_t matchCount, int32_t) override
+ {
+ if (!m_client.didFindString)
+ return;
+
+ m_client.didFindString(toAPI(page), toAPI(string.impl()), matchCount, m_client.base.clientInfo);
+ }
+
+ void didFailToFindString(WebPageProxy* page, const String& string) override
+ {
+ if (!m_client.didFailToFindString)
+ return;
+
+ m_client.didFailToFindString(toAPI(page), toAPI(string.impl()), m_client.base.clientInfo);
+ }
+
+ void didCountStringMatches(WebPageProxy* page, const String& string, uint32_t matchCount) override
+ {
+ if (!m_client.didCountStringMatches)
+ return;
+
+ m_client.didCountStringMatches(toAPI(page), toAPI(string.impl()), matchCount, m_client.base.clientInfo);
+ }
+ };
+
+ toImpl(pageRef)->setFindClient(std::make_unique<FindClient>(wkClient));
}
void WKPageSetPageFindMatchesClient(WKPageRef pageRef, const WKPageFindMatchesClientBase* wkClient)
{
- toImpl(pageRef)->initializeFindMatchesClient(wkClient);
+ class FindMatchesClient : public API::Client<WKPageFindMatchesClientBase>, public API::FindMatchesClient {
+ public:
+ explicit FindMatchesClient(const WKPageFindMatchesClientBase* client)
+ {
+ initialize(client);
+ }
+
+ private:
+ void didFindStringMatches(WebPageProxy* page, const String& string, const Vector<Vector<WebCore::IntRect>>& matchRects, int32_t index) override
+ {
+ if (!m_client.didFindStringMatches)
+ return;
+
+ Vector<RefPtr<API::Object>> matches;
+ matches.reserveInitialCapacity(matchRects.size());
+
+ for (const auto& rects : matchRects) {
+ Vector<RefPtr<API::Object>> apiRects;
+ apiRects.reserveInitialCapacity(rects.size());
+
+ for (const auto& rect : rects)
+ apiRects.uncheckedAppend(API::Rect::create(toAPI(rect)));
+
+ matches.uncheckedAppend(API::Array::create(WTFMove(apiRects)));
+ }
+
+ m_client.didFindStringMatches(toAPI(page), toAPI(string.impl()), toAPI(API::Array::create(WTFMove(matches)).ptr()), index, m_client.base.clientInfo);
+ }
+
+ void didGetImageForMatchResult(WebPageProxy* page, WebImage* image, int32_t index) override
+ {
+ if (!m_client.didGetImageForMatchResult)
+ return;
+
+ m_client.didGetImageForMatchResult(toAPI(page), toAPI(image), index, m_client.base.clientInfo);
+ }
+ };
+
+ toImpl(pageRef)->setFindMatchesClient(std::make_unique<FindMatchesClient>(wkClient));
+}
+
+void WKPageSetPageInjectedBundleClient(WKPageRef pageRef, const WKPageInjectedBundleClientBase* wkClient)
+{
+ toImpl(pageRef)->setInjectedBundleClient(wkClient);
}
void WKPageSetPageFormClient(WKPageRef pageRef, const WKPageFormClientBase* wkClient)
{
- toImpl(pageRef)->initializeFormClient(wkClient);
+ toImpl(pageRef)->setFormClient(std::make_unique<WebFormClient>(wkClient));
}
void WKPageSetPageLoaderClient(WKPageRef pageRef, const WKPageLoaderClientBase* wkClient)
@@ -692,255 +1023,271 @@ void WKPageSetPageLoaderClient(WKPageRef pageRef, const WKPageLoaderClientBase*
}
private:
- virtual void didStartProvisionalLoadForFrame(WebPageProxy* page, WebFrameProxy* frame, API::Object* userData) override
+ void didStartProvisionalLoadForFrame(WebPageProxy& page, WebFrameProxy& frame, API::Navigation*, API::Object* userData) override
{
if (!m_client.didStartProvisionalLoadForFrame)
return;
- m_client.didStartProvisionalLoadForFrame(toAPI(page), toAPI(frame), toAPI(userData), m_client.base.clientInfo);
+ m_client.didStartProvisionalLoadForFrame(toAPI(&page), toAPI(&frame), toAPI(userData), m_client.base.clientInfo);
}
- virtual void didReceiveServerRedirectForProvisionalLoadForFrame(WebPageProxy* page, WebFrameProxy* frame, API::Object* userData) override
+ void didReceiveServerRedirectForProvisionalLoadForFrame(WebPageProxy& page, WebFrameProxy& frame, API::Navigation*, API::Object* userData) override
{
if (!m_client.didReceiveServerRedirectForProvisionalLoadForFrame)
return;
- m_client.didReceiveServerRedirectForProvisionalLoadForFrame(toAPI(page), toAPI(frame), toAPI(userData), m_client.base.clientInfo);
+ m_client.didReceiveServerRedirectForProvisionalLoadForFrame(toAPI(&page), toAPI(&frame), toAPI(userData), m_client.base.clientInfo);
}
- virtual void didFailProvisionalLoadWithErrorForFrame(WebPageProxy* page, WebFrameProxy* frame, const ResourceError& error, API::Object* userData) override
+ void didFailProvisionalLoadWithErrorForFrame(WebPageProxy& page, WebFrameProxy& frame, API::Navigation*, const ResourceError& error, API::Object* userData) override
{
if (!m_client.didFailProvisionalLoadWithErrorForFrame)
return;
- m_client.didFailProvisionalLoadWithErrorForFrame(toAPI(page), toAPI(frame), toAPI(error), toAPI(userData), m_client.base.clientInfo);
+ m_client.didFailProvisionalLoadWithErrorForFrame(toAPI(&page), toAPI(&frame), toAPI(error), toAPI(userData), m_client.base.clientInfo);
}
- virtual void didCommitLoadForFrame(WebPageProxy* page, WebFrameProxy* frame, API::Object* userData) override
+ void didCommitLoadForFrame(WebPageProxy& page, WebFrameProxy& frame, API::Navigation*, API::Object* userData) override
{
if (!m_client.didCommitLoadForFrame)
return;
- m_client.didCommitLoadForFrame(toAPI(page), toAPI(frame), toAPI(userData), m_client.base.clientInfo);
+ m_client.didCommitLoadForFrame(toAPI(&page), toAPI(&frame), toAPI(userData), m_client.base.clientInfo);
}
- virtual void didFinishDocumentLoadForFrame(WebPageProxy* page, WebFrameProxy* frame, API::Object* userData) override
+ void didFinishDocumentLoadForFrame(WebPageProxy& page, WebFrameProxy& frame, API::Navigation*, API::Object* userData) override
{
if (!m_client.didFinishDocumentLoadForFrame)
return;
- m_client.didFinishDocumentLoadForFrame(toAPI(page), toAPI(frame), toAPI(userData), m_client.base.clientInfo);
+ m_client.didFinishDocumentLoadForFrame(toAPI(&page), toAPI(&frame), toAPI(userData), m_client.base.clientInfo);
}
- virtual void didFinishLoadForFrame(WebPageProxy* page, WebFrameProxy* frame, API::Object* userData) override
+ void didFinishLoadForFrame(WebPageProxy& page, WebFrameProxy& frame, API::Navigation*, API::Object* userData) override
{
if (!m_client.didFinishLoadForFrame)
return;
- m_client.didFinishLoadForFrame(toAPI(page), toAPI(frame), toAPI(userData), m_client.base.clientInfo);
+ m_client.didFinishLoadForFrame(toAPI(&page), toAPI(&frame), toAPI(userData), m_client.base.clientInfo);
}
- virtual void didFailLoadWithErrorForFrame(WebPageProxy* page, WebFrameProxy* frame, const ResourceError& error, API::Object* userData) override
+ void didFailLoadWithErrorForFrame(WebPageProxy& page, WebFrameProxy& frame, API::Navigation*, const ResourceError& error, API::Object* userData) override
{
if (!m_client.didFailLoadWithErrorForFrame)
return;
- m_client.didFailLoadWithErrorForFrame(toAPI(page), toAPI(frame), toAPI(error), toAPI(userData), m_client.base.clientInfo);
+ m_client.didFailLoadWithErrorForFrame(toAPI(&page), toAPI(&frame), toAPI(error), toAPI(userData), m_client.base.clientInfo);
}
- virtual void didSameDocumentNavigationForFrame(WebPageProxy* page, WebFrameProxy* frame, SameDocumentNavigationType type, API::Object* userData) override
+ void didSameDocumentNavigationForFrame(WebPageProxy& page, WebFrameProxy& frame, API::Navigation*, SameDocumentNavigationType type, API::Object* userData) override
{
if (!m_client.didSameDocumentNavigationForFrame)
return;
- m_client.didSameDocumentNavigationForFrame(toAPI(page), toAPI(frame), toAPI(type), toAPI(userData), m_client.base.clientInfo);
+ m_client.didSameDocumentNavigationForFrame(toAPI(&page), toAPI(&frame), toAPI(type), toAPI(userData), m_client.base.clientInfo);
}
- virtual void didReceiveTitleForFrame(WebPageProxy* page, const String& title, WebFrameProxy* frame, API::Object* userData) override
+ void didReceiveTitleForFrame(WebPageProxy& page, const String& title, WebFrameProxy& frame, API::Object* userData) override
{
if (!m_client.didReceiveTitleForFrame)
return;
- m_client.didReceiveTitleForFrame(toAPI(page), toAPI(title.impl()), toAPI(frame), toAPI(userData), m_client.base.clientInfo);
+ m_client.didReceiveTitleForFrame(toAPI(&page), toAPI(title.impl()), toAPI(&frame), toAPI(userData), m_client.base.clientInfo);
}
- virtual void didFirstLayoutForFrame(WebPageProxy* page, WebFrameProxy* frame, API::Object* userData) override
+ void didFirstLayoutForFrame(WebPageProxy& page, WebFrameProxy& frame, API::Object* userData) override
{
if (!m_client.didFirstLayoutForFrame)
return;
- m_client.didFirstLayoutForFrame(toAPI(page), toAPI(frame), toAPI(userData), m_client.base.clientInfo);
+ m_client.didFirstLayoutForFrame(toAPI(&page), toAPI(&frame), toAPI(userData), m_client.base.clientInfo);
}
- virtual void didFirstVisuallyNonEmptyLayoutForFrame(WebPageProxy* page, WebFrameProxy* frame, API::Object* userData) override
+ void didFirstVisuallyNonEmptyLayoutForFrame(WebPageProxy& page, WebFrameProxy& frame, API::Object* userData) override
{
if (!m_client.didFirstVisuallyNonEmptyLayoutForFrame)
return;
- m_client.didFirstVisuallyNonEmptyLayoutForFrame(toAPI(page), toAPI(frame), toAPI(userData), m_client.base.clientInfo);
+ m_client.didFirstVisuallyNonEmptyLayoutForFrame(toAPI(&page), toAPI(&frame), toAPI(userData), m_client.base.clientInfo);
}
- virtual void didLayout(WebPageProxy* page, LayoutMilestones milestones, API::Object* userData) override
+ void didReachLayoutMilestone(WebPageProxy& page, LayoutMilestones milestones) override
{
if (!m_client.didLayout)
return;
- m_client.didLayout(toAPI(page), toWKLayoutMilestones(milestones), toAPI(userData), m_client.base.clientInfo);
+ m_client.didLayout(toAPI(&page), toWKLayoutMilestones(milestones), nullptr, m_client.base.clientInfo);
}
- virtual void didRemoveFrameFromHierarchy(WebPageProxy* page, WebFrameProxy* frame, API::Object* userData) override
- {
- if (!m_client.didRemoveFrameFromHierarchy)
- return;
-
- m_client.didRemoveFrameFromHierarchy(toAPI(page), toAPI(frame), toAPI(userData), m_client.base.clientInfo);
- }
-
- virtual void didDisplayInsecureContentForFrame(WebPageProxy* page, WebFrameProxy* frame, API::Object* userData) override
+ void didDisplayInsecureContentForFrame(WebPageProxy& page, WebFrameProxy& frame, API::Object* userData) override
{
if (!m_client.didDisplayInsecureContentForFrame)
return;
- m_client.didDisplayInsecureContentForFrame(toAPI(page), toAPI(frame), toAPI(userData), m_client.base.clientInfo);
+ m_client.didDisplayInsecureContentForFrame(toAPI(&page), toAPI(&frame), toAPI(userData), m_client.base.clientInfo);
}
- virtual void didRunInsecureContentForFrame(WebPageProxy* page, WebFrameProxy* frame, API::Object* userData) override
+ void didRunInsecureContentForFrame(WebPageProxy& page, WebFrameProxy& frame, API::Object* userData) override
{
if (!m_client.didRunInsecureContentForFrame)
return;
- m_client.didRunInsecureContentForFrame(toAPI(page), toAPI(frame), toAPI(userData), m_client.base.clientInfo);
+ m_client.didRunInsecureContentForFrame(toAPI(&page), toAPI(&frame), toAPI(userData), m_client.base.clientInfo);
}
- virtual void didDetectXSSForFrame(WebPageProxy* page, WebFrameProxy* frame, API::Object* userData) override
+ void didDetectXSSForFrame(WebPageProxy& page, WebFrameProxy& frame, API::Object* userData) override
{
if (!m_client.didDetectXSSForFrame)
return;
- m_client.didDetectXSSForFrame(toAPI(page), toAPI(frame), toAPI(userData), m_client.base.clientInfo);
+ m_client.didDetectXSSForFrame(toAPI(&page), toAPI(&frame), toAPI(userData), m_client.base.clientInfo);
}
- virtual bool canAuthenticateAgainstProtectionSpaceInFrame(WebPageProxy* page, WebFrameProxy* frame, WebProtectionSpace* protectionSpace) override
+ bool canAuthenticateAgainstProtectionSpaceInFrame(WebPageProxy& page, WebFrameProxy& frame, WebProtectionSpace* protectionSpace) override
{
if (!m_client.canAuthenticateAgainstProtectionSpaceInFrame)
return false;
- return m_client.canAuthenticateAgainstProtectionSpaceInFrame(toAPI(page), toAPI(frame), toAPI(protectionSpace), m_client.base.clientInfo);
+ return m_client.canAuthenticateAgainstProtectionSpaceInFrame(toAPI(&page), toAPI(&frame), toAPI(protectionSpace), m_client.base.clientInfo);
}
- virtual void didReceiveAuthenticationChallengeInFrame(WebPageProxy* page, WebFrameProxy* frame, AuthenticationChallengeProxy* authenticationChallenge) override
+ void didReceiveAuthenticationChallengeInFrame(WebPageProxy& page, WebFrameProxy& frame, AuthenticationChallengeProxy* authenticationChallenge) override
{
if (!m_client.didReceiveAuthenticationChallengeInFrame)
return;
- m_client.didReceiveAuthenticationChallengeInFrame(toAPI(page), toAPI(frame), toAPI(authenticationChallenge), m_client.base.clientInfo);
+ m_client.didReceiveAuthenticationChallengeInFrame(toAPI(&page), toAPI(&frame), toAPI(authenticationChallenge), m_client.base.clientInfo);
}
- virtual void didStartProgress(WebPageProxy* page) override
+ void didStartProgress(WebPageProxy& page) override
{
if (!m_client.didStartProgress)
return;
- m_client.didStartProgress(toAPI(page), m_client.base.clientInfo);
+ m_client.didStartProgress(toAPI(&page), m_client.base.clientInfo);
}
- virtual void didChangeProgress(WebPageProxy* page) override
+ void didChangeProgress(WebPageProxy& page) override
{
if (!m_client.didChangeProgress)
return;
- m_client.didChangeProgress(toAPI(page), m_client.base.clientInfo);
+ m_client.didChangeProgress(toAPI(&page), m_client.base.clientInfo);
}
- virtual void didFinishProgress(WebPageProxy* page) override
+ void didFinishProgress(WebPageProxy& page) override
{
if (!m_client.didFinishProgress)
return;
- m_client.didFinishProgress(toAPI(page), m_client.base.clientInfo);
+ m_client.didFinishProgress(toAPI(&page), m_client.base.clientInfo);
}
- virtual void processDidBecomeUnresponsive(WebPageProxy* page) override
+ void processDidBecomeUnresponsive(WebPageProxy& page) override
{
if (!m_client.processDidBecomeUnresponsive)
return;
- m_client.processDidBecomeUnresponsive(toAPI(page), m_client.base.clientInfo);
- }
-
- virtual void interactionOccurredWhileProcessUnresponsive(WebPageProxy* page) override
- {
- if (!m_client.interactionOccurredWhileProcessUnresponsive)
- return;
-
- m_client.interactionOccurredWhileProcessUnresponsive(toAPI(page), m_client.base.clientInfo);
+ m_client.processDidBecomeUnresponsive(toAPI(&page), m_client.base.clientInfo);
}
- virtual void processDidBecomeResponsive(WebPageProxy* page) override
+ void processDidBecomeResponsive(WebPageProxy& page) override
{
if (!m_client.processDidBecomeResponsive)
return;
- m_client.processDidBecomeResponsive(toAPI(page), m_client.base.clientInfo);
+ m_client.processDidBecomeResponsive(toAPI(&page), m_client.base.clientInfo);
}
- virtual void processDidCrash(WebPageProxy* page) override
+ void processDidCrash(WebPageProxy& page) override
{
if (!m_client.processDidCrash)
return;
- m_client.processDidCrash(toAPI(page), m_client.base.clientInfo);
+ m_client.processDidCrash(toAPI(&page), m_client.base.clientInfo);
}
- virtual void didChangeBackForwardList(WebPageProxy* page, WebBackForwardListItem* addedItem, Vector<RefPtr<API::Object>>* removedItems) override
+ void didChangeBackForwardList(WebPageProxy& page, WebBackForwardListItem* addedItem, Vector<RefPtr<WebBackForwardListItem>> removedItems) override
{
if (!m_client.didChangeBackForwardList)
return;
RefPtr<API::Array> removedItemsArray;
- if (removedItems && !removedItems->isEmpty())
- removedItemsArray = API::Array::create(std::move(*removedItems));
+ if (!removedItems.isEmpty()) {
+ Vector<RefPtr<API::Object>> removedItemsVector;
+ removedItemsVector.reserveInitialCapacity(removedItems.size());
+ for (auto& removedItem : removedItems)
+ removedItemsVector.append(WTFMove(removedItem));
- m_client.didChangeBackForwardList(toAPI(page), toAPI(addedItem), toAPI(removedItemsArray.get()), m_client.base.clientInfo);
+ removedItemsArray = API::Array::create(WTFMove(removedItemsVector));
+ }
+
+ m_client.didChangeBackForwardList(toAPI(&page), toAPI(addedItem), toAPI(removedItemsArray.get()), m_client.base.clientInfo);
+ }
+
+ bool shouldKeepCurrentBackForwardListItemInList(WebKit::WebPageProxy& page, WebKit::WebBackForwardListItem* item) override
+ {
+ if (!m_client.shouldKeepCurrentBackForwardListItemInList)
+ return true;
+
+ return m_client.shouldKeepCurrentBackForwardListItemInList(toAPI(&page), toAPI(item), m_client.base.clientInfo);
}
- virtual void willGoToBackForwardListItem(WebPageProxy* page, WebBackForwardListItem* item, API::Object* userData) override
+ void willGoToBackForwardListItem(WebPageProxy& page, WebBackForwardListItem* item, API::Object* userData) override
{
if (m_client.willGoToBackForwardListItem)
- m_client.willGoToBackForwardListItem(toAPI(page), toAPI(item), toAPI(userData), m_client.base.clientInfo);
+ m_client.willGoToBackForwardListItem(toAPI(&page), toAPI(item), toAPI(userData), m_client.base.clientInfo);
+ }
+
+ void navigationGestureDidBegin(WebPageProxy& page) override
+ {
+ if (m_client.navigationGestureDidBegin)
+ m_client.navigationGestureDidBegin(toAPI(&page), m_client.base.clientInfo);
+ }
+
+ void navigationGestureWillEnd(WebPageProxy& page, bool willNavigate, WebBackForwardListItem& item) override
+ {
+ if (m_client.navigationGestureWillEnd)
+ m_client.navigationGestureWillEnd(toAPI(&page), willNavigate, toAPI(&item), m_client.base.clientInfo);
+ }
+
+ void navigationGestureDidEnd(WebPageProxy& page, bool willNavigate, WebBackForwardListItem& item) override
+ {
+ if (m_client.navigationGestureDidEnd)
+ m_client.navigationGestureDidEnd(toAPI(&page), willNavigate, toAPI(&item), m_client.base.clientInfo);
}
#if ENABLE(NETSCAPE_PLUGIN_API)
- virtual void didFailToInitializePlugin(WebPageProxy* page, ImmutableDictionary* pluginInformation) override
+ void didFailToInitializePlugin(WebPageProxy& page, API::Dictionary* pluginInformation) override
{
if (m_client.didFailToInitializePlugin_deprecatedForUseWithV0)
- m_client.didFailToInitializePlugin_deprecatedForUseWithV0(toAPI(page), toAPI(pluginInformation->get<API::String>(pluginInformationMIMETypeKey())), m_client.base.clientInfo);
+ m_client.didFailToInitializePlugin_deprecatedForUseWithV0(toAPI(&page), toAPI(pluginInformation->get<API::String>(pluginInformationMIMETypeKey())), m_client.base.clientInfo);
if (m_client.pluginDidFail_deprecatedForUseWithV1)
- m_client.pluginDidFail_deprecatedForUseWithV1(toAPI(page), kWKErrorCodeCannotLoadPlugIn, toAPI(pluginInformation->get<API::String>(pluginInformationMIMETypeKey())), 0, 0, m_client.base.clientInfo);
+ m_client.pluginDidFail_deprecatedForUseWithV1(toAPI(&page), kWKErrorCodeCannotLoadPlugIn, toAPI(pluginInformation->get<API::String>(pluginInformationMIMETypeKey())), 0, 0, m_client.base.clientInfo);
if (m_client.pluginDidFail)
- m_client.pluginDidFail(toAPI(page), kWKErrorCodeCannotLoadPlugIn, toAPI(pluginInformation), m_client.base.clientInfo);
+ m_client.pluginDidFail(toAPI(&page), kWKErrorCodeCannotLoadPlugIn, toAPI(pluginInformation), m_client.base.clientInfo);
}
- virtual void didBlockInsecurePluginVersion(WebPageProxy* page, ImmutableDictionary* pluginInformation) override
+ void didBlockInsecurePluginVersion(WebPageProxy& page, API::Dictionary* pluginInformation) override
{
if (m_client.pluginDidFail_deprecatedForUseWithV1)
- m_client.pluginDidFail_deprecatedForUseWithV1(toAPI(page), kWKErrorCodeInsecurePlugInVersion, toAPI(pluginInformation->get<API::String>(pluginInformationMIMETypeKey())), toAPI(pluginInformation->get<API::String>(pluginInformationBundleIdentifierKey())), toAPI(pluginInformation->get<API::String>(pluginInformationBundleVersionKey())), m_client.base.clientInfo);
+ m_client.pluginDidFail_deprecatedForUseWithV1(toAPI(&page), kWKErrorCodeInsecurePlugInVersion, toAPI(pluginInformation->get<API::String>(pluginInformationMIMETypeKey())), toAPI(pluginInformation->get<API::String>(pluginInformationBundleIdentifierKey())), toAPI(pluginInformation->get<API::String>(pluginInformationBundleVersionKey())), m_client.base.clientInfo);
if (m_client.pluginDidFail)
- m_client.pluginDidFail(toAPI(page), kWKErrorCodeInsecurePlugInVersion, toAPI(pluginInformation), m_client.base.clientInfo);
+ m_client.pluginDidFail(toAPI(&page), kWKErrorCodeInsecurePlugInVersion, toAPI(pluginInformation), m_client.base.clientInfo);
}
- virtual PluginModuleLoadPolicy pluginLoadPolicy(WebPageProxy* page, PluginModuleLoadPolicy currentPluginLoadPolicy, ImmutableDictionary* pluginInformation, String& unavailabilityDescription) override
+ PluginModuleLoadPolicy pluginLoadPolicy(WebPageProxy& page, PluginModuleLoadPolicy currentPluginLoadPolicy, API::Dictionary* pluginInformation, String& unavailabilityDescription) override
{
WKStringRef unavailabilityDescriptionOut = 0;
PluginModuleLoadPolicy loadPolicy = currentPluginLoadPolicy;
if (m_client.pluginLoadPolicy_deprecatedForUseWithV2)
- loadPolicy = toPluginModuleLoadPolicy(m_client.pluginLoadPolicy_deprecatedForUseWithV2(toAPI(page), toWKPluginLoadPolicy(currentPluginLoadPolicy), toAPI(pluginInformation), m_client.base.clientInfo));
+ loadPolicy = toPluginModuleLoadPolicy(m_client.pluginLoadPolicy_deprecatedForUseWithV2(toAPI(&page), toWKPluginLoadPolicy(currentPluginLoadPolicy), toAPI(pluginInformation), m_client.base.clientInfo));
else if (m_client.pluginLoadPolicy)
- loadPolicy = toPluginModuleLoadPolicy(m_client.pluginLoadPolicy(toAPI(page), toWKPluginLoadPolicy(currentPluginLoadPolicy), toAPI(pluginInformation), &unavailabilityDescriptionOut, m_client.base.clientInfo));
+ loadPolicy = toPluginModuleLoadPolicy(m_client.pluginLoadPolicy(toAPI(&page), toWKPluginLoadPolicy(currentPluginLoadPolicy), toAPI(pluginInformation), &unavailabilityDescriptionOut, m_client.base.clientInfo));
if (unavailabilityDescriptionOut) {
RefPtr<API::String> webUnavailabilityDescription = adoptRef(toImpl(unavailabilityDescriptionOut));
@@ -952,15 +1299,26 @@ void WKPageSetPageLoaderClient(WKPageRef pageRef, const WKPageLoaderClientBase*
#endif // ENABLE(NETSCAPE_PLUGIN_API)
#if ENABLE(WEBGL)
- virtual WebCore::WebGLLoadPolicy webGLLoadPolicy(WebPageProxy* page, const String& url) const override
+ WebCore::WebGLLoadPolicy webGLLoadPolicy(WebPageProxy& page, const String& url) const override
{
- WebCore::WebGLLoadPolicy loadPolicy = WebGLAllow;
+ WebCore::WebGLLoadPolicy loadPolicy = WebGLAllowCreation;
if (m_client.webGLLoadPolicy)
- loadPolicy = toWebGLLoadPolicy(m_client.webGLLoadPolicy(toAPI(page), toAPI(url.impl()), m_client.base.clientInfo));
+ loadPolicy = toWebGLLoadPolicy(m_client.webGLLoadPolicy(toAPI(&page), toAPI(url.impl()), m_client.base.clientInfo));
return loadPolicy;
}
+
+ WebCore::WebGLLoadPolicy resolveWebGLLoadPolicy(WebPageProxy& page, const String& url) const override
+ {
+ WebCore::WebGLLoadPolicy loadPolicy = WebGLAllowCreation;
+
+ if (m_client.resolveWebGLLoadPolicy)
+ loadPolicy = toWebGLLoadPolicy(m_client.resolveWebGLLoadPolicy(toAPI(&page), toAPI(url.impl()), m_client.base.clientInfo));
+
+ return loadPolicy;
+ }
+
#endif // ENABLE(WEBGL)
};
@@ -980,7 +1338,7 @@ void WKPageSetPageLoaderClient(WKPageRef pageRef, const WKPageLoaderClientBase*
if (milestones)
webPageProxy->process().send(Messages::WebPage::ListenForLayoutMilestones(milestones), webPageProxy->pageID());
- webPageProxy->setLoaderClient(std::move(loaderClient));
+ webPageProxy->setLoaderClient(WTFMove(loaderClient));
}
void WKPageSetPagePolicyClient(WKPageRef pageRef, const WKPagePolicyClientBase* wkClient)
@@ -993,77 +1351,1096 @@ void WKPageSetPagePolicyClient(WKPageRef pageRef, const WKPagePolicyClientBase*
}
private:
- virtual void decidePolicyForNavigationAction(WebPageProxy* page, WebFrameProxy* frame, const NavigationActionData& navigationActionData, WebFrameProxy* originatingFrame, const WebCore::ResourceRequest& originalResourceRequest, const WebCore::ResourceRequest& resourceRequest, WebFramePolicyListenerProxy* listener, API::Object* userData) override
+ void decidePolicyForNavigationAction(WebPageProxy& page, WebFrameProxy* frame, const NavigationActionData& navigationActionData, WebFrameProxy* originatingFrame, const WebCore::ResourceRequest& originalResourceRequest, const WebCore::ResourceRequest& resourceRequest, Ref<WebFramePolicyListenerProxy>&& listener, API::Object* userData) override
{
if (!m_client.decidePolicyForNavigationAction_deprecatedForUseWithV0 && !m_client.decidePolicyForNavigationAction_deprecatedForUseWithV1 && !m_client.decidePolicyForNavigationAction) {
- listener->use();
+ listener->use({ });
return;
}
- RefPtr<API::URLRequest> originalRequest = API::URLRequest::create(originalResourceRequest);
- RefPtr<API::URLRequest> request = API::URLRequest::create(resourceRequest);
+ Ref<API::URLRequest> originalRequest = API::URLRequest::create(originalResourceRequest);
+ Ref<API::URLRequest> request = API::URLRequest::create(resourceRequest);
if (m_client.decidePolicyForNavigationAction_deprecatedForUseWithV0)
- m_client.decidePolicyForNavigationAction_deprecatedForUseWithV0(toAPI(page), toAPI(frame), toAPI(navigationActionData.navigationType), toAPI(navigationActionData.modifiers), toAPI(navigationActionData.mouseButton), toAPI(request.get()), toAPI(listener), toAPI(userData), m_client.base.clientInfo);
+ m_client.decidePolicyForNavigationAction_deprecatedForUseWithV0(toAPI(&page), toAPI(frame), toAPI(navigationActionData.navigationType), toAPI(navigationActionData.modifiers), toAPI(navigationActionData.mouseButton), toAPI(request.ptr()), toAPI(listener.ptr()), toAPI(userData), m_client.base.clientInfo);
else if (m_client.decidePolicyForNavigationAction_deprecatedForUseWithV1)
- m_client.decidePolicyForNavigationAction_deprecatedForUseWithV1(toAPI(page), toAPI(frame), toAPI(navigationActionData.navigationType), toAPI(navigationActionData.modifiers), toAPI(navigationActionData.mouseButton), toAPI(originatingFrame), toAPI(request.get()), toAPI(listener), toAPI(userData), m_client.base.clientInfo);
+ m_client.decidePolicyForNavigationAction_deprecatedForUseWithV1(toAPI(&page), toAPI(frame), toAPI(navigationActionData.navigationType), toAPI(navigationActionData.modifiers), toAPI(navigationActionData.mouseButton), toAPI(originatingFrame), toAPI(request.ptr()), toAPI(listener.ptr()), toAPI(userData), m_client.base.clientInfo);
else
- m_client.decidePolicyForNavigationAction(toAPI(page), toAPI(frame), toAPI(navigationActionData.navigationType), toAPI(navigationActionData.modifiers), toAPI(navigationActionData.mouseButton), toAPI(originatingFrame), toAPI(originalRequest.get()), toAPI(request.get()), toAPI(listener), toAPI(userData), m_client.base.clientInfo);
+ m_client.decidePolicyForNavigationAction(toAPI(&page), toAPI(frame), toAPI(navigationActionData.navigationType), toAPI(navigationActionData.modifiers), toAPI(navigationActionData.mouseButton), toAPI(originatingFrame), toAPI(originalRequest.ptr()), toAPI(request.ptr()), toAPI(listener.ptr()), toAPI(userData), m_client.base.clientInfo);
}
- virtual void decidePolicyForNewWindowAction(WebPageProxy* page, WebFrameProxy* frame, NavigationType type, WebEvent::Modifiers modifiers, WebMouseEvent::Button mouseButton, const ResourceRequest& resourceRequest, const String& frameName, WebFramePolicyListenerProxy* listener, API::Object* userData) override
+ void decidePolicyForNewWindowAction(WebPageProxy& page, WebFrameProxy& frame, const NavigationActionData& navigationActionData, const ResourceRequest& resourceRequest, const String& frameName, Ref<WebFramePolicyListenerProxy>&& listener, API::Object* userData) override
{
if (!m_client.decidePolicyForNewWindowAction) {
- listener->use();
+ listener->use({ });
return;
}
- RefPtr<API::URLRequest> request = API::URLRequest::create(resourceRequest);
+ Ref<API::URLRequest> request = API::URLRequest::create(resourceRequest);
- m_client.decidePolicyForNewWindowAction(toAPI(page), toAPI(frame), toAPI(type), toAPI(modifiers), toAPI(mouseButton), toAPI(request.get()), toAPI(frameName.impl()), toAPI(listener), toAPI(userData), m_client.base.clientInfo);
+ m_client.decidePolicyForNewWindowAction(toAPI(&page), toAPI(&frame), toAPI(navigationActionData.navigationType), toAPI(navigationActionData.modifiers), toAPI(navigationActionData.mouseButton), toAPI(request.ptr()), toAPI(frameName.impl()), toAPI(listener.ptr()), toAPI(userData), m_client.base.clientInfo);
}
- virtual void decidePolicyForResponse(WebPageProxy* page, WebFrameProxy* frame, const ResourceResponse& resourceResponse, const ResourceRequest& resourceRequest, bool canShowMIMEType, WebFramePolicyListenerProxy* listener, API::Object* userData) override
+ void decidePolicyForResponse(WebPageProxy& page, WebFrameProxy& frame, const ResourceResponse& resourceResponse, const ResourceRequest& resourceRequest, bool canShowMIMEType, Ref<WebFramePolicyListenerProxy>&& listener, API::Object* userData) override
{
if (!m_client.decidePolicyForResponse_deprecatedForUseWithV0 && !m_client.decidePolicyForResponse) {
- listener->use();
+ listener->use({ });
return;
}
- RefPtr<API::URLResponse> response = API::URLResponse::create(resourceResponse);
- RefPtr<API::URLRequest> request = API::URLRequest::create(resourceRequest);
+ Ref<API::URLResponse> response = API::URLResponse::create(resourceResponse);
+ Ref<API::URLRequest> request = API::URLRequest::create(resourceRequest);
if (m_client.decidePolicyForResponse_deprecatedForUseWithV0)
- m_client.decidePolicyForResponse_deprecatedForUseWithV0(toAPI(page), toAPI(frame), toAPI(response.get()), toAPI(request.get()), toAPI(listener), toAPI(userData), m_client.base.clientInfo);
+ m_client.decidePolicyForResponse_deprecatedForUseWithV0(toAPI(&page), toAPI(&frame), toAPI(response.ptr()), toAPI(request.ptr()), toAPI(listener.ptr()), toAPI(userData), m_client.base.clientInfo);
else
- m_client.decidePolicyForResponse(toAPI(page), toAPI(frame), toAPI(response.get()), toAPI(request.get()), canShowMIMEType, toAPI(listener), toAPI(userData), m_client.base.clientInfo);
+ m_client.decidePolicyForResponse(toAPI(&page), toAPI(&frame), toAPI(response.ptr()), toAPI(request.ptr()), canShowMIMEType, toAPI(listener.ptr()), toAPI(userData), m_client.base.clientInfo);
}
- virtual void unableToImplementPolicy(WebPageProxy* page, WebFrameProxy* frame, const ResourceError& error, API::Object* userData) override
+ void unableToImplementPolicy(WebPageProxy& page, WebFrameProxy& frame, const ResourceError& error, API::Object* userData) override
{
if (!m_client.unableToImplementPolicy)
return;
- m_client.unableToImplementPolicy(toAPI(page), toAPI(frame), toAPI(error), toAPI(userData), m_client.base.clientInfo);
+ m_client.unableToImplementPolicy(toAPI(&page), toAPI(&frame), toAPI(error), toAPI(userData), m_client.base.clientInfo);
}
};
toImpl(pageRef)->setPolicyClient(std::make_unique<PolicyClient>(wkClient));
}
+#if PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED <= 101000
+static void fixUpBotchedPageUIClient(WKPageRef pageRef, const WKPageUIClientBase& wkClient)
+{
+ struct BotchedWKPageUIClientV4 {
+ WKPageUIClientBase base;
+
+ // Version 0.
+ WKPageCreateNewPageCallback_deprecatedForUseWithV0 createNewPage_deprecatedForUseWithV0;
+ WKPageUIClientCallback showPage;
+ WKPageUIClientCallback close;
+ WKPageTakeFocusCallback takeFocus;
+ WKPageFocusCallback focus;
+ WKPageUnfocusCallback unfocus;
+ WKPageRunJavaScriptAlertCallback_deprecatedForUseWithV0 runJavaScriptAlert_deprecatedForUseWithV0;
+ WKPageRunJavaScriptConfirmCallback_deprecatedForUseWithV0 runJavaScriptConfirm_deprecatedForUseWithV0;
+ WKPageRunJavaScriptPromptCallback_deprecatedForUseWithV0 runJavaScriptPrompt_deprecatedForUseWithV0;
+ WKPageSetStatusTextCallback setStatusText;
+ WKPageMouseDidMoveOverElementCallback_deprecatedForUseWithV0 mouseDidMoveOverElement_deprecatedForUseWithV0;
+ WKPageMissingPluginButtonClickedCallback_deprecatedForUseWithV0 missingPluginButtonClicked_deprecatedForUseWithV0;
+ WKPageDidNotHandleKeyEventCallback didNotHandleKeyEvent;
+ WKPageDidNotHandleWheelEventCallback didNotHandleWheelEvent;
+ WKPageGetToolbarsAreVisibleCallback toolbarsAreVisible;
+ WKPageSetToolbarsAreVisibleCallback setToolbarsAreVisible;
+ WKPageGetMenuBarIsVisibleCallback menuBarIsVisible;
+ WKPageSetMenuBarIsVisibleCallback setMenuBarIsVisible;
+ WKPageGetStatusBarIsVisibleCallback statusBarIsVisible;
+ WKPageSetStatusBarIsVisibleCallback setStatusBarIsVisible;
+ WKPageGetIsResizableCallback isResizable;
+ WKPageSetIsResizableCallback setIsResizable;
+ WKPageGetWindowFrameCallback getWindowFrame;
+ WKPageSetWindowFrameCallback setWindowFrame;
+ WKPageRunBeforeUnloadConfirmPanelCallback_deprecatedForUseWithV6 runBeforeUnloadConfirmPanel;
+ WKPageUIClientCallback didDraw;
+ WKPageUIClientCallback pageDidScroll;
+ WKPageExceededDatabaseQuotaCallback exceededDatabaseQuota;
+ WKPageRunOpenPanelCallback runOpenPanel;
+ WKPageDecidePolicyForGeolocationPermissionRequestCallback decidePolicyForGeolocationPermissionRequest;
+ WKPageHeaderHeightCallback headerHeight;
+ WKPageFooterHeightCallback footerHeight;
+ WKPageDrawHeaderCallback drawHeader;
+ WKPageDrawFooterCallback drawFooter;
+ WKPagePrintFrameCallback printFrame;
+ WKPageUIClientCallback runModal;
+ void* unused1; // Used to be didCompleteRubberBandForMainFrame
+ WKPageSaveDataToFileInDownloadsFolderCallback saveDataToFileInDownloadsFolder;
+ void* shouldInterruptJavaScript_unavailable;
+
+ // Version 1.
+ WKPageCreateNewPageCallback_deprecatedForUseWithV1 createNewPage;
+ WKPageMouseDidMoveOverElementCallback mouseDidMoveOverElement;
+ WKPageDecidePolicyForNotificationPermissionRequestCallback decidePolicyForNotificationPermissionRequest;
+ WKPageUnavailablePluginButtonClickedCallback_deprecatedForUseWithV1 unavailablePluginButtonClicked_deprecatedForUseWithV1;
+
+ // Version 2.
+ WKPageShowColorPickerCallback showColorPicker;
+ WKPageHideColorPickerCallback hideColorPicker;
+ WKPageUnavailablePluginButtonClickedCallback unavailablePluginButtonClicked;
+
+ // Version 3.
+ WKPagePinnedStateDidChangeCallback pinnedStateDidChange;
+
+ // Version 4.
+ WKPageRunJavaScriptAlertCallback_deprecatedForUseWithV5 runJavaScriptAlert;
+ WKPageRunJavaScriptConfirmCallback_deprecatedForUseWithV5 runJavaScriptConfirm;
+ WKPageRunJavaScriptPromptCallback_deprecatedForUseWithV5 runJavaScriptPrompt;
+ };
+
+ const auto& botchedPageUIClient = reinterpret_cast<const BotchedWKPageUIClientV4&>(wkClient);
+
+ WKPageUIClientV5 fixedPageUIClient = {
+ { 5, botchedPageUIClient.base.clientInfo },
+ botchedPageUIClient.createNewPage_deprecatedForUseWithV0,
+ botchedPageUIClient.showPage,
+ botchedPageUIClient.close,
+ botchedPageUIClient.takeFocus,
+ botchedPageUIClient.focus,
+ botchedPageUIClient.unfocus,
+ botchedPageUIClient.runJavaScriptAlert_deprecatedForUseWithV0,
+ botchedPageUIClient.runJavaScriptConfirm_deprecatedForUseWithV0,
+ botchedPageUIClient.runJavaScriptPrompt_deprecatedForUseWithV0,
+ botchedPageUIClient.setStatusText,
+ botchedPageUIClient.mouseDidMoveOverElement_deprecatedForUseWithV0,
+ botchedPageUIClient.missingPluginButtonClicked_deprecatedForUseWithV0,
+ botchedPageUIClient.didNotHandleKeyEvent,
+ botchedPageUIClient.didNotHandleWheelEvent,
+ botchedPageUIClient.toolbarsAreVisible,
+ botchedPageUIClient.setToolbarsAreVisible,
+ botchedPageUIClient.menuBarIsVisible,
+ botchedPageUIClient.setMenuBarIsVisible,
+ botchedPageUIClient.statusBarIsVisible,
+ botchedPageUIClient.setStatusBarIsVisible,
+ botchedPageUIClient.isResizable,
+ botchedPageUIClient.setIsResizable,
+ botchedPageUIClient.getWindowFrame,
+ botchedPageUIClient.setWindowFrame,
+ botchedPageUIClient.runBeforeUnloadConfirmPanel,
+ botchedPageUIClient.didDraw,
+ botchedPageUIClient.pageDidScroll,
+ botchedPageUIClient.exceededDatabaseQuota,
+ botchedPageUIClient.runOpenPanel,
+ botchedPageUIClient.decidePolicyForGeolocationPermissionRequest,
+ botchedPageUIClient.headerHeight,
+ botchedPageUIClient.footerHeight,
+ botchedPageUIClient.drawHeader,
+ botchedPageUIClient.drawFooter,
+ botchedPageUIClient.printFrame,
+ botchedPageUIClient.runModal,
+ botchedPageUIClient.unused1,
+ botchedPageUIClient.saveDataToFileInDownloadsFolder,
+ botchedPageUIClient.shouldInterruptJavaScript_unavailable,
+ botchedPageUIClient.createNewPage,
+ botchedPageUIClient.mouseDidMoveOverElement,
+ botchedPageUIClient.decidePolicyForNotificationPermissionRequest,
+ botchedPageUIClient.unavailablePluginButtonClicked_deprecatedForUseWithV1,
+ botchedPageUIClient.showColorPicker,
+ botchedPageUIClient.hideColorPicker,
+ botchedPageUIClient.unavailablePluginButtonClicked,
+ botchedPageUIClient.pinnedStateDidChange,
+ nullptr,
+ nullptr,
+ nullptr,
+ nullptr,
+ nullptr,
+ nullptr,
+ botchedPageUIClient.runJavaScriptAlert,
+ botchedPageUIClient.runJavaScriptConfirm,
+ botchedPageUIClient.runJavaScriptPrompt,
+ nullptr,
+ };
+
+ WKPageSetPageUIClient(pageRef, &fixedPageUIClient.base);
+}
+#endif
+
+namespace WebKit {
+
+class RunBeforeUnloadConfirmPanelResultListener : public API::ObjectImpl<API::Object::Type::RunBeforeUnloadConfirmPanelResultListener> {
+public:
+ static PassRefPtr<RunBeforeUnloadConfirmPanelResultListener> create(Function<void (bool)>&& completionHandler)
+ {
+ return adoptRef(new RunBeforeUnloadConfirmPanelResultListener(WTFMove(completionHandler)));
+ }
+
+ virtual ~RunBeforeUnloadConfirmPanelResultListener()
+ {
+ }
+
+ void call(bool result)
+ {
+ m_completionHandler(result);
+ }
+
+private:
+ explicit RunBeforeUnloadConfirmPanelResultListener(Function<void (bool)>&& completionHandler)
+ : m_completionHandler(WTFMove(completionHandler))
+ {
+ }
+
+ Function<void (bool)> m_completionHandler;
+};
+
+class RunJavaScriptAlertResultListener : public API::ObjectImpl<API::Object::Type::RunJavaScriptAlertResultListener> {
+public:
+ static PassRefPtr<RunJavaScriptAlertResultListener> create(Function<void ()>&& completionHandler)
+ {
+ return adoptRef(new RunJavaScriptAlertResultListener(WTFMove(completionHandler)));
+ }
+
+ virtual ~RunJavaScriptAlertResultListener()
+ {
+ }
+
+ void call()
+ {
+ m_completionHandler();
+ }
+
+private:
+ explicit RunJavaScriptAlertResultListener(Function<void ()>&& completionHandler)
+ : m_completionHandler(WTFMove(completionHandler))
+ {
+ }
+
+ Function<void ()> m_completionHandler;
+};
+
+class RunJavaScriptConfirmResultListener : public API::ObjectImpl<API::Object::Type::RunJavaScriptConfirmResultListener> {
+public:
+ static PassRefPtr<RunJavaScriptConfirmResultListener> create(Function<void (bool)>&& completionHandler)
+ {
+ return adoptRef(new RunJavaScriptConfirmResultListener(WTFMove(completionHandler)));
+ }
+
+ virtual ~RunJavaScriptConfirmResultListener()
+ {
+ }
+
+ void call(bool result)
+ {
+ m_completionHandler(result);
+ }
+
+private:
+ explicit RunJavaScriptConfirmResultListener(Function<void (bool)>&& completionHandler)
+ : m_completionHandler(WTFMove(completionHandler))
+ {
+ }
+
+ Function<void (bool)> m_completionHandler;
+};
+
+class RunJavaScriptPromptResultListener : public API::ObjectImpl<API::Object::Type::RunJavaScriptPromptResultListener> {
+public:
+ static PassRefPtr<RunJavaScriptPromptResultListener> create(Function<void (const String&)>&& completionHandler)
+ {
+ return adoptRef(new RunJavaScriptPromptResultListener(WTFMove(completionHandler)));
+ }
+
+ virtual ~RunJavaScriptPromptResultListener()
+ {
+ }
+
+ void call(const String& result)
+ {
+ m_completionHandler(result);
+ }
+
+private:
+ explicit RunJavaScriptPromptResultListener(Function<void (const String&)>&& completionHandler)
+ : m_completionHandler(WTFMove(completionHandler))
+ {
+ }
+
+ Function<void (const String&)> m_completionHandler;
+};
+
+WK_ADD_API_MAPPING(WKPageRunBeforeUnloadConfirmPanelResultListenerRef, RunBeforeUnloadConfirmPanelResultListener)
+WK_ADD_API_MAPPING(WKPageRunJavaScriptAlertResultListenerRef, RunJavaScriptAlertResultListener)
+WK_ADD_API_MAPPING(WKPageRunJavaScriptConfirmResultListenerRef, RunJavaScriptConfirmResultListener)
+WK_ADD_API_MAPPING(WKPageRunJavaScriptPromptResultListenerRef, RunJavaScriptPromptResultListener)
+
+}
+
+WKTypeID WKPageRunBeforeUnloadConfirmPanelResultListenerGetTypeID()
+{
+ return toAPI(RunBeforeUnloadConfirmPanelResultListener::APIType);
+}
+
+void WKPageRunBeforeUnloadConfirmPanelResultListenerCall(WKPageRunBeforeUnloadConfirmPanelResultListenerRef listener, bool result)
+{
+ toImpl(listener)->call(result);
+}
+
+WKTypeID WKPageRunJavaScriptAlertResultListenerGetTypeID()
+{
+ return toAPI(RunJavaScriptAlertResultListener::APIType);
+}
+
+void WKPageRunJavaScriptAlertResultListenerCall(WKPageRunJavaScriptAlertResultListenerRef listener)
+{
+ toImpl(listener)->call();
+}
+
+WKTypeID WKPageRunJavaScriptConfirmResultListenerGetTypeID()
+{
+ return toAPI(RunJavaScriptConfirmResultListener::APIType);
+}
+
+void WKPageRunJavaScriptConfirmResultListenerCall(WKPageRunJavaScriptConfirmResultListenerRef listener, bool result)
+{
+ toImpl(listener)->call(result);
+}
+
+WKTypeID WKPageRunJavaScriptPromptResultListenerGetTypeID()
+{
+ return toAPI(RunJavaScriptPromptResultListener::APIType);
+}
+
+void WKPageRunJavaScriptPromptResultListenerCall(WKPageRunJavaScriptPromptResultListenerRef listener, WKStringRef result)
+{
+ toImpl(listener)->call(toWTFString(result));
+}
+
void WKPageSetPageUIClient(WKPageRef pageRef, const WKPageUIClientBase* wkClient)
{
- toImpl(pageRef)->initializeUIClient(wkClient);
+#if PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED <= 101000
+ if (wkClient && wkClient->version == 4) {
+ fixUpBotchedPageUIClient(pageRef, *wkClient);
+ return;
+ }
+#endif
+
+ class UIClient : public API::Client<WKPageUIClientBase>, public API::UIClient {
+ public:
+ explicit UIClient(const WKPageUIClientBase* client)
+ {
+ initialize(client);
+ }
+
+ private:
+ PassRefPtr<WebPageProxy> createNewPage(WebPageProxy* page, WebFrameProxy* initiatingFrame, const SecurityOriginData& securityOriginData, const ResourceRequest& resourceRequest, const WindowFeatures& windowFeatures, const NavigationActionData& navigationActionData) override
+ {
+ if (m_client.createNewPage) {
+ auto configuration = page->configuration().copy();
+ configuration->setRelatedPage(page);
+
+ auto sourceFrameInfo = API::FrameInfo::create(*initiatingFrame, securityOriginData.securityOrigin());
+
+ auto userInitiatedActivity = page->process().userInitiatedActivity(navigationActionData.userGestureTokenIdentifier);
+ bool shouldOpenAppLinks = !hostsAreEqual(WebCore::URL(WebCore::ParsedURLString, initiatingFrame->url()), resourceRequest.url());
+ auto apiNavigationAction = API::NavigationAction::create(navigationActionData, sourceFrameInfo.ptr(), nullptr, resourceRequest, WebCore::URL(), shouldOpenAppLinks, userInitiatedActivity);
+
+ auto apiWindowFeatures = API::WindowFeatures::create(windowFeatures);
+
+ return adoptRef(toImpl(m_client.createNewPage(toAPI(page), toAPI(configuration.ptr()), toAPI(apiNavigationAction.ptr()), toAPI(apiWindowFeatures.ptr()), m_client.base.clientInfo)));
+ }
+
+ if (m_client.createNewPage_deprecatedForUseWithV1 || m_client.createNewPage_deprecatedForUseWithV0) {
+ API::Dictionary::MapType map;
+ if (windowFeatures.x)
+ map.set("x", API::Double::create(*windowFeatures.x));
+ if (windowFeatures.y)
+ map.set("y", API::Double::create(*windowFeatures.y));
+ if (windowFeatures.width)
+ map.set("width", API::Double::create(*windowFeatures.width));
+ if (windowFeatures.height)
+ map.set("height", API::Double::create(*windowFeatures.height));
+ map.set("menuBarVisible", API::Boolean::create(windowFeatures.menuBarVisible));
+ map.set("statusBarVisible", API::Boolean::create(windowFeatures.statusBarVisible));
+ map.set("toolBarVisible", API::Boolean::create(windowFeatures.toolBarVisible));
+ map.set("locationBarVisible", API::Boolean::create(windowFeatures.locationBarVisible));
+ map.set("scrollbarsVisible", API::Boolean::create(windowFeatures.scrollbarsVisible));
+ map.set("resizable", API::Boolean::create(windowFeatures.resizable));
+ map.set("fullscreen", API::Boolean::create(windowFeatures.fullscreen));
+ map.set("dialog", API::Boolean::create(windowFeatures.dialog));
+ Ref<API::Dictionary> featuresMap = API::Dictionary::create(WTFMove(map));
+
+ if (m_client.createNewPage_deprecatedForUseWithV1) {
+ Ref<API::URLRequest> request = API::URLRequest::create(resourceRequest);
+ return adoptRef(toImpl(m_client.createNewPage_deprecatedForUseWithV1(toAPI(page), toAPI(request.ptr()), toAPI(featuresMap.ptr()), toAPI(navigationActionData.modifiers), toAPI(navigationActionData.mouseButton), m_client.base.clientInfo)));
+ }
+
+ ASSERT(m_client.createNewPage_deprecatedForUseWithV0);
+ return adoptRef(toImpl(m_client.createNewPage_deprecatedForUseWithV0(toAPI(page), toAPI(featuresMap.ptr()), toAPI(navigationActionData.modifiers), toAPI(navigationActionData.mouseButton), m_client.base.clientInfo)));
+ }
+
+ return nullptr;
+ }
+
+ void showPage(WebPageProxy* page) override
+ {
+ if (!m_client.showPage)
+ return;
+
+ m_client.showPage(toAPI(page), m_client.base.clientInfo);
+ }
+
+ void fullscreenMayReturnToInline(WebPageProxy* page) override
+ {
+ if (!m_client.fullscreenMayReturnToInline)
+ return;
+
+ m_client.fullscreenMayReturnToInline(toAPI(page), m_client.base.clientInfo);
+ }
+
+ void close(WebPageProxy* page) override
+ {
+ if (!m_client.close)
+ return;
+
+ m_client.close(toAPI(page), m_client.base.clientInfo);
+ }
+
+ void takeFocus(WebPageProxy* page, WKFocusDirection direction) override
+ {
+ if (!m_client.takeFocus)
+ return;
+
+ m_client.takeFocus(toAPI(page), direction, m_client.base.clientInfo);
+ }
+
+ void focus(WebPageProxy* page) override
+ {
+ if (!m_client.focus)
+ return;
+
+ m_client.focus(toAPI(page), m_client.base.clientInfo);
+ }
+
+ void unfocus(WebPageProxy* page) override
+ {
+ if (!m_client.unfocus)
+ return;
+
+ m_client.unfocus(toAPI(page), m_client.base.clientInfo);
+ }
+
+ void runJavaScriptAlert(WebPageProxy* page, const String& message, WebFrameProxy* frame, const SecurityOriginData& securityOriginData, Function<void ()>&& completionHandler) override
+ {
+ if (m_client.runJavaScriptAlert) {
+ RefPtr<RunJavaScriptAlertResultListener> listener = RunJavaScriptAlertResultListener::create(WTFMove(completionHandler));
+ RefPtr<API::SecurityOrigin> securityOrigin = API::SecurityOrigin::create(securityOriginData.protocol, securityOriginData.host, securityOriginData.port);
+ m_client.runJavaScriptAlert(toAPI(page), toAPI(message.impl()), toAPI(frame), toAPI(securityOrigin.get()), toAPI(listener.get()), m_client.base.clientInfo);
+ return;
+ }
+
+ if (m_client.runJavaScriptAlert_deprecatedForUseWithV5) {
+ RefPtr<API::SecurityOrigin> securityOrigin = API::SecurityOrigin::create(securityOriginData.protocol, securityOriginData.host, securityOriginData.port);
+ m_client.runJavaScriptAlert_deprecatedForUseWithV5(toAPI(page), toAPI(message.impl()), toAPI(frame), toAPI(securityOrigin.get()), m_client.base.clientInfo);
+ completionHandler();
+ return;
+ }
+
+ if (m_client.runJavaScriptAlert_deprecatedForUseWithV0) {
+ m_client.runJavaScriptAlert_deprecatedForUseWithV0(toAPI(page), toAPI(message.impl()), toAPI(frame), m_client.base.clientInfo);
+ completionHandler();
+ return;
+ }
+
+
+ completionHandler();
+ }
+
+ void runJavaScriptConfirm(WebPageProxy* page, const String& message, WebFrameProxy* frame, const SecurityOriginData& securityOriginData, Function<void (bool)>&& completionHandler) override
+ {
+ if (m_client.runJavaScriptConfirm) {
+ RefPtr<RunJavaScriptConfirmResultListener> listener = RunJavaScriptConfirmResultListener::create(WTFMove(completionHandler));
+ RefPtr<API::SecurityOrigin> securityOrigin = API::SecurityOrigin::create(securityOriginData.protocol, securityOriginData.host, securityOriginData.port);
+ m_client.runJavaScriptConfirm(toAPI(page), toAPI(message.impl()), toAPI(frame), toAPI(securityOrigin.get()), toAPI(listener.get()), m_client.base.clientInfo);
+ return;
+ }
+
+ if (m_client.runJavaScriptConfirm_deprecatedForUseWithV5) {
+ RefPtr<API::SecurityOrigin> securityOrigin = API::SecurityOrigin::create(securityOriginData.protocol, securityOriginData.host, securityOriginData.port);
+ bool result = m_client.runJavaScriptConfirm_deprecatedForUseWithV5(toAPI(page), toAPI(message.impl()), toAPI(frame), toAPI(securityOrigin.get()), m_client.base.clientInfo);
+
+ completionHandler(result);
+ return;
+ }
+
+ if (m_client.runJavaScriptConfirm_deprecatedForUseWithV0) {
+ bool result = m_client.runJavaScriptConfirm_deprecatedForUseWithV0(toAPI(page), toAPI(message.impl()), toAPI(frame), m_client.base.clientInfo);
+
+ completionHandler(result);
+ return;
+ }
+
+ completionHandler(false);
+ }
+
+ void runJavaScriptPrompt(WebPageProxy* page, const String& message, const String& defaultValue, WebFrameProxy* frame, const SecurityOriginData& securityOriginData, Function<void (const String&)>&& completionHandler) override
+ {
+ if (m_client.runJavaScriptPrompt) {
+ RefPtr<RunJavaScriptPromptResultListener> listener = RunJavaScriptPromptResultListener::create(WTFMove(completionHandler));
+ RefPtr<API::SecurityOrigin> securityOrigin = API::SecurityOrigin::create(securityOriginData.protocol, securityOriginData.host, securityOriginData.port);
+ m_client.runJavaScriptPrompt(toAPI(page), toAPI(message.impl()), toAPI(defaultValue.impl()), toAPI(frame), toAPI(securityOrigin.get()), toAPI(listener.get()), m_client.base.clientInfo);
+ return;
+ }
+
+ if (m_client.runJavaScriptPrompt_deprecatedForUseWithV5) {
+ RefPtr<API::SecurityOrigin> securityOrigin = API::SecurityOrigin::create(securityOriginData.protocol, securityOriginData.host, securityOriginData.port);
+ RefPtr<API::String> string = adoptRef(toImpl(m_client.runJavaScriptPrompt_deprecatedForUseWithV5(toAPI(page), toAPI(message.impl()), toAPI(defaultValue.impl()), toAPI(frame), toAPI(securityOrigin.get()), m_client.base.clientInfo)));
+
+ if (string)
+ completionHandler(string->string());
+ else
+ completionHandler(String());
+ return;
+ }
+
+ if (m_client.runJavaScriptPrompt_deprecatedForUseWithV0) {
+ RefPtr<API::String> string = adoptRef(toImpl(m_client.runJavaScriptPrompt_deprecatedForUseWithV0(toAPI(page), toAPI(message.impl()), toAPI(defaultValue.impl()), toAPI(frame), m_client.base.clientInfo)));
+
+ if (string)
+ completionHandler(string->string());
+ else
+ completionHandler(String());
+ return;
+ }
+
+ completionHandler(String());
+ }
+
+ void setStatusText(WebPageProxy* page, const String& text) override
+ {
+ if (!m_client.setStatusText)
+ return;
+
+ m_client.setStatusText(toAPI(page), toAPI(text.impl()), m_client.base.clientInfo);
+ }
+
+ void mouseDidMoveOverElement(WebPageProxy* page, const WebHitTestResultData& data, WebKit::WebEvent::Modifiers modifiers, API::Object* userData) override
+ {
+ if (!m_client.mouseDidMoveOverElement && !m_client.mouseDidMoveOverElement_deprecatedForUseWithV0)
+ return;
+
+ if (m_client.base.version > 0 && !m_client.mouseDidMoveOverElement)
+ return;
+
+ if (!m_client.base.version) {
+ m_client.mouseDidMoveOverElement_deprecatedForUseWithV0(toAPI(page), toAPI(modifiers), toAPI(userData), m_client.base.clientInfo);
+ return;
+ }
+
+ RefPtr<API::HitTestResult> webHitTestResult = API::HitTestResult::create(data);
+ m_client.mouseDidMoveOverElement(toAPI(page), toAPI(webHitTestResult.get()), toAPI(modifiers), toAPI(userData), m_client.base.clientInfo);
+ }
+
+#if ENABLE(NETSCAPE_PLUGIN_API)
+ void unavailablePluginButtonClicked(WebPageProxy* page, WKPluginUnavailabilityReason pluginUnavailabilityReason, API::Dictionary* pluginInformation) override
+ {
+ if (pluginUnavailabilityReason == kWKPluginUnavailabilityReasonPluginMissing) {
+ if (m_client.missingPluginButtonClicked_deprecatedForUseWithV0)
+ m_client.missingPluginButtonClicked_deprecatedForUseWithV0(
+ toAPI(page),
+ toAPI(pluginInformation->get<API::String>(pluginInformationMIMETypeKey())),
+ toAPI(pluginInformation->get<API::String>(pluginInformationPluginURLKey())),
+ toAPI(pluginInformation->get<API::String>(pluginInformationPluginspageAttributeURLKey())),
+ m_client.base.clientInfo);
+ }
+
+ if (m_client.unavailablePluginButtonClicked_deprecatedForUseWithV1)
+ m_client.unavailablePluginButtonClicked_deprecatedForUseWithV1(
+ toAPI(page),
+ pluginUnavailabilityReason,
+ toAPI(pluginInformation->get<API::String>(pluginInformationMIMETypeKey())),
+ toAPI(pluginInformation->get<API::String>(pluginInformationPluginURLKey())),
+ toAPI(pluginInformation->get<API::String>(pluginInformationPluginspageAttributeURLKey())),
+ m_client.base.clientInfo);
+
+ if (m_client.unavailablePluginButtonClicked)
+ m_client.unavailablePluginButtonClicked(
+ toAPI(page),
+ pluginUnavailabilityReason,
+ toAPI(pluginInformation),
+ m_client.base.clientInfo);
+ }
+#endif // ENABLE(NETSCAPE_PLUGIN_API)
+
+ bool implementsDidNotHandleKeyEvent() const override
+ {
+ return m_client.didNotHandleKeyEvent;
+ }
+
+ void didNotHandleKeyEvent(WebPageProxy* page, const NativeWebKeyboardEvent& event) override
+ {
+ if (!m_client.didNotHandleKeyEvent)
+ return;
+ m_client.didNotHandleKeyEvent(toAPI(page), event.nativeEvent(), m_client.base.clientInfo);
+ }
+
+ bool implementsDidNotHandleWheelEvent() const override
+ {
+ return m_client.didNotHandleWheelEvent;
+ }
+
+ void didNotHandleWheelEvent(WebPageProxy* page, const NativeWebWheelEvent& event) override
+ {
+ if (!m_client.didNotHandleWheelEvent)
+ return;
+ m_client.didNotHandleWheelEvent(toAPI(page), event.nativeEvent(), m_client.base.clientInfo);
+ }
+
+ bool toolbarsAreVisible(WebPageProxy* page) override
+ {
+ if (!m_client.toolbarsAreVisible)
+ return true;
+ return m_client.toolbarsAreVisible(toAPI(page), m_client.base.clientInfo);
+ }
+
+ void setToolbarsAreVisible(WebPageProxy* page, bool visible) override
+ {
+ if (!m_client.setToolbarsAreVisible)
+ return;
+ m_client.setToolbarsAreVisible(toAPI(page), visible, m_client.base.clientInfo);
+ }
+
+ bool menuBarIsVisible(WebPageProxy* page) override
+ {
+ if (!m_client.menuBarIsVisible)
+ return true;
+ return m_client.menuBarIsVisible(toAPI(page), m_client.base.clientInfo);
+ }
+
+ void setMenuBarIsVisible(WebPageProxy* page, bool visible) override
+ {
+ if (!m_client.setMenuBarIsVisible)
+ return;
+ m_client.setMenuBarIsVisible(toAPI(page), visible, m_client.base.clientInfo);
+ }
+
+ bool statusBarIsVisible(WebPageProxy* page) override
+ {
+ if (!m_client.statusBarIsVisible)
+ return true;
+ return m_client.statusBarIsVisible(toAPI(page), m_client.base.clientInfo);
+ }
+
+ void setStatusBarIsVisible(WebPageProxy* page, bool visible) override
+ {
+ if (!m_client.setStatusBarIsVisible)
+ return;
+ m_client.setStatusBarIsVisible(toAPI(page), visible, m_client.base.clientInfo);
+ }
+
+ bool isResizable(WebPageProxy* page) override
+ {
+ if (!m_client.isResizable)
+ return true;
+ return m_client.isResizable(toAPI(page), m_client.base.clientInfo);
+ }
+
+ void setIsResizable(WebPageProxy* page, bool resizable) override
+ {
+ if (!m_client.setIsResizable)
+ return;
+ m_client.setIsResizable(toAPI(page), resizable, m_client.base.clientInfo);
+ }
+
+ void setWindowFrame(WebPageProxy* page, const FloatRect& frame) override
+ {
+ if (!m_client.setWindowFrame)
+ return;
+
+ m_client.setWindowFrame(toAPI(page), toAPI(frame), m_client.base.clientInfo);
+ }
+
+ FloatRect windowFrame(WebPageProxy* page) override
+ {
+ if (!m_client.getWindowFrame)
+ return FloatRect();
+
+ return toFloatRect(m_client.getWindowFrame(toAPI(page), m_client.base.clientInfo));
+ }
+
+ bool canRunBeforeUnloadConfirmPanel() const override
+ {
+ return m_client.runBeforeUnloadConfirmPanel_deprecatedForUseWithV6 || m_client.runBeforeUnloadConfirmPanel;
+ }
+
+ void runBeforeUnloadConfirmPanel(WebKit::WebPageProxy* page, const WTF::String& message, WebKit::WebFrameProxy* frame, Function<void (bool)>&& completionHandler) override
+ {
+ if (m_client.runBeforeUnloadConfirmPanel) {
+ RefPtr<RunBeforeUnloadConfirmPanelResultListener> listener = RunBeforeUnloadConfirmPanelResultListener::create(WTFMove(completionHandler));
+ m_client.runBeforeUnloadConfirmPanel(toAPI(page), toAPI(message.impl()), toAPI(frame), toAPI(listener.get()), m_client.base.clientInfo);
+ return;
+ }
+
+ if (m_client.runBeforeUnloadConfirmPanel_deprecatedForUseWithV6) {
+ bool result = m_client.runBeforeUnloadConfirmPanel_deprecatedForUseWithV6(toAPI(page), toAPI(message.impl()), toAPI(frame), m_client.base.clientInfo);
+ completionHandler(result);
+ return;
+ }
+
+ completionHandler(true);
+ }
+
+ void pageDidScroll(WebPageProxy* page) override
+ {
+ if (!m_client.pageDidScroll)
+ return;
+
+ m_client.pageDidScroll(toAPI(page), m_client.base.clientInfo);
+ }
+
+ void exceededDatabaseQuota(WebPageProxy* page, WebFrameProxy* frame, API::SecurityOrigin* origin, const String& databaseName, const String& databaseDisplayName, unsigned long long currentQuota, unsigned long long currentOriginUsage, unsigned long long currentDatabaseUsage, unsigned long long expectedUsage, Function<void (unsigned long long)>&& completionHandler) override
+ {
+ if (!m_client.exceededDatabaseQuota) {
+ completionHandler(currentQuota);
+ return;
+ }
+
+ completionHandler(m_client.exceededDatabaseQuota(toAPI(page), toAPI(frame), toAPI(origin), toAPI(databaseName.impl()), toAPI(databaseDisplayName.impl()), currentQuota, currentOriginUsage, currentDatabaseUsage, expectedUsage, m_client.base.clientInfo));
+ }
+
+ bool runOpenPanel(WebPageProxy* page, WebFrameProxy* frame, const WebCore::SecurityOriginData&, API::OpenPanelParameters* parameters, WebOpenPanelResultListenerProxy* listener) override
+ {
+ if (!m_client.runOpenPanel)
+ return false;
+
+ m_client.runOpenPanel(toAPI(page), toAPI(frame), toAPI(parameters), toAPI(listener), m_client.base.clientInfo);
+ return true;
+ }
+
+ bool decidePolicyForGeolocationPermissionRequest(WebPageProxy* page, WebFrameProxy* frame, API::SecurityOrigin* origin, GeolocationPermissionRequestProxy* permissionRequest) override
+ {
+ if (!m_client.decidePolicyForGeolocationPermissionRequest)
+ return false;
+
+ m_client.decidePolicyForGeolocationPermissionRequest(toAPI(page), toAPI(frame), toAPI(origin), toAPI(permissionRequest), m_client.base.clientInfo);
+ return true;
+ }
+
+ bool decidePolicyForUserMediaPermissionRequest(WebPageProxy& page, WebFrameProxy& frame, API::SecurityOrigin& userMediaDocumentOrigin, API::SecurityOrigin& topLevelDocumentOrigin, UserMediaPermissionRequestProxy& permissionRequest) override
+ {
+ if (!m_client.decidePolicyForUserMediaPermissionRequest)
+ return false;
+
+ m_client.decidePolicyForUserMediaPermissionRequest(toAPI(&page), toAPI(&frame), toAPI(&userMediaDocumentOrigin), toAPI(&topLevelDocumentOrigin), toAPI(&permissionRequest), m_client.base.clientInfo);
+ return true;
+ }
+
+ bool checkUserMediaPermissionForOrigin(WebPageProxy& page, WebFrameProxy& frame, API::SecurityOrigin& userMediaDocumentOrigin, API::SecurityOrigin& topLevelDocumentOrigin, UserMediaPermissionCheckProxy& request) override
+ {
+ if (!m_client.checkUserMediaPermissionForOrigin)
+ return false;
+
+ m_client.checkUserMediaPermissionForOrigin(toAPI(&page), toAPI(&frame), toAPI(&userMediaDocumentOrigin), toAPI(&topLevelDocumentOrigin), toAPI(&request), m_client.base.clientInfo);
+ return true;
+ }
+
+ bool decidePolicyForNotificationPermissionRequest(WebPageProxy* page, API::SecurityOrigin* origin, NotificationPermissionRequest* permissionRequest) override
+ {
+ if (!m_client.decidePolicyForNotificationPermissionRequest)
+ return false;
+
+ m_client.decidePolicyForNotificationPermissionRequest(toAPI(page), toAPI(origin), toAPI(permissionRequest), m_client.base.clientInfo);
+ return true;
+ }
+
+ // Printing.
+ float headerHeight(WebPageProxy* page, WebFrameProxy* frame) override
+ {
+ if (!m_client.headerHeight)
+ return 0;
+
+ return m_client.headerHeight(toAPI(page), toAPI(frame), m_client.base.clientInfo);
+ }
+
+ float footerHeight(WebPageProxy* page, WebFrameProxy* frame) override
+ {
+ if (!m_client.footerHeight)
+ return 0;
+
+ return m_client.footerHeight(toAPI(page), toAPI(frame), m_client.base.clientInfo);
+ }
+
+ void drawHeader(WebPageProxy* page, WebFrameProxy* frame, const WebCore::FloatRect& rect) override
+ {
+ if (!m_client.drawHeader)
+ return;
+
+ m_client.drawHeader(toAPI(page), toAPI(frame), toAPI(rect), m_client.base.clientInfo);
+ }
+
+ void drawFooter(WebPageProxy* page, WebFrameProxy* frame, const WebCore::FloatRect& rect) override
+ {
+ if (!m_client.drawFooter)
+ return;
+
+ m_client.drawFooter(toAPI(page), toAPI(frame), toAPI(rect), m_client.base.clientInfo);
+ }
+
+ void printFrame(WebPageProxy* page, WebFrameProxy* frame) override
+ {
+ if (!m_client.printFrame)
+ return;
+
+ m_client.printFrame(toAPI(page), toAPI(frame), m_client.base.clientInfo);
+ }
+
+ bool canRunModal() const override
+ {
+ return m_client.runModal;
+ }
+
+ void runModal(WebPageProxy* page) override
+ {
+ if (!m_client.runModal)
+ return;
+
+ m_client.runModal(toAPI(page), m_client.base.clientInfo);
+ }
+
+ void saveDataToFileInDownloadsFolder(WebPageProxy* page, const String& suggestedFilename, const String& mimeType, const String& originatingURLString, API::Data* data) override
+ {
+ if (!m_client.saveDataToFileInDownloadsFolder)
+ return;
+
+ m_client.saveDataToFileInDownloadsFolder(toAPI(page), toAPI(suggestedFilename.impl()), toAPI(mimeType.impl()), toURLRef(originatingURLString.impl()), toAPI(data), m_client.base.clientInfo);
+ }
+
+ void pinnedStateDidChange(WebPageProxy& page) override
+ {
+ if (!m_client.pinnedStateDidChange)
+ return;
+
+ m_client.pinnedStateDidChange(toAPI(&page), m_client.base.clientInfo);
+ }
+
+ void isPlayingAudioDidChange(WebPageProxy& page) override
+ {
+ if (!m_client.isPlayingAudioDidChange)
+ return;
+
+ m_client.isPlayingAudioDidChange(toAPI(&page), m_client.base.clientInfo);
+ }
+
+ void didClickAutoFillButton(WebPageProxy& page, API::Object* userInfo) override
+ {
+ if (!m_client.didClickAutoFillButton)
+ return;
+
+ m_client.didClickAutoFillButton(toAPI(&page), toAPI(userInfo), m_client.base.clientInfo);
+ }
+
+#if ENABLE(MEDIA_SESSION)
+ void mediaSessionMetadataDidChange(WebPageProxy& page, WebMediaSessionMetadata* metadata) override
+ {
+ if (!m_client.mediaSessionMetadataDidChange)
+ return;
+
+ m_client.mediaSessionMetadataDidChange(toAPI(&page), toAPI(metadata), m_client.base.clientInfo);
+ }
+#endif
+#if ENABLE(POINTER_LOCK)
+ void requestPointerLock(WebPageProxy* page) override
+ {
+ if (!m_client.requestPointerLock)
+ return;
+
+ m_client.requestPointerLock(toAPI(page), m_client.base.clientInfo);
+ }
+
+ void didLosePointerLock(WebPageProxy* page) override
+ {
+ if (!m_client.didLosePointerLock)
+ return;
+
+ m_client.didLosePointerLock(toAPI(page), m_client.base.clientInfo);
+ }
+#endif
+
+ void didPlayMediaPreventedFromPlayingWithoutUserGesture(WebPageProxy& page) override
+ {
+ if (!m_client.didPlayMediaPreventedFromPlayingWithoutUserGesture)
+ return;
+
+ m_client.didPlayMediaPreventedFromPlayingWithoutUserGesture(toAPI(&page), m_client.base.clientInfo);
+ }
+ };
+
+ toImpl(pageRef)->setUIClient(std::make_unique<UIClient>(wkClient));
}
-void WKPageSetSession(WKPageRef pageRef, WKSessionRef session)
+void WKPageSetPageNavigationClient(WKPageRef pageRef, const WKPageNavigationClientBase* wkClient)
{
- toImpl(pageRef)->setSession(*toImpl(session));
+ class NavigationClient : public API::Client<WKPageNavigationClientBase>, public API::NavigationClient {
+ public:
+ explicit NavigationClient(const WKPageNavigationClientBase* client)
+ {
+ initialize(client);
+ }
+
+ private:
+ void decidePolicyForNavigationAction(WebPageProxy& page, API::NavigationAction& navigationAction, Ref<WebKit::WebFramePolicyListenerProxy>&& listener, API::Object* userData) override
+ {
+ if (!m_client.decidePolicyForNavigationAction)
+ return;
+ m_client.decidePolicyForNavigationAction(toAPI(&page), toAPI(&navigationAction), toAPI(listener.ptr()), toAPI(userData), m_client.base.clientInfo);
+ }
+
+ void decidePolicyForNavigationResponse(WebPageProxy& page, API::NavigationResponse& navigationResponse, Ref<WebKit::WebFramePolicyListenerProxy>&& listener, API::Object* userData) override
+ {
+ if (!m_client.decidePolicyForNavigationResponse)
+ return;
+ m_client.decidePolicyForNavigationResponse(toAPI(&page), toAPI(&navigationResponse), toAPI(listener.ptr()), toAPI(userData), m_client.base.clientInfo);
+ }
+
+ void didStartProvisionalNavigation(WebPageProxy& page, API::Navigation* navigation, API::Object* userData) override
+ {
+ if (!m_client.didStartProvisionalNavigation)
+ return;
+ m_client.didStartProvisionalNavigation(toAPI(&page), toAPI(navigation), toAPI(userData), m_client.base.clientInfo);
+ }
+
+ void didReceiveServerRedirectForProvisionalNavigation(WebPageProxy& page, API::Navigation* navigation, API::Object* userData) override
+ {
+ if (!m_client.didReceiveServerRedirectForProvisionalNavigation)
+ return;
+ m_client.didReceiveServerRedirectForProvisionalNavigation(toAPI(&page), toAPI(navigation), toAPI(userData), m_client.base.clientInfo);
+ }
+
+ void didFailProvisionalNavigationWithError(WebPageProxy& page, WebFrameProxy&, API::Navigation* navigation, const WebCore::ResourceError& error, API::Object* userData) override
+ {
+ if (!m_client.didFailProvisionalNavigation)
+ return;
+ m_client.didFailProvisionalNavigation(toAPI(&page), toAPI(navigation), toAPI(error), toAPI(userData), m_client.base.clientInfo);
+ }
+
+ void didCommitNavigation(WebPageProxy& page, API::Navigation* navigation, API::Object* userData) override
+ {
+ if (!m_client.didCommitNavigation)
+ return;
+ m_client.didCommitNavigation(toAPI(&page), toAPI(navigation), toAPI(userData), m_client.base.clientInfo);
+ }
+
+ void didFinishNavigation(WebPageProxy& page, API::Navigation* navigation, API::Object* userData) override
+ {
+ if (!m_client.didFinishNavigation)
+ return;
+ m_client.didFinishNavigation(toAPI(&page), toAPI(navigation), toAPI(userData), m_client.base.clientInfo);
+ }
+
+ void didFailNavigationWithError(WebPageProxy& page, WebFrameProxy&, API::Navigation* navigation, const WebCore::ResourceError& error, API::Object* userData) override
+ {
+ if (!m_client.didFailNavigation)
+ return;
+ m_client.didFailNavigation(toAPI(&page), toAPI(navigation), toAPI(error), toAPI(userData), m_client.base.clientInfo);
+ }
+
+ void didFailProvisionalLoadInSubframeWithError(WebPageProxy& page, WebFrameProxy& subframe, const WebCore::SecurityOriginData& securityOriginData, API::Navigation* navigation, const WebCore::ResourceError& error, API::Object* userData) override
+ {
+ if (!m_client.didFailProvisionalLoadInSubframe)
+ return;
+ m_client.didFailProvisionalLoadInSubframe(toAPI(&page), toAPI(navigation), toAPI(API::FrameInfo::create(subframe, securityOriginData.securityOrigin()).ptr()), toAPI(error), toAPI(userData), m_client.base.clientInfo);
+ }
+
+ void didFinishDocumentLoad(WebPageProxy& page, API::Navigation* navigation, API::Object* userData) override
+ {
+ if (!m_client.didFinishDocumentLoad)
+ return;
+ m_client.didFinishDocumentLoad(toAPI(&page), toAPI(navigation), toAPI(userData), m_client.base.clientInfo);
+ }
+
+ void didSameDocumentNavigation(WebPageProxy& page, API::Navigation* navigation, WebKit::SameDocumentNavigationType navigationType, API::Object* userData) override
+ {
+ if (!m_client.didSameDocumentNavigation)
+ return;
+ m_client.didSameDocumentNavigation(toAPI(&page), toAPI(navigation), toAPI(navigationType), toAPI(userData), m_client.base.clientInfo);
+ }
+
+ void renderingProgressDidChange(WebPageProxy& page, WebCore::LayoutMilestones milestones) override
+ {
+ if (!m_client.renderingProgressDidChange)
+ return;
+ m_client.renderingProgressDidChange(toAPI(&page), pageRenderingProgressEvents(milestones), nullptr, m_client.base.clientInfo);
+ }
+
+ bool canAuthenticateAgainstProtectionSpace(WebPageProxy& page, WebProtectionSpace* protectionSpace) override
+ {
+ if (!m_client.canAuthenticateAgainstProtectionSpace)
+ return false;
+ return m_client.canAuthenticateAgainstProtectionSpace(toAPI(&page), toAPI(protectionSpace), m_client.base.clientInfo);
+ }
+
+ void didReceiveAuthenticationChallenge(WebPageProxy& page, AuthenticationChallengeProxy* authenticationChallenge) override
+ {
+ if (!m_client.didReceiveAuthenticationChallenge)
+ return;
+ m_client.didReceiveAuthenticationChallenge(toAPI(&page), toAPI(authenticationChallenge), m_client.base.clientInfo);
+ }
+
+ void processDidCrash(WebPageProxy& page) override
+ {
+ if (!m_client.webProcessDidCrash)
+ return;
+ m_client.webProcessDidCrash(toAPI(&page), m_client.base.clientInfo);
+ }
+
+ RefPtr<API::Data> webCryptoMasterKey(WebPageProxy& page) override
+ {
+ if (m_client.copyWebCryptoMasterKey)
+ return adoptRef(toImpl(m_client.copyWebCryptoMasterKey(toAPI(&page), m_client.base.clientInfo)));
+
+ Vector<uint8_t> masterKey;
+#if ENABLE(SUBTLE_CRYPTO)
+ if (!getDefaultWebCryptoMasterKey(masterKey))
+ return nullptr;
+#endif
+
+ return API::Data::create(masterKey.data(), masterKey.size());
+ }
+
+ void didBeginNavigationGesture(WebPageProxy& page) override
+ {
+ if (!m_client.didBeginNavigationGesture)
+ return;
+ m_client.didBeginNavigationGesture(toAPI(&page), m_client.base.clientInfo);
+ }
+
+ void didEndNavigationGesture(WebPageProxy& page, bool willNavigate, WebKit::WebBackForwardListItem& item) override
+ {
+ if (!m_client.didEndNavigationGesture)
+ return;
+ m_client.didEndNavigationGesture(toAPI(&page), willNavigate ? toAPI(&item) : nullptr, m_client.base.clientInfo);
+ }
+
+ void willEndNavigationGesture(WebPageProxy& page, bool willNavigate, WebKit::WebBackForwardListItem& item) override
+ {
+ if (!m_client.willEndNavigationGesture)
+ return;
+ m_client.willEndNavigationGesture(toAPI(&page), willNavigate ? toAPI(&item) : nullptr, m_client.base.clientInfo);
+ }
+
+ void didRemoveNavigationGestureSnapshot(WebPageProxy& page) override
+ {
+ if (!m_client.didRemoveNavigationGestureSnapshot)
+ return;
+ m_client.didRemoveNavigationGestureSnapshot(toAPI(&page), m_client.base.clientInfo);
+ }
+
+#if ENABLE(NETSCAPE_PLUGIN_API)
+ PluginModuleLoadPolicy decidePolicyForPluginLoad(WebPageProxy& page, PluginModuleLoadPolicy currentPluginLoadPolicy, API::Dictionary* pluginInformation, String& unavailabilityDescription) override
+ {
+ WKStringRef unavailabilityDescriptionOut = 0;
+ PluginModuleLoadPolicy loadPolicy = currentPluginLoadPolicy;
+
+ if (m_client.decidePolicyForPluginLoad)
+ loadPolicy = toPluginModuleLoadPolicy(m_client.decidePolicyForPluginLoad(toAPI(&page), toWKPluginLoadPolicy(currentPluginLoadPolicy), toAPI(pluginInformation), &unavailabilityDescriptionOut, m_client.base.clientInfo));
+
+ if (unavailabilityDescriptionOut) {
+ RefPtr<API::String> webUnavailabilityDescription = adoptRef(toImpl(unavailabilityDescriptionOut));
+ unavailabilityDescription = webUnavailabilityDescription->string();
+ }
+
+ return loadPolicy;
+ }
+#endif
+ };
+
+ WebPageProxy* webPageProxy = toImpl(pageRef);
+
+ auto navigationClient = std::make_unique<NavigationClient>(wkClient);
+ webPageProxy->setNavigationClient(WTFMove(navigationClient));
}
void WKPageRunJavaScriptInMainFrame(WKPageRef pageRef, WKStringRef scriptRef, void* context, WKPageRunJavaScriptFunction callback)
{
- toImpl(pageRef)->runJavaScriptInMainFrame(toImpl(scriptRef)->string(), ScriptValueCallback::create(context, callback));
+ toImpl(pageRef)->runJavaScriptInMainFrame(toImpl(scriptRef)->string(), [context, callback](API::SerializedScriptValue* returnValue, bool, const WebCore::ExceptionDetails&, CallbackBase::Error error) {
+ callback(toAPI(returnValue), (error != CallbackBase::Error::None) ? toAPI(API::Error::create().ptr()) : 0, context);
+ });
}
#ifdef __BLOCKS__
@@ -1080,33 +2457,56 @@ void WKPageRunJavaScriptInMainFrame_b(WKPageRef pageRef, WKStringRef scriptRef,
}
#endif
+static std::function<void (const String&, WebKit::CallbackBase::Error)> toGenericCallbackFunction(void* context, void (*callback)(WKStringRef, WKErrorRef, void*))
+{
+ return [context, callback](const String& returnValue, WebKit::CallbackBase::Error error) {
+ callback(toAPI(API::String::create(returnValue).ptr()), error != WebKit::CallbackBase::Error::None ? toAPI(API::Error::create().ptr()) : 0, context);
+ };
+}
+
void WKPageRenderTreeExternalRepresentation(WKPageRef pageRef, void* context, WKPageRenderTreeExternalRepresentationFunction callback)
{
- toImpl(pageRef)->getRenderTreeExternalRepresentation(StringCallback::create(context, callback));
+ toImpl(pageRef)->getRenderTreeExternalRepresentation(toGenericCallbackFunction(context, callback));
}
void WKPageGetSourceForFrame(WKPageRef pageRef, WKFrameRef frameRef, void* context, WKPageGetSourceForFrameFunction callback)
{
- toImpl(pageRef)->getSourceForFrame(toImpl(frameRef), StringCallback::create(context, callback));
+ toImpl(pageRef)->getSourceForFrame(toImpl(frameRef), toGenericCallbackFunction(context, callback));
}
void WKPageGetContentsAsString(WKPageRef pageRef, void* context, WKPageGetContentsAsStringFunction callback)
{
- toImpl(pageRef)->getContentsAsString(StringCallback::create(context, callback));
+ toImpl(pageRef)->getContentsAsString(toGenericCallbackFunction(context, callback));
+}
+
+void WKPageGetBytecodeProfile(WKPageRef pageRef, void* context, WKPageGetBytecodeProfileFunction callback)
+{
+ toImpl(pageRef)->getBytecodeProfile(toGenericCallbackFunction(context, callback));
+}
+
+void WKPageGetSamplingProfilerOutput(WKPageRef pageRef, void* context, WKPageGetSamplingProfilerOutputFunction callback)
+{
+ toImpl(pageRef)->getSamplingProfilerOutput(toGenericCallbackFunction(context, callback));
+}
+
+void WKPageIsWebProcessResponsive(WKPageRef pageRef, void* context, WKPageIsWebProcessResponsiveFunction callback)
+{
+ toImpl(pageRef)->isWebProcessResponsive([context, callback](bool isWebProcessResponsive) {
+ callback(isWebProcessResponsive, context);
+ });
}
void WKPageGetSelectionAsWebArchiveData(WKPageRef pageRef, void* context, WKPageGetSelectionAsWebArchiveDataFunction callback)
{
- toImpl(pageRef)->getSelectionAsWebArchiveData(DataCallback::create(context, callback));
+ toImpl(pageRef)->getSelectionAsWebArchiveData(toGenericCallbackFunction(context, callback));
}
-void WKPageGetContentsAsMHTMLData(WKPageRef pageRef, bool useBinaryEncoding, void* context, WKPageGetContentsAsMHTMLDataFunction callback)
+void WKPageGetContentsAsMHTMLData(WKPageRef pageRef, void* context, WKPageGetContentsAsMHTMLDataFunction callback)
{
#if ENABLE(MHTML)
- toImpl(pageRef)->getContentsAsMHTMLData(DataCallback::create(context, callback), useBinaryEncoding);
+ toImpl(pageRef)->getContentsAsMHTMLData(toGenericCallbackFunction(context, callback));
#else
UNUSED_PARAM(pageRef);
- UNUSED_PARAM(useBinaryEncoding);
UNUSED_PARAM(context);
UNUSED_PARAM(callback);
#endif
@@ -1114,7 +2514,9 @@ void WKPageGetContentsAsMHTMLData(WKPageRef pageRef, bool useBinaryEncoding, voi
void WKPageForceRepaint(WKPageRef pageRef, void* context, WKPageForceRepaintFunction callback)
{
- toImpl(pageRef)->forceRepaint(VoidCallback::create(context, callback));
+ toImpl(pageRef)->forceRepaint(VoidCallback::create([context, callback](WebKit::CallbackBase::Error error) {
+ callback(error == WebKit::CallbackBase::Error::None ? nullptr : toAPI(API::Error::create().ptr()), context);
+ }));
}
WK_EXPORT WKURLRef WKPageCopyPendingAPIRequestURL(WKPageRef pageRef)
@@ -1149,7 +2551,9 @@ WKStringRef WKPageCopyStandardUserAgentWithApplicationName(WKStringRef applicati
void WKPageValidateCommand(WKPageRef pageRef, WKStringRef command, void* context, WKPageValidateCommandCallback callback)
{
- toImpl(pageRef)->validateCommand(toImpl(command)->string(), ValidateCommandCallback::create(context, callback));
+ toImpl(pageRef)->validateCommand(toImpl(command)->string(), [context, callback](const String& commandName, bool isEnabled, int32_t state, WebKit::CallbackBase::Error error) {
+ callback(toAPI(API::String::create(commandName).ptr()), isEnabled, state, error != WebKit::CallbackBase::Error::None ? toAPI(API::Error::create().ptr()) : 0, context);
+ });
}
void WKPageExecuteCommand(WKPageRef pageRef, WKStringRef command)
@@ -1157,26 +2561,7 @@ void WKPageExecuteCommand(WKPageRef pageRef, WKStringRef command)
toImpl(pageRef)->executeEditCommand(toImpl(command)->string());
}
-#if PLATFORM(MAC)
-struct ComputedPagesContext {
- ComputedPagesContext(WKPageComputePagesForPrintingFunction callback, void* context)
- : callback(callback)
- , context(context)
- {
- }
- WKPageComputePagesForPrintingFunction callback;
- void* context;
-};
-
-static void computedPagesCallback(const Vector<WebCore::IntRect>& rects, double scaleFactor, WKErrorRef error, void* untypedContext)
-{
- OwnPtr<ComputedPagesContext> context = adoptPtr(static_cast<ComputedPagesContext*>(untypedContext));
- Vector<WKRect> wkRects(rects.size());
- for (size_t i = 0; i < rects.size(); ++i)
- wkRects[i] = toAPI(rects[i]);
- context->callback(wkRects.data(), wkRects.size(), scaleFactor, error, context->context);
-}
-
+#if PLATFORM(COCOA)
static PrintInfo printInfoFromWKPrintInfo(const WKPrintInfo& printInfo)
{
PrintInfo result;
@@ -1188,7 +2573,12 @@ static PrintInfo printInfoFromWKPrintInfo(const WKPrintInfo& printInfo)
void WKPageComputePagesForPrinting(WKPageRef page, WKFrameRef frame, WKPrintInfo printInfo, WKPageComputePagesForPrintingFunction callback, void* context)
{
- toImpl(page)->computePagesForPrinting(toImpl(frame), printInfoFromWKPrintInfo(printInfo), ComputedPagesCallback::create(new ComputedPagesContext(callback, context), computedPagesCallback));
+ toImpl(page)->computePagesForPrinting(toImpl(frame), printInfoFromWKPrintInfo(printInfo), ComputedPagesCallback::create([context, callback](const Vector<WebCore::IntRect>& rects, double scaleFactor, WebKit::CallbackBase::Error error) {
+ Vector<WKRect> wkRects(rects.size());
+ for (size_t i = 0; i < rects.size(); ++i)
+ wkRects[i] = toAPI(rects[i]);
+ callback(wkRects.data(), wkRects.size(), scaleFactor, error != WebKit::CallbackBase::Error::None ? toAPI(API::Error::create().ptr()) : 0, context);
+ }));
}
void WKPageBeginPrinting(WKPageRef page, WKFrameRef frame, WKPrintInfo printInfo)
@@ -1198,7 +2588,7 @@ void WKPageBeginPrinting(WKPageRef page, WKFrameRef frame, WKPrintInfo printInfo
void WKPageDrawPagesToPDF(WKPageRef page, WKFrameRef frame, WKPrintInfo printInfo, uint32_t first, uint32_t count, WKPageDrawToPDFFunction callback, void* context)
{
- toImpl(page)->drawPagesToPDF(toImpl(frame), printInfoFromWKPrintInfo(printInfo), first, count, DataCallback::create(context, callback));
+ toImpl(page)->drawPagesToPDF(toImpl(frame), printInfoFromWKPrintInfo(printInfo), first, count, DataCallback::create(toGenericCallbackFunction(context, callback)));
}
void WKPageEndPrinting(WKPageRef page)
@@ -1207,14 +2597,34 @@ void WKPageEndPrinting(WKPageRef page)
}
#endif
-WKImageRef WKPageCreateSnapshotOfVisibleContent(WKPageRef)
+bool WKPageGetIsControlledByAutomation(WKPageRef page)
{
- return 0;
+ return toImpl(page)->isControlledByAutomation();
+}
+
+void WKPageSetControlledByAutomation(WKPageRef page, bool controlled)
+{
+ toImpl(page)->setControlledByAutomation(controlled);
}
-void WKPageSetShouldSendEventsSynchronously(WKPageRef page, bool sync)
+bool WKPageGetAllowsRemoteInspection(WKPageRef page)
{
- toImpl(page)->setShouldSendEventsSynchronously(sync);
+#if ENABLE(REMOTE_INSPECTOR)
+ return toImpl(page)->allowsRemoteInspection();
+#else
+ UNUSED_PARAM(page);
+ return false;
+#endif
+}
+
+void WKPageSetAllowsRemoteInspection(WKPageRef page, bool allow)
+{
+#if ENABLE(REMOTE_INSPECTOR)
+ toImpl(page)->setAllowsRemoteInspection(allow);
+#else
+ UNUSED_PARAM(page);
+ UNUSED_PARAM(allow);
+#endif
}
void WKPageSetMediaVolume(WKPageRef page, float volume)
@@ -1222,6 +2632,75 @@ void WKPageSetMediaVolume(WKPageRef page, float volume)
toImpl(page)->setMediaVolume(volume);
}
+void WKPageSetMuted(WKPageRef page, WKMediaMutedState muted)
+{
+ toImpl(page)->setMuted(muted);
+}
+
+void WKPageDidAllowPointerLock(WKPageRef page)
+{
+#if ENABLE(POINTER_LOCK)
+ toImpl(page)->didAllowPointerLock();
+#else
+ UNUSED_PARAM(page);
+#endif
+}
+
+void WKPageClearUserMediaState(WKPageRef page)
+{
+#if ENABLE(MEDIA_STREAM)
+ toImpl(page)->clearUserMediaState();
+#else
+ UNUSED_PARAM(page);
+#endif
+}
+
+void WKPageDidDenyPointerLock(WKPageRef page)
+{
+#if ENABLE(POINTER_LOCK)
+ toImpl(page)->didDenyPointerLock();
+#else
+ UNUSED_PARAM(page);
+#endif
+}
+
+bool WKPageHasMediaSessionWithActiveMediaElements(WKPageRef page)
+{
+#if ENABLE(MEDIA_SESSION)
+ return toImpl(page)->hasMediaSessionWithActiveMediaElements();
+#else
+ UNUSED_PARAM(page);
+ return false;
+#endif
+}
+
+void WKPageHandleMediaEvent(WKPageRef page, WKMediaEventType wkEventType)
+{
+#if ENABLE(MEDIA_SESSION)
+ MediaEventType eventType;
+
+ switch (wkEventType) {
+ case kWKMediaEventTypePlayPause:
+ eventType = MediaEventType::PlayPause;
+ break;
+ case kWKMediaEventTypeTrackNext:
+ eventType = MediaEventType::TrackNext;
+ break;
+ case kWKMediaEventTypeTrackPrevious:
+ eventType = MediaEventType::TrackPrevious;
+ break;
+ default:
+ ASSERT_NOT_REACHED();
+ return;
+ }
+
+ toImpl(page)->handleMediaEvent(eventType);
+#else
+ UNUSED_PARAM(page);
+ UNUSED_PARAM(wkEventType);
+#endif
+}
+
void WKPagePostMessageToInjectedBundle(WKPageRef pageRef, WKStringRef messageNameRef, WKTypeRef messageBodyRef)
{
toImpl(pageRef)->postMessageToInjectedBundle(toImpl(messageNameRef)->string(), toImpl(messageBodyRef));
@@ -1229,7 +2708,24 @@ void WKPagePostMessageToInjectedBundle(WKPageRef pageRef, WKStringRef messageNam
WKArrayRef WKPageCopyRelatedPages(WKPageRef pageRef)
{
- return toAPI(toImpl(pageRef)->relatedPages().leakRef());
+ Vector<RefPtr<API::Object>> relatedPages;
+
+ for (auto& page : toImpl(pageRef)->process().pages()) {
+ if (page != toImpl(pageRef))
+ relatedPages.append(page);
+ }
+
+ return toAPI(&API::Array::create(WTFMove(relatedPages)).leakRef());
+}
+
+WKFrameRef WKPageLookUpFrameFromHandle(WKPageRef pageRef, WKFrameHandleRef handleRef)
+{
+ auto page = toImpl(pageRef);
+ auto frame = page->process().webFrame(toImpl(handleRef)->frameID());
+ if (!frame || frame->page() != page)
+ return nullptr;
+
+ return toAPI(frame);
}
void WKPageSetMayStartMediaWhenInWindow(WKPageRef pageRef, bool mayStartMedia)
@@ -1241,7 +2737,7 @@ void WKPageSetMayStartMediaWhenInWindow(WKPageRef pageRef, bool mayStartMedia)
void WKPageSelectContextMenuItem(WKPageRef page, WKContextMenuItemRef item)
{
#if ENABLE(CONTEXT_MENUS)
- toImpl(page)->contextMenuItemSelected(*(toImpl(item)->data()));
+ toImpl(page)->contextMenuItemSelected((toImpl(item)->data()));
#else
UNUSED_PARAM(page);
UNUSED_PARAM(item);
@@ -1286,9 +2782,70 @@ void WKPageSetScrollPinningBehavior(WKPageRef page, WKScrollPinningBehavior pinn
toImpl(page)->setScrollPinningBehavior(corePinning);
}
-void WKPageSetInvalidMessageFunction(WKPageInvalidMessageFunction)
+bool WKPageGetAddsVisitedLinks(WKPageRef page)
+{
+ return toImpl(page)->addsVisitedLinks();
+}
+
+void WKPageSetAddsVisitedLinks(WKPageRef page, bool addsVisitedLinks)
+{
+ toImpl(page)->setAddsVisitedLinks(addsVisitedLinks);
+}
+
+bool WKPageIsPlayingAudio(WKPageRef page)
+{
+ return toImpl(page)->isPlayingAudio();
+}
+
+WKMediaState WKPageGetMediaState(WKPageRef page)
+{
+ WebCore::MediaProducer::MediaStateFlags coreState = toImpl(page)->mediaStateFlags();
+ WKMediaState state = kWKMediaIsNotPlaying;
+
+ if (coreState & WebCore::MediaProducer::IsPlayingAudio)
+ state |= kWKMediaIsPlayingAudio;
+ if (coreState & WebCore::MediaProducer::IsPlayingVideo)
+ state |= kWKMediaIsPlayingVideo;
+ if (coreState & WebCore::MediaProducer::HasActiveAudioCaptureDevice)
+ state |= kWKMediaHasActiveAudioCaptureDevice;
+ if (coreState & WebCore::MediaProducer::HasActiveVideoCaptureDevice)
+ state |= kWKMediaHasActiveVideoCaptureDevice;
+
+ return state;
+}
+
+void WKPageClearWheelEventTestTrigger(WKPageRef pageRef)
+{
+ toImpl(pageRef)->clearWheelEventTestTrigger();
+}
+
+void WKPageCallAfterNextPresentationUpdate(WKPageRef pageRef, void* context, WKPagePostPresentationUpdateFunction callback)
+{
+ toImpl(pageRef)->callAfterNextPresentationUpdate([context, callback](WebKit::CallbackBase::Error error) {
+ callback(error != WebKit::CallbackBase::Error::None ? toAPI(API::Error::create().ptr()) : 0, context);
+ });
+}
+
+bool WKPageGetResourceCachingDisabled(WKPageRef page)
+{
+ return toImpl(page)->isResourceCachingDisabled();
+}
+
+void WKPageSetResourceCachingDisabled(WKPageRef page, bool disabled)
+{
+ toImpl(page)->setResourceCachingDisabled(disabled);
+}
+
+void WKPageSetIgnoresViewportScaleLimits(WKPageRef page, bool ignoresViewportScaleLimits)
+{
+#if PLATFORM(IOS)
+ toImpl(page)->setForceAlwaysUserScalable(ignoresViewportScaleLimits);
+#endif
+}
+
+pid_t WKPageGetProcessIdentifier(WKPageRef page)
{
- // FIXME: Remove this function when doing so won't break WebKit nightlies.
+ return toImpl(page)->processIdentifier();
}
#if ENABLE(NETSCAPE_PLUGIN_API)
diff --git a/Source/WebKit2/UIProcess/API/C/WKPage.h b/Source/WebKit2/UIProcess/API/C/WKPage.h
index 216a8ff45..56de50357 100644
--- a/Source/WebKit2/UIProcess/API/C/WKPage.h
+++ b/Source/WebKit2/UIProcess/API/C/WKPage.h
@@ -26,22 +26,24 @@
#ifndef WKPage_h
#define WKPage_h
-#include <WebKit2/WKBase.h>
-#include <WebKit2/WKError.h>
-#include <WebKit2/WKEvent.h>
-#include <WebKit2/WKFindOptions.h>
-#include <WebKit2/WKGeometry.h>
-#include <WebKit2/WKNativeEvent.h>
-#include <WebKit2/WKPageContextMenuClient.h>
-#include <WebKit2/WKPageFindClient.h>
-#include <WebKit2/WKPageFindMatchesClient.h>
-#include <WebKit2/WKPageFormClient.h>
-#include <WebKit2/WKPageLoadTypes.h>
-#include <WebKit2/WKPageLoaderClient.h>
-#include <WebKit2/WKPagePolicyClient.h>
-#include <WebKit2/WKPageUIClient.h>
-#include <WebKit2/WKPageVisibilityTypes.h>
-#include <WebKit2/WKSessionRef.h>
+#include <WebKit/WKBase.h>
+#include <WebKit/WKErrorRef.h>
+#include <WebKit/WKEvent.h>
+#include <WebKit/WKFindOptions.h>
+#include <WebKit/WKGeometry.h>
+#include <WebKit/WKNativeEvent.h>
+#include <WebKit/WKPageContextMenuClient.h>
+#include <WebKit/WKPageDiagnosticLoggingClient.h>
+#include <WebKit/WKPageFindClient.h>
+#include <WebKit/WKPageFindMatchesClient.h>
+#include <WebKit/WKPageFormClient.h>
+#include <WebKit/WKPageInjectedBundleClient.h>
+#include <WebKit/WKPageLoadTypes.h>
+#include <WebKit/WKPageLoaderClient.h>
+#include <WebKit/WKPageNavigationClient.h>
+#include <WebKit/WKPagePolicyClient.h>
+#include <WebKit/WKPageUIClient.h>
+#include <WebKit/WKPageVisibilityTypes.h>
#ifndef __cplusplus
#include <stdbool.h>
@@ -56,6 +58,8 @@ WK_EXPORT WKTypeID WKPageGetTypeID();
WK_EXPORT WKContextRef WKPageGetContext(WKPageRef page);
WK_EXPORT WKPageGroupRef WKPageGetPageGroup(WKPageRef page);
+WK_EXPORT WKPageConfigurationRef WKPageCopyPageConfiguration(WKPageRef page);
+
// URL Requests
WK_EXPORT void WKPageLoadURL(WKPageRef page, WKURLRef url);
WK_EXPORT void WKPageLoadURLWithUserData(WKPageRef page, WKURLRef url, WKTypeRef userData);
@@ -78,6 +82,7 @@ WK_EXPORT void WKPageLoadWebArchiveDataWithUserData(WKPageRef page, WKDataRef we
WK_EXPORT void WKPageStopLoading(WKPageRef page);
WK_EXPORT void WKPageReload(WKPageRef page);
+WK_EXPORT void WKPageReloadWithoutContentBlockers(WKPageRef page);
WK_EXPORT void WKPageReloadFromOrigin(WKPageRef page);
WK_EXPORT bool WKPageTryClose(WKPageRef page);
@@ -92,7 +97,9 @@ WK_EXPORT void WKPageGoToBackForwardListItem(WKPageRef page, WKBackForwardListIt
WK_EXPORT void WKPageTryRestoreScrollPosition(WKPageRef page);
WK_EXPORT WKBackForwardListRef WKPageGetBackForwardList(WKPageRef page);
WK_EXPORT bool WKPageWillHandleHorizontalScrollEvents(WKPageRef page);
-
+
+WK_EXPORT void WKPageUpdateWebsitePolicies(WKPageRef, WKWebsitePoliciesRef);
+
WK_EXPORT WKStringRef WKPageCopyTitle(WKPageRef page);
WK_EXPORT WKURLRef WKPageCopyPendingAPIRequestURL(WKPageRef page);
@@ -108,8 +115,6 @@ WK_EXPORT double WKPageGetEstimatedProgress(WKPageRef page);
WK_EXPORT uint64_t WKPageGetRenderTreeSize(WKPageRef page);
-WK_EXPORT void WKPageSetMemoryCacheClientCallsEnabled(WKPageRef page, bool memoryCacheClientCallsEnabled);
-
WK_EXPORT WKInspectorRef WKPageGetInspector(WKPageRef page);
WK_EXPORT WKVibrationRef WKPageGetVibration(WKPageRef page);
@@ -122,6 +127,8 @@ WK_EXPORT void WKPageSetApplicationNameForUserAgent(WKPageRef page, WKStringRef
WK_EXPORT WKStringRef WKPageCopyCustomUserAgent(WKPageRef page);
WK_EXPORT void WKPageSetCustomUserAgent(WKPageRef page, WKStringRef userAgent);
+WK_EXPORT void WKPageSetUserContentExtensionsEnabled(WKPageRef, bool);
+
WK_EXPORT bool WKPageSupportsTextEncoding(WKPageRef page);
WK_EXPORT WKStringRef WKPageCopyCustomTextEncodingName(WKPageRef page);
WK_EXPORT void WKPageSetCustomTextEncodingName(WKPageRef page, WKStringRef encodingName);
@@ -132,11 +139,18 @@ WK_EXPORT WKStringRef WKPageGetSessionHistoryURLValueType(void);
WK_EXPORT WKStringRef WKPageGetSessionBackForwardListItemValueType(void);
typedef bool (*WKPageSessionStateFilterCallback)(WKPageRef page, WKStringRef valueType, WKTypeRef value, void* context);
-WK_EXPORT WKDataRef WKPageCopySessionState(WKPageRef page, void* context, WKPageSessionStateFilterCallback urlAllowedCallback);
-WK_EXPORT void WKPageRestoreFromSessionState(WKPageRef page, WKDataRef sessionStateData);
+
+// FIXME: This should return a WKSessionStateRef object, not a WKTypeRef.
+// It currently returns a WKTypeRef for backwards compatibility with Safari.
+WK_EXPORT WKTypeRef WKPageCopySessionState(WKPageRef page, void* context, WKPageSessionStateFilterCallback urlAllowedCallback);
+
+// FIXME: This should take a WKSessionStateRef object, not a WKTypeRef.
+// It currently takes a WKTypeRef for backwards compatibility with Safari.
+WK_EXPORT void WKPageRestoreFromSessionState(WKPageRef page, WKTypeRef sessionState);
WK_EXPORT double WKPageGetBackingScaleFactor(WKPageRef page);
WK_EXPORT void WKPageSetCustomBackingScaleFactor(WKPageRef page, double customScaleFactor);
+WK_EXPORT void WKPageClearWheelEventTestTrigger(WKPageRef page);
WK_EXPORT bool WKPageSupportsTextZoom(WKPageRef page);
WK_EXPORT double WKPageGetTextZoomFactor(WKPageRef page);
@@ -155,8 +169,6 @@ WK_EXPORT WKSize WKPageFixedLayoutSize(WKPageRef page);
WK_EXPORT void WKPageListenForLayoutMilestones(WKPageRef page, WKLayoutMilestones milestones);
-WK_EXPORT void WKPageSetVisibilityState(WKPageRef page, WKPageVisibilityState state, bool isInitialState);
-
WK_EXPORT bool WKPageHasHorizontalScrollbar(WKPageRef page);
WK_EXPORT bool WKPageHasVerticalScrollbar(WKPageRef page);
@@ -167,7 +179,11 @@ WK_EXPORT bool WKPageIsPinnedToLeftSide(WKPageRef page);
WK_EXPORT bool WKPageIsPinnedToRightSide(WKPageRef page);
WK_EXPORT bool WKPageIsPinnedToTopSide(WKPageRef page);
WK_EXPORT bool WKPageIsPinnedToBottomSide(WKPageRef page);
-
+
+// This API is poorly named. Even when these values are set to false, rubber-banding will
+// still be allowed to occur at the end of a momentum scroll. These values are used along
+// with pin state to determine if wheel events should be handled in the web process or if
+// they should be passed up to the client.
WK_EXPORT bool WKPageRubberBandsAtLeft(WKPageRef);
WK_EXPORT void WKPageSetRubberBandsAtLeft(WKPageRef, bool rubberBandsAtLeft);
WK_EXPORT bool WKPageRubberBandsAtRight(WKPageRef);
@@ -176,7 +192,13 @@ WK_EXPORT bool WKPageRubberBandsAtTop(WKPageRef);
WK_EXPORT void WKPageSetRubberBandsAtTop(WKPageRef, bool rubberBandsAtTop);
WK_EXPORT bool WKPageRubberBandsAtBottom(WKPageRef);
WK_EXPORT void WKPageSetRubberBandsAtBottom(WKPageRef, bool rubberBandsAtBottom);
-
+
+// Rubber-banding is enabled by default.
+WK_EXPORT bool WKPageVerticalRubberBandingIsEnabled(WKPageRef);
+WK_EXPORT void WKPageSetEnableVerticalRubberBanding(WKPageRef, bool enableVerticalRubberBanding);
+WK_EXPORT bool WKPageHorizontalRubberBandingIsEnabled(WKPageRef);
+WK_EXPORT void WKPageSetEnableHorizontalRubberBanding(WKPageRef, bool enableHorizontalRubberBanding);
+
WK_EXPORT void WKPageSetBackgroundExtendsBeyondPage(WKPageRef, bool backgroundExtendsBeyondPage);
WK_EXPORT bool WKPageBackgroundExtendsBeyondPage(WKPageRef);
@@ -195,14 +217,17 @@ WK_EXPORT void WKPageGetImageForFindMatch(WKPageRef page, int32_t matchIndex);
WK_EXPORT void WKPageSelectFindMatch(WKPageRef page, int32_t matchIndex);
WK_EXPORT void WKPageSetPageContextMenuClient(WKPageRef page, const WKPageContextMenuClientBase* client);
+WK_EXPORT void WKPageSetPageDiagnosticLoggingClient(WKPageRef page, const WKPageDiagnosticLoggingClientBase* client);
WK_EXPORT void WKPageSetPageFindClient(WKPageRef page, const WKPageFindClientBase* client);
WK_EXPORT void WKPageSetPageFindMatchesClient(WKPageRef page, const WKPageFindMatchesClientBase* client);
WK_EXPORT void WKPageSetPageFormClient(WKPageRef page, const WKPageFormClientBase* client);
-WK_EXPORT void WKPageSetPageLoaderClient(WKPageRef page, const WKPageLoaderClientBase* client);
-WK_EXPORT void WKPageSetPagePolicyClient(WKPageRef page, const WKPagePolicyClientBase* client);
WK_EXPORT void WKPageSetPageUIClient(WKPageRef page, const WKPageUIClientBase* client);
+WK_EXPORT void WKPageSetPageInjectedBundleClient(WKPageRef page, const WKPageInjectedBundleClientBase* client);
-WK_EXPORT void WKPageSetSession(WKPageRef page, WKSessionRef session);
+// A client can implement either a navigation client or loader and policy clients, but never both.
+WK_EXPORT void WKPageSetPageLoaderClient(WKPageRef page, const WKPageLoaderClientBase* client);
+WK_EXPORT void WKPageSetPagePolicyClient(WKPageRef page, const WKPagePolicyClientBase* client);
+WK_EXPORT void WKPageSetPageNavigationClient(WKPageRef page, const WKPageNavigationClientBase* client);
typedef void (*WKPageRunJavaScriptFunction)(WKSerializedScriptValueRef, WKErrorRef, void*);
WK_EXPORT void WKPageRunJavaScriptInMainFrame(WKPageRef page, WKStringRef script, void* context, WKPageRunJavaScriptFunction function);
@@ -218,7 +243,7 @@ typedef void (*WKPageGetContentsAsStringFunction)(WKStringRef, WKErrorRef, void*
WK_EXPORT void WKPageGetContentsAsString(WKPageRef page, void* context, WKPageGetContentsAsStringFunction function);
typedef void (*WKPageGetContentsAsMHTMLDataFunction)(WKDataRef, WKErrorRef, void*);
-WK_EXPORT void WKPageGetContentsAsMHTMLData(WKPageRef page, bool useBinaryEncoding, void* context, WKPageGetContentsAsMHTMLDataFunction function);
+WK_EXPORT void WKPageGetContentsAsMHTMLData(WKPageRef page, void* context, WKPageGetContentsAsMHTMLDataFunction function);
typedef void (*WKPageGetSelectionAsWebArchiveDataFunction)(WKDataRef, WKErrorRef, void*);
WK_EXPORT void WKPageGetSelectionAsWebArchiveData(WKPageRef page, void* context, WKPageGetSelectionAsWebArchiveDataFunction function);
diff --git a/Source/WebKit2/UIProcess/API/C/WKPageConfigurationRef.cpp b/Source/WebKit2/UIProcess/API/C/WKPageConfigurationRef.cpp
new file mode 100644
index 000000000..4f4d5f094
--- /dev/null
+++ b/Source/WebKit2/UIProcess/API/C/WKPageConfigurationRef.cpp
@@ -0,0 +1,110 @@
+/*
+ * Copyright (C) 2015 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "WKPageConfigurationRef.h"
+
+#include "APIPageConfiguration.h"
+#include "WKAPICast.h"
+#include "WebPageGroup.h"
+#include "WebProcessPool.h"
+#include "WebUserContentControllerProxy.h"
+
+using namespace WebKit;
+
+WKTypeID WKPageConfigurationGetTypeID()
+{
+ return toAPI(API::PageConfiguration::APIType);
+}
+
+WKPageConfigurationRef WKPageConfigurationCreate()
+{
+ return toAPI(&API::PageConfiguration::create().leakRef());
+}
+
+WKContextRef WKPageConfigurationGetContext(WKPageConfigurationRef configuration)
+{
+ return toAPI(toImpl(configuration)->processPool());
+}
+
+void WKPageConfigurationSetContext(WKPageConfigurationRef configuration, WKContextRef context)
+{
+ toImpl(configuration)->setProcessPool(toImpl(context));
+}
+
+WKPageGroupRef WKPageConfigurationGetPageGroup(WKPageConfigurationRef configuration)
+{
+ return toAPI(toImpl(configuration)->pageGroup());
+}
+
+void WKPageConfigurationSetPageGroup(WKPageConfigurationRef configuration, WKPageGroupRef pageGroup)
+{
+ toImpl(configuration)->setPageGroup(toImpl(pageGroup));
+}
+
+WKUserContentControllerRef WKPageConfigurationGetUserContentController(WKPageConfigurationRef configuration)
+{
+ return toAPI(toImpl(configuration)->userContentController());
+}
+
+void WKPageConfigurationSetUserContentController(WKPageConfigurationRef configuration, WKUserContentControllerRef userContentController)
+{
+ toImpl(configuration)->setUserContentController(toImpl(userContentController));
+}
+
+WKPreferencesRef WKPageConfigurationGetPreferences(WKPageConfigurationRef configuration)
+{
+ return toAPI(toImpl(configuration)->preferences());
+}
+
+void WKPageConfigurationSetPreferences(WKPageConfigurationRef configuration, WKPreferencesRef preferences)
+{
+ toImpl(configuration)->setPreferences(toImpl(preferences));
+}
+
+WKPageRef WKPageConfigurationGetRelatedPage(WKPageConfigurationRef configuration)
+{
+ return toAPI(toImpl(configuration)->relatedPage());
+}
+
+void WKPageConfigurationSetRelatedPage(WKPageConfigurationRef configuration, WKPageRef relatedPage)
+{
+ toImpl(configuration)->setRelatedPage(toImpl(relatedPage));
+}
+
+WKWebsiteDataStoreRef WKPageConfigurationGetWebsiteDataStore(WKPageConfigurationRef configuration)
+{
+ return toAPI(toImpl(configuration)->websiteDataStore());
+}
+
+void WKPageConfigurationSetWebsiteDataStore(WKPageConfigurationRef configuration, WKWebsiteDataStoreRef websiteDataStore)
+{
+ toImpl(configuration)->setWebsiteDataStore(toImpl(websiteDataStore));
+}
+
+void WKPageConfigurationSetInitialCapitalizationEnabled(WKPageConfigurationRef configuration, bool enabled)
+{
+ toImpl(configuration)->setInitialCapitalizationEnabled(enabled);
+}
diff --git a/Source/WebKit2/UIProcess/API/C/WKPageConfigurationRef.h b/Source/WebKit2/UIProcess/API/C/WKPageConfigurationRef.h
new file mode 100644
index 000000000..72e7a6bc2
--- /dev/null
+++ b/Source/WebKit2/UIProcess/API/C/WKPageConfigurationRef.h
@@ -0,0 +1,63 @@
+/*
+ * Copyright (C) 2015 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef WKPageConfigurationRef_h
+#define WKPageConfigurationRef_h
+
+#include <WebKit/WKBase.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+WK_EXPORT WKTypeID WKPageConfigurationGetTypeID();
+
+WK_EXPORT WKPageConfigurationRef WKPageConfigurationCreate();
+
+WK_EXPORT WKContextRef WKPageConfigurationGetContext(WKPageConfigurationRef configuration);
+WK_EXPORT void WKPageConfigurationSetContext(WKPageConfigurationRef configuration, WKContextRef context);
+
+WK_EXPORT WKPageGroupRef WKPageConfigurationGetPageGroup(WKPageConfigurationRef configuration);
+WK_EXPORT void WKPageConfigurationSetPageGroup(WKPageConfigurationRef configuration, WKPageGroupRef pageGroup);
+
+WK_EXPORT WKUserContentControllerRef WKPageConfigurationGetUserContentController(WKPageConfigurationRef configuration);
+WK_EXPORT void WKPageConfigurationSetUserContentController(WKPageConfigurationRef configuration, WKUserContentControllerRef userContentController);
+
+WK_EXPORT WKPreferencesRef WKPageConfigurationGetPreferences(WKPageConfigurationRef configuration);
+WK_EXPORT void WKPageConfigurationSetPreferences(WKPageConfigurationRef configuration, WKPreferencesRef preferences);
+
+WK_EXPORT WKPageRef WKPageConfigurationGetRelatedPage(WKPageConfigurationRef configuration);
+WK_EXPORT void WKPageConfigurationSetRelatedPage(WKPageConfigurationRef configuration, WKPageRef relatedPage);
+
+WK_EXPORT WKWebsiteDataStoreRef WKPageConfigurationGetWebsiteDataStore(WKPageConfigurationRef configuration);
+WK_EXPORT void WKPageConfigurationSetWebsiteDataStore(WKPageConfigurationRef configuration, WKWebsiteDataStoreRef websiteDataStore);
+
+WK_EXPORT void WKPageConfigurationSetInitialCapitalizationEnabled(WKPageConfigurationRef configuration, bool enabled);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif // WKPageConfigurationRef_h
diff --git a/Source/WebKit2/UIProcess/API/C/WKPageContextMenuClient.h b/Source/WebKit2/UIProcess/API/C/WKPageContextMenuClient.h
index e892c3d59..18d7b5b67 100644
--- a/Source/WebKit2/UIProcess/API/C/WKPageContextMenuClient.h
+++ b/Source/WebKit2/UIProcess/API/C/WKPageContextMenuClient.h
@@ -26,14 +26,15 @@
#ifndef WKPageContextMenuClient_h
#define WKPageContextMenuClient_h
-#include <WebKit2/WKBase.h>
-#include <WebKit2/WKGeometry.h>
+#include <WebKit/WKBase.h>
+#include <WebKit/WKGeometry.h>
#ifdef __cplusplus
extern "C" {
#endif
typedef void (*WKPageGetContextMenuFromProposedContextMenuCallback)(WKPageRef page, WKArrayRef proposedMenu, WKArrayRef* newMenu, WKHitTestResultRef hitTestResult, WKTypeRef userData, const void* clientInfo);
+typedef void (*WKPageGetContextMenuFromProposedContextMenuCallbackAsync)(WKPageRef page, WKArrayRef proposedMenu, WKContextMenuListenerRef listener, WKHitTestResultRef hitTestResult, WKTypeRef userData, const void* clientInfo);
typedef void (*WKPageCustomContextMenuItemSelectedCallback)(WKPageRef page, WKContextMenuItemRef contextMenuItem, const void* clientInfo);
typedef void (*WKPageContextMenuDismissedCallback)(WKPageRef page, const void* clientInfo);
typedef void (*WKPageShowContextMenuCallback)(WKPageRef page, WKPoint menuLocation, WKArrayRef menuItems, const void* clientInfo);
@@ -98,10 +99,8 @@ typedef struct WKPageContextMenuClientV3 {
WKPageHideContextMenuCallback hideContextMenu;
} WKPageContextMenuClientV3;
-enum { kWKPageContextMenuClientCurrentVersion WK_ENUM_DEPRECATED("Use an explicit version number instead") = 3 };
-typedef struct WKPageContextMenuClient {
- int version;
- const void * clientInfo;
+typedef struct WKPageContextMenuClientV4 {
+ WKPageContextMenuClientBase base;
// Version 0.
WKPageGetContextMenuFromProposedContextMenuCallback_deprecatedForUseWithV0 getContextMenuFromProposedMenu_deprecatedForUseWithV0;
@@ -116,7 +115,11 @@ typedef struct WKPageContextMenuClient {
// Version 3.
WKPageShowContextMenuCallback showContextMenu;
WKPageHideContextMenuCallback hideContextMenu;
-} WKPageContextMenuClient WK_DEPRECATED("Use an explicit versioned struct instead");
+
+ // Version 4.
+ WKPageGetContextMenuFromProposedContextMenuCallbackAsync getContextMenuFromProposedMenuAsync;
+
+} WKPageContextMenuClientV4;
#ifdef __cplusplus
}
diff --git a/Source/WebKit2/UIProcess/API/C/WKPageDiagnosticLoggingClient.h b/Source/WebKit2/UIProcess/API/C/WKPageDiagnosticLoggingClient.h
new file mode 100644
index 000000000..8ae513a3b
--- /dev/null
+++ b/Source/WebKit2/UIProcess/API/C/WKPageDiagnosticLoggingClient.h
@@ -0,0 +1,71 @@
+/*
+ * Copyright (C) 2015 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef WKPageDiagnosticLoggingClient_h
+#define WKPageDiagnosticLoggingClient_h
+
+#include <WebKit/WKBase.h>
+#include <WebKit/WKDiagnosticLoggingResultType.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+typedef void (*WKPageLogDiagnosticMessageCallback)(WKPageRef page, WKStringRef message, WKStringRef description, const void* clientInfo);
+typedef void (*WKPageLogDiagnosticMessageWithResultCallback)(WKPageRef page, WKStringRef message, WKStringRef description, WKDiagnosticLoggingResultType result, const void* clientInfo);
+typedef void (*WKPageLogDiagnosticMessageWithValueCallback)(WKPageRef page, WKStringRef message, WKStringRef description, WKStringRef value, const void* clientInfo);
+typedef void (*WKPageLogDiagnosticMessageWithEnhancedPrivacyCallback)(WKPageRef page, WKStringRef message, WKStringRef description, const void* clientInfo);
+
+typedef struct WKPageDiagnosticLoggingClientBase {
+ int version;
+ const void * clientInfo;
+} WKPageDiagnosticLoggingClientBase;
+
+typedef struct WKPageDiagnosticLoggingClientV0 {
+ WKPageDiagnosticLoggingClientBase base;
+
+ // Version 0.
+ WKPageLogDiagnosticMessageCallback logDiagnosticMessage;
+ WKPageLogDiagnosticMessageWithResultCallback logDiagnosticMessageWithResult;
+ WKPageLogDiagnosticMessageWithValueCallback logDiagnosticMessageWithValue;
+} WKPageDiagnosticLoggingClientV0;
+
+typedef struct WKPageDiagnosticLoggingClientV1 {
+ WKPageDiagnosticLoggingClientBase base;
+
+ // Version 0.
+ WKPageLogDiagnosticMessageCallback logDiagnosticMessage;
+ WKPageLogDiagnosticMessageWithResultCallback logDiagnosticMessageWithResult;
+ WKPageLogDiagnosticMessageWithValueCallback logDiagnosticMessageWithValue;
+
+ // Version 1.
+ WKPageLogDiagnosticMessageWithEnhancedPrivacyCallback logDiagnosticMessageWithEnhancedPrivacy;
+} WKPageDiagnosticLoggingClientV1;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif // WKPageDiagnosticLoggingClient_h
diff --git a/Source/WebKit2/UIProcess/API/C/WKPageFindClient.h b/Source/WebKit2/UIProcess/API/C/WKPageFindClient.h
index 4d67d69db..6c7b1f22c 100644
--- a/Source/WebKit2/UIProcess/API/C/WKPageFindClient.h
+++ b/Source/WebKit2/UIProcess/API/C/WKPageFindClient.h
@@ -26,7 +26,7 @@
#ifndef WKPageFindClient_h
#define WKPageFindClient_h
-#include <WebKit2/WKBase.h>
+#include <WebKit/WKBase.h>
#ifdef __cplusplus
extern "C" {
@@ -50,17 +50,6 @@ typedef struct WKPageFindClientV0 {
WKPageDidCountStringMatchesCallback didCountStringMatches;
} WKPageFindClientV0;
-enum { kWKPageFindClientCurrentVersion WK_ENUM_DEPRECATED("Use an explicit version number instead") = 0 };
-typedef struct WKPageFindClient {
- int version;
- const void * clientInfo;
-
- // Version 0.
- WKPageDidFindStringCallback didFindString;
- WKPageDidFailToFindStringCallback didFailToFindString;
- WKPageDidCountStringMatchesCallback didCountStringMatches;
-} WKPageFindClient WK_DEPRECATED("Use an explicit versioned struct instead");
-
#ifdef __cplusplus
}
#endif
diff --git a/Source/WebKit2/UIProcess/API/C/WKPageFindMatchesClient.h b/Source/WebKit2/UIProcess/API/C/WKPageFindMatchesClient.h
index 15701aac6..395588c7e 100644
--- a/Source/WebKit2/UIProcess/API/C/WKPageFindMatchesClient.h
+++ b/Source/WebKit2/UIProcess/API/C/WKPageFindMatchesClient.h
@@ -26,7 +26,7 @@
#ifndef WKPageFindMatchesClient_h
#define WKPageFindMatchesClient_h
-#include <WebKit2/WKBase.h>
+#include <WebKit/WKBase.h>
#ifdef __cplusplus
extern "C" {
@@ -53,14 +53,6 @@ typedef struct WKPageFindMatchesClientV0 {
WKPageDidGetImageForMatchResultCallback didGetImageForMatchResult;
} WKPageFindMatchesClientV0;
-enum { kWKPageFindMatchesClientCurrentVersion WK_ENUM_DEPRECATED("Use an explicit version number instead") = 0 };
-typedef struct WKPageFindMatchesClient {
- int version;
- const void * clientInfo;
- WKPageDidFindStringMatchesCallback didFindStringMatches;
- WKPageDidGetImageForMatchResultCallback didGetImageForMatchResult;
-} WKPageFindMatchesClient WK_DEPRECATED("Use an explicit versioned struct instead");
-
#ifdef __cplusplus
}
#endif
diff --git a/Source/WebKit2/UIProcess/API/C/WKPageFormClient.h b/Source/WebKit2/UIProcess/API/C/WKPageFormClient.h
index 98b2c6abe..2e6b7aeb1 100644
--- a/Source/WebKit2/UIProcess/API/C/WKPageFormClient.h
+++ b/Source/WebKit2/UIProcess/API/C/WKPageFormClient.h
@@ -26,7 +26,7 @@
#ifndef WKPageFormClient_h
#define WKPageFormClient_h
-#include <WebKit2/WKBase.h>
+#include <WebKit/WKBase.h>
#ifdef __cplusplus
extern "C" {
@@ -47,15 +47,6 @@ typedef struct WKPageFormClientV0 {
WKPageWillSubmitFormCallback willSubmitForm;
} WKPageFormClientV0;
-enum { kWKPageFormClientCurrentVersion WK_ENUM_DEPRECATED("Use an explicit version number instead") = 0 };
-typedef struct WKPageFormClient {
- int version;
- const void * clientInfo;
-
- // Version 0.
- WKPageWillSubmitFormCallback willSubmitForm;
-} WKPageFormClient WK_DEPRECATED("Use an explicit versioned struct instead");
-
#ifdef __cplusplus
}
#endif
diff --git a/Source/WebKit2/UIProcess/API/C/WKPageGroup.cpp b/Source/WebKit2/UIProcess/API/C/WKPageGroup.cpp
index 51298cd14..81e9cbf60 100644
--- a/Source/WebKit2/UIProcess/API/C/WKPageGroup.cpp
+++ b/Source/WebKit2/UIProcess/API/C/WKPageGroup.cpp
@@ -26,9 +26,14 @@
#include "config.h"
#include "WKPageGroup.h"
+#include "APIUserContentExtension.h"
+#include "APIUserContentWorld.h"
+#include "APIUserScript.h"
+#include "APIUserStyleSheet.h"
#include "WKAPICast.h"
#include "WebPageGroup.h"
#include "WebPreferences.h"
+#include "WebUserContentControllerProxy.h"
using namespace WebKit;
@@ -39,13 +44,8 @@ WKTypeID WKPageGroupGetTypeID()
WKPageGroupRef WKPageGroupCreateWithIdentifier(WKStringRef identifier)
{
- RefPtr<WebPageGroup> pageGroup = WebPageGroup::create(toWTFString(identifier));
- return toAPI(pageGroup.release().leakRef());
-}
-
-WKStringRef WKPageGroupCopyIdentifier(WKPageGroupRef pageGroupRef)
-{
- return toCopiedAPI(toImpl(pageGroupRef)->identifier());
+ auto pageGroup = WebPageGroup::create(toWTFString(identifier));
+ return toAPI(pageGroup.leakRef());
}
void WKPageGroupSetPreferences(WKPageGroupRef pageGroupRef, WKPreferencesRef preferencesRef)
@@ -55,25 +55,51 @@ void WKPageGroupSetPreferences(WKPageGroupRef pageGroupRef, WKPreferencesRef pre
WKPreferencesRef WKPageGroupGetPreferences(WKPageGroupRef pageGroupRef)
{
- return toAPI(toImpl(pageGroupRef)->preferences());
+ return toAPI(&toImpl(pageGroupRef)->preferences());
}
-void WKPageGroupAddUserStyleSheet(WKPageGroupRef pageGroupRef, WKStringRef sourceRef, WKURLRef baseURL, WKArrayRef whitelistedURLPatterns, WKArrayRef blacklistedURLPatterns, WKUserContentInjectedFrames injectedFrames)
+WKUserContentControllerRef WKPageGroupGetUserContentController(WKPageGroupRef pageGroupRef)
{
- toImpl(pageGroupRef)->addUserStyleSheet(toWTFString(sourceRef), toWTFString(baseURL), toImpl(whitelistedURLPatterns), toImpl(blacklistedURLPatterns), toUserContentInjectedFrames(injectedFrames), WebCore::UserStyleUserLevel);
+ return toAPI(&toImpl(pageGroupRef)->userContentController());
}
-void WKPageGroupRemoveAllUserStyleSheets(WKPageGroupRef pageGroupRef)
+void WKPageGroupAddUserStyleSheet(WKPageGroupRef pageGroupRef, WKStringRef sourceRef, WKURLRef baseURLRef, WKArrayRef whitelistedURLPatterns, WKArrayRef blacklistedURLPatterns, WKUserContentInjectedFrames injectedFrames)
{
- toImpl(pageGroupRef)->removeAllUserStyleSheets();
+ auto source = toWTFString(sourceRef);
+
+ if (source.isEmpty())
+ return;
+
+ auto baseURLString = toWTFString(baseURLRef);
+ auto whitelist = toImpl(whitelistedURLPatterns);
+ auto blacklist = toImpl(blacklistedURLPatterns);
+
+ Ref<API::UserStyleSheet> userStyleSheet = API::UserStyleSheet::create(WebCore::UserStyleSheet { source, (baseURLString.isEmpty() ? WebCore::blankURL() : WebCore::URL(WebCore::URL(), baseURLString)), whitelist ? whitelist->toStringVector() : Vector<String>(), blacklist ? blacklist->toStringVector() : Vector<String>(), toUserContentInjectedFrames(injectedFrames), WebCore::UserStyleUserLevel }, API::UserContentWorld::normalWorld());
+
+ toImpl(pageGroupRef)->userContentController().addUserStyleSheet(userStyleSheet.get());
}
-void WKPageGroupAddUserScript(WKPageGroupRef pageGroupRef, WKStringRef sourceRef, WKURLRef baseURL, WKArrayRef whitelistedURLPatterns, WKArrayRef blacklistedURLPatterns, WKUserContentInjectedFrames injectedFrames, WKUserScriptInjectionTime injectionTime)
+void WKPageGroupRemoveAllUserStyleSheets(WKPageGroupRef pageGroup)
{
- toImpl(pageGroupRef)->addUserScript(toWTFString(sourceRef), toWTFString(baseURL), toImpl(whitelistedURLPatterns), toImpl(blacklistedURLPatterns), toUserContentInjectedFrames(injectedFrames), toUserScriptInjectionTime(injectionTime));
+ toImpl(pageGroup)->userContentController().removeAllUserStyleSheets();
+}
+
+void WKPageGroupAddUserScript(WKPageGroupRef pageGroupRef, WKStringRef sourceRef, WKURLRef baseURLRef, WKArrayRef whitelistedURLPatterns, WKArrayRef blacklistedURLPatterns, WKUserContentInjectedFrames injectedFrames, _WKUserScriptInjectionTime injectionTime)
+{
+ auto source = toWTFString(sourceRef);
+
+ if (source.isEmpty())
+ return;
+
+ auto baseURLString = toWTFString(baseURLRef);
+ auto whitelist = toImpl(whitelistedURLPatterns);
+ auto blacklist = toImpl(blacklistedURLPatterns);
+
+ Ref<API::UserScript> userScript = API::UserScript::create(WebCore::UserScript { source, (baseURLString.isEmpty() ? WebCore::blankURL() : WebCore::URL(WebCore::URL(), baseURLString)), whitelist ? whitelist->toStringVector() : Vector<String>(), blacklist ? blacklist->toStringVector() : Vector<String>(), toUserScriptInjectionTime(injectionTime), toUserContentInjectedFrames(injectedFrames) }, API::UserContentWorld::normalWorld());
+ toImpl(pageGroupRef)->userContentController().addUserScript(userScript.get());
}
void WKPageGroupRemoveAllUserScripts(WKPageGroupRef pageGroupRef)
{
- toImpl(pageGroupRef)->removeAllUserScripts();
+ toImpl(pageGroupRef)->userContentController().removeAllUserScripts();
}
diff --git a/Source/WebKit2/UIProcess/API/C/WKPageGroup.h b/Source/WebKit2/UIProcess/API/C/WKPageGroup.h
index 530674220..d820804f0 100644
--- a/Source/WebKit2/UIProcess/API/C/WKPageGroup.h
+++ b/Source/WebKit2/UIProcess/API/C/WKPageGroup.h
@@ -26,9 +26,9 @@
#ifndef WKPageGroup_h
#define WKPageGroup_h
-#include <WebKit2/WKBase.h>
-#include <WebKit2/WKUserContentInjectedFrames.h>
-#include <WebKit2/WKUserScriptInjectionTime.h>
+#include <WebKit/WKBase.h>
+#include <WebKit/WKUserContentInjectedFrames.h>
+#include <WebKit/WKUserScriptInjectionTime.h>
#ifdef __cplusplus
extern "C" {
@@ -38,15 +38,15 @@ WK_EXPORT WKTypeID WKPageGroupGetTypeID();
WK_EXPORT WKPageGroupRef WKPageGroupCreateWithIdentifier(WKStringRef identifier);
-WK_EXPORT WKStringRef WKPageGroupCopyIdentifier(WKPageGroupRef pageGroup);
-
WK_EXPORT void WKPageGroupSetPreferences(WKPageGroupRef pageGroup, WKPreferencesRef preferences);
WK_EXPORT WKPreferencesRef WKPageGroupGetPreferences(WKPageGroupRef pageGroup);
-
+
+WK_EXPORT WKUserContentControllerRef WKPageGroupGetUserContentController(WKPageGroupRef pageGroup);
+
WK_EXPORT void WKPageGroupAddUserStyleSheet(WKPageGroupRef pageGroup, WKStringRef source, WKURLRef baseURL, WKArrayRef whitelistedURLPatterns, WKArrayRef blacklistedURLPatterns, WKUserContentInjectedFrames);
WK_EXPORT void WKPageGroupRemoveAllUserStyleSheets(WKPageGroupRef pageGroup);
-WK_EXPORT void WKPageGroupAddUserScript(WKPageGroupRef pageGroup, WKStringRef source, WKURLRef baseURL, WKArrayRef whitelistedURLPatterns, WKArrayRef blacklistedURLPatterns, WKUserContentInjectedFrames, WKUserScriptInjectionTime);
+WK_EXPORT void WKPageGroupAddUserScript(WKPageGroupRef pageGroup, WKStringRef source, WKURLRef baseURL, WKArrayRef whitelistedURLPatterns, WKArrayRef blacklistedURLPatterns, WKUserContentInjectedFrames, _WKUserScriptInjectionTime);
WK_EXPORT void WKPageGroupRemoveAllUserScripts(WKPageGroupRef pageGroup);
#ifdef __cplusplus
diff --git a/Source/WebKit2/UIProcess/API/C/WKBatteryManager.h b/Source/WebKit2/UIProcess/API/C/WKPageInjectedBundleClient.h
index 75b3eafec..b22c3eb86 100644
--- a/Source/WebKit2/UIProcess/API/C/WKBatteryManager.h
+++ b/Source/WebKit2/UIProcess/API/C/WKPageInjectedBundleClient.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2012 Intel Corporation. All rights reserved.
+ * Copyright (C) 2015 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -23,40 +23,26 @@
* THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef WKBatteryManager_h
-#define WKBatteryManager_h
+#ifndef WKPageInjectedBundleClient_h
+#define WKPageInjectedBundleClient_h
-#include <WebKit2/WKBase.h>
+#include <WebKit/WKBase.h>
-#ifdef __cplusplus
-extern "C" {
-#endif
+typedef void (*WKPageDidReceiveMessageFromInjectedBundleCallback)(WKPageRef page, WKStringRef messageName, WKTypeRef messageBody, const void *clientInfo);
+typedef void (*WKPageDidReceiveSynchronousMessageFromInjectedBundleCallback)(WKPageRef page, WKStringRef messageName, WKTypeRef messageBody, WKTypeRef* returnData, const void *clientInfo);
+typedef WKTypeRef (*WKPageGetInjectedBundleInitializationUserDataCallback)(WKPageRef page, const void *clientInfo);
-// Provider.
-typedef void (*WKBatteryProviderStartUpdatingCallback)(WKBatteryManagerRef batteryManager, const void* clientInfo);
-typedef void (*WKBatteryProviderStopUpdatingCallback)(WKBatteryManagerRef batteryManager, const void* clientInfo);
-
-typedef struct WKBatteryProviderBase {
+typedef struct WKPageInjectedBundleClientBase {
int version;
const void * clientInfo;
-} WKBatteryProviderBase;
-
-typedef struct WKBatteryProviderV0 {
- WKBatteryProviderBase base;
-
- WKBatteryProviderStartUpdatingCallback startUpdating;
- WKBatteryProviderStopUpdatingCallback stopUpdating;
-} WKBatteryProviderV0;
-
-WK_EXPORT WKTypeID WKBatteryManagerGetTypeID();
-
-WK_EXPORT void WKBatteryManagerSetProvider(WKBatteryManagerRef batteryManager, const WKBatteryProviderBase* provider);
+} WKPageInjectedBundleClientBase;
-WK_EXPORT void WKBatteryManagerProviderDidChangeBatteryStatus(WKBatteryManagerRef batteryManager, WKStringRef eventType, WKBatteryStatusRef status);
-WK_EXPORT void WKBatteryManagerProviderUpdateBatteryStatus(WKBatteryManagerRef batteryManager, WKBatteryStatusRef status);
+typedef struct WKPageInjectedBundleClientV0 {
+ WKPageInjectedBundleClientBase base;
-#ifdef __cplusplus
-}
-#endif
+ // Version 0.
+ WKPageDidReceiveMessageFromInjectedBundleCallback didReceiveMessageFromInjectedBundle;
+ WKPageDidReceiveSynchronousMessageFromInjectedBundleCallback didReceiveSynchronousMessageFromInjectedBundle;
+} WKPageInjectedBundleClientV0;
-#endif /* WKBatteryManager_h */
+#endif // WKPageInjectedBundleClient_h
diff --git a/Source/WebKit2/UIProcess/API/C/WKPageLoaderClient.h b/Source/WebKit2/UIProcess/API/C/WKPageLoaderClient.h
index 579d8c2cb..c7c1cb011 100644
--- a/Source/WebKit2/UIProcess/API/C/WKPageLoaderClient.h
+++ b/Source/WebKit2/UIProcess/API/C/WKPageLoaderClient.h
@@ -26,25 +26,19 @@
#ifndef WKPageLoaderClient_h
#define WKPageLoaderClient_h
-#include <WebKit2/WKBase.h>
-#include <WebKit2/WKError.h>
-#include <WebKit2/WKPageLoadTypes.h>
+#include <WebKit/WKBase.h>
+#include <WebKit/WKErrorRef.h>
+#include <WebKit/WKPageLoadTypes.h>
+#include <WebKit/WKPluginLoadPolicy.h>
#ifdef __cplusplus
extern "C" {
#endif
enum {
- kWKPluginLoadPolicyLoadNormally = 0,
- kWKPluginLoadPolicyBlocked,
- kWKPluginLoadPolicyInactive,
- kWKPluginLoadPolicyLoadUnsandboxed,
-};
-typedef uint32_t WKPluginLoadPolicy;
-
-enum {
kWKWebGLLoadPolicyBlocked = 0,
kWKWebGLLoadPolicyLoadNormally,
+ kWKWebGLLoadPolicyPending
};
typedef uint32_t WKWebGLLoadPolicy;
@@ -68,15 +62,19 @@ typedef bool (*WKPageCanAuthenticateAgainstProtectionSpaceInFrameCallback)(WKPag
typedef void (*WKPageDidReceiveAuthenticationChallengeInFrameCallback)(WKPageRef page, WKFrameRef frame, WKAuthenticationChallengeRef authenticationChallenge, const void *clientInfo);
typedef void (*WKPageDidChangeBackForwardListCallback)(WKPageRef page, WKBackForwardListItemRef addedItem, WKArrayRef removedItems, const void *clientInfo);
typedef bool (*WKPageShouldGoToBackForwardListItemCallback)(WKPageRef page, WKBackForwardListItemRef item, const void *clientInfo);
+typedef bool (*WKPageShouldKeepCurrentBackForwardListItemInListCallback)(WKPageRef page, WKBackForwardListItemRef item, const void *clientInfo);
typedef void (*WKPageWillGoToBackForwardListItemCallback)(WKPageRef page, WKBackForwardListItemRef item, WKTypeRef userData, const void *clientInfo);
typedef void (*WKPageDidLayoutCallback)(WKPageRef page, WKLayoutMilestones milestones, WKTypeRef userData, const void *clientInfo);
typedef WKPluginLoadPolicy (*WKPagePluginLoadPolicyCallback)(WKPageRef page, WKPluginLoadPolicy currentPluginLoadPolicy, WKDictionaryRef pluginInfoDictionary, WKStringRef* unavailabilityDescription, const void* clientInfo);
-typedef void (*WKPagePluginDidFailCallback)(WKPageRef page, WKErrorCode errorCode, WKDictionaryRef pluginInfoDictionary, const void* clientInfo);
+typedef void (*WKPagePluginDidFailCallback)(WKPageRef page, uint32_t errorCode, WKDictionaryRef pluginInfoDictionary, const void* clientInfo);
typedef WKWebGLLoadPolicy (*WKPageWebGLLoadPolicyCallback)(WKPageRef page, WKStringRef url, const void* clientInfo);
+typedef void (*WKPageNavigationGestureDidBeginCallback)(WKPageRef page, const void* clientInfo);
+typedef void (*WKPageNavigationGestureWillEndCallback)(WKPageRef page, bool willNavigate, WKBackForwardListItemRef item, const void* clientInfo);
+typedef void (*WKPageNavigationGestureDidEndCallback)(WKPageRef page, bool willNavigate, WKBackForwardListItemRef item, const void* clientInfo);
// Deprecated
typedef void (*WKPageDidFailToInitializePluginCallback_deprecatedForUseWithV0)(WKPageRef page, WKStringRef mimeType, const void* clientInfo);
-typedef void (*WKPagePluginDidFailCallback_deprecatedForUseWithV1)(WKPageRef page, WKErrorCode errorCode, WKStringRef mimeType, WKStringRef pluginIdentifier, WKStringRef pluginVersion, const void* clientInfo);
+typedef void (*WKPagePluginDidFailCallback_deprecatedForUseWithV1)(WKPageRef page, uint32_t errorCode, WKStringRef mimeType, WKStringRef pluginIdentifier, WKStringRef pluginVersion, const void* clientInfo);
typedef WKPluginLoadPolicy (*WKPagePluginLoadPolicyCallback_deprecatedForUseWithV2)(WKPageRef page, WKPluginLoadPolicy currentPluginLoadPolicy, WKDictionaryRef pluginInfoDictionary, const void* clientInfo);
typedef struct WKPageLoaderClientBase {
@@ -330,13 +328,74 @@ typedef struct WKPageLoaderClientV4 {
// Version 4
WKPageWebGLLoadPolicyCallback webGLLoadPolicy;
+ WKPageWebGLLoadPolicyCallback resolveWebGLLoadPolicy;
} WKPageLoaderClientV4;
-// FIXME: These should be deprecated.
-enum { kWKPageLoaderClientCurrentVersion WK_ENUM_DEPRECATED("Use an explicit version number instead") = 3 };
-typedef struct WKPageLoaderClient {
- int version;
- const void * clientInfo;
+typedef struct WKPageLoaderClientV5 {
+ WKPageLoaderClientBase base;
+
+ // Version 0.
+ WKPageDidStartProvisionalLoadForFrameCallback didStartProvisionalLoadForFrame;
+ WKPageDidReceiveServerRedirectForProvisionalLoadForFrameCallback didReceiveServerRedirectForProvisionalLoadForFrame;
+ WKPageDidFailProvisionalLoadWithErrorForFrameCallback didFailProvisionalLoadWithErrorForFrame;
+ WKPageDidCommitLoadForFrameCallback didCommitLoadForFrame;
+ WKPageDidFinishDocumentLoadForFrameCallback didFinishDocumentLoadForFrame;
+ WKPageDidFinishLoadForFrameCallback didFinishLoadForFrame;
+ WKPageDidFailLoadWithErrorForFrameCallback didFailLoadWithErrorForFrame;
+ WKPageDidSameDocumentNavigationForFrameCallback didSameDocumentNavigationForFrame;
+ WKPageDidReceiveTitleForFrameCallback didReceiveTitleForFrame;
+ WKPageDidFirstLayoutForFrameCallback didFirstLayoutForFrame;
+ WKPageDidFirstVisuallyNonEmptyLayoutForFrameCallback didFirstVisuallyNonEmptyLayoutForFrame;
+ WKPageDidRemoveFrameFromHierarchyCallback didRemoveFrameFromHierarchy;
+ WKPageDidDisplayInsecureContentForFrameCallback didDisplayInsecureContentForFrame;
+ WKPageDidRunInsecureContentForFrameCallback didRunInsecureContentForFrame;
+ WKPageCanAuthenticateAgainstProtectionSpaceInFrameCallback canAuthenticateAgainstProtectionSpaceInFrame;
+ WKPageDidReceiveAuthenticationChallengeInFrameCallback didReceiveAuthenticationChallengeInFrame;
+
+ // FIXME: Move to progress client.
+ WKPageLoaderClientCallback didStartProgress;
+ WKPageLoaderClientCallback didChangeProgress;
+ WKPageLoaderClientCallback didFinishProgress;
+
+ // FIXME: These three functions should not be part of this client.
+ WKPageLoaderClientCallback processDidBecomeUnresponsive;
+ WKPageLoaderClientCallback processDidBecomeResponsive;
+ WKPageLoaderClientCallback processDidCrash;
+ WKPageDidChangeBackForwardListCallback didChangeBackForwardList;
+ WKPageShouldGoToBackForwardListItemCallback shouldGoToBackForwardListItem;
+ WKPageDidFailToInitializePluginCallback_deprecatedForUseWithV0 didFailToInitializePlugin_deprecatedForUseWithV0;
+
+ // Version 1.
+ WKPageDidDetectXSSForFrameCallback didDetectXSSForFrame;
+
+ void* didNewFirstVisuallyNonEmptyLayout_unavailable;
+
+ WKPageWillGoToBackForwardListItemCallback willGoToBackForwardListItem;
+
+ WKPageLoaderClientCallback interactionOccurredWhileProcessUnresponsive;
+ WKPagePluginDidFailCallback_deprecatedForUseWithV1 pluginDidFail_deprecatedForUseWithV1;
+
+ // Version 2.
+ void (*didReceiveIntentForFrame_unavailable)(void);
+ void (*registerIntentServiceForFrame_unavailable)(void);
+
+ WKPageDidLayoutCallback didLayout;
+ WKPagePluginLoadPolicyCallback_deprecatedForUseWithV2 pluginLoadPolicy_deprecatedForUseWithV2;
+ WKPagePluginDidFailCallback pluginDidFail;
+
+ // Version 3.
+ WKPagePluginLoadPolicyCallback pluginLoadPolicy;
+
+ // Version 4.
+ WKPageWebGLLoadPolicyCallback webGLLoadPolicy;
+ WKPageWebGLLoadPolicyCallback resolveWebGLLoadPolicy;
+
+ // Version 5.
+ WKPageShouldKeepCurrentBackForwardListItemInListCallback shouldKeepCurrentBackForwardListItemInList;
+} WKPageLoaderClientV5;
+
+typedef struct WKPageLoaderClientV6 {
+ WKPageLoaderClientBase base;
// Version 0.
WKPageDidStartProvisionalLoadForFrameCallback didStartProvisionalLoadForFrame;
@@ -389,7 +448,19 @@ typedef struct WKPageLoaderClient {
// Version 3.
WKPagePluginLoadPolicyCallback pluginLoadPolicy;
-} WKPageLoaderClient;
+
+ // Version 4.
+ WKPageWebGLLoadPolicyCallback webGLLoadPolicy;
+ WKPageWebGLLoadPolicyCallback resolveWebGLLoadPolicy;
+
+ // Version 5.
+ WKPageShouldKeepCurrentBackForwardListItemInListCallback shouldKeepCurrentBackForwardListItemInList;
+
+ // Version 6.
+ WKPageNavigationGestureDidBeginCallback navigationGestureDidBegin;
+ WKPageNavigationGestureWillEndCallback navigationGestureWillEnd;
+ WKPageNavigationGestureDidEndCallback navigationGestureDidEnd;
+} WKPageLoaderClientV6;
#ifdef __cplusplus
}
diff --git a/Source/WebKit2/UIProcess/API/C/WKPageNavigationClient.h b/Source/WebKit2/UIProcess/API/C/WKPageNavigationClient.h
new file mode 100644
index 000000000..e19cf9741
--- /dev/null
+++ b/Source/WebKit2/UIProcess/API/C/WKPageNavigationClient.h
@@ -0,0 +1,118 @@
+/*
+ * Copyright (C) 2015 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef WKPageNavigationClient_h
+#define WKPageNavigationClient_h
+
+#include <WebKit/WKBase.h>
+#include <WebKit/WKPageLoadTypes.h>
+#include <WebKit/WKPageRenderingProgressEvents.h>
+#include <WebKit/WKPluginLoadPolicy.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+typedef void (*WKPageNavigationDecidePolicyForNavigationActionCallback)(WKPageRef page, WKNavigationActionRef navigationAction, WKFramePolicyListenerRef listener, WKTypeRef userData, const void* clientInfo);
+
+typedef void (*WKPageNavigationDecidePolicyForNavigationResponseCallback)(WKPageRef page, WKNavigationResponseRef navigationResponse, WKFramePolicyListenerRef listener, WKTypeRef userData, const void* clientInfo);
+
+typedef void (*WKPageNavigationDidStartProvisionalNavigationCallback)(WKPageRef page, WKNavigationRef navigation, WKTypeRef userData, const void* clientInfo);
+
+typedef void (*WKPageNavigationDidReceiveServerRedirectForProvisionalNavigationCallback)(WKPageRef page, WKNavigationRef navigation, WKTypeRef userData, const void* clientInfo);
+
+typedef void (*WKPageNavigationDidFailProvisionalNavigationCallback)(WKPageRef page, WKNavigationRef navigation, WKErrorRef error, WKTypeRef userData, const void* clientInfo);
+
+typedef void (*WKPageNavigationDidCommitNavigationCallback)(WKPageRef page, WKNavigationRef navigation, WKTypeRef userData, const void* clientInfo);
+
+typedef void (*WKPageNavigationDidFinishNavigationCallback)(WKPageRef page, WKNavigationRef navigation, WKTypeRef userData, const void* clientInfo);
+
+typedef void (*WKPageNavigationDidFailNavigationCallback)(WKPageRef page, WKNavigationRef navigation, WKErrorRef error, WKTypeRef userData, const void* clientInfo);
+
+typedef void (*WKPageNavigationDidFailProvisionalLoadInSubframeCallback)(WKPageRef page, WKNavigationRef navigation, WKFrameInfoRef subframe, WKErrorRef error, WKTypeRef userData, const void* clientInfo);
+
+typedef void (*WKPageNavigationDidFinishDocumentLoadCallback)(WKPageRef page, WKNavigationRef navigation, WKTypeRef userData, const void* clientInfo);
+
+typedef void (*WKPageNavigationDidSameDocumentNavigationCallback)(WKPageRef page, WKNavigationRef navigation, WKSameDocumentNavigationType navigationType, WKTypeRef userData, const void* clientInfo);
+
+typedef void (*WKPageNavigationRenderingProgressDidChangeCallback)(WKPageRef page, WKPageRenderingProgressEvents progressEvents, WKTypeRef userData, const void* clientInfo);
+
+typedef bool (*WKPageNavigationCanAuthenticateAgainstProtectionSpaceCallback)(WKPageRef page, WKProtectionSpaceRef protectionSpace, const void* clientInfo);
+
+typedef void (*WKPageNavigationDidReceiveAuthenticationChallengeCallback)(WKPageRef page, WKAuthenticationChallengeRef challenge, const void* clientInfo);
+
+typedef void (*WKPageNavigationWebProcessDidCrashCallback)(WKPageRef page, const void* clientInfo);
+
+typedef WKDataRef (*WKPageNavigationCopyWebCryptoMasterKeyCallback)(WKPageRef page, const void* clientInfo);
+
+typedef WKPluginLoadPolicy (*WKPageNavigationDecidePolicyForPluginLoadCallback)(WKPageRef page, WKPluginLoadPolicy currentPluginLoadPolicy, WKDictionaryRef pluginInfoDictionary, WKStringRef* unavailabilityDescription, const void* clientInfo);
+
+typedef void (*WKPageNavigationDidBeginNavigationGesture)(WKPageRef page, const void* clientInfo);
+
+typedef void (*WKPageNavigationWillEndNavigationGesture)(WKPageRef page, WKBackForwardListItemRef backForwardListItem, const void* clientInfo);
+
+typedef void (*WKPageNavigationDidEndNavigationGesture)(WKPageRef page, WKBackForwardListItemRef backForwardListItem, const void* clientInfo);
+
+typedef void (*WKPageNavigationDidRemoveNavigationGestureSnapshot)(WKPageRef page, const void* clientInfo);
+
+
+typedef struct WKPageNavigationClientBase {
+ int version;
+ const void* clientInfo;
+} WKPageNavigationClientBase;
+
+typedef struct WKPageNavigationClientV0 {
+ WKPageNavigationClientBase base;
+
+ // Version 0.
+ WKPageNavigationDecidePolicyForNavigationActionCallback decidePolicyForNavigationAction;
+ WKPageNavigationDecidePolicyForNavigationResponseCallback decidePolicyForNavigationResponse;
+ WKPageNavigationDecidePolicyForPluginLoadCallback decidePolicyForPluginLoad;
+ WKPageNavigationDidStartProvisionalNavigationCallback didStartProvisionalNavigation;
+ WKPageNavigationDidReceiveServerRedirectForProvisionalNavigationCallback didReceiveServerRedirectForProvisionalNavigation;
+ WKPageNavigationDidFailProvisionalNavigationCallback didFailProvisionalNavigation;
+ WKPageNavigationDidCommitNavigationCallback didCommitNavigation;
+ WKPageNavigationDidFinishNavigationCallback didFinishNavigation;
+ WKPageNavigationDidFailNavigationCallback didFailNavigation;
+ WKPageNavigationDidFailProvisionalLoadInSubframeCallback didFailProvisionalLoadInSubframe;
+ WKPageNavigationDidFinishDocumentLoadCallback didFinishDocumentLoad;
+ WKPageNavigationDidSameDocumentNavigationCallback didSameDocumentNavigation;
+ WKPageNavigationRenderingProgressDidChangeCallback renderingProgressDidChange;
+ WKPageNavigationCanAuthenticateAgainstProtectionSpaceCallback canAuthenticateAgainstProtectionSpace;
+ WKPageNavigationDidReceiveAuthenticationChallengeCallback didReceiveAuthenticationChallenge;
+ WKPageNavigationWebProcessDidCrashCallback webProcessDidCrash;
+ WKPageNavigationCopyWebCryptoMasterKeyCallback copyWebCryptoMasterKey;
+
+ WKPageNavigationDidBeginNavigationGesture didBeginNavigationGesture;
+ WKPageNavigationWillEndNavigationGesture willEndNavigationGesture;
+ WKPageNavigationDidEndNavigationGesture didEndNavigationGesture;
+ WKPageNavigationDidRemoveNavigationGestureSnapshot didRemoveNavigationGestureSnapshot;
+} WKPageNavigationClientV0;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif // WKPageNavigationClient_h
diff --git a/Source/WebKit2/UIProcess/API/C/WKPagePolicyClient.h b/Source/WebKit2/UIProcess/API/C/WKPagePolicyClient.h
index 15f834835..121c1018a 100644
--- a/Source/WebKit2/UIProcess/API/C/WKPagePolicyClient.h
+++ b/Source/WebKit2/UIProcess/API/C/WKPagePolicyClient.h
@@ -26,9 +26,9 @@
#ifndef WKPagePolicyClient_h
#define WKPagePolicyClient_h
-#include <WebKit2/WKBase.h>
-#include <WebKit2/WKEvent.h>
-#include <WebKit2/WKPageLoadTypes.h>
+#include <WebKit/WKBase.h>
+#include <WebKit/WKEvent.h>
+#include <WebKit/WKPageLoadTypes.h>
#ifdef __cplusplus
extern "C" {
@@ -71,23 +71,6 @@ typedef struct WKPagePolicyClientV1 {
WKPageDecidePolicyForResponseCallback decidePolicyForResponse;
} WKPagePolicyClientV1;
-// FIXME: These should be deprecated.
-enum { kWKPagePolicyClientCurrentVersion WK_ENUM_DEPRECATED("Use an explicit version number instead") = 1 };
-typedef struct WKPagePolicyClient {
- int version;
- const void * clientInfo;
-
- // Version 0.
- WKPageDecidePolicyForNavigationActionCallback_deprecatedForUseWithV0 decidePolicyForNavigationAction_deprecatedForUseWithV0;
- WKPageDecidePolicyForNewWindowActionCallback decidePolicyForNewWindowAction;
- WKPageDecidePolicyForResponseCallback_deprecatedForUseWithV0 decidePolicyForResponse_deprecatedForUseWithV0;
- WKPageUnableToImplementPolicyCallback unableToImplementPolicy;
-
- // Version 1.
- WKPageDecidePolicyForNavigationActionCallback decidePolicyForNavigationAction;
- WKPageDecidePolicyForResponseCallback decidePolicyForResponse;
-} WKPagePolicyClient;
-
#ifdef __cplusplus
}
#endif
diff --git a/Source/WebKit2/UIProcess/API/C/WKPagePrivate.h b/Source/WebKit2/UIProcess/API/C/WKPagePrivate.h
index 5d6f66082..d3ed91af6 100644
--- a/Source/WebKit2/UIProcess/API/C/WKPagePrivate.h
+++ b/Source/WebKit2/UIProcess/API/C/WKPagePrivate.h
@@ -26,8 +26,8 @@
#ifndef WKPagePrivate_h
#define WKPagePrivate_h
-#include <WebKit2/WKBase.h>
-#include <WebKit2/WKPage.h>
+#include <WebKit/WKBase.h>
+#include <WebKit/WKPage.h>
#ifdef __cplusplus
extern "C" {
@@ -42,9 +42,6 @@ enum {
};
typedef unsigned WKPageDebugPaintFlags;
-WK_EXPORT void WKPageSetDebugPaintFlags(WKPageDebugPaintFlags flags);
-WK_EXPORT WKPageDebugPaintFlags WKPageGetDebugPaintFlags(void);
-
WK_EXPORT WKStringRef WKPageCopyStandardUserAgentWithApplicationName(WKStringRef);
enum {
@@ -64,6 +61,8 @@ WK_EXPORT void WKPageSetPageLength(WKPageRef page, double pageLength);
WK_EXPORT double WKPageGetPageLength(WKPageRef page);
WK_EXPORT void WKPageSetGapBetweenPages(WKPageRef page, double gap);
WK_EXPORT double WKPageGetGapBetweenPages(WKPageRef page);
+WK_EXPORT void WKPageSetPaginationLineGridEnabled(WKPageRef page, bool lineGridEnabled);
+WK_EXPORT bool WKPageGetPaginationLineGridEnabled(WKPageRef page);
WK_EXPORT unsigned WKPageGetPageCount(WKPageRef page);
@@ -82,18 +81,27 @@ WK_EXPORT void WKPageBeginPrinting(WKPageRef page, WKFrameRef frame, WKPrintInfo
WK_EXPORT void WKPageDrawPagesToPDF(WKPageRef page, WKFrameRef frame, WKPrintInfo printInfo, uint32_t first, uint32_t count, WKPageDrawToPDFFunction callback, void* context);
WK_EXPORT void WKPageEndPrinting(WKPageRef page);
-// FIXME https://bugs.webkit.org/show_bug.cgi?id=66979: Remove this sync call.
-WK_EXPORT WKImageRef WKPageCreateSnapshotOfVisibleContent(WKPageRef page);
+WK_EXPORT bool WKPageGetIsControlledByAutomation(WKPageRef page);
+WK_EXPORT void WKPageSetControlledByAutomation(WKPageRef page, bool controlled);
-WK_EXPORT void WKPageSetShouldSendEventsSynchronously(WKPageRef page, bool sync);
+WK_EXPORT bool WKPageGetAllowsRemoteInspection(WKPageRef page);
+WK_EXPORT void WKPageSetAllowsRemoteInspection(WKPageRef page, bool allow);
WK_EXPORT void WKPageSetMediaVolume(WKPageRef page, float volume);
WK_EXPORT void WKPageSetMayStartMediaWhenInWindow(WKPageRef page, bool mayStartMedia);
+typedef void (*WKPageGetBytecodeProfileFunction)(WKStringRef, WKErrorRef, void*);
+WK_EXPORT void WKPageGetBytecodeProfile(WKPageRef page, void* context, WKPageGetBytecodeProfileFunction function);
+
+typedef void (*WKPageGetSamplingProfilerOutputFunction)(WKStringRef, WKErrorRef, void*);
+WK_EXPORT void WKPageGetSamplingProfilerOutput(WKPageRef page, void* context, WKPageGetSamplingProfilerOutputFunction function);
+
+typedef void (*WKPageIsWebProcessResponsiveFunction)(bool isWebProcessResponsive, void* context);
+WK_EXPORT void WKPageIsWebProcessResponsive(WKPageRef page, void* context, WKPageIsWebProcessResponsiveFunction function);
+
WK_EXPORT WKArrayRef WKPageCopyRelatedPages(WKPageRef page);
-typedef void (*WKPageInvalidMessageFunction)(uint32_t messageID);
-WK_EXPORT void WKPageSetInvalidMessageFunction(WKPageInvalidMessageFunction function);
+WK_EXPORT WKFrameRef WKPageLookUpFrameFromHandle(WKPageRef page, WKFrameHandleRef handle);
enum {
kWKScrollPinningBehaviorDoNotPin,
@@ -105,6 +113,60 @@ typedef uint32_t WKScrollPinningBehavior;
WK_EXPORT WKScrollPinningBehavior WKPageGetScrollPinningBehavior(WKPageRef page);
WK_EXPORT void WKPageSetScrollPinningBehavior(WKPageRef page, WKScrollPinningBehavior pinning);
+WK_EXPORT bool WKPageGetAddsVisitedLinks(WKPageRef page);
+WK_EXPORT void WKPageSetAddsVisitedLinks(WKPageRef page, bool visitedLinks);
+
+WK_EXPORT bool WKPageIsPlayingAudio(WKPageRef page);
+
+enum {
+ kWKMediaNoneMuted = 0,
+ kWKMediaAudioMuted = 1 << 0,
+ kWKMediaCaptureDevicesMuted = 1 << 1,
+};
+typedef uint32_t WKMediaMutedState;
+WK_EXPORT void WKPageSetMuted(WKPageRef page, WKMediaMutedState muted);
+
+WK_EXPORT void WKPageClearUserMediaState(WKPageRef page);
+
+WK_EXPORT void WKPageDidAllowPointerLock(WKPageRef page);
+WK_EXPORT void WKPageDidDenyPointerLock(WKPageRef page);
+
+enum {
+ kWKMediaIsNotPlaying = 0,
+ kWKMediaIsPlayingAudio = 1 << 0,
+ kWKMediaIsPlayingVideo = 1 << 1,
+ kWKMediaHasActiveAudioCaptureDevice = 1 << 2,
+ kWKMediaHasActiveVideoCaptureDevice = 1 << 3,
+};
+typedef uint32_t WKMediaState;
+
+
+WK_EXPORT WKMediaState WKPageGetMediaState(WKPageRef page);
+
+enum {
+ kWKMediaEventTypePlayPause,
+ kWKMediaEventTypeTrackNext,
+ kWKMediaEventTypeTrackPrevious
+};
+typedef uint32_t WKMediaEventType;
+
+WK_EXPORT bool WKPageHasMediaSessionWithActiveMediaElements(WKPageRef page);
+WK_EXPORT void WKPageHandleMediaEvent(WKPageRef page, WKMediaEventType event);
+
+WK_EXPORT void WKPageLoadURLWithShouldOpenExternalURLsPolicy(WKPageRef page, WKURLRef url, bool shouldOpenExternalURLs);
+
+typedef void (*WKPagePostPresentationUpdateFunction)(WKErrorRef, void*);
+WK_EXPORT void WKPageCallAfterNextPresentationUpdate(WKPageRef page, void* context, WKPagePostPresentationUpdateFunction function);
+
+WK_EXPORT bool WKPageGetResourceCachingDisabled(WKPageRef page);
+WK_EXPORT void WKPageSetResourceCachingDisabled(WKPageRef page, bool disabled);
+
+WK_EXPORT void WKPageRestoreFromSessionStateWithoutNavigation(WKPageRef page, WKTypeRef sessionState);
+
+WK_EXPORT void WKPageSetIgnoresViewportScaleLimits(WKPageRef page, bool ignoresViewportScaleLimits);
+
+WK_EXPORT pid_t WKPageGetProcessIdentifier(WKPageRef page);
+
#ifdef __cplusplus
}
#endif
diff --git a/Source/WebKit2/UIProcess/API/C/WKSessionRef.h b/Source/WebKit2/UIProcess/API/C/WKPageRenderingProgressEvents.h
index 63fa54277..6d258ed15 100644
--- a/Source/WebKit2/UIProcess/API/C/WKSessionRef.h
+++ b/Source/WebKit2/UIProcess/API/C/WKPageRenderingProgressEvents.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2014 Apple Inc. All rights reserved.
+ * Copyright (C) 2015 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -23,24 +23,25 @@
* THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef WKSessionRef_h
-#define WKSessionRef_h
+#ifndef WKPageRenderingProgressEvents_h
+#define WKPageRenderingProgressEvents_h
-#include <WebKit2/WKBase.h>
+#include <stdint.h>
#ifdef __cplusplus
extern "C" {
#endif
-/* FIXME: We can create sessions on demand, because we hardcode the fact that all sessions but the default one are ephemeral. We'll need to create them explicitly once sessions have more configuration options. */
-WK_EXPORT WKSessionRef WKSessionCreate(bool isEphemeral);
-
-WK_EXPORT WKTypeID WKSessionGetTypeID();
-
-WK_EXPORT bool WKSessionIsEphemeral(WKSessionRef session);
+enum {
+ WKPageRenderingProgressEventFirstLayout = 1 << 0,
+ WKPageRenderingProgressEventFirstVisuallyNonEmptyLayout = 1 << 1,
+ WKPageRenderingProgressEventFirstPaintWithSignificantArea = 1 << 2,
+ WKPageRenderingProgressEventReachedSessionRestorationRenderTreeSizeThreshold = 1 << 3
+};
+typedef uint32_t WKPageRenderingProgressEvents;
#ifdef __cplusplus
}
#endif
-#endif /* WKSessionRef_h */
+#endif /* WKPageRenderingProgressEvents_h */
diff --git a/Source/WebKit2/UIProcess/API/C/soup/WKSoupCustomProtocolRequestManager.cpp b/Source/WebKit2/UIProcess/API/C/WKPageRenderingProgressEventsInternal.h
index 95b1f8124..ab9274534 100644
--- a/Source/WebKit2/UIProcess/API/C/soup/WKSoupCustomProtocolRequestManager.cpp
+++ b/Source/WebKit2/UIProcess/API/C/WKPageRenderingProgressEventsInternal.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2013 Igalia S.L.
+ * Copyright (C) 2015 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -23,29 +23,25 @@
* THE POSSIBILITY OF SUCH DAMAGE.
*/
-#include "config.h"
-#include "WKSoupCustomProtocolRequestManager.h"
+#include "WKPageRenderingProgressEvents.h"
-#include "WKAPICast.h"
-#include "WebSoupCustomProtocolRequestManager.h"
+#include <WebCore/LayoutMilestones.h>
-using namespace WebKit;
-
-WKTypeID WKSoupCustomProtocolRequestManagerGetTypeID()
-{
-#if ENABLE(CUSTOM_PROTOCOLS)
- return toAPI(WebSoupCustomProtocolRequestManager::APIType);
-#else
- return 0;
-#endif
-}
-
-void WKSoupCustomProtocolRequestManagerSetClient(WKSoupCustomProtocolRequestManagerRef soupRequestManagerRef, const WKSoupCustomProtocolRequestManagerClientBase* wkClient)
+static inline WKPageRenderingProgressEvents pageRenderingProgressEvents(WebCore::LayoutMilestones milestones)
{
-#if ENABLE(CUSTOM_PROTOCOLS)
- toImpl(soupRequestManagerRef)->initializeClient(wkClient);
-#else
- UNUSED_PARAM(soupRequestManagerRef);
- UNUSED_PARAM(wkClient);
-#endif
+ WKPageRenderingProgressEvents events = 0;
+
+ if (milestones & WebCore::DidFirstLayout)
+ events |= WKPageRenderingProgressEventFirstLayout;
+
+ if (milestones & WebCore::DidFirstVisuallyNonEmptyLayout)
+ events |= WKPageRenderingProgressEventFirstVisuallyNonEmptyLayout;
+
+ if (milestones & WebCore::DidHitRelevantRepaintedObjectsAreaThreshold)
+ events |= WKPageRenderingProgressEventFirstPaintWithSignificantArea;
+
+ if (milestones & WebCore::ReachedSessionRestorationRenderTreeSizeThreshold)
+ events |= WKPageRenderingProgressEventReachedSessionRestorationRenderTreeSizeThreshold;
+
+ return events;
}
diff --git a/Source/WebKit2/UIProcess/API/C/WKPageUIClient.h b/Source/WebKit2/UIProcess/API/C/WKPageUIClient.h
index 1d8417000..21f51a882 100644
--- a/Source/WebKit2/UIProcess/API/C/WKPageUIClient.h
+++ b/Source/WebKit2/UIProcess/API/C/WKPageUIClient.h
@@ -26,10 +26,10 @@
#ifndef WKPageUIClient_h
#define WKPageUIClient_h
-#include <WebKit2/WKBase.h>
-#include <WebKit2/WKEvent.h>
-#include <WebKit2/WKGeometry.h>
-#include <WebKit2/WKNativeEvent.h>
+#include <WebKit/WKBase.h>
+#include <WebKit/WKEvent.h>
+#include <WebKit/WKGeometry.h>
+#include <WebKit/WKNativeEvent.h>
#ifdef __cplusplus
extern "C" {
@@ -48,11 +48,24 @@ enum {
};
typedef uint32_t WKPluginUnavailabilityReason;
+WK_EXPORT WKTypeID WKPageRunBeforeUnloadConfirmPanelResultListenerGetTypeID();
+WK_EXPORT void WKPageRunBeforeUnloadConfirmPanelResultListenerCall(WKPageRunBeforeUnloadConfirmPanelResultListenerRef listener, bool result);
+
+WK_EXPORT WKTypeID WKPageRunJavaScriptAlertResultListenerGetTypeID();
+WK_EXPORT void WKPageRunJavaScriptAlertResultListenerCall(WKPageRunJavaScriptAlertResultListenerRef listener);
+
+WK_EXPORT WKTypeID WKPageRunJavaScriptConfirmResultListenerGetTypeID();
+WK_EXPORT void WKPageRunJavaScriptConfirmResultListenerCall(WKPageRunJavaScriptConfirmResultListenerRef listener, bool result);
+
+WK_EXPORT WKTypeID WKPageRunJavaScriptPromptResultListenerGetTypeID();
+WK_EXPORT void WKPageRunJavaScriptPromptResultListenerCall(WKPageRunJavaScriptPromptResultListenerRef listener, WKStringRef result);
+
typedef void (*WKPageUIClientCallback)(WKPageRef page, const void* clientInfo);
-typedef WKPageRef (*WKPageCreateNewPageCallback)(WKPageRef page, WKURLRequestRef urlRequest, WKDictionaryRef features, WKEventModifiers modifiers, WKEventMouseButton mouseButton, const void *clientInfo);
-typedef void (*WKPageRunJavaScriptAlertCallback)(WKPageRef page, WKStringRef alertText, WKFrameRef frame, const void *clientInfo);
-typedef bool (*WKPageRunJavaScriptConfirmCallback)(WKPageRef page, WKStringRef message, WKFrameRef frame, const void *clientInfo);
-typedef WKStringRef (*WKPageRunJavaScriptPromptCallback)(WKPageRef page, WKStringRef message, WKStringRef defaultValue, WKFrameRef frame, const void *clientInfo);
+typedef WKPageRef (*WKPageCreateNewPageCallback)(WKPageRef page, WKPageConfigurationRef configuration, WKNavigationActionRef navigationAction, WKWindowFeaturesRef windowFeatures, const void *clientInfo);
+typedef void (*WKPageRunBeforeUnloadConfirmPanelCallback)(WKPageRef page, WKStringRef message, WKFrameRef frame, WKPageRunBeforeUnloadConfirmPanelResultListenerRef listener, const void *clientInfo);
+typedef void (*WKPageRunJavaScriptAlertCallback)(WKPageRef page, WKStringRef alertText, WKFrameRef frame, WKSecurityOriginRef securityOrigin, WKPageRunJavaScriptAlertResultListenerRef listener, const void *clientInfo);
+typedef void (*WKPageRunJavaScriptConfirmCallback)(WKPageRef page, WKStringRef message, WKFrameRef frame, WKSecurityOriginRef securityOrigin, WKPageRunJavaScriptConfirmResultListenerRef listener, const void *clientInfo);
+typedef void (*WKPageRunJavaScriptPromptCallback)(WKPageRef page, WKStringRef message, WKStringRef defaultValue, WKFrameRef frame, WKSecurityOriginRef securityOrigin, WKPageRunJavaScriptPromptResultListenerRef listener, const void *clientInfo);
typedef void (*WKPageTakeFocusCallback)(WKPageRef page, WKFocusDirection direction, const void *clientInfo);
typedef void (*WKPageFocusCallback)(WKPageRef page, const void *clientInfo);
typedef void (*WKPageUnfocusCallback)(WKPageRef page, const void *clientInfo);
@@ -70,7 +83,6 @@ typedef bool (*WKPageGetIsResizableCallback)(WKPageRef page, const void *clientI
typedef void (*WKPageSetIsResizableCallback)(WKPageRef page, bool resizable, const void *clientInfo);
typedef WKRect (*WKPageGetWindowFrameCallback)(WKPageRef page, const void *clientInfo);
typedef void (*WKPageSetWindowFrameCallback)(WKPageRef page, WKRect frame, const void *clientInfo);
-typedef bool (*WKPageRunBeforeUnloadConfirmPanelCallback)(WKPageRef page, WKStringRef message, WKFrameRef frame, const void *clientInfo);
typedef unsigned long long (*WKPageExceededDatabaseQuotaCallback)(WKPageRef page, WKFrameRef frame, WKSecurityOriginRef origin, WKStringRef databaseName, WKStringRef displayName, unsigned long long currentQuota, unsigned long long currentOriginUsage, unsigned long long currentDatabaseUsage, unsigned long long expectedUsage, const void *clientInfo);
typedef void (*WKPageRunOpenPanelCallback)(WKPageRef page, WKFrameRef frame, WKOpenPanelParametersRef parameters, WKOpenPanelResultListenerRef listener, const void *clientInfo);
typedef void (*WKPageDecidePolicyForGeolocationPermissionRequestCallback)(WKPageRef page, WKFrameRef frame, WKSecurityOriginRef origin, WKGeolocationPermissionRequestRef permissionRequest, const void* clientInfo);
@@ -80,17 +92,35 @@ typedef void (*WKPageDrawHeaderCallback)(WKPageRef page, WKFrameRef frame, WKRec
typedef void (*WKPageDrawFooterCallback)(WKPageRef page, WKFrameRef frame, WKRect rect, const void* clientInfo);
typedef void (*WKPagePrintFrameCallback)(WKPageRef page, WKFrameRef frame, const void* clientInfo);
typedef void (*WKPageSaveDataToFileInDownloadsFolderCallback)(WKPageRef page, WKStringRef suggestedFilename, WKStringRef mimeType, WKURLRef originatingURL, WKDataRef data, const void* clientInfo);
-typedef bool (*WKPageShouldInterruptJavaScriptCallback)(WKPageRef page, const void *clientInfo);
typedef void (*WKPageDecidePolicyForNotificationPermissionRequestCallback)(WKPageRef page, WKSecurityOriginRef origin, WKNotificationPermissionRequestRef permissionRequest, const void *clientInfo);
typedef void (*WKPageShowColorPickerCallback)(WKPageRef page, WKStringRef initialColor, WKColorPickerResultListenerRef listener, const void* clientInfo);
typedef void (*WKPageHideColorPickerCallback)(WKPageRef page, const void* clientInfo);
typedef void (*WKPageUnavailablePluginButtonClickedCallback)(WKPageRef page, WKPluginUnavailabilityReason pluginUnavailabilityReason, WKDictionaryRef pluginInfoDictionary, const void* clientInfo);
+typedef void (*WKPagePinnedStateDidChangeCallback)(WKPageRef page, const void* clientInfo);
+typedef void (*WKPageIsPlayingAudioDidChangeCallback)(WKPageRef page, const void* clientInfo);
+typedef void (*WKPageDecidePolicyForUserMediaPermissionRequestCallback)(WKPageRef page, WKFrameRef frame, WKSecurityOriginRef userMediaDocumentOrigin, WKSecurityOriginRef topLevelDocumentOrigin, WKUserMediaPermissionRequestRef permissionRequest, const void* clientInfo);
+typedef void (*WKCheckUserMediaPermissionCallback)(WKPageRef page, WKFrameRef frame, WKSecurityOriginRef userMediaDocumentOrigin, WKSecurityOriginRef topLevelDocumentOrigin, WKUserMediaPermissionCheckRef devicesRequest, const void *clientInfo);
+typedef void (*WKPageDidClickAutoFillButtonCallback)(WKPageRef page, WKTypeRef userData, const void *clientInfo);
+typedef void (*WKPageMediaSessionMetadataDidChangeCallback)(WKPageRef page, WKMediaSessionMetadataRef metadata, const void* clientInfo);
+typedef void (*WKDidPlayMediaPreventedFromPlayingWithoutUserGesture)(WKPageRef page, const void* clientInfo);
+typedef void (*WKFullscreenMayReturnToInlineCallback)(WKPageRef page, const void* clientInfo);
+
+typedef void (*WKRequestPointerLockCallback)(WKPageRef page, const void* clientInfo);
+typedef void (*WKDidLosePointerLockCallback)(WKPageRef page, const void* clientInfo);
-// Deprecated
+// Deprecated
typedef WKPageRef (*WKPageCreateNewPageCallback_deprecatedForUseWithV0)(WKPageRef page, WKDictionaryRef features, WKEventModifiers modifiers, WKEventMouseButton mouseButton, const void *clientInfo);
typedef void (*WKPageMouseDidMoveOverElementCallback_deprecatedForUseWithV0)(WKPageRef page, WKEventModifiers modifiers, WKTypeRef userData, const void *clientInfo);
typedef void (*WKPageMissingPluginButtonClickedCallback_deprecatedForUseWithV0)(WKPageRef page, WKStringRef mimeType, WKStringRef url, WKStringRef pluginsPageURL, const void* clientInfo);
typedef void (*WKPageUnavailablePluginButtonClickedCallback_deprecatedForUseWithV1)(WKPageRef page, WKPluginUnavailabilityReason pluginUnavailabilityReason, WKStringRef mimeType, WKStringRef url, WKStringRef pluginsPageURL, const void* clientInfo);
+typedef void (*WKPageRunJavaScriptAlertCallback_deprecatedForUseWithV0)(WKPageRef page, WKStringRef alertText, WKFrameRef frame, const void *clientInfo);
+typedef bool (*WKPageRunJavaScriptConfirmCallback_deprecatedForUseWithV0)(WKPageRef page, WKStringRef message, WKFrameRef frame, const void *clientInfo);
+typedef WKStringRef (*WKPageRunJavaScriptPromptCallback_deprecatedForUseWithV0)(WKPageRef page, WKStringRef message, WKStringRef defaultValue, WKFrameRef frame, const void *clientInfo);
+typedef WKPageRef (*WKPageCreateNewPageCallback_deprecatedForUseWithV1)(WKPageRef page, WKURLRequestRef urlRequest, WKDictionaryRef features, WKEventModifiers modifiers, WKEventMouseButton mouseButton, const void *clientInfo);
+typedef void (*WKPageRunJavaScriptAlertCallback_deprecatedForUseWithV5)(WKPageRef page, WKStringRef alertText, WKFrameRef frame, WKSecurityOriginRef securityOrigin, const void *clientInfo);
+typedef bool (*WKPageRunJavaScriptConfirmCallback_deprecatedForUseWithV5)(WKPageRef page, WKStringRef message, WKFrameRef frame, WKSecurityOriginRef securityOrigin, const void *clientInfo);
+typedef WKStringRef (*WKPageRunJavaScriptPromptCallback_deprecatedForUseWithV5)(WKPageRef page, WKStringRef message, WKStringRef defaultValue, WKFrameRef frame, WKSecurityOriginRef securityOrigin, const void *clientInfo);
+typedef bool (*WKPageRunBeforeUnloadConfirmPanelCallback_deprecatedForUseWithV6)(WKPageRef page, WKStringRef message, WKFrameRef frame, const void *clientInfo);
typedef struct WKPageUIClientBase {
int version;
@@ -107,9 +137,9 @@ typedef struct WKPageUIClientV0 {
WKPageTakeFocusCallback takeFocus;
WKPageFocusCallback focus;
WKPageUnfocusCallback unfocus;
- WKPageRunJavaScriptAlertCallback runJavaScriptAlert;
- WKPageRunJavaScriptConfirmCallback runJavaScriptConfirm;
- WKPageRunJavaScriptPromptCallback runJavaScriptPrompt;
+ WKPageRunJavaScriptAlertCallback_deprecatedForUseWithV0 runJavaScriptAlert;
+ WKPageRunJavaScriptConfirmCallback_deprecatedForUseWithV0 runJavaScriptConfirm;
+ WKPageRunJavaScriptPromptCallback_deprecatedForUseWithV0 runJavaScriptPrompt;
WKPageSetStatusTextCallback setStatusText;
WKPageMouseDidMoveOverElementCallback_deprecatedForUseWithV0 mouseDidMoveOverElement_deprecatedForUseWithV0;
WKPageMissingPluginButtonClickedCallback_deprecatedForUseWithV0 missingPluginButtonClicked_deprecatedForUseWithV0;
@@ -125,7 +155,7 @@ typedef struct WKPageUIClientV0 {
WKPageSetIsResizableCallback setIsResizable;
WKPageGetWindowFrameCallback getWindowFrame;
WKPageSetWindowFrameCallback setWindowFrame;
- WKPageRunBeforeUnloadConfirmPanelCallback runBeforeUnloadConfirmPanel;
+ WKPageRunBeforeUnloadConfirmPanelCallback_deprecatedForUseWithV6 runBeforeUnloadConfirmPanel;
WKPageUIClientCallback didDraw;
WKPageUIClientCallback pageDidScroll;
WKPageExceededDatabaseQuotaCallback exceededDatabaseQuota;
@@ -139,7 +169,7 @@ typedef struct WKPageUIClientV0 {
WKPageUIClientCallback runModal;
void* unused1; // Used to be didCompleteRubberBandForMainFrame
WKPageSaveDataToFileInDownloadsFolderCallback saveDataToFileInDownloadsFolder;
- WKPageShouldInterruptJavaScriptCallback shouldInterruptJavaScript;
+ void* shouldInterruptJavaScript_unavailable;
} WKPageUIClientV0;
typedef struct WKPageUIClientV1 {
@@ -152,9 +182,9 @@ typedef struct WKPageUIClientV1 {
WKPageTakeFocusCallback takeFocus;
WKPageFocusCallback focus;
WKPageUnfocusCallback unfocus;
- WKPageRunJavaScriptAlertCallback runJavaScriptAlert;
- WKPageRunJavaScriptConfirmCallback runJavaScriptConfirm;
- WKPageRunJavaScriptPromptCallback runJavaScriptPrompt;
+ WKPageRunJavaScriptAlertCallback_deprecatedForUseWithV0 runJavaScriptAlert;
+ WKPageRunJavaScriptConfirmCallback_deprecatedForUseWithV0 runJavaScriptConfirm;
+ WKPageRunJavaScriptPromptCallback_deprecatedForUseWithV0 runJavaScriptPrompt;
WKPageSetStatusTextCallback setStatusText;
WKPageMouseDidMoveOverElementCallback_deprecatedForUseWithV0 mouseDidMoveOverElement_deprecatedForUseWithV0;
WKPageMissingPluginButtonClickedCallback_deprecatedForUseWithV0 missingPluginButtonClicked_deprecatedForUseWithV0;
@@ -170,7 +200,7 @@ typedef struct WKPageUIClientV1 {
WKPageSetIsResizableCallback setIsResizable;
WKPageGetWindowFrameCallback getWindowFrame;
WKPageSetWindowFrameCallback setWindowFrame;
- WKPageRunBeforeUnloadConfirmPanelCallback runBeforeUnloadConfirmPanel;
+ WKPageRunBeforeUnloadConfirmPanelCallback_deprecatedForUseWithV6 runBeforeUnloadConfirmPanel;
WKPageUIClientCallback didDraw;
WKPageUIClientCallback pageDidScroll;
WKPageExceededDatabaseQuotaCallback exceededDatabaseQuota;
@@ -184,10 +214,10 @@ typedef struct WKPageUIClientV1 {
WKPageUIClientCallback runModal;
void* unused1; // Used to be didCompleteRubberBandForMainFrame
WKPageSaveDataToFileInDownloadsFolderCallback saveDataToFileInDownloadsFolder;
- WKPageShouldInterruptJavaScriptCallback shouldInterruptJavaScript;
+ void* shouldInterruptJavaScript_unavailable;
// Version 1.
- WKPageCreateNewPageCallback createNewPage;
+ WKPageCreateNewPageCallback_deprecatedForUseWithV1 createNewPage;
WKPageMouseDidMoveOverElementCallback mouseDidMoveOverElement;
WKPageDecidePolicyForNotificationPermissionRequestCallback decidePolicyForNotificationPermissionRequest;
WKPageUnavailablePluginButtonClickedCallback_deprecatedForUseWithV1 unavailablePluginButtonClicked_deprecatedForUseWithV1;
@@ -203,9 +233,342 @@ typedef struct WKPageUIClientV2 {
WKPageTakeFocusCallback takeFocus;
WKPageFocusCallback focus;
WKPageUnfocusCallback unfocus;
+ WKPageRunJavaScriptAlertCallback_deprecatedForUseWithV0 runJavaScriptAlert;
+ WKPageRunJavaScriptConfirmCallback_deprecatedForUseWithV0 runJavaScriptConfirm;
+ WKPageRunJavaScriptPromptCallback_deprecatedForUseWithV0 runJavaScriptPrompt;
+ WKPageSetStatusTextCallback setStatusText;
+ WKPageMouseDidMoveOverElementCallback_deprecatedForUseWithV0 mouseDidMoveOverElement_deprecatedForUseWithV0;
+ WKPageMissingPluginButtonClickedCallback_deprecatedForUseWithV0 missingPluginButtonClicked_deprecatedForUseWithV0;
+ WKPageDidNotHandleKeyEventCallback didNotHandleKeyEvent;
+ WKPageDidNotHandleWheelEventCallback didNotHandleWheelEvent;
+ WKPageGetToolbarsAreVisibleCallback toolbarsAreVisible;
+ WKPageSetToolbarsAreVisibleCallback setToolbarsAreVisible;
+ WKPageGetMenuBarIsVisibleCallback menuBarIsVisible;
+ WKPageSetMenuBarIsVisibleCallback setMenuBarIsVisible;
+ WKPageGetStatusBarIsVisibleCallback statusBarIsVisible;
+ WKPageSetStatusBarIsVisibleCallback setStatusBarIsVisible;
+ WKPageGetIsResizableCallback isResizable;
+ WKPageSetIsResizableCallback setIsResizable;
+ WKPageGetWindowFrameCallback getWindowFrame;
+ WKPageSetWindowFrameCallback setWindowFrame;
+ WKPageRunBeforeUnloadConfirmPanelCallback_deprecatedForUseWithV6 runBeforeUnloadConfirmPanel;
+ WKPageUIClientCallback didDraw;
+ WKPageUIClientCallback pageDidScroll;
+ WKPageExceededDatabaseQuotaCallback exceededDatabaseQuota;
+ WKPageRunOpenPanelCallback runOpenPanel;
+ WKPageDecidePolicyForGeolocationPermissionRequestCallback decidePolicyForGeolocationPermissionRequest;
+ WKPageHeaderHeightCallback headerHeight;
+ WKPageFooterHeightCallback footerHeight;
+ WKPageDrawHeaderCallback drawHeader;
+ WKPageDrawFooterCallback drawFooter;
+ WKPagePrintFrameCallback printFrame;
+ WKPageUIClientCallback runModal;
+ void* unused1; // Used to be didCompleteRubberBandForMainFrame
+ WKPageSaveDataToFileInDownloadsFolderCallback saveDataToFileInDownloadsFolder;
+ void* shouldInterruptJavaScript_unavailable;
+
+ // Version 1.
+ WKPageCreateNewPageCallback_deprecatedForUseWithV1 createNewPage;
+ WKPageMouseDidMoveOverElementCallback mouseDidMoveOverElement;
+ WKPageDecidePolicyForNotificationPermissionRequestCallback decidePolicyForNotificationPermissionRequest;
+ WKPageUnavailablePluginButtonClickedCallback_deprecatedForUseWithV1 unavailablePluginButtonClicked_deprecatedForUseWithV1;
+
+ // Version 2.
+ WKPageShowColorPickerCallback showColorPicker;
+ WKPageHideColorPickerCallback hideColorPicker;
+ WKPageUnavailablePluginButtonClickedCallback unavailablePluginButtonClicked;
+} WKPageUIClientV2;
+
+typedef struct WKPageUIClientV3 {
+ WKPageUIClientBase base;
+
+ // Version 0.
+ WKPageCreateNewPageCallback_deprecatedForUseWithV0 createNewPage_deprecatedForUseWithV0;
+ WKPageUIClientCallback showPage;
+ WKPageUIClientCallback close;
+ WKPageTakeFocusCallback takeFocus;
+ WKPageFocusCallback focus;
+ WKPageUnfocusCallback unfocus;
+ WKPageRunJavaScriptAlertCallback_deprecatedForUseWithV0 runJavaScriptAlert;
+ WKPageRunJavaScriptConfirmCallback_deprecatedForUseWithV0 runJavaScriptConfirm;
+ WKPageRunJavaScriptPromptCallback_deprecatedForUseWithV0 runJavaScriptPrompt;
+ WKPageSetStatusTextCallback setStatusText;
+ WKPageMouseDidMoveOverElementCallback_deprecatedForUseWithV0 mouseDidMoveOverElement_deprecatedForUseWithV0;
+ WKPageMissingPluginButtonClickedCallback_deprecatedForUseWithV0 missingPluginButtonClicked_deprecatedForUseWithV0;
+ WKPageDidNotHandleKeyEventCallback didNotHandleKeyEvent;
+ WKPageDidNotHandleWheelEventCallback didNotHandleWheelEvent;
+ WKPageGetToolbarsAreVisibleCallback toolbarsAreVisible;
+ WKPageSetToolbarsAreVisibleCallback setToolbarsAreVisible;
+ WKPageGetMenuBarIsVisibleCallback menuBarIsVisible;
+ WKPageSetMenuBarIsVisibleCallback setMenuBarIsVisible;
+ WKPageGetStatusBarIsVisibleCallback statusBarIsVisible;
+ WKPageSetStatusBarIsVisibleCallback setStatusBarIsVisible;
+ WKPageGetIsResizableCallback isResizable;
+ WKPageSetIsResizableCallback setIsResizable;
+ WKPageGetWindowFrameCallback getWindowFrame;
+ WKPageSetWindowFrameCallback setWindowFrame;
+ WKPageRunBeforeUnloadConfirmPanelCallback_deprecatedForUseWithV6 runBeforeUnloadConfirmPanel;
+ WKPageUIClientCallback didDraw;
+ WKPageUIClientCallback pageDidScroll;
+ WKPageExceededDatabaseQuotaCallback exceededDatabaseQuota;
+ WKPageRunOpenPanelCallback runOpenPanel;
+ WKPageDecidePolicyForGeolocationPermissionRequestCallback decidePolicyForGeolocationPermissionRequest;
+ WKPageHeaderHeightCallback headerHeight;
+ WKPageFooterHeightCallback footerHeight;
+ WKPageDrawHeaderCallback drawHeader;
+ WKPageDrawFooterCallback drawFooter;
+ WKPagePrintFrameCallback printFrame;
+ WKPageUIClientCallback runModal;
+ void* unused1; // Used to be didCompleteRubberBandForMainFrame
+ WKPageSaveDataToFileInDownloadsFolderCallback saveDataToFileInDownloadsFolder;
+ void* shouldInterruptJavaScript_unavailable;
+
+ // Version 1.
+ WKPageCreateNewPageCallback_deprecatedForUseWithV1 createNewPage;
+ WKPageMouseDidMoveOverElementCallback mouseDidMoveOverElement;
+ WKPageDecidePolicyForNotificationPermissionRequestCallback decidePolicyForNotificationPermissionRequest;
+ WKPageUnavailablePluginButtonClickedCallback_deprecatedForUseWithV1 unavailablePluginButtonClicked_deprecatedForUseWithV1;
+
+ // Version 2.
+ WKPageShowColorPickerCallback showColorPicker;
+ WKPageHideColorPickerCallback hideColorPicker;
+ WKPageUnavailablePluginButtonClickedCallback unavailablePluginButtonClicked;
+
+ // Version 3.
+ WKPagePinnedStateDidChangeCallback pinnedStateDidChange;
+} WKPageUIClientV3;
+
+typedef struct WKPageUIClientV4 {
+ WKPageUIClientBase base;
+
+ // Version 0.
+ WKPageCreateNewPageCallback_deprecatedForUseWithV0 createNewPage_deprecatedForUseWithV0;
+ WKPageUIClientCallback showPage;
+ WKPageUIClientCallback close;
+ WKPageTakeFocusCallback takeFocus;
+ WKPageFocusCallback focus;
+ WKPageUnfocusCallback unfocus;
+ WKPageRunJavaScriptAlertCallback_deprecatedForUseWithV0 runJavaScriptAlert;
+ WKPageRunJavaScriptConfirmCallback_deprecatedForUseWithV0 runJavaScriptConfirm;
+ WKPageRunJavaScriptPromptCallback_deprecatedForUseWithV0 runJavaScriptPrompt;
+ WKPageSetStatusTextCallback setStatusText;
+ WKPageMouseDidMoveOverElementCallback_deprecatedForUseWithV0 mouseDidMoveOverElement_deprecatedForUseWithV0;
+ WKPageMissingPluginButtonClickedCallback_deprecatedForUseWithV0 missingPluginButtonClicked_deprecatedForUseWithV0;
+ WKPageDidNotHandleKeyEventCallback didNotHandleKeyEvent;
+ WKPageDidNotHandleWheelEventCallback didNotHandleWheelEvent;
+ WKPageGetToolbarsAreVisibleCallback toolbarsAreVisible;
+ WKPageSetToolbarsAreVisibleCallback setToolbarsAreVisible;
+ WKPageGetMenuBarIsVisibleCallback menuBarIsVisible;
+ WKPageSetMenuBarIsVisibleCallback setMenuBarIsVisible;
+ WKPageGetStatusBarIsVisibleCallback statusBarIsVisible;
+ WKPageSetStatusBarIsVisibleCallback setStatusBarIsVisible;
+ WKPageGetIsResizableCallback isResizable;
+ WKPageSetIsResizableCallback setIsResizable;
+ WKPageGetWindowFrameCallback getWindowFrame;
+ WKPageSetWindowFrameCallback setWindowFrame;
+ WKPageRunBeforeUnloadConfirmPanelCallback_deprecatedForUseWithV6 runBeforeUnloadConfirmPanel;
+ WKPageUIClientCallback didDraw;
+ WKPageUIClientCallback pageDidScroll;
+ WKPageExceededDatabaseQuotaCallback exceededDatabaseQuota;
+ WKPageRunOpenPanelCallback runOpenPanel;
+ WKPageDecidePolicyForGeolocationPermissionRequestCallback decidePolicyForGeolocationPermissionRequest;
+ WKPageHeaderHeightCallback headerHeight;
+ WKPageFooterHeightCallback footerHeight;
+ WKPageDrawHeaderCallback drawHeader;
+ WKPageDrawFooterCallback drawFooter;
+ WKPagePrintFrameCallback printFrame;
+ WKPageUIClientCallback runModal;
+ void* unused1; // Used to be didCompleteRubberBandForMainFrame.
+ WKPageSaveDataToFileInDownloadsFolderCallback saveDataToFileInDownloadsFolder;
+ void* shouldInterruptJavaScript_unavailable;
+
+ // Version 1.
+ WKPageCreateNewPageCallback_deprecatedForUseWithV1 createNewPage;
+ WKPageMouseDidMoveOverElementCallback mouseDidMoveOverElement;
+ WKPageDecidePolicyForNotificationPermissionRequestCallback decidePolicyForNotificationPermissionRequest;
+ WKPageUnavailablePluginButtonClickedCallback_deprecatedForUseWithV1 unavailablePluginButtonClicked_deprecatedForUseWithV1;
+
+ // Version 2.
+ WKPageShowColorPickerCallback showColorPicker;
+ WKPageHideColorPickerCallback hideColorPicker;
+ WKPageUnavailablePluginButtonClickedCallback unavailablePluginButtonClicked;
+
+ // Version 3.
+ WKPagePinnedStateDidChangeCallback pinnedStateDidChange;
+
+ // Version 4.
+ void* unused2; // Used to be didBeginTrackingPotentialLongMousePress.
+ void* unused3; // Used to be didRecognizeLongMousePress.
+ void* unused4; // Used to be didCancelTrackingPotentialLongMousePress.
+ WKPageIsPlayingAudioDidChangeCallback isPlayingAudioDidChange;
+} WKPageUIClientV4;
+
+typedef struct WKPageUIClientV5 {
+ WKPageUIClientBase base;
+
+ // Version 0.
+ WKPageCreateNewPageCallback_deprecatedForUseWithV0 createNewPage_deprecatedForUseWithV0;
+ WKPageUIClientCallback showPage;
+ WKPageUIClientCallback close;
+ WKPageTakeFocusCallback takeFocus;
+ WKPageFocusCallback focus;
+ WKPageUnfocusCallback unfocus;
+ WKPageRunJavaScriptAlertCallback_deprecatedForUseWithV0 runJavaScriptAlert_deprecatedForUseWithV0;
+ WKPageRunJavaScriptConfirmCallback_deprecatedForUseWithV0 runJavaScriptConfirm_deprecatedForUseWithV0;
+ WKPageRunJavaScriptPromptCallback_deprecatedForUseWithV0 runJavaScriptPrompt_deprecatedForUseWithV0;
+ WKPageSetStatusTextCallback setStatusText;
+ WKPageMouseDidMoveOverElementCallback_deprecatedForUseWithV0 mouseDidMoveOverElement_deprecatedForUseWithV0;
+ WKPageMissingPluginButtonClickedCallback_deprecatedForUseWithV0 missingPluginButtonClicked_deprecatedForUseWithV0;
+ WKPageDidNotHandleKeyEventCallback didNotHandleKeyEvent;
+ WKPageDidNotHandleWheelEventCallback didNotHandleWheelEvent;
+ WKPageGetToolbarsAreVisibleCallback toolbarsAreVisible;
+ WKPageSetToolbarsAreVisibleCallback setToolbarsAreVisible;
+ WKPageGetMenuBarIsVisibleCallback menuBarIsVisible;
+ WKPageSetMenuBarIsVisibleCallback setMenuBarIsVisible;
+ WKPageGetStatusBarIsVisibleCallback statusBarIsVisible;
+ WKPageSetStatusBarIsVisibleCallback setStatusBarIsVisible;
+ WKPageGetIsResizableCallback isResizable;
+ WKPageSetIsResizableCallback setIsResizable;
+ WKPageGetWindowFrameCallback getWindowFrame;
+ WKPageSetWindowFrameCallback setWindowFrame;
+ WKPageRunBeforeUnloadConfirmPanelCallback_deprecatedForUseWithV6 runBeforeUnloadConfirmPanel;
+ WKPageUIClientCallback didDraw;
+ WKPageUIClientCallback pageDidScroll;
+ WKPageExceededDatabaseQuotaCallback exceededDatabaseQuota;
+ WKPageRunOpenPanelCallback runOpenPanel;
+ WKPageDecidePolicyForGeolocationPermissionRequestCallback decidePolicyForGeolocationPermissionRequest;
+ WKPageHeaderHeightCallback headerHeight;
+ WKPageFooterHeightCallback footerHeight;
+ WKPageDrawHeaderCallback drawHeader;
+ WKPageDrawFooterCallback drawFooter;
+ WKPagePrintFrameCallback printFrame;
+ WKPageUIClientCallback runModal;
+ void* unused1; // Used to be didCompleteRubberBandForMainFrame
+ WKPageSaveDataToFileInDownloadsFolderCallback saveDataToFileInDownloadsFolder;
+ void* shouldInterruptJavaScript_unavailable;
+
+ // Version 1.
+ WKPageCreateNewPageCallback_deprecatedForUseWithV1 createNewPage;
+ WKPageMouseDidMoveOverElementCallback mouseDidMoveOverElement;
+ WKPageDecidePolicyForNotificationPermissionRequestCallback decidePolicyForNotificationPermissionRequest;
+ WKPageUnavailablePluginButtonClickedCallback_deprecatedForUseWithV1 unavailablePluginButtonClicked_deprecatedForUseWithV1;
+
+ // Version 2.
+ WKPageShowColorPickerCallback showColorPicker;
+ WKPageHideColorPickerCallback hideColorPicker;
+ WKPageUnavailablePluginButtonClickedCallback unavailablePluginButtonClicked;
+
+ // Version 3.
+ WKPagePinnedStateDidChangeCallback pinnedStateDidChange;
+
+ // Version 4.
+ void* unused2; // Used to be didBeginTrackingPotentialLongMousePress.
+ void* unused3; // Used to be didRecognizeLongMousePress.
+ void* unused4; // Used to be didCancelTrackingPotentialLongMousePress.
+ WKPageIsPlayingAudioDidChangeCallback isPlayingAudioDidChange;
+
+ // Version 5.
+ WKPageDecidePolicyForUserMediaPermissionRequestCallback decidePolicyForUserMediaPermissionRequest;
+ WKPageDidClickAutoFillButtonCallback didClickAutoFillButton;
+ WKPageRunJavaScriptAlertCallback_deprecatedForUseWithV5 runJavaScriptAlert;
+ WKPageRunJavaScriptConfirmCallback_deprecatedForUseWithV5 runJavaScriptConfirm;
+ WKPageRunJavaScriptPromptCallback_deprecatedForUseWithV5 runJavaScriptPrompt;
+ WKPageMediaSessionMetadataDidChangeCallback mediaSessionMetadataDidChange;
+} WKPageUIClientV5;
+
+typedef struct WKPageUIClientV6 {
+ WKPageUIClientBase base;
+
+ // Version 0.
+ WKPageCreateNewPageCallback_deprecatedForUseWithV0 createNewPage_deprecatedForUseWithV0;
+ WKPageUIClientCallback showPage;
+ WKPageUIClientCallback close;
+ WKPageTakeFocusCallback takeFocus;
+ WKPageFocusCallback focus;
+ WKPageUnfocusCallback unfocus;
+ WKPageRunJavaScriptAlertCallback_deprecatedForUseWithV0 runJavaScriptAlert_deprecatedForUseWithV0;
+ WKPageRunJavaScriptConfirmCallback_deprecatedForUseWithV0 runJavaScriptConfirm_deprecatedForUseWithV0;
+ WKPageRunJavaScriptPromptCallback_deprecatedForUseWithV0 runJavaScriptPrompt_deprecatedForUseWithV0;
+ WKPageSetStatusTextCallback setStatusText;
+ WKPageMouseDidMoveOverElementCallback_deprecatedForUseWithV0 mouseDidMoveOverElement_deprecatedForUseWithV0;
+ WKPageMissingPluginButtonClickedCallback_deprecatedForUseWithV0 missingPluginButtonClicked_deprecatedForUseWithV0;
+ WKPageDidNotHandleKeyEventCallback didNotHandleKeyEvent;
+ WKPageDidNotHandleWheelEventCallback didNotHandleWheelEvent;
+ WKPageGetToolbarsAreVisibleCallback toolbarsAreVisible;
+ WKPageSetToolbarsAreVisibleCallback setToolbarsAreVisible;
+ WKPageGetMenuBarIsVisibleCallback menuBarIsVisible;
+ WKPageSetMenuBarIsVisibleCallback setMenuBarIsVisible;
+ WKPageGetStatusBarIsVisibleCallback statusBarIsVisible;
+ WKPageSetStatusBarIsVisibleCallback setStatusBarIsVisible;
+ WKPageGetIsResizableCallback isResizable;
+ WKPageSetIsResizableCallback setIsResizable;
+ WKPageGetWindowFrameCallback getWindowFrame;
+ WKPageSetWindowFrameCallback setWindowFrame;
+ WKPageRunBeforeUnloadConfirmPanelCallback_deprecatedForUseWithV6 runBeforeUnloadConfirmPanel;
+ WKPageUIClientCallback didDraw;
+ WKPageUIClientCallback pageDidScroll;
+ WKPageExceededDatabaseQuotaCallback exceededDatabaseQuota;
+ WKPageRunOpenPanelCallback runOpenPanel;
+ WKPageDecidePolicyForGeolocationPermissionRequestCallback decidePolicyForGeolocationPermissionRequest;
+ WKPageHeaderHeightCallback headerHeight;
+ WKPageFooterHeightCallback footerHeight;
+ WKPageDrawHeaderCallback drawHeader;
+ WKPageDrawFooterCallback drawFooter;
+ WKPagePrintFrameCallback printFrame;
+ WKPageUIClientCallback runModal;
+ void* unused1; // Used to be didCompleteRubberBandForMainFrame
+ WKPageSaveDataToFileInDownloadsFolderCallback saveDataToFileInDownloadsFolder;
+ void* shouldInterruptJavaScript_unavailable;
+
+ // Version 1.
+ WKPageCreateNewPageCallback_deprecatedForUseWithV1 createNewPage_deprecatedForUseWithV1;
+ WKPageMouseDidMoveOverElementCallback mouseDidMoveOverElement;
+ WKPageDecidePolicyForNotificationPermissionRequestCallback decidePolicyForNotificationPermissionRequest;
+ WKPageUnavailablePluginButtonClickedCallback_deprecatedForUseWithV1 unavailablePluginButtonClicked_deprecatedForUseWithV1;
+
+ // Version 2.
+ WKPageShowColorPickerCallback showColorPicker;
+ WKPageHideColorPickerCallback hideColorPicker;
+ WKPageUnavailablePluginButtonClickedCallback unavailablePluginButtonClicked;
+
+ // Version 3.
+ WKPagePinnedStateDidChangeCallback pinnedStateDidChange;
+
+ // Version 4.
+ void* unused2; // Used to be didBeginTrackingPotentialLongMousePress.
+ void* unused3; // Used to be didRecognizeLongMousePress.
+ void* unused4; // Used to be didCancelTrackingPotentialLongMousePress.
+ WKPageIsPlayingAudioDidChangeCallback isPlayingAudioDidChange;
+
+ // Version 5.
+ WKPageDecidePolicyForUserMediaPermissionRequestCallback decidePolicyForUserMediaPermissionRequest;
+ WKPageDidClickAutoFillButtonCallback didClickAutoFillButton;
+ WKPageRunJavaScriptAlertCallback_deprecatedForUseWithV5 runJavaScriptAlert_deprecatedForUseWithV5;
+ WKPageRunJavaScriptConfirmCallback_deprecatedForUseWithV5 runJavaScriptConfirm_deprecatedForUseWithV5;
+ WKPageRunJavaScriptPromptCallback_deprecatedForUseWithV5 runJavaScriptPrompt_deprecatedForUseWithV5;
+ WKPageMediaSessionMetadataDidChangeCallback mediaSessionMetadataDidChange;
+
+ // Version 6.
+ WKPageCreateNewPageCallback createNewPage;
WKPageRunJavaScriptAlertCallback runJavaScriptAlert;
WKPageRunJavaScriptConfirmCallback runJavaScriptConfirm;
WKPageRunJavaScriptPromptCallback runJavaScriptPrompt;
+ WKCheckUserMediaPermissionCallback checkUserMediaPermissionForOrigin;
+} WKPageUIClientV6;
+
+typedef struct WKPageUIClientV7 {
+ WKPageUIClientBase base;
+
+ // Version 0.
+ WKPageCreateNewPageCallback_deprecatedForUseWithV0 createNewPage_deprecatedForUseWithV0;
+ WKPageUIClientCallback showPage;
+ WKPageUIClientCallback close;
+ WKPageTakeFocusCallback takeFocus;
+ WKPageFocusCallback focus;
+ WKPageUnfocusCallback unfocus;
+ WKPageRunJavaScriptAlertCallback_deprecatedForUseWithV0 runJavaScriptAlert_deprecatedForUseWithV0;
+ WKPageRunJavaScriptConfirmCallback_deprecatedForUseWithV0 runJavaScriptConfirm_deprecatedForUseWithV0;
+ WKPageRunJavaScriptPromptCallback_deprecatedForUseWithV0 runJavaScriptPrompt_deprecatedForUseWithV0;
WKPageSetStatusTextCallback setStatusText;
WKPageMouseDidMoveOverElementCallback_deprecatedForUseWithV0 mouseDidMoveOverElement_deprecatedForUseWithV0;
WKPageMissingPluginButtonClickedCallback_deprecatedForUseWithV0 missingPluginButtonClicked_deprecatedForUseWithV0;
@@ -221,7 +584,7 @@ typedef struct WKPageUIClientV2 {
WKPageSetIsResizableCallback setIsResizable;
WKPageGetWindowFrameCallback getWindowFrame;
WKPageSetWindowFrameCallback setWindowFrame;
- WKPageRunBeforeUnloadConfirmPanelCallback runBeforeUnloadConfirmPanel;
+ WKPageRunBeforeUnloadConfirmPanelCallback_deprecatedForUseWithV6 runBeforeUnloadConfirmPanel_deprecatedForUseWithV6;
WKPageUIClientCallback didDraw;
WKPageUIClientCallback pageDidScroll;
WKPageExceededDatabaseQuotaCallback exceededDatabaseQuota;
@@ -235,10 +598,10 @@ typedef struct WKPageUIClientV2 {
WKPageUIClientCallback runModal;
void* unused1; // Used to be didCompleteRubberBandForMainFrame
WKPageSaveDataToFileInDownloadsFolderCallback saveDataToFileInDownloadsFolder;
- WKPageShouldInterruptJavaScriptCallback shouldInterruptJavaScript;
+ void* shouldInterruptJavaScript_unavailable;
// Version 1.
- WKPageCreateNewPageCallback createNewPage;
+ WKPageCreateNewPageCallback_deprecatedForUseWithV1 createNewPage_deprecatedForUseWithV1;
WKPageMouseDidMoveOverElementCallback mouseDidMoveOverElement;
WKPageDecidePolicyForNotificationPermissionRequestCallback decidePolicyForNotificationPermissionRequest;
WKPageUnavailablePluginButtonClickedCallback_deprecatedForUseWithV1 unavailablePluginButtonClicked_deprecatedForUseWithV1;
@@ -247,13 +610,39 @@ typedef struct WKPageUIClientV2 {
WKPageShowColorPickerCallback showColorPicker;
WKPageHideColorPickerCallback hideColorPicker;
WKPageUnavailablePluginButtonClickedCallback unavailablePluginButtonClicked;
-} WKPageUIClientV2;
-enum { kWKPageUIClientCurrentVersion WK_ENUM_DEPRECATED("Use an explicit version number instead") = 2 };
-typedef struct WKPageUIClient {
- int version;
- const void * clientInfo;
+ // Version 3.
+ WKPagePinnedStateDidChangeCallback pinnedStateDidChange;
+
+ // Version 4.
+ void* unused2; // Used to be didBeginTrackingPotentialLongMousePress.
+ void* unused3; // Used to be didRecognizeLongMousePress.
+ void* unused4; // Used to be didCancelTrackingPotentialLongMousePress.
+ WKPageIsPlayingAudioDidChangeCallback isPlayingAudioDidChange;
+
+ // Version 5.
+ WKPageDecidePolicyForUserMediaPermissionRequestCallback decidePolicyForUserMediaPermissionRequest;
+ WKPageDidClickAutoFillButtonCallback didClickAutoFillButton;
+ WKPageRunJavaScriptAlertCallback_deprecatedForUseWithV5 runJavaScriptAlert_deprecatedForUseWithV5;
+ WKPageRunJavaScriptConfirmCallback_deprecatedForUseWithV5 runJavaScriptConfirm_deprecatedForUseWithV5;
+ WKPageRunJavaScriptPromptCallback_deprecatedForUseWithV5 runJavaScriptPrompt_deprecatedForUseWithV5;
+ WKPageMediaSessionMetadataDidChangeCallback mediaSessionMetadataDidChange;
+
+ // Version 6.
+ WKPageCreateNewPageCallback createNewPage;
+ WKPageRunJavaScriptAlertCallback runJavaScriptAlert;
+ WKPageRunJavaScriptConfirmCallback runJavaScriptConfirm;
+ WKPageRunJavaScriptPromptCallback runJavaScriptPrompt;
+ WKCheckUserMediaPermissionCallback checkUserMediaPermissionForOrigin;
+
+ // Version 7.
+ WKPageRunBeforeUnloadConfirmPanelCallback runBeforeUnloadConfirmPanel;
+ WKFullscreenMayReturnToInlineCallback fullscreenMayReturnToInline;
+} WKPageUIClientV7;
+typedef struct WKPageUIClientV8 {
+ WKPageUIClientBase base;
+
// Version 0.
WKPageCreateNewPageCallback_deprecatedForUseWithV0 createNewPage_deprecatedForUseWithV0;
WKPageUIClientCallback showPage;
@@ -261,9 +650,97 @@ typedef struct WKPageUIClient {
WKPageTakeFocusCallback takeFocus;
WKPageFocusCallback focus;
WKPageUnfocusCallback unfocus;
+ WKPageRunJavaScriptAlertCallback_deprecatedForUseWithV0 runJavaScriptAlert_deprecatedForUseWithV0;
+ WKPageRunJavaScriptConfirmCallback_deprecatedForUseWithV0 runJavaScriptConfirm_deprecatedForUseWithV0;
+ WKPageRunJavaScriptPromptCallback_deprecatedForUseWithV0 runJavaScriptPrompt_deprecatedForUseWithV0;
+ WKPageSetStatusTextCallback setStatusText;
+ WKPageMouseDidMoveOverElementCallback_deprecatedForUseWithV0 mouseDidMoveOverElement_deprecatedForUseWithV0;
+ WKPageMissingPluginButtonClickedCallback_deprecatedForUseWithV0 missingPluginButtonClicked_deprecatedForUseWithV0;
+ WKPageDidNotHandleKeyEventCallback didNotHandleKeyEvent;
+ WKPageDidNotHandleWheelEventCallback didNotHandleWheelEvent;
+ WKPageGetToolbarsAreVisibleCallback toolbarsAreVisible;
+ WKPageSetToolbarsAreVisibleCallback setToolbarsAreVisible;
+ WKPageGetMenuBarIsVisibleCallback menuBarIsVisible;
+ WKPageSetMenuBarIsVisibleCallback setMenuBarIsVisible;
+ WKPageGetStatusBarIsVisibleCallback statusBarIsVisible;
+ WKPageSetStatusBarIsVisibleCallback setStatusBarIsVisible;
+ WKPageGetIsResizableCallback isResizable;
+ WKPageSetIsResizableCallback setIsResizable;
+ WKPageGetWindowFrameCallback getWindowFrame;
+ WKPageSetWindowFrameCallback setWindowFrame;
+ WKPageRunBeforeUnloadConfirmPanelCallback_deprecatedForUseWithV6 runBeforeUnloadConfirmPanel_deprecatedForUseWithV6;
+ WKPageUIClientCallback didDraw;
+ WKPageUIClientCallback pageDidScroll;
+ WKPageExceededDatabaseQuotaCallback exceededDatabaseQuota;
+ WKPageRunOpenPanelCallback runOpenPanel;
+ WKPageDecidePolicyForGeolocationPermissionRequestCallback decidePolicyForGeolocationPermissionRequest;
+ WKPageHeaderHeightCallback headerHeight;
+ WKPageFooterHeightCallback footerHeight;
+ WKPageDrawHeaderCallback drawHeader;
+ WKPageDrawFooterCallback drawFooter;
+ WKPagePrintFrameCallback printFrame;
+ WKPageUIClientCallback runModal;
+ void* unused1; // Used to be didCompleteRubberBandForMainFrame
+ WKPageSaveDataToFileInDownloadsFolderCallback saveDataToFileInDownloadsFolder;
+ void* shouldInterruptJavaScript_unavailable;
+
+ // Version 1.
+ WKPageCreateNewPageCallback_deprecatedForUseWithV1 createNewPage_deprecatedForUseWithV1;
+ WKPageMouseDidMoveOverElementCallback mouseDidMoveOverElement;
+ WKPageDecidePolicyForNotificationPermissionRequestCallback decidePolicyForNotificationPermissionRequest;
+ WKPageUnavailablePluginButtonClickedCallback_deprecatedForUseWithV1 unavailablePluginButtonClicked_deprecatedForUseWithV1;
+
+ // Version 2.
+ WKPageShowColorPickerCallback showColorPicker;
+ WKPageHideColorPickerCallback hideColorPicker;
+ WKPageUnavailablePluginButtonClickedCallback unavailablePluginButtonClicked;
+
+ // Version 3.
+ WKPagePinnedStateDidChangeCallback pinnedStateDidChange;
+
+ // Version 4.
+ void* unused2; // Used to be didBeginTrackingPotentialLongMousePress.
+ void* unused3; // Used to be didRecognizeLongMousePress.
+ void* unused4; // Used to be didCancelTrackingPotentialLongMousePress.
+ WKPageIsPlayingAudioDidChangeCallback isPlayingAudioDidChange;
+
+ // Version 5.
+ WKPageDecidePolicyForUserMediaPermissionRequestCallback decidePolicyForUserMediaPermissionRequest;
+ WKPageDidClickAutoFillButtonCallback didClickAutoFillButton;
+ WKPageRunJavaScriptAlertCallback_deprecatedForUseWithV5 runJavaScriptAlert_deprecatedForUseWithV5;
+ WKPageRunJavaScriptConfirmCallback_deprecatedForUseWithV5 runJavaScriptConfirm_deprecatedForUseWithV5;
+ WKPageRunJavaScriptPromptCallback_deprecatedForUseWithV5 runJavaScriptPrompt_deprecatedForUseWithV5;
+ WKPageMediaSessionMetadataDidChangeCallback mediaSessionMetadataDidChange;
+
+ // Version 6.
+ WKPageCreateNewPageCallback createNewPage;
WKPageRunJavaScriptAlertCallback runJavaScriptAlert;
WKPageRunJavaScriptConfirmCallback runJavaScriptConfirm;
WKPageRunJavaScriptPromptCallback runJavaScriptPrompt;
+ WKCheckUserMediaPermissionCallback checkUserMediaPermissionForOrigin;
+
+ // Version 7.
+ WKPageRunBeforeUnloadConfirmPanelCallback runBeforeUnloadConfirmPanel;
+ WKFullscreenMayReturnToInlineCallback fullscreenMayReturnToInline;
+
+ // Version 8.
+ WKRequestPointerLockCallback requestPointerLock;
+ WKDidLosePointerLockCallback didLosePointerLock;
+} WKPageUIClientV8;
+
+typedef struct WKPageUIClientV9 {
+ WKPageUIClientBase base;
+
+ // Version 0.
+ WKPageCreateNewPageCallback_deprecatedForUseWithV0 createNewPage_deprecatedForUseWithV0;
+ WKPageUIClientCallback showPage;
+ WKPageUIClientCallback close;
+ WKPageTakeFocusCallback takeFocus;
+ WKPageFocusCallback focus;
+ WKPageUnfocusCallback unfocus;
+ WKPageRunJavaScriptAlertCallback_deprecatedForUseWithV0 runJavaScriptAlert_deprecatedForUseWithV0;
+ WKPageRunJavaScriptConfirmCallback_deprecatedForUseWithV0 runJavaScriptConfirm_deprecatedForUseWithV0;
+ WKPageRunJavaScriptPromptCallback_deprecatedForUseWithV0 runJavaScriptPrompt_deprecatedForUseWithV0;
WKPageSetStatusTextCallback setStatusText;
WKPageMouseDidMoveOverElementCallback_deprecatedForUseWithV0 mouseDidMoveOverElement_deprecatedForUseWithV0;
WKPageMissingPluginButtonClickedCallback_deprecatedForUseWithV0 missingPluginButtonClicked_deprecatedForUseWithV0;
@@ -279,7 +756,7 @@ typedef struct WKPageUIClient {
WKPageSetIsResizableCallback setIsResizable;
WKPageGetWindowFrameCallback getWindowFrame;
WKPageSetWindowFrameCallback setWindowFrame;
- WKPageRunBeforeUnloadConfirmPanelCallback runBeforeUnloadConfirmPanel;
+ WKPageRunBeforeUnloadConfirmPanelCallback_deprecatedForUseWithV6 runBeforeUnloadConfirmPanel_deprecatedForUseWithV6;
WKPageUIClientCallback didDraw;
WKPageUIClientCallback pageDidScroll;
WKPageExceededDatabaseQuotaCallback exceededDatabaseQuota;
@@ -293,10 +770,10 @@ typedef struct WKPageUIClient {
WKPageUIClientCallback runModal;
void* unused1; // Used to be didCompleteRubberBandForMainFrame
WKPageSaveDataToFileInDownloadsFolderCallback saveDataToFileInDownloadsFolder;
- WKPageShouldInterruptJavaScriptCallback shouldInterruptJavaScript;
+ void* shouldInterruptJavaScript_unavailable;
// Version 1.
- WKPageCreateNewPageCallback createNewPage;
+ WKPageCreateNewPageCallback_deprecatedForUseWithV1 createNewPage_deprecatedForUseWithV1;
WKPageMouseDidMoveOverElementCallback mouseDidMoveOverElement;
WKPageDecidePolicyForNotificationPermissionRequestCallback decidePolicyForNotificationPermissionRequest;
WKPageUnavailablePluginButtonClickedCallback_deprecatedForUseWithV1 unavailablePluginButtonClicked_deprecatedForUseWithV1;
@@ -305,8 +782,43 @@ typedef struct WKPageUIClient {
WKPageShowColorPickerCallback showColorPicker;
WKPageHideColorPickerCallback hideColorPicker;
WKPageUnavailablePluginButtonClickedCallback unavailablePluginButtonClicked;
-} WKPageUIClient WK_DEPRECATED("Use an explicit versioned struct instead");
+ // Version 3.
+ WKPagePinnedStateDidChangeCallback pinnedStateDidChange;
+
+ // Version 4.
+ void* unused2; // Used to be didBeginTrackingPotentialLongMousePress.
+ void* unused3; // Used to be didRecognizeLongMousePress.
+ void* unused4; // Used to be didCancelTrackingPotentialLongMousePress.
+ WKPageIsPlayingAudioDidChangeCallback isPlayingAudioDidChange;
+
+ // Version 5.
+ WKPageDecidePolicyForUserMediaPermissionRequestCallback decidePolicyForUserMediaPermissionRequest;
+ WKPageDidClickAutoFillButtonCallback didClickAutoFillButton;
+ WKPageRunJavaScriptAlertCallback_deprecatedForUseWithV5 runJavaScriptAlert_deprecatedForUseWithV5;
+ WKPageRunJavaScriptConfirmCallback_deprecatedForUseWithV5 runJavaScriptConfirm_deprecatedForUseWithV5;
+ WKPageRunJavaScriptPromptCallback_deprecatedForUseWithV5 runJavaScriptPrompt_deprecatedForUseWithV5;
+ WKPageMediaSessionMetadataDidChangeCallback mediaSessionMetadataDidChange;
+
+ // Version 6.
+ WKPageCreateNewPageCallback createNewPage;
+ WKPageRunJavaScriptAlertCallback runJavaScriptAlert;
+ WKPageRunJavaScriptConfirmCallback runJavaScriptConfirm;
+ WKPageRunJavaScriptPromptCallback runJavaScriptPrompt;
+ WKCheckUserMediaPermissionCallback checkUserMediaPermissionForOrigin;
+
+ // Version 7.
+ WKPageRunBeforeUnloadConfirmPanelCallback runBeforeUnloadConfirmPanel;
+ WKFullscreenMayReturnToInlineCallback fullscreenMayReturnToInline;
+
+ // Version 8.
+ WKRequestPointerLockCallback requestPointerLock;
+ WKDidLosePointerLockCallback didLosePointerLock;
+
+ // Version 9.
+ WKDidPlayMediaPreventedFromPlayingWithoutUserGesture didPlayMediaPreventedFromPlayingWithoutUserGesture;
+} WKPageUIClientV9;
+
#ifdef __cplusplus
}
#endif
diff --git a/Source/WebKit2/UIProcess/API/C/WKPluginLoadPolicy.h b/Source/WebKit2/UIProcess/API/C/WKPluginLoadPolicy.h
new file mode 100644
index 000000000..7aaef37ee
--- /dev/null
+++ b/Source/WebKit2/UIProcess/API/C/WKPluginLoadPolicy.h
@@ -0,0 +1,57 @@
+/*
+ * Copyright (C) 2015 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef WKPluginLoadPolicy_h
+#define WKPluginLoadPolicy_h
+
+#include <stdint.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+enum {
+ kWKPluginLoadPolicyLoadNormally = 0,
+ kWKPluginLoadPolicyBlocked,
+ kWKPluginLoadPolicyInactive,
+ kWKPluginLoadPolicyLoadUnsandboxed,
+ kWKPluginLoadPolicyBlockedForCompatibility,
+};
+typedef uint32_t WKPluginLoadPolicy;
+
+enum {
+ kWKPluginLoadClientPolicyUndefined = 0,
+ kWKPluginLoadClientPolicyBlock,
+ kWKPluginLoadClientPolicyAsk,
+ kWKPluginLoadClientPolicyAllow,
+ kWKPluginLoadClientPolicyAllowAlways,
+};
+typedef uint32_t WKPluginLoadClientPolicy;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* WKPluginLoadPolicy_h */
diff --git a/Source/WebKit2/UIProcess/API/C/WKPluginSiteDataManager.cpp b/Source/WebKit2/UIProcess/API/C/WKPluginSiteDataManager.cpp
deleted file mode 100644
index 5ae8abf9d..000000000
--- a/Source/WebKit2/UIProcess/API/C/WKPluginSiteDataManager.cpp
+++ /dev/null
@@ -1,95 +0,0 @@
-/*
- * Copyright (C) 2011, 2012 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-#include "WKPluginSiteDataManager.h"
-
-#include "APIObject.h"
-#include "WKAPICast.h"
-#include "WebPluginSiteDataManager.h"
-
-#if ENABLE(NETSCAPE_PLUGIN_API)
-#include <WebCore/npapi.h>
-#endif
-
-using namespace WebKit;
-
-WKTypeID WKPluginSiteDataManagerGetTypeID()
-{
-#if ENABLE(NETSCAPE_PLUGIN_API)
- return toAPI(WebPluginSiteDataManager::APIType);
-#else
- return toAPI(API::Object::Type::Null);
-#endif
-}
-
-void WKPluginSiteDataManagerGetSitesWithData(WKPluginSiteDataManagerRef managerRef, void* context, WKPluginSiteDataManagerGetSitesWithDataFunction callback)
-{
-#if ENABLE(NETSCAPE_PLUGIN_API)
- toImpl(managerRef)->getSitesWithData(ArrayCallback::create(context, callback));
-#else
- UNUSED_PARAM(managerRef);
- UNUSED_PARAM(context);
- UNUSED_PARAM(callback);
-#endif
-}
-
-#if ENABLE(NETSCAPE_PLUGIN_API)
-static uint64_t toNPClearSiteDataFlags(WKClearSiteDataFlags flags)
-{
- if (flags == kWKClearSiteDataFlagsClearAll)
- return NP_CLEAR_ALL;
-
- uint64_t result = 0;
- if (flags & kWKClearSiteDataFlagsClearCache)
- result |= NP_CLEAR_CACHE;
- return result;
-}
-#endif
-
-void WKPluginSiteDataManagerClearSiteData(WKPluginSiteDataManagerRef managerRef, WKArrayRef sitesRef, WKClearSiteDataFlags flags, uint64_t maxAgeInSeconds, void* context, WKPluginSiteDataManagerClearSiteDataFunction function)
-{
-#if ENABLE(NETSCAPE_PLUGIN_API)
- toImpl(managerRef)->clearSiteData(toImpl(sitesRef), toNPClearSiteDataFlags(flags), maxAgeInSeconds, VoidCallback::create(context, function));
-#else
- UNUSED_PARAM(managerRef);
- UNUSED_PARAM(sitesRef);
- UNUSED_PARAM(flags);
- UNUSED_PARAM(maxAgeInSeconds);
- UNUSED_PARAM(context);
- UNUSED_PARAM(function);
-#endif
-}
-
-void WKPluginSiteDataManagerClearAllSiteData(WKPluginSiteDataManagerRef managerRef, void* context, WKPluginSiteDataManagerClearSiteDataFunction function)
-{
-#if ENABLE(NETSCAPE_PLUGIN_API)
- toImpl(managerRef)->clearSiteData(0, NP_CLEAR_ALL, std::numeric_limits<uint64_t>::max(), VoidCallback::create(context, function));
-#else
- UNUSED_PARAM(managerRef);
- UNUSED_PARAM(context);
- UNUSED_PARAM(function);
-#endif
-}
diff --git a/Source/WebKit2/UIProcess/API/C/WKPluginSiteDataManager.h b/Source/WebKit2/UIProcess/API/C/WKPluginSiteDataManager.h
deleted file mode 100644
index 66e76fbcd..000000000
--- a/Source/WebKit2/UIProcess/API/C/WKPluginSiteDataManager.h
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * Copyright (C) 2011 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef WKPluginSiteDataManager_h
-#define WKPluginSiteDataManager_h
-
-#include <WebKit2/WKBase.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-WK_EXPORT WKTypeID WKPluginSiteDataManagerGetTypeID();
-
-typedef void (*WKPluginSiteDataManagerGetSitesWithDataFunction)(WKArrayRef, WKErrorRef, void*);
-WK_EXPORT void WKPluginSiteDataManagerGetSitesWithData(WKPluginSiteDataManagerRef manager, void* context, WKPluginSiteDataManagerGetSitesWithDataFunction function);
-
-enum {
- kWKClearSiteDataFlagsClearAll = 0,
- kWKClearSiteDataFlagsClearCache = 1 << 0,
-};
-typedef uint64_t WKClearSiteDataFlags;
-
-typedef void (*WKPluginSiteDataManagerClearSiteDataFunction)(WKErrorRef, void*);
-
-WK_EXPORT void WKPluginSiteDataManagerClearSiteData(WKPluginSiteDataManagerRef manager, WKArrayRef sites, WKClearSiteDataFlags flags, uint64_t maxAgeInSeconds, void* context, WKPluginSiteDataManagerClearSiteDataFunction function);
-WK_EXPORT void WKPluginSiteDataManagerClearAllSiteData(WKPluginSiteDataManagerRef manager, void* context, WKPluginSiteDataManagerClearSiteDataFunction function);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif // WKPluginSiteDataManager_h
diff --git a/Source/WebKit2/UIProcess/API/C/WKPreferences.cpp b/Source/WebKit2/UIProcess/API/C/WKPreferences.cpp
index d81dd2ba5..0d7090e3d 100644
--- a/Source/WebKit2/UIProcess/API/C/WKPreferences.cpp
+++ b/Source/WebKit2/UIProcess/API/C/WKPreferences.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2010, 2012 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
@@ -24,14 +24,12 @@
*/
#include "config.h"
-#include "WKPreferencesPrivate.h"
-#include "WKPreferencesRef.h"
+#include "WKPreferencesRef.h"
+#include "WKPreferencesRefPrivate.h"
#include "WKAPICast.h"
-#include "WebContext.h"
#include "WebPreferences.h"
#include <WebCore/Settings.h>
-#include <wtf/PassRefPtr.h>
#include <wtf/RefPtr.h>
using namespace WebKit;
@@ -43,20 +41,25 @@ WKTypeID WKPreferencesGetTypeID()
WKPreferencesRef WKPreferencesCreate()
{
- RefPtr<WebPreferences> preferences = WebPreferences::create();
- return toAPI(preferences.release().leakRef());
+ auto preferences = WebPreferences::createWithLegacyDefaults(String(), "WebKit2.", "WebKit2.");
+ return toAPI(preferences.leakRef());
}
WKPreferencesRef WKPreferencesCreateWithIdentifier(WKStringRef identifierRef)
{
- RefPtr<WebPreferences> preferences = WebPreferences::create(toWTFString(identifierRef));
- return toAPI(preferences.release().leakRef());
+ auto preferences = WebPreferences::createWithLegacyDefaults(toWTFString(identifierRef), "WebKit2.", "WebKit2.");
+ return toAPI(preferences.leakRef());
}
WKPreferencesRef WKPreferencesCreateCopy(WKPreferencesRef preferencesRef)
{
- RefPtr<WebPreferences> preferences = WebPreferences::create(*toImpl(preferencesRef));
- return toAPI(preferences.release().leakRef());
+ auto preferences = toImpl(preferencesRef)->copy();
+ return toAPI(preferences.leakRef());
+}
+
+void WKPreferencesEnableAllExperimentalFeatures(WKPreferencesRef preferencesRef)
+{
+ toImpl(preferencesRef)->enableAllExperimentalFeatures();
}
void WKPreferencesSetJavaScriptEnabled(WKPreferencesRef preferencesRef, bool javaScriptEnabled)
@@ -299,15 +302,6 @@ uint32_t WKPreferencesGetMinimumFontSize(WKPreferencesRef preferencesRef)
return toImpl(preferencesRef)->minimumFontSize();
}
-void WKPreferencesSetScreenFontSubstitutionEnabled(WKPreferencesRef preferencesRef, bool enabled)
-{
- toImpl(preferencesRef)->setScreenFontSubstitutionEnabled(enabled);
-}
-
-bool WKPreferencesGetScreenFontSubstitutionEnabled(WKPreferencesRef preferencesRef)
-{
- return toImpl(preferencesRef)->screenFontSubstitutionEnabled();
-}
void WKPreferencesSetCookieEnabled(WKPreferencesRef preferencesRef, bool enabled)
{
@@ -359,14 +353,14 @@ bool WKPreferencesGetDeveloperExtrasEnabled(WKPreferencesRef preferencesRef)
return toImpl(preferencesRef)->developerExtrasEnabled();
}
-void WKPreferencesSetJavaScriptExperimentsEnabled(WKPreferencesRef preferencesRef, bool enabled)
+void WKPreferencesSetJavaScriptRuntimeFlags(WKPreferencesRef preferencesRef, WKJavaScriptRuntimeFlagSet javaScriptRuntimeFlagSet)
{
- toImpl(preferencesRef)->setJavaScriptExperimentsEnabled(enabled);
+ toImpl(preferencesRef)->setJavaScriptRuntimeFlags(javaScriptRuntimeFlagSet);
}
-bool WKPreferencesGetJavaScriptExperimentsEnabled(WKPreferencesRef preferencesRef)
+WKJavaScriptRuntimeFlagSet WKPreferencesGetJavaScriptRuntimeFlags(WKPreferencesRef preferencesRef)
{
- return toImpl(preferencesRef)->javaScriptExperimentsEnabled();
+ return toImpl(preferencesRef)->javaScriptRuntimeFlags();
}
void WKPreferencesSetTextAreasAreResizable(WKPreferencesRef preferencesRef, bool resizable)
@@ -469,16 +463,6 @@ bool WKPreferencesGetWebGLEnabled(WKPreferencesRef preferencesRef)
return toImpl(preferencesRef)->webGLEnabled();
}
-void WKPreferencesSetMultithreadedWebGLEnabled(WKPreferencesRef preferencesRef, bool flag)
-{
- toImpl(preferencesRef)->setMultithreadedWebGLEnabled(flag);
-}
-
-bool WKPreferencesGetMultithreadedWebGLEnabled(WKPreferencesRef preferencesRef)
-{
- return toImpl(preferencesRef)->multithreadedWebGLEnabled();
-}
-
void WKPreferencesSetForceSoftwareWebGLRendering(WKPreferencesRef preferencesRef, bool flag)
{
toImpl(preferencesRef)->setForceSoftwareWebGLRendering(flag);
@@ -499,34 +483,24 @@ bool WKPreferencesGetAccelerated2DCanvasEnabled(WKPreferencesRef preferencesRef)
return toImpl(preferencesRef)->accelerated2dCanvasEnabled();
}
-void WKPreferencesSetCSSRegionsEnabled(WKPreferencesRef preferencesRef, bool flag)
-{
- toImpl(preferencesRef)->setCSSRegionsEnabled(flag);
-}
-
-bool WKPreferencesGetCSSRegionsEnabled(WKPreferencesRef preferencesRef)
+void WKPreferencesSetCSSAnimationTriggersEnabled(WKPreferencesRef preferencesRef, bool flag)
{
- return toImpl(preferencesRef)->cssRegionsEnabled();
+ toImpl(preferencesRef)->setCSSAnimationTriggersEnabled(flag);
}
-void WKPreferencesSetCSSGridLayoutEnabled(WKPreferencesRef preferencesRef, bool flag)
+bool WKPreferencesGetCSSAnimationTriggersEnabled(WKPreferencesRef preferencesRef)
{
- toImpl(preferencesRef)->setCSSGridLayoutEnabled(flag);
+ return toImpl(preferencesRef)->cssAnimationTriggersEnabled();
}
-bool WKPreferencesGetCSSGridLayoutEnabled(WKPreferencesRef preferencesRef)
+void WKPreferencesSetWebAnimationsEnabled(WKPreferencesRef preferencesRef, bool flag)
{
- return toImpl(preferencesRef)->cssGridLayoutEnabled();
+ toImpl(preferencesRef)->setWebAnimationsEnabled(flag);
}
-void WKPreferencesSetRegionBasedColumnsEnabled(WKPreferencesRef preferencesRef, bool flag)
+bool WKPreferencesGetWebAnimationsEnabled(WKPreferencesRef preferencesRef)
{
- toImpl(preferencesRef)->setRegionBasedColumnsEnabled(flag);
-}
-
-bool WKPreferencesGetRegionBasedColumnsEnabled(WKPreferencesRef preferencesRef)
-{
- return toImpl(preferencesRef)->regionBasedColumnsEnabled();
+ return toImpl(preferencesRef)->webAnimationsEnabled();
}
void WKPreferencesSetNeedsSiteSpecificQuirks(WKPreferencesRef preferencesRef, bool flag)
@@ -609,6 +583,16 @@ bool WKPreferencesGetShouldPrintBackgrounds(WKPreferencesRef preferencesRef)
return toImpl(preferencesRef)->shouldPrintBackgrounds();
}
+void WKPreferencesSetDOMTimersThrottlingEnabled(WKPreferencesRef preferencesRef, bool enabled)
+{
+ toImpl(preferencesRef)->setDOMTimersThrottlingEnabled(enabled);
+}
+
+bool WKPreferencesGetDOMTimersThrottlingEnabled(WKPreferencesRef preferencesRef)
+{
+ return toImpl(preferencesRef)->domTimersThrottlingEnabled();
+}
+
void WKPreferencesSetWebArchiveDebugModeEnabled(WKPreferencesRef preferencesRef, bool enabled)
{
toImpl(preferencesRef)->setWebArchiveDebugModeEnabled(enabled);
@@ -709,6 +693,16 @@ bool WKPreferencesGetAVFoundationEnabled(WKPreferencesRef preferencesRef)
return toImpl(preferencesRef)->isAVFoundationEnabled();
}
+void WKPreferencesSetAVFoundationNSURLSessionEnabled(WKPreferencesRef preferencesRef, bool enabled)
+{
+ toImpl(preferencesRef)->setAVFoundationNSURLSessionEnabled(enabled);
+}
+
+bool WKPreferencesGetAVFoundationNSURLSessionEnabled(WKPreferencesRef preferencesRef)
+{
+ return toImpl(preferencesRef)->isAVFoundationNSURLSessionEnabled();
+}
+
void WKPreferencesSetWebSecurityEnabled(WKPreferencesRef preferencesRef, bool enabled)
{
toImpl(preferencesRef)->setWebSecurityEnabled(enabled);
@@ -739,6 +733,16 @@ bool WKPreferencesGetFileAccessFromFileURLsAllowed(WKPreferencesRef preferencesR
return toImpl(preferencesRef)->allowFileAccessFromFileURLs();
}
+void WKPreferencesSetNeedsStorageAccessFromFileURLsQuirk(WKPreferencesRef preferencesRef, bool needsQuirk)
+{
+ toImpl(preferencesRef)->setNeedsStorageAccessFromFileURLsQuirk(needsQuirk);
+}
+
+bool WKPreferencesGetNeedsStorageAccessFromFileURLsQuirk(WKPreferencesRef preferencesRef)
+{
+ return toImpl(preferencesRef)->needsStorageAccessFromFileURLsQuirk();
+}
+
void WKPreferencesSetHixie76WebSocketProtocolEnabled(WKPreferencesRef, bool /*enabled*/)
{
}
@@ -750,22 +754,82 @@ bool WKPreferencesGetHixie76WebSocketProtocolEnabled(WKPreferencesRef)
void WKPreferencesSetMediaPlaybackRequiresUserGesture(WKPreferencesRef preferencesRef, bool flag)
{
- toImpl(preferencesRef)->setMediaPlaybackRequiresUserGesture(flag);
+ toImpl(preferencesRef)->setRequiresUserGestureForMediaPlayback(flag);
}
bool WKPreferencesGetMediaPlaybackRequiresUserGesture(WKPreferencesRef preferencesRef)
{
- return toImpl(preferencesRef)->mediaPlaybackRequiresUserGesture();
+ return toImpl(preferencesRef)->requiresUserGestureForMediaPlayback();
+}
+
+void WKPreferencesSetVideoPlaybackRequiresUserGesture(WKPreferencesRef preferencesRef, bool flag)
+{
+ toImpl(preferencesRef)->setRequiresUserGestureForVideoPlayback(flag);
+}
+
+bool WKPreferencesGetVideoPlaybackRequiresUserGesture(WKPreferencesRef preferencesRef)
+{
+ return toImpl(preferencesRef)->requiresUserGestureForVideoPlayback();
+}
+
+void WKPreferencesSetAudioPlaybackRequiresUserGesture(WKPreferencesRef preferencesRef, bool flag)
+{
+ toImpl(preferencesRef)->setRequiresUserGestureForAudioPlayback(flag);
+}
+
+bool WKPreferencesGetAudioPlaybackRequiresUserGesture(WKPreferencesRef preferencesRef)
+{
+ return toImpl(preferencesRef)->requiresUserGestureForAudioPlayback();
+}
+
+void WKPreferencesSetMainContentUserGestureOverrideEnabled(WKPreferencesRef preferencesRef, bool flag)
+{
+ toImpl(preferencesRef)->setMainContentUserGestureOverrideEnabled(flag);
+}
+
+bool WKPreferencesGetMainContentUserGestureOverrideEnabled(WKPreferencesRef preferencesRef)
+{
+ return toImpl(preferencesRef)->mainContentUserGestureOverrideEnabled();
}
void WKPreferencesSetMediaPlaybackAllowsInline(WKPreferencesRef preferencesRef, bool flag)
{
- toImpl(preferencesRef)->setMediaPlaybackAllowsInline(flag);
+ toImpl(preferencesRef)->setAllowsInlineMediaPlayback(flag);
}
bool WKPreferencesGetMediaPlaybackAllowsInline(WKPreferencesRef preferencesRef)
{
- return toImpl(preferencesRef)->mediaPlaybackAllowsInline();
+ return toImpl(preferencesRef)->allowsInlineMediaPlayback();
+}
+
+void WKPreferencesSetInlineMediaPlaybackRequiresPlaysInlineAttribute(WKPreferencesRef preferencesRef, bool flag)
+{
+ toImpl(preferencesRef)->setInlineMediaPlaybackRequiresPlaysInlineAttribute(flag);
+}
+
+bool WKPreferencesGetInlineMediaPlaybackRequiresPlaysInlineAttribute(WKPreferencesRef preferencesRef)
+{
+ return toImpl(preferencesRef)->inlineMediaPlaybackRequiresPlaysInlineAttribute();
+}
+
+void WKPreferencesSetMediaControlsScaleWithPageZoom(WKPreferencesRef preferencesRef, bool flag)
+{
+ toImpl(preferencesRef)->setMediaControlsScaleWithPageZoom(flag);
+}
+
+bool WKPreferencesGetMediaControlsScaleWithPageZoom(WKPreferencesRef preferencesRef)
+{
+ return toImpl(preferencesRef)->mediaControlsScaleWithPageZoom();
+}
+
+void WKPreferencesSetModernMediaControlsEnabled(WKPreferencesRef preferencesRef, bool flag)
+{
+ toImpl(preferencesRef)->setModernMediaControlsEnabled(flag);
+}
+
+bool WKPreferencesGetModernMediaControlsEnabled(WKPreferencesRef preferencesRef)
+{
+ return toImpl(preferencesRef)->modernMediaControlsEnabled();
}
void WKPreferencesSetShowsToolTipOverTruncatedText(WKPreferencesRef preferencesRef, bool flag)
@@ -798,14 +862,15 @@ bool WKPreferencesGetWebAudioEnabled(WKPreferencesRef preferencesRef)
return toImpl(preferencesRef)->webAudioEnabled();
}
-void WKPreferencesSetApplicationChromeModeEnabled(WKPreferencesRef preferencesRef, bool enabled)
+void WKPreferencesSetApplicationChromeModeEnabled(WKPreferencesRef, bool)
{
- toImpl(preferencesRef)->setApplicationChromeModeEnabled(enabled);
+ // FIXME: Remove once WebKit nightlies don't need to support Safari 8.
}
-bool WKPreferencesGetApplicationChromeModeEnabled(WKPreferencesRef preferencesRef)
+bool WKPreferencesGetApplicationChromeModeEnabled(WKPreferencesRef)
{
- return toImpl(preferencesRef)->applicationChromeMode();
+ // FIXME: Remove once WebKit nightlies don't need to support Safari 8.
+ return false;
}
void WKPreferencesSetInspectorUsesWebKitUserInterface(WKPreferencesRef, bool)
@@ -1141,11 +1206,21 @@ void WKPreferencesSetHiddenPageDOMTimerThrottlingEnabled(WKPreferencesRef prefer
toImpl(preferencesRef)->setHiddenPageDOMTimerThrottlingEnabled(enabled);
}
+void WKPreferencesSetHiddenPageDOMTimerThrottlingAutoIncreases(WKPreferencesRef preferencesRef, bool enabled)
+{
+ toImpl(preferencesRef)->setHiddenPageDOMTimerThrottlingAutoIncreases(enabled);
+}
+
bool WKPreferencesGetHiddenPageDOMTimerThrottlingEnabled(WKPreferencesRef preferencesRef)
{
return toImpl(preferencesRef)->hiddenPageDOMTimerThrottlingEnabled();
}
+bool WKPreferencesGetHiddenPageDOMTimerThrottlingAutoIncreases(WKPreferencesRef preferencesRef)
+{
+ return toImpl(preferencesRef)->hiddenPageDOMTimerThrottlingAutoIncreases();
+}
+
void WKPreferencesSetHiddenPageCSSAnimationSuspensionEnabled(WKPreferencesRef preferencesRef, bool enabled)
{
toImpl(preferencesRef)->setHiddenPageCSSAnimationSuspensionEnabled(enabled);
@@ -1196,6 +1271,46 @@ bool WKPreferencesGetSimpleLineLayoutDebugBordersEnabled(WKPreferencesRef prefer
return toImpl(preferencesRef)->simpleLineLayoutDebugBordersEnabled();
}
+void WKPreferencesSetNewBlockInsideInlineModelEnabled(WKPreferencesRef preferencesRef, bool flag)
+{
+ toImpl(preferencesRef)->setNewBlockInsideInlineModelEnabled(flag);
+}
+
+bool WKPreferencesGetNewBlockInsideInlineModelEnabled(WKPreferencesRef preferencesRef)
+{
+ return toImpl(preferencesRef)->newBlockInsideInlineModelEnabled();
+}
+
+void WKPreferencesSetDeferredCSSParserEnabled(WKPreferencesRef preferencesRef, bool flag)
+{
+ toImpl(preferencesRef)->setDeferredCSSParserEnabled(flag);
+}
+
+bool WKPreferencesGetDeferredCSSParserEnabled(WKPreferencesRef preferencesRef)
+{
+ return toImpl(preferencesRef)->deferredCSSParserEnabled();
+}
+
+void WKPreferencesSetSubpixelCSSOMElementMetricsEnabled(WKPreferencesRef preferencesRef, bool flag)
+{
+ toImpl(preferencesRef)->setSubpixelCSSOMElementMetricsEnabled(flag);
+}
+
+bool WKPreferencesGetSubpixelCSSOMElementMetricsEnabled(WKPreferencesRef preferencesRef)
+{
+ return toImpl(preferencesRef)->subpixelCSSOMElementMetricsEnabled();
+}
+
+void WKPreferencesSetUseGiantTiles(WKPreferencesRef preferencesRef, bool flag)
+{
+ toImpl(preferencesRef)->setUseGiantTiles(flag);
+}
+
+bool WKPreferencesGetUseGiantTiles(WKPreferencesRef preferencesRef)
+{
+ return toImpl(preferencesRef)->useGiantTiles();
+}
+
void WKPreferencesSetMediaStreamEnabled(WKPreferencesRef preferencesRef, bool enabled)
{
toImpl(preferencesRef)->setMediaStreamEnabled(enabled);
@@ -1206,14 +1321,14 @@ bool WKPreferencesGetMediaStreamEnabled(WKPreferencesRef preferencesRef)
return toImpl(preferencesRef)->mediaStreamEnabled();
}
-void WKPreferencesSetVideoPluginProxyEnabled(WKPreferencesRef preferencesRef, bool enabled)
+void WKPreferencesSetPeerConnectionEnabled(WKPreferencesRef preferencesRef, bool enabled)
{
- toImpl(preferencesRef)->setVideoPluginProxyEnabled(enabled);
+ toImpl(preferencesRef)->setPeerConnectionEnabled(enabled);
}
-bool WKPreferencesGetVideoPluginProxyEnabled(WKPreferencesRef preferencesRef)
+bool WKPreferencesGetPeerConnectionEnabled(WKPreferencesRef preferencesRef)
{
- return toImpl(preferencesRef)->isVideoPluginProxyEnabled();
+ return toImpl(preferencesRef)->peerConnectionEnabled();
}
void WKPreferencesSetSpatialNavigationEnabled(WKPreferencesRef preferencesRef, bool enabled)
@@ -1245,3 +1360,303 @@ bool WKPreferencesGetViewGestureDebuggingEnabled(WKPreferencesRef preferencesRef
{
return toImpl(preferencesRef)->viewGestureDebuggingEnabled();
}
+
+void WKPreferencesSetShouldConvertPositionStyleOnCopy(WKPreferencesRef preferencesRef, bool convert)
+{
+ toImpl(preferencesRef)->setShouldConvertPositionStyleOnCopy(convert);
+}
+
+bool WKPreferencesGetShouldConvertPositionStyleOnCopy(WKPreferencesRef preferencesRef)
+{
+ return toImpl(preferencesRef)->shouldConvertPositionStyleOnCopy();
+}
+
+void WKPreferencesSetTelephoneNumberParsingEnabled(WKPreferencesRef preferencesRef, bool enabled)
+{
+ toImpl(preferencesRef)->setTelephoneNumberParsingEnabled(enabled);
+}
+
+bool WKPreferencesGetTelephoneNumberParsingEnabled(WKPreferencesRef preferencesRef)
+{
+ return toImpl(preferencesRef)->telephoneNumberParsingEnabled();
+}
+
+void WKPreferencesSetEnableInheritURIQueryComponent(WKPreferencesRef preferencesRef, bool enabled)
+{
+ toImpl(preferencesRef)->setEnableInheritURIQueryComponent(enabled);
+}
+
+bool WKPreferencesGetEnableInheritURIQueryComponent(WKPreferencesRef preferencesRef)
+{
+ return toImpl(preferencesRef)->enableInheritURIQueryComponent();
+}
+
+void WKPreferencesSetServiceControlsEnabled(WKPreferencesRef preferencesRef, bool enabled)
+{
+ toImpl(preferencesRef)->setServiceControlsEnabled(enabled);
+}
+
+bool WKPreferencesGetServiceControlsEnabled(WKPreferencesRef preferencesRef)
+{
+ return toImpl(preferencesRef)->serviceControlsEnabled();
+}
+
+void WKPreferencesSetImageControlsEnabled(WKPreferencesRef preferencesRef, bool enabled)
+{
+ toImpl(preferencesRef)->setImageControlsEnabled(enabled);
+}
+
+bool WKPreferencesGetImageControlsEnabled(WKPreferencesRef preferencesRef)
+{
+ return toImpl(preferencesRef)->imageControlsEnabled();
+}
+
+void WKPreferencesSetGamepadsEnabled(WKPreferencesRef preferencesRef, bool enabled)
+{
+ toImpl(preferencesRef)->setGamepadsEnabled(enabled);
+}
+
+bool WKPreferencesGetGamepadsEnabled(WKPreferencesRef preferencesRef)
+{
+ return toImpl(preferencesRef)->gamepadsEnabled();
+}
+
+// FIXME: Remove these when possible.
+void WKPreferencesSetLongMousePressEnabled(WKPreferencesRef preferencesRef, bool enabled)
+{
+}
+
+bool WKPreferencesGetLongMousePressEnabled(WKPreferencesRef preferencesRef)
+{
+ return false;
+}
+
+void WKPreferencesSetMinimumZoomFontSize(WKPreferencesRef preferencesRef, double size)
+{
+ toImpl(preferencesRef)->setMinimumZoomFontSize(size);
+}
+
+double WKPreferencesGetMinimumZoomFontSize(WKPreferencesRef preferencesRef)
+{
+ return toImpl(preferencesRef)->minimumZoomFontSize();
+}
+
+void WKPreferencesSetAntialiasedFontDilationEnabled(WKPreferencesRef, bool)
+{
+ // Feature removed.
+}
+
+bool WKPreferencesGetAntialiasedFontDilationEnabled(WKPreferencesRef)
+{
+ return false; // Feature removed.
+}
+
+void WKPreferencesSetVisibleDebugOverlayRegions(WKPreferencesRef preferencesRef, WKDebugOverlayRegions visibleRegions)
+{
+ toImpl(preferencesRef)->setVisibleDebugOverlayRegions(visibleRegions);
+}
+
+WKDebugOverlayRegions WKPreferencesGetVisibleDebugOverlayRegions(WKPreferencesRef preferencesRef)
+{
+ return toImpl(preferencesRef)->visibleDebugOverlayRegions();
+}
+
+void WKPreferencesSetIgnoreViewportScalingConstraints(WKPreferencesRef preferencesRef, bool enabled)
+{
+ toImpl(preferencesRef)->setIgnoreViewportScalingConstraints(enabled);
+}
+
+bool WKPreferencesGetIgnoreViewportScalingConstraints(WKPreferencesRef preferencesRef)
+{
+ return toImpl(preferencesRef)->ignoreViewportScalingConstraints();
+}
+
+void WKPreferencesSetMetaRefreshEnabled(WKPreferencesRef preferencesRef, bool enabled)
+{
+ toImpl(preferencesRef)->setHTTPEquivEnabled(enabled);
+}
+
+bool WKPreferencesGetMetaRefreshEnabled(WKPreferencesRef preferencesRef)
+{
+ return toImpl(preferencesRef)->httpEquivEnabled();
+}
+
+void WKPreferencesSetHTTPEquivEnabled(WKPreferencesRef preferencesRef, bool enabled)
+{
+ toImpl(preferencesRef)->setHTTPEquivEnabled(enabled);
+}
+
+bool WKPreferencesGetHTTPEquivEnabled(WKPreferencesRef preferencesRef)
+{
+ return toImpl(preferencesRef)->httpEquivEnabled();
+}
+
+void WKPreferencesSetAllowsAirPlayForMediaPlayback(WKPreferencesRef preferencesRef, bool enabled)
+{
+ toImpl(preferencesRef)->setAllowsAirPlayForMediaPlayback(enabled);
+}
+
+bool WKPreferencesGetAllowsAirPlayForMediaPlayback(WKPreferencesRef preferencesRef)
+{
+ return toImpl(preferencesRef)->allowsAirPlayForMediaPlayback();
+}
+
+void WKPreferencesSetUserInterfaceDirectionPolicy(WKPreferencesRef preferencesRef, _WKUserInterfaceDirectionPolicy userInterfaceDirectionPolicy)
+{
+ toImpl(preferencesRef)->setUserInterfaceDirectionPolicy(userInterfaceDirectionPolicy);
+}
+
+_WKUserInterfaceDirectionPolicy WKPreferencesGetUserInterfaceDirectionPolicy(WKPreferencesRef preferencesRef)
+{
+ return static_cast<_WKUserInterfaceDirectionPolicy>(toImpl(preferencesRef)->userInterfaceDirectionPolicy());
+}
+
+void WKPreferencesSetResourceUsageOverlayVisible(WKPreferencesRef preferencesRef, bool enabled)
+{
+ toImpl(preferencesRef)->setResourceUsageOverlayVisible(enabled);
+}
+
+bool WKPreferencesGetResourceUsageOverlayVisible(WKPreferencesRef preferencesRef)
+{
+ return toImpl(preferencesRef)->resourceUsageOverlayVisible();
+}
+
+void WKPreferencesSetMockCaptureDevicesEnabled(WKPreferencesRef preferencesRef, bool enabled)
+{
+ toImpl(preferencesRef)->setMockCaptureDevicesEnabled(enabled);
+}
+
+bool WKPreferencesGetMockCaptureDevicesEnabled(WKPreferencesRef preferencesRef)
+{
+ return toImpl(preferencesRef)->mockCaptureDevicesEnabled();
+}
+
+void WKPreferencesSetMediaCaptureRequiresSecureConnection(WKPreferencesRef preferencesRef, bool enabled)
+{
+ toImpl(preferencesRef)->setMediaCaptureRequiresSecureConnection(enabled);
+}
+
+bool WKPreferencesGetMediaCaptureRequiresSecureConnection(WKPreferencesRef preferencesRef)
+{
+ return toImpl(preferencesRef)->mediaCaptureRequiresSecureConnection();
+}
+
+void WKPreferencesSetFetchAPIEnabled(WKPreferencesRef preferencesRef, bool flag)
+{
+ toImpl(preferencesRef)->setFetchAPIEnabled(flag);
+}
+
+bool WKPreferencesGetFetchAPIEnabled(WKPreferencesRef preferencesRef)
+{
+ return toImpl(preferencesRef)->fetchAPIEnabled();
+}
+
+void WKPreferencesSetDownloadAttributeEnabled(WKPreferencesRef preferencesRef, bool flag)
+{
+ toImpl(preferencesRef)->setDownloadAttributeEnabled(flag);
+}
+
+bool WKPreferencesGetDownloadAttributeEnabled(WKPreferencesRef preferencesRef)
+{
+ return toImpl(preferencesRef)->downloadAttributeEnabled();
+}
+
+void WKPreferencesSetIntersectionObserverEnabled(WKPreferencesRef preferencesRef, bool flag)
+{
+ toImpl(preferencesRef)->setIntersectionObserverEnabled(flag);
+}
+
+bool WKPreferencesGetIntersectionObserverEnabled(WKPreferencesRef preferencesRef)
+{
+ return toImpl(preferencesRef)->intersectionObserverEnabled();
+}
+
+void WKPreferencesSetUserTimingEnabled(WKPreferencesRef preferencesRef, bool flag)
+{
+ toImpl(preferencesRef)->setUserTimingEnabled(flag);
+}
+
+bool WKPreferencesGetUserTimingEnabled(WKPreferencesRef preferencesRef)
+{
+ return toImpl(preferencesRef)->userTimingEnabled();
+}
+
+void WKPreferencesSetResourceTimingEnabled(WKPreferencesRef preferencesRef, bool flag)
+{
+ toImpl(preferencesRef)->setResourceTimingEnabled(flag);
+}
+
+bool WKPreferencesGetResourceTimingEnabled(WKPreferencesRef preferencesRef)
+{
+ return toImpl(preferencesRef)->resourceTimingEnabled();
+}
+
+void WKPreferencesSetSelectionPaintingWithoutSelectionGapsEnabled(WKPreferencesRef preferencesRef, bool flag)
+{
+ toImpl(preferencesRef)->setSelectionPaintingWithoutSelectionGapsEnabled(flag);
+}
+
+bool WKPreferencesGetSelectionPaintingWithoutSelectionGapsEnabled(WKPreferencesRef preferencesRef)
+{
+ return toImpl(preferencesRef)->selectionPaintingWithoutSelectionGapsEnabled();
+}
+
+void WKPreferencesSetAllowsPictureInPictureMediaPlayback(WKPreferencesRef preferencesRef, bool enabled)
+{
+ toImpl(preferencesRef)->setAllowsPictureInPictureMediaPlayback(enabled);
+}
+
+bool WKPreferencesGetAllowsPictureInPictureMediaPlayback(WKPreferencesRef preferencesRef)
+{
+ return toImpl(preferencesRef)->allowsPictureInPictureMediaPlayback();
+}
+
+WK_EXPORT bool WKPreferencesGetApplePayEnabled(WKPreferencesRef preferencesRef)
+{
+ return WebKit::toImpl(preferencesRef)->applePayEnabled();
+}
+
+void WKPreferencesSetApplePayEnabled(WKPreferencesRef preferencesRef, bool enabled)
+{
+ WebKit::toImpl(preferencesRef)->setApplePayEnabled(enabled);
+}
+
+bool WKPreferencesGetApplePayCapabilityDisclosureAllowed(WKPreferencesRef preferencesRef)
+{
+ return WebKit::toImpl(preferencesRef)->applePayCapabilityDisclosureAllowed();
+}
+
+void WKPreferencesSetApplePayCapabilityDisclosureAllowed(WKPreferencesRef preferencesRef, bool allowed)
+{
+ WebKit::toImpl(preferencesRef)->setApplePayCapabilityDisclosureAllowed(allowed);
+}
+
+void WKPreferencesSetSubtleCryptoEnabled(WKPreferencesRef preferencesRef, bool flag)
+{
+ toImpl(preferencesRef)->setSubtleCryptoEnabled(flag);
+}
+
+bool WKPreferencesGetSubtleCryptoEnabled(WKPreferencesRef preferencesRef)
+{
+ return toImpl(preferencesRef)->subtleCryptoEnabled();
+}
+
+void WKPreferencesSetLinkPreloadEnabled(WKPreferencesRef preferencesRef, bool flag)
+{
+ toImpl(preferencesRef)->setLinkPreloadEnabled(flag);
+}
+
+bool WKPreferencesGetLinkPreloadEnabled(WKPreferencesRef preferencesRef)
+{
+ return toImpl(preferencesRef)->linkPreloadEnabled();
+}
+
+void WKPreferencesSetShouldSuppressKeyboardInputDuringProvisionalNavigation(WKPreferencesRef preferencesRef, bool flag)
+{
+ toImpl(preferencesRef)->setShouldSuppressKeyboardInputDuringProvisionalNavigation(flag);
+}
+
+bool WKPreferencesGetShouldSuppressKeyboardInputDuringProvisionalNavigation(WKPreferencesRef preferencesRef)
+{
+ return toImpl(preferencesRef)->shouldSuppressKeyboardInputDuringProvisionalNavigation();
+}
diff --git a/Source/WebKit2/UIProcess/API/C/WKPreferencesRef.h b/Source/WebKit2/UIProcess/API/C/WKPreferencesRef.h
index a4a7c9b1a..bc5d70b01 100644
--- a/Source/WebKit2/UIProcess/API/C/WKPreferencesRef.h
+++ b/Source/WebKit2/UIProcess/API/C/WKPreferencesRef.h
@@ -26,7 +26,7 @@
#ifndef WKPreferencesRef_h
#define WKPreferencesRef_h
-#include <WebKit2/WKBase.h>
+#include <WebKit/WKBase.h>
#ifndef __cplusplus
#include <stdbool.h>
@@ -43,6 +43,18 @@ enum WKStorageBlockingPolicy {
};
typedef enum WKStorageBlockingPolicy WKStorageBlockingPolicy;
+enum WKDebugOverlayRegionFlags {
+ kWKNonFastScrollableRegion = 1 << 0,
+ kWKWheelEventHandlerRegion = 1 << 1
+};
+typedef unsigned WKDebugOverlayRegions;
+
+enum _WKUserInterfaceDirectionPolicy {
+ kWKUserInterfaceDirectionPolicyContent,
+ kWKUserInterfaceDirectionPolicySystem,
+};
+typedef enum _WKUserInterfaceDirectionPolicy _WKUserInterfaceDirectionPolicy;
+
WK_EXPORT WKTypeID WKPreferencesGetTypeID();
WK_EXPORT WKPreferencesRef WKPreferencesCreate();
@@ -64,7 +76,7 @@ WK_EXPORT bool WKPreferencesGetLoadsImagesAutomatically(WKPreferencesRef prefere
WK_EXPORT void WKPreferencesSetLoadsSiteIconsIgnoringImageLoadingPreference(WKPreferencesRef preferences, bool loadsSiteIconsIgnoringImageLoadingPreference);
WK_EXPORT bool WKPreferencesGetLoadsSiteIconsIgnoringImageLoadingPreference(WKPreferencesRef preferences);
-// Defaults to false.
+// Defaults to true.
WK_EXPORT void WKPreferencesSetOfflineWebApplicationCacheEnabled(WKPreferencesRef preferences, bool offlineWebApplicationCacheEnabled);
WK_EXPORT bool WKPreferencesGetOfflineWebApplicationCacheEnabled(WKPreferencesRef preferences);
@@ -144,10 +156,6 @@ WK_EXPORT bool WKPreferencesGetPrivateBrowsingEnabled(WKPreferencesRef preferenc
WK_EXPORT void WKPreferencesSetDeveloperExtrasEnabled(WKPreferencesRef preferencesRef, bool enabled);
WK_EXPORT bool WKPreferencesGetDeveloperExtrasEnabled(WKPreferencesRef preferencesRef);
-// Defaults to false.
-WK_EXPORT void WKPreferencesSetJavaScriptExperimentsEnabled(WKPreferencesRef preferencesRef, bool enabled);
-WK_EXPORT bool WKPreferencesGetJavaScriptExperimentsEnabled(WKPreferencesRef preferencesRef);
-
// Defaults to true.
WK_EXPORT void WKPreferencesSetTextAreasAreResizable(WKPreferencesRef preferencesRef, bool resizable);
WK_EXPORT bool WKPreferencesGetTextAreasAreResizable(WKPreferencesRef preferencesRef);
@@ -180,6 +188,10 @@ WK_EXPORT bool WKPreferencesGetFullScreenEnabled(WKPreferencesRef preferencesRef
WK_EXPORT void WKPreferencesSetAVFoundationEnabled(WKPreferencesRef preferencesRef, bool enabled);
WK_EXPORT bool WKPreferencesGetAVFoundationEnabled(WKPreferencesRef preferencesRef);
+// Defaults to false.
+WK_EXPORT void WKPreferencesSetAVFoundationNSURLSessionEnabled(WKPreferencesRef preferencesRef, bool enabled);
+WK_EXPORT bool WKPreferencesGetAVFoundationNSURLSessionEnabled(WKPreferencesRef preferencesRef);
+
// Defaults to false
WK_EXPORT void WKPreferencesSetWebAudioEnabled(WKPreferencesRef preferencesRef, bool enabled);
WK_EXPORT bool WKPreferencesGetWebAudioEnabled(WKPreferencesRef preferencesRef);
@@ -216,7 +228,7 @@ WK_EXPORT bool WKPreferencesGetNotificationsEnabled(WKPreferencesRef preferences
WK_EXPORT void WKPreferencesSetShouldRespectImageOrientation(WKPreferencesRef preferencesRef, bool enabled);
WK_EXPORT bool WKPreferencesGetShouldRespectImageOrientation(WKPreferencesRef preferencesRef);
-// Defaults to false
+// Defaults to kWKAllowAllStorage
WK_EXPORT void WKPreferencesSetStorageBlockingPolicy(WKPreferencesRef preferencesRef, WKStorageBlockingPolicy policy);
WK_EXPORT WKStorageBlockingPolicy WKPreferencesGetStorageBlockingPolicy(WKPreferencesRef preferencesRef);
@@ -244,14 +256,38 @@ WK_EXPORT bool WKPreferencesGetAsynchronousSpellCheckingEnabled(WKPreferencesRef
WK_EXPORT void WKPreferencesSetMediaStreamEnabled(WKPreferencesRef preferencesRef, bool enabled);
WK_EXPORT bool WKPreferencesGetMediaStreamEnabled(WKPreferencesRef preferencesRef);
-// Defaults to true.
-WK_EXPORT void WKPreferencesSetVideoPluginProxyEnabled(WKPreferencesRef preferencesRef, bool enabled);
-WK_EXPORT bool WKPreferencesGetVideoPluginProxyEnabled(WKPreferencesRef preferencesRef);
+// Defaults to false
+WK_EXPORT void WKPreferencesSetPeerConnectionEnabled(WKPreferencesRef preferencesRef, bool enabled);
+WK_EXPORT bool WKPreferencesGetPeerConnectionEnabled(WKPreferencesRef preferencesRef);
// Defaults to false.
WK_EXPORT void WKPreferencesSetSpatialNavigationEnabled(WKPreferencesRef preferencesRef, bool enabled);
WK_EXPORT bool WKPreferencesGetSpatialNavigationEnabled(WKPreferencesRef preferencesRef);
+// Defaults to 0.
+WK_EXPORT void WKPreferencesSetVisibleDebugOverlayRegions(WKPreferencesRef preferencesRef, WKDebugOverlayRegions enabled);
+WK_EXPORT WKDebugOverlayRegions WKPreferencesGetVisibleDebugOverlayRegions(WKPreferencesRef preferencesRef);
+
+// Defaults to false.
+WK_EXPORT void WKPreferencesSetIgnoreViewportScalingConstraints(WKPreferencesRef preferencesRef, bool enabled);
+WK_EXPORT bool WKPreferencesGetIgnoreViewportScalingConstraints(WKPreferencesRef preferencesRef);
+
+// Defaults to true.
+WK_EXPORT void WKPreferencesSetAllowsAirPlayForMediaPlayback(WKPreferencesRef preferencesRef, bool enabled);
+WK_EXPORT bool WKPreferencesGetAllowsAirPlayForMediaPlayback(WKPreferencesRef preferencesRef);
+
+// Defaults to kWKUserInterfaceDirectionPolicyContent.
+WK_EXPORT void WKPreferencesSetUserInterfaceDirectionPolicy(WKPreferencesRef preferencesRef, _WKUserInterfaceDirectionPolicy userInterfaceDirectionPolicy);
+WK_EXPORT _WKUserInterfaceDirectionPolicy WKPreferencesGetUserInterfaceDirectionPolicy(WKPreferencesRef preferencesRef);
+
+// Defaults to false.
+WK_EXPORT bool WKPreferencesGetApplePayEnabled(WKPreferencesRef preferencesRef);
+WK_EXPORT void WKPreferencesSetApplePayEnabled(WKPreferencesRef preferencesRef, bool enabled);
+
+// Defaults to true.
+WK_EXPORT bool WKPreferencesGetApplePayCapabilityDisclosureAllowed(WKPreferencesRef preferencesRef);
+WK_EXPORT void WKPreferencesSetApplePayCapabilityDisclosureAllowed(WKPreferencesRef preferencesRef, bool allowed);
+
#ifdef __cplusplus
}
#endif
diff --git a/Source/WebKit2/UIProcess/API/C/WKPreferencesPrivate.h b/Source/WebKit2/UIProcess/API/C/WKPreferencesRefPrivate.h
index 0d80f0499..7c255841a 100644
--- a/Source/WebKit2/UIProcess/API/C/WKPreferencesPrivate.h
+++ b/Source/WebKit2/UIProcess/API/C/WKPreferencesRefPrivate.h
@@ -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
@@ -26,7 +26,7 @@
#ifndef WKPreferencesPrivate_h
#define WKPreferencesPrivate_h
-#include <WebKit2/WKBase.h>
+#include <WebKit/WKBase.h>
#ifdef __cplusplus
extern "C" {
@@ -49,9 +49,16 @@ enum WKEditableLinkBehavior {
};
typedef enum WKEditableLinkBehavior WKEditableLinkBehavior;
+enum WKJavaScriptRuntimeFlags {
+ kWKJavaScriptRuntimeFlagsAllEnabled = 0
+};
+typedef unsigned WKJavaScriptRuntimeFlagSet;
+
// Creates a copy with no identifier.
WK_EXPORT WKPreferencesRef WKPreferencesCreateCopy(WKPreferencesRef);
+WK_EXPORT void WKPreferencesEnableAllExperimentalFeatures(WKPreferencesRef);
+
// Defaults to kWKFontSmoothingLevelMedium.
WK_EXPORT void WKPreferencesSetFontSmoothingLevel(WKPreferencesRef, WKFontSmoothingLevel);
WK_EXPORT WKFontSmoothingLevel WKPreferencesGetFontSmoothingLevel(WKPreferencesRef);
@@ -93,10 +100,6 @@ WK_EXPORT void WKPreferencesSetWebGLEnabled(WKPreferencesRef, bool);
WK_EXPORT bool WKPreferencesGetWebGLEnabled(WKPreferencesRef);
// Defaults to false.
-WK_EXPORT void WKPreferencesSetMultithreadedWebGLEnabled(WKPreferencesRef, bool);
-WK_EXPORT bool WKPreferencesGetMultithreadedWebGLEnabled(WKPreferencesRef);
-
-// Defaults to false.
WK_EXPORT void WKPreferencesSetForceSoftwareWebGLRendering(WKPreferencesRef, bool);
WK_EXPORT bool WKPreferencesGetForceSoftwareWebGLRendering(WKPreferencesRef);
@@ -105,16 +108,12 @@ WK_EXPORT void WKPreferencesSetAccelerated2DCanvasEnabled(WKPreferencesRef, bool
WK_EXPORT bool WKPreferencesGetAccelerated2DCanvasEnabled(WKPreferencesRef);
// Defaults to true
-WK_EXPORT void WKPreferencesSetCSSRegionsEnabled(WKPreferencesRef, bool flag);
-WK_EXPORT bool WKPreferencesGetCSSRegionsEnabled(WKPreferencesRef);
-
-// Defaults to false
-WK_EXPORT void WKPreferencesSetCSSGridLayoutEnabled(WKPreferencesRef, bool flag);
-WK_EXPORT bool WKPreferencesGetCSSGridLayoutEnabled(WKPreferencesRef);
+WK_EXPORT void WKPreferencesSetCSSAnimationTriggersEnabled(WKPreferencesRef, bool flag);
+WK_EXPORT bool WKPreferencesGetCSSAnimationTriggersEnabled(WKPreferencesRef);
// Defaults to false
-WK_EXPORT void WKPreferencesSetRegionBasedColumnsEnabled(WKPreferencesRef, bool flag);
-WK_EXPORT bool WKPreferencesGetRegionBasedColumnsEnabled(WKPreferencesRef);
+WK_EXPORT void WKPreferencesSetWebAnimationsEnabled(WKPreferencesRef, bool flag);
+WK_EXPORT bool WKPreferencesGetWebAnimationsEnabled(WKPreferencesRef);
// Defaults to false.
WK_EXPORT void WKPreferencesSetNeedsSiteSpecificQuirks(WKPreferencesRef, bool);
@@ -128,6 +127,10 @@ WK_EXPORT bool WKPreferencesGetForceFTPDirectoryListings(WKPreferencesRef prefer
WK_EXPORT void WKPreferencesSetFTPDirectoryTemplatePath(WKPreferencesRef preferences, WKStringRef path);
WK_EXPORT WKStringRef WKPreferencesCopyFTPDirectoryTemplatePath(WKPreferencesRef preferences);
+// Defaults to true.
+WK_EXPORT void WKPreferencesSetDOMTimersThrottlingEnabled(WKPreferencesRef preferences, bool enabled);
+WK_EXPORT bool WKPreferencesGetDOMTimersThrottlingEnabled(WKPreferencesRef preferences);
+
// Defaults to false.
WK_EXPORT void WKPreferencesSetWebArchiveDebugModeEnabled(WKPreferencesRef preferences, bool enabled);
WK_EXPORT bool WKPreferencesGetWebArchiveDebugModeEnabled(WKPreferencesRef preferences);
@@ -164,6 +167,10 @@ WK_EXPORT bool WKPreferencesGetUniversalAccessFromFileURLsAllowed(WKPreferencesR
WK_EXPORT void WKPreferencesSetFileAccessFromFileURLsAllowed(WKPreferencesRef preferences, bool allowed);
WK_EXPORT bool WKPreferencesGetFileAccessFromFileURLsAllowed(WKPreferencesRef preferences);
+// Defaults to true
+WK_EXPORT void WKPreferencesSetNeedsStorageAccessFromFileURLsQuirk(WKPreferencesRef preferences, bool needsQuirk);
+WK_EXPORT bool WKPreferencesGetNeedsStorageAccessFromFileURLsQuirk(WKPreferencesRef preferences);
+
// Defaults to true.
WK_EXPORT void WKPreferencesSetHixie76WebSocketProtocolEnabled(WKPreferencesRef preferencesRef, bool enabled);
WK_EXPORT bool WKPreferencesGetHixie76WebSocketProtocolEnabled(WKPreferencesRef preferencesRef);
@@ -172,19 +179,43 @@ WK_EXPORT bool WKPreferencesGetHixie76WebSocketProtocolEnabled(WKPreferencesRef
WK_EXPORT void WKPreferencesSetMediaPlaybackRequiresUserGesture(WKPreferencesRef preferencesRef, bool flag);
WK_EXPORT bool WKPreferencesGetMediaPlaybackRequiresUserGesture(WKPreferencesRef preferencesRef);
+// Defaults to false.
+WK_EXPORT void WKPreferencesSetVideoPlaybackRequiresUserGesture(WKPreferencesRef preferencesRef, bool flag);
+WK_EXPORT bool WKPreferencesGetVideoPlaybackRequiresUserGesture(WKPreferencesRef preferencesRef);
+
+// Defaults to false.
+WK_EXPORT void WKPreferencesSetAudioPlaybackRequiresUserGesture(WKPreferencesRef preferencesRef, bool flag);
+WK_EXPORT bool WKPreferencesGetAudioPlaybackRequiresUserGesture(WKPreferencesRef preferencesRef);
+
+// Defaults to false.
+WK_EXPORT void WKPreferencesSetMainContentUserGestureOverrideEnabled(WKPreferencesRef preferencesRef, bool flag);
+WK_EXPORT bool WKPreferencesGetMainContentUserGestureOverrideEnabled(WKPreferencesRef preferencesRef);
+
// Defaults to true.
WK_EXPORT void WKPreferencesSetMediaPlaybackAllowsInline(WKPreferencesRef preferencesRef, bool flag);
WK_EXPORT bool WKPreferencesGetMediaPlaybackAllowsInline(WKPreferencesRef preferencesRef);
// Defaults to false.
+WK_EXPORT void WKPreferencesSetInlineMediaPlaybackRequiresPlaysInlineAttribute(WKPreferencesRef preferencesRef, bool flag);
+WK_EXPORT bool WKPreferencesGetInlineMediaPlaybackRequiresPlaysInlineAttribute(WKPreferencesRef preferencesRef);
+
+// Defaults to false on iOS, true elsewhere.
+WK_EXPORT void WKPreferencesSetMediaControlsScaleWithPageZoom(WKPreferencesRef preferencesRef, bool flag);
+WK_EXPORT bool WKPreferencesGetMediaControlsScaleWithPageZoom(WKPreferencesRef preferencesRef);
+
+// Defaults to false.
+WK_EXPORT void WKPreferencesSetModernMediaControlsEnabled(WKPreferencesRef preferencesRef, bool flag);
+WK_EXPORT bool WKPreferencesGetModernMediaControlsEnabled(WKPreferencesRef preferencesRef);
+
+// Defaults to false.
WK_EXPORT void WKPreferencesSetShowsToolTipOverTruncatedText(WKPreferencesRef preferencesRef, bool flag);
WK_EXPORT bool WKPreferencesGetShowsToolTipOverTruncatedText(WKPreferencesRef preferencesRef);
// Defaults to false.
WK_EXPORT void WKPreferencesSetMockScrollbarsEnabled(WKPreferencesRef preferencesRef, bool flag);
WK_EXPORT bool WKPreferencesGetMockScrollbarsEnabled(WKPreferencesRef preferencesRef);
-
-// Defaults to false.
+
+// Deprecated. Always returns false.
WK_EXPORT void WKPreferencesSetApplicationChromeModeEnabled(WKPreferencesRef preferencesRef, bool enabled);
WK_EXPORT bool WKPreferencesGetApplicationChromeModeEnabled(WKPreferencesRef preferencesRef);
@@ -220,7 +251,7 @@ WK_EXPORT bool WKPreferencesGetArtificialPluginInitializationDelayEnabled(WKPref
WK_EXPORT void WKPreferencesSetTabToLinksEnabled(WKPreferencesRef preferencesRef, bool enabled);
WK_EXPORT bool WKPreferencesGetTabToLinksEnabled(WKPreferencesRef preferencesRef);
-// Defaults to false
+// Defaults to true
WK_EXPORT void WKPreferencesSetInteractiveFormValidationEnabled(WKPreferencesRef preferencesRef, bool enabled);
WK_EXPORT bool WKPreferencesGetInteractiveFormValidationEnabled(WKPreferencesRef preferencesRef);
@@ -229,10 +260,6 @@ WK_EXPORT void WKPreferencesSetScrollingPerformanceLoggingEnabled(WKPreferencesR
WK_EXPORT bool WKPreferencesGetScrollingPerformanceLoggingEnabled(WKPreferencesRef preferencesRef);
// Defaults to true
-WK_EXPORT void WKPreferencesSetScreenFontSubstitutionEnabled(WKPreferencesRef preferences, bool enabled);
-WK_EXPORT bool WKPreferencesGetScreenFontSubstitutionEnabled(WKPreferencesRef preferences);
-
-// Defaults to true
WK_EXPORT void WKPreferencesSetCookieEnabled(WKPreferencesRef preferences, bool enabled);
WK_EXPORT bool WKPreferencesGetCookieEnabled(WKPreferencesRef preferences);
@@ -248,7 +275,7 @@ WK_EXPORT bool WKPreferencesGetAggressiveTileRetentionEnabled(WKPreferencesRef p
WK_EXPORT void WKPreferencesSetLogsPageMessagesToSystemConsoleEnabled(WKPreferencesRef preferences, bool enabled);
WK_EXPORT bool WKPreferencesGetLogsPageMessagesToSystemConsoleEnabled(WKPreferencesRef preferences);
-// Defaults to false
+// Defaults to true
WK_EXPORT void WKPreferencesSetPageVisibilityBasedProcessSuppressionEnabled(WKPreferencesRef preferences, bool enabled);
WK_EXPORT bool WKPreferencesGetPageVisibilityBasedProcessSuppressionEnabled(WKPreferencesRef);
@@ -268,6 +295,10 @@ WK_EXPORT bool WKPreferencesGetShowsURLsInToolTipsEnabled(WKPreferencesRef prefe
WK_EXPORT void WKPreferencesSetHiddenPageDOMTimerThrottlingEnabled(WKPreferencesRef preferences, bool enabled);
WK_EXPORT bool WKPreferencesGetHiddenPageDOMTimerThrottlingEnabled(WKPreferencesRef preferences);
+// Defaults to false
+WK_EXPORT void WKPreferencesSetHiddenPageDOMTimerThrottlingAutoIncreases(WKPreferencesRef preferences, bool enabled);
+WK_EXPORT bool WKPreferencesGetHiddenPageDOMTimerThrottlingAutoIncreases(WKPreferencesRef preferences);
+
// Defaults to true on Mac, false on other platforms.
WK_EXPORT void WKPreferencesSetHiddenPageCSSAnimationSuspensionEnabled(WKPreferencesRef preferences, bool enabled);
WK_EXPORT bool WKPreferencesGetHiddenPageCSSAnimationSuspensionEnabled(WKPreferencesRef preferences);
@@ -300,13 +331,29 @@ WK_EXPORT bool WKPreferencesGetSimpleLineLayoutEnabled(WKPreferencesRef);
WK_EXPORT void WKPreferencesSetSimpleLineLayoutDebugBordersEnabled(WKPreferencesRef, bool);
WK_EXPORT bool WKPreferencesGetSimpleLineLayoutDebugBordersEnabled(WKPreferencesRef);
+// Defaults to false.
+WK_EXPORT void WKPreferencesSetNewBlockInsideInlineModelEnabled(WKPreferencesRef, bool);
+WK_EXPORT bool WKPreferencesGetNewBlockInsideInlineModelEnabled(WKPreferencesRef);
+
+// Defaults to false.
+WK_EXPORT void WKPreferencesSetDeferredCSSParserEnabled(WKPreferencesRef, bool);
+WK_EXPORT bool WKPreferencesGetDeferredCSSParserEnabled(WKPreferencesRef);
+
+// Defaults to false.
+WK_EXPORT void WKPreferencesSetSubpixelCSSOMElementMetricsEnabled(WKPreferencesRef, bool);
+WK_EXPORT bool WKPreferencesGetSubpixelCSSOMElementMetricsEnabled(WKPreferencesRef);
+
+// Defaults to false.
+WK_EXPORT void WKPreferencesSetUseGiantTiles(WKPreferencesRef, bool);
+WK_EXPORT bool WKPreferencesGetUseGiantTiles(WKPreferencesRef);
+
WK_EXPORT void WKPreferencesResetTestRunnerOverrides(WKPreferencesRef preferencesRef);
// Defaults to false.
WK_EXPORT void WKPreferencesSetUseLegacyTextAlignPositionedElementBehavior(WKPreferencesRef preferencesRef, bool enabled);
WK_EXPORT bool WKPreferencesUseLegacyTextAlignPositionedElementBehavior(WKPreferencesRef preferencesRef);
-// Defaults to false.
+// Defaults to true.
WK_EXPORT void WKPreferencesSetMediaSourceEnabled(WKPreferencesRef preferencesRef, bool enabled);
WK_EXPORT bool WKPreferencesGetMediaSourceEnabled(WKPreferencesRef preferencesRef);
@@ -314,6 +361,110 @@ WK_EXPORT bool WKPreferencesGetMediaSourceEnabled(WKPreferencesRef preferencesRe
WK_EXPORT void WKPreferencesSetViewGestureDebuggingEnabled(WKPreferencesRef preferencesRef, bool enabled);
WK_EXPORT bool WKPreferencesGetViewGestureDebuggingEnabled(WKPreferencesRef preferencesRef);
+// Default to false.
+WK_EXPORT void WKPreferencesSetShouldConvertPositionStyleOnCopy(WKPreferencesRef preferencesRef, bool convert);
+WK_EXPORT bool WKPreferencesGetShouldConvertPositionStyleOnCopy(WKPreferencesRef preferencesRef);
+
+// Default to false.
+WK_EXPORT void WKPreferencesSetTelephoneNumberParsingEnabled(WKPreferencesRef preferencesRef, bool enabled);
+WK_EXPORT bool WKPreferencesGetTelephoneNumberParsingEnabled(WKPreferencesRef preferencesRef);
+
+// Default to false.
+WK_EXPORT void WKPreferencesSetEnableInheritURIQueryComponent(WKPreferencesRef preferencesRef, bool enabled);
+WK_EXPORT bool WKPreferencesGetEnableInheritURIQueryComponent(WKPreferencesRef preferencesRef);
+
+// Default to false.
+WK_EXPORT void WKPreferencesSetServiceControlsEnabled(WKPreferencesRef preferencesRef, bool enabled);
+WK_EXPORT bool WKPreferencesGetServiceControlsEnabled(WKPreferencesRef preferencesRef);
+
+// Default to false.
+WK_EXPORT void WKPreferencesSetImageControlsEnabled(WKPreferencesRef preferencesRef, bool enabled);
+WK_EXPORT bool WKPreferencesGetImageControlsEnabled(WKPreferencesRef preferencesRef);
+
+// Default to false.
+WK_EXPORT void WKPreferencesSetGamepadsEnabled(WKPreferencesRef preferencesRef, bool enabled);
+WK_EXPORT bool WKPreferencesGetGamepadsEnabled(WKPreferencesRef preferencesRef);
+
+// Not implemented, should be deleted once there are no callers.
+WK_EXPORT void WKPreferencesSetLongMousePressEnabled(WKPreferencesRef preferencesRef, bool enabled);
+WK_EXPORT bool WKPreferencesGetLongMousePressEnabled(WKPreferencesRef preferencesRef);
+
+// Defaults to 0. Setting this to 0 disables font autosizing on iOS.
+WK_EXPORT void WKPreferencesSetMinimumZoomFontSize(WKPreferencesRef preferencesRef, double);
+WK_EXPORT double WKPreferencesGetMinimumZoomFontSize(WKPreferencesRef preferencesRef);
+
+// Not implemented, should be deleted once Safari no longer uses this function.
+WK_EXPORT void WKPreferencesSetScreenFontSubstitutionEnabled(WKPreferencesRef preferences, bool enabled);
+WK_EXPORT bool WKPreferencesGetScreenFontSubstitutionEnabled(WKPreferencesRef preferences);
+
+// Not implemented, should be deleted once Safari no longer uses this function.
+WK_EXPORT void WKPreferencesSetAntialiasedFontDilationEnabled(WKPreferencesRef preferences, bool enabled);
+WK_EXPORT bool WKPreferencesGetAntialiasedFontDilationEnabled(WKPreferencesRef preferences);
+
+// Defaults to 0.
+WK_EXPORT void WKPreferencesSetJavaScriptRuntimeFlags(WKPreferencesRef preferences, WKJavaScriptRuntimeFlagSet javascriptRuntimeFlagSet);
+WK_EXPORT WKJavaScriptRuntimeFlagSet WKPreferencesGetJavaScriptRuntimeFlags(WKPreferencesRef preferences);
+
+// Defaults to true.
+WK_EXPORT void WKPreferencesSetMetaRefreshEnabled(WKPreferencesRef preferences, bool enabled);
+WK_EXPORT bool WKPreferencesGetMetaRefreshEnabled(WKPreferencesRef preferences);
+
+// Defaults to true.
+WK_EXPORT void WKPreferencesSetHTTPEquivEnabled(WKPreferencesRef preferences, bool enabled);
+WK_EXPORT bool WKPreferencesGetHTTPEquivEnabled(WKPreferencesRef preferences);
+
+// Defaults to false.
+WK_EXPORT void WKPreferencesSetResourceUsageOverlayVisible(WKPreferencesRef, bool);
+WK_EXPORT bool WKPreferencesGetResourceUsageOverlayVisible(WKPreferencesRef);
+
+// Defaults to false.
+WK_EXPORT void WKPreferencesSetMockCaptureDevicesEnabled(WKPreferencesRef, bool);
+WK_EXPORT bool WKPreferencesGetMockCaptureDevicesEnabled(WKPreferencesRef);
+
+// Defaults to true.
+WK_EXPORT void WKPreferencesSetMediaCaptureRequiresSecureConnection(WKPreferencesRef, bool);
+WK_EXPORT bool WKPreferencesGetMediaCaptureRequiresSecureConnection(WKPreferencesRef);
+
+// Defaults to false
+WK_EXPORT void WKPreferencesSetFetchAPIEnabled(WKPreferencesRef, bool flag);
+WK_EXPORT bool WKPreferencesGetFetchAPIEnabled(WKPreferencesRef);
+
+// Defaults to false
+WK_EXPORT void WKPreferencesSetDownloadAttributeEnabled(WKPreferencesRef, bool flag);
+WK_EXPORT bool WKPreferencesGetDownloadAttributeEnabled(WKPreferencesRef);
+
+// Defaults to false
+WK_EXPORT void WKPreferencesSetSelectionPaintingWithoutSelectionGapsEnabled(WKPreferencesRef, bool flag);
+WK_EXPORT bool WKPreferencesGetSelectionPaintingWithoutSelectionGapsEnabled(WKPreferencesRef);
+
+// Defaults to false.
+WK_EXPORT void WKPreferencesSetAllowsPictureInPictureMediaPlayback(WKPreferencesRef, bool flag);
+WK_EXPORT bool WKPreferencesGetAllowsPictureInPictureMediaPlayback(WKPreferencesRef);
+
+// Defaults to false
+WK_EXPORT void WKPreferencesSetIntersectionObserverEnabled(WKPreferencesRef, bool flag);
+WK_EXPORT bool WKPreferencesGetIntersectionObserverEnabled(WKPreferencesRef);
+
+// Defaults to false
+WK_EXPORT void WKPreferencesSetUserTimingEnabled(WKPreferencesRef, bool flag);
+WK_EXPORT bool WKPreferencesGetUserTimingEnabled(WKPreferencesRef);
+
+// Defaults to false
+WK_EXPORT void WKPreferencesSetResourceTimingEnabled(WKPreferencesRef, bool flag);
+WK_EXPORT bool WKPreferencesGetResourceTimingEnabled(WKPreferencesRef);
+
+// Defaults to true
+WK_EXPORT void WKPreferencesSetSubtleCryptoEnabled(WKPreferencesRef, bool flag);
+WK_EXPORT bool WKPreferencesGetSubtleCryptoEnabled(WKPreferencesRef);
+
+// Defaults to false
+WK_EXPORT void WKPreferencesSetShouldSuppressKeyboardInputDuringProvisionalNavigation(WKPreferencesRef, bool flag);
+WK_EXPORT bool WKPreferencesGetShouldSuppressKeyboardInputDuringProvisionalNavigation(WKPreferencesRef);
+
+// Defaults to false.
+WK_EXPORT void WKPreferencesSetLinkPreloadEnabled(WKPreferencesRef, bool flag);
+WK_EXPORT bool WKPreferencesGetLinkPreloadEnabled(WKPreferencesRef);
+
#ifdef __cplusplus
}
#endif
diff --git a/Source/WebKit2/UIProcess/API/C/WKProtectionSpace.h b/Source/WebKit2/UIProcess/API/C/WKProtectionSpace.h
index c77d93ba0..ff7ca8742 100644
--- a/Source/WebKit2/UIProcess/API/C/WKProtectionSpace.h
+++ b/Source/WebKit2/UIProcess/API/C/WKProtectionSpace.h
@@ -26,8 +26,8 @@
#ifndef WKProtectionSpace_h
#define WKProtectionSpace_h
-#include <WebKit2/WKBase.h>
-#include <WebKit2/WKProtectionSpaceTypes.h>
+#include <WebKit/WKBase.h>
+#include <WebKit/WKProtectionSpaceTypes.h>
#ifdef __cplusplus
extern "C" {
diff --git a/Source/WebKit2/UIProcess/API/C/WKProtectionSpaceTypes.h b/Source/WebKit2/UIProcess/API/C/WKProtectionSpaceTypes.h
index fd1bd09d2..474146049 100644
--- a/Source/WebKit2/UIProcess/API/C/WKProtectionSpaceTypes.h
+++ b/Source/WebKit2/UIProcess/API/C/WKProtectionSpaceTypes.h
@@ -26,7 +26,7 @@
#ifndef WKProtectionSpaceTypes_h
#define WKProtectionSpaceTypes_h
-#include <WebKit2/WKBase.h>
+#include <WebKit/WKBase.h>
#ifdef __cplusplus
extern "C" {
diff --git a/Source/WebKit2/UIProcess/API/C/WKResourceCacheManager.cpp b/Source/WebKit2/UIProcess/API/C/WKResourceCacheManager.cpp
index a5711e014..c0621d5a8 100644
--- a/Source/WebKit2/UIProcess/API/C/WKResourceCacheManager.cpp
+++ b/Source/WebKit2/UIProcess/API/C/WKResourceCacheManager.cpp
@@ -26,27 +26,68 @@
#include "config.h"
#include "WKResourceCacheManager.h"
-#include "WebResourceCacheManagerProxy.h"
+#include "APIWebsiteDataStore.h"
#include "WKAPICast.h"
+#include "WebsiteDataRecord.h"
using namespace WebKit;
WKTypeID WKResourceCacheManagerGetTypeID()
{
- return toAPI(WebResourceCacheManagerProxy::APIType);
+ return toAPI(API::WebsiteDataStore::APIType);
}
-void WKResourceCacheManagerGetCacheOrigins(WKResourceCacheManagerRef cacheManagerRef, void* context, WKResourceCacheManagerGetCacheOriginsFunction callback)
+static OptionSet<WebsiteDataType> toWebsiteDataTypes(WKResourceCachesToClear cachesToClear)
{
- toImpl(cacheManagerRef)->getCacheOrigins(ArrayCallback::create(context, callback));
+ OptionSet<WebsiteDataType> websiteDataTypes;
+
+ websiteDataTypes |= WebsiteDataType::MemoryCache;
+
+ if (cachesToClear == WKResourceCachesToClearAll)
+ websiteDataTypes |= WebsiteDataType::DiskCache;
+
+ return websiteDataTypes;
+}
+
+void WKResourceCacheManagerGetCacheOrigins(WKResourceCacheManagerRef cacheManager, void* context, WKResourceCacheManagerGetCacheOriginsFunction callback)
+{
+ auto& websiteDataStore = toImpl(reinterpret_cast<WKWebsiteDataStoreRef>(cacheManager))->websiteDataStore();
+ websiteDataStore.fetchData(toWebsiteDataTypes(WKResourceCachesToClearAll), { }, [context, callback](auto dataRecords) {
+ Vector<RefPtr<API::Object>> securityOrigins;
+ for (const auto& dataRecord : dataRecords) {
+ for (const auto& origin : dataRecord.origins)
+ securityOrigins.append(API::SecurityOrigin::create(origin.securityOrigin()));
+ }
+
+ callback(toAPI(API::Array::create(WTFMove(securityOrigins)).ptr()), nullptr, context);
+ });
}
-void WKResourceCacheManagerClearCacheForOrigin(WKResourceCacheManagerRef cacheManagerRef, WKSecurityOriginRef originRef, WKResourceCachesToClear cachesToClear)
+void WKResourceCacheManagerClearCacheForOrigin(WKResourceCacheManagerRef cacheManager, WKSecurityOriginRef origin, WKResourceCachesToClear cachesToClear)
{
- toImpl(cacheManagerRef)->clearCacheForOrigin(toImpl(originRef), toResourceCachesToClear(cachesToClear));
+ auto& websiteDataStore = toImpl(reinterpret_cast<WKWebsiteDataStoreRef>(cacheManager))->websiteDataStore();
+
+ Vector<WebsiteDataRecord> dataRecords;
+
+ {
+ WebsiteDataRecord dataRecord;
+ dataRecord.add(WebsiteDataType::MemoryCache, WebCore::SecurityOriginData::fromSecurityOrigin(toImpl(origin)->securityOrigin()));
+
+ dataRecords.append(dataRecord);
+ }
+
+ if (cachesToClear == WKResourceCachesToClearAll) {
+ WebsiteDataRecord dataRecord;
+ dataRecord.add(WebsiteDataType::DiskCache, WebCore::SecurityOriginData::fromSecurityOrigin(toImpl(origin)->securityOrigin()));
+
+ dataRecords.append(dataRecord);
+ }
+
+ websiteDataStore.removeData(toWebsiteDataTypes(cachesToClear), dataRecords, [] { });
}
-void WKResourceCacheManagerClearCacheForAllOrigins(WKResourceCacheManagerRef cacheManagerRef, WKResourceCachesToClear cachesToClear)
+void WKResourceCacheManagerClearCacheForAllOrigins(WKResourceCacheManagerRef cacheManager, WKResourceCachesToClear cachesToClear)
{
- toImpl(cacheManagerRef)->clearCacheForAllOrigins(toResourceCachesToClear(cachesToClear));
+ auto& websiteDataStore = toImpl(reinterpret_cast<WKWebsiteDataStoreRef>(cacheManager))->websiteDataStore();
+ websiteDataStore.removeData(toWebsiteDataTypes(cachesToClear), std::chrono::system_clock::time_point::min(), [] { });
}
diff --git a/Source/WebKit2/UIProcess/API/C/WKResourceCacheManager.h b/Source/WebKit2/UIProcess/API/C/WKResourceCacheManager.h
index 80c4531ff..7f4bb6c51 100644
--- a/Source/WebKit2/UIProcess/API/C/WKResourceCacheManager.h
+++ b/Source/WebKit2/UIProcess/API/C/WKResourceCacheManager.h
@@ -26,7 +26,7 @@
#ifndef WKResourceCacheManager_h
#define WKResourceCacheManager_h
-#include <WebKit2/WKBase.h>
+#include <WebKit/WKBase.h>
#ifdef __cplusplus
extern "C" {
diff --git a/Source/WebKit2/UIProcess/API/C/WKResourceLoadStatisticsManager.cpp b/Source/WebKit2/UIProcess/API/C/WKResourceLoadStatisticsManager.cpp
new file mode 100644
index 000000000..879abeb39
--- /dev/null
+++ b/Source/WebKit2/UIProcess/API/C/WKResourceLoadStatisticsManager.cpp
@@ -0,0 +1,87 @@
+/*
+ * Copyright (C) 2017 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "WKResourceLoadStatisticsManager.h"
+
+#include "WKAPICast.h"
+#include "WebResourceLoadStatisticsManager.h"
+
+using namespace WebKit;
+
+WKTypeID WKResourceLoadStatisticsManagerGetTypeID()
+{
+ return toAPI(WebResourceLoadStatisticsManager::APIType);
+}
+
+void WKResourceLoadStatisticsManagerSetPrevalentResource(WKStringRef hostName, bool value)
+{
+ WebResourceLoadStatisticsManager::setPrevalentResource(toWTFString(hostName), value);
+}
+
+bool WKResourceLoadStatisticsManagerIsPrevalentResource(WKStringRef hostName)
+{
+ return WebResourceLoadStatisticsManager::isPrevalentResource(toWTFString(hostName));
+}
+
+void WKResourceLoadStatisticsManagerSetHasHadUserInteraction(WKStringRef hostName, bool value)
+{
+ WebResourceLoadStatisticsManager::setHasHadUserInteraction(toWTFString(hostName), value);
+}
+
+bool WKResourceLoadStatisticsManagerIsHasHadUserInteraction(WKStringRef hostName)
+{
+ return WebResourceLoadStatisticsManager::hasHadUserInteraction(toWTFString(hostName));
+}
+
+void WKResourceLoadStatisticsManagerSetTimeToLiveUserInteraction(double seconds)
+{
+ WebResourceLoadStatisticsManager::setTimeToLiveUserInteraction(seconds);
+}
+
+void WKResourceLoadStatisticsManagerFireDataModificationHandler()
+{
+ WebResourceLoadStatisticsManager::fireDataModificationHandler();
+}
+
+void WKResourceLoadStatisticsManagerSetNotifyPagesWhenDataRecordsWereScanned(bool value)
+{
+ WebResourceLoadStatisticsManager::setNotifyPagesWhenDataRecordsWereScanned(value);
+}
+
+void WKResourceLoadStatisticsManagerSetShouldClassifyResourcesBeforeDataRecordsRemoval(bool value)
+{
+ WebResourceLoadStatisticsManager::setShouldClassifyResourcesBeforeDataRecordsRemoval(value);
+}
+
+void WKResourceLoadStatisticsManagerSetMinimumTimeBetweeenDataRecordsRemoval(double seconds)
+{
+ WebResourceLoadStatisticsManager::setMinimumTimeBetweeenDataRecordsRemoval(seconds);
+}
+
+void WKResourceLoadStatisticsManagerResetToConsistentState()
+{
+ WebResourceLoadStatisticsManager::resetToConsistentState();
+}
diff --git a/Source/WebKit2/UIProcess/API/C/WKResourceLoadStatisticsManager.h b/Source/WebKit2/UIProcess/API/C/WKResourceLoadStatisticsManager.h
new file mode 100644
index 000000000..2b83f5c11
--- /dev/null
+++ b/Source/WebKit2/UIProcess/API/C/WKResourceLoadStatisticsManager.h
@@ -0,0 +1,51 @@
+/*
+ * Copyright (C) 2017 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#pragma once
+
+#include <WebKit/WKBase.h>
+#include <wtf/text/WTFString.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+ WK_EXPORT WKTypeID WKResourceLoadStatisticsManagerGetTypeID();
+
+ WK_EXPORT void WKResourceLoadStatisticsManagerSetPrevalentResource(WKStringRef hostName, bool value);
+ WK_EXPORT bool WKResourceLoadStatisticsManagerIsPrevalentResource(WKStringRef hostName);
+ WK_EXPORT void WKResourceLoadStatisticsManagerSetHasHadUserInteraction(WKStringRef hostName, bool value);
+ WK_EXPORT bool WKResourceLoadStatisticsManagerIsHasHadUserInteraction(WKStringRef hostName);
+ WK_EXPORT void WKResourceLoadStatisticsManagerSetTimeToLiveUserInteraction(double seconds);
+ WK_EXPORT void WKResourceLoadStatisticsManagerSetReducedTimestampResolution(double seconds);
+ WK_EXPORT void WKResourceLoadStatisticsManagerFireDataModificationHandler();
+ WK_EXPORT void WKResourceLoadStatisticsManagerSetNotifyPagesWhenDataRecordsWereScanned(bool value);
+ WK_EXPORT void WKResourceLoadStatisticsManagerSetShouldClassifyResourcesBeforeDataRecordsRemoval(bool value);
+ WK_EXPORT void WKResourceLoadStatisticsManagerSetMinimumTimeBetweeenDataRecordsRemoval(double seconds);
+ WK_EXPORT void WKResourceLoadStatisticsManagerResetToConsistentState();
+
+#ifdef __cplusplus
+}
+#endif
diff --git a/Source/WebKit2/UIProcess/API/C/WKNetworkInfo.cpp b/Source/WebKit2/UIProcess/API/C/WKSessionStateRef.cpp
index 73fd05e53..c938f514c 100644
--- a/Source/WebKit2/UIProcess/API/C/WKNetworkInfo.cpp
+++ b/Source/WebKit2/UIProcess/API/C/WKSessionStateRef.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2012 Intel Corporation. All rights reserved.
+ * Copyright (C) 2014 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -24,32 +24,29 @@
*/
#include "config.h"
-#include "WKNetworkInfo.h"
+#include "WKSessionStateRef.h"
-#if ENABLE(NETWORK_INFO)
+#include "APIData.h"
+#include "APISessionState.h"
+#include "LegacySessionStateCoding.h"
+#include "SessionState.h"
#include "WKAPICast.h"
-#include "WebNetworkInfo.h"
-using namespace WebKit;
-#endif
+WKTypeID WKSessionStateGetTypeID()
+{
+ return WebKit::toAPI(API::SessionState::APIType);
+}
-WKTypeID WKNetworkInfoGetTypeID()
+WKSessionStateRef WKSessionStateCreateFromData(WKDataRef data)
{
-#if ENABLE(NETWORK_INFO)
- return toAPI(WebNetworkInfo::APIType);
-#else
- return 0;
-#endif
+ WebKit::SessionState sessionState;
+ if (!WebKit::decodeLegacySessionState(WebKit::toImpl(data)->bytes(), WebKit::toImpl(data)->size(), sessionState))
+ return nullptr;
+
+ return WebKit::toAPI(&API::SessionState::create(WTFMove(sessionState)).leakRef());
}
-WKNetworkInfoRef WKNetworkInfoCreate(double bandwidth, bool isMetered)
+WKDataRef WKSessionStateCopyData(WKSessionStateRef sessionState)
{
-#if ENABLE(NETWORK_INFO)
- RefPtr<WebNetworkInfo> networkInfo = WebNetworkInfo::create(bandwidth, isMetered);
- return toAPI(networkInfo.release().leakRef());
-#else
- UNUSED_PARAM(bandwidth);
- UNUSED_PARAM(isMetered);
- return 0;
-#endif
+ return WebKit::toAPI(WebKit::encodeLegacySessionState(WebKit::toImpl(sessionState)->sessionState()).leakRef());
}
diff --git a/Source/WebKit2/UIProcess/API/C/WKColorPickerResultListener.h b/Source/WebKit2/UIProcess/API/C/WKSessionStateRef.h
index bfd4732c9..e46b66414 100644
--- a/Source/WebKit2/UIProcess/API/C/WKColorPickerResultListener.h
+++ b/Source/WebKit2/UIProcess/API/C/WKSessionStateRef.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2012 Samsung Electronics. All rights reserved.
+ * Copyright (C) 2014 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -10,7 +10,7 @@
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS AS IS''
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
@@ -23,21 +23,23 @@
* THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef WKColorPickerResultListener_h
-#define WKColorPickerResultListener_h
+#ifndef WKSessionStateRef_h
+#define WKSessionStateRef_h
-#include <WebKit2/WKBase.h>
+#include <WebKit/WKBase.h>
#ifdef __cplusplus
extern "C" {
#endif
-WK_EXPORT WKTypeID WKColorPickerResultListenerGetTypeID();
+WK_EXPORT WKTypeID WKSessionStateGetTypeID();
-WK_EXPORT void WKColorPickerResultListenerSetColor(WKColorPickerResultListenerRef listenerRef, const WKStringRef color);
+WK_EXPORT WKSessionStateRef WKSessionStateCreateFromData(WKDataRef data);
+
+WK_EXPORT WKDataRef WKSessionStateCopyData(WKSessionStateRef sessionState);
#ifdef __cplusplus
}
#endif
-#endif /* WKColorPickerResultListener_h */
+#endif // WKSessionStateRef_h
diff --git a/Source/WebKit2/UIProcess/API/C/WKTextChecker.cpp b/Source/WebKit2/UIProcess/API/C/WKTextChecker.cpp
index 2da94dfc2..c8e7560b1 100644
--- a/Source/WebKit2/UIProcess/API/C/WKTextChecker.cpp
+++ b/Source/WebKit2/UIProcess/API/C/WKTextChecker.cpp
@@ -25,36 +25,48 @@
#include "config.h"
#include "WKTextChecker.h"
+#include "TextChecker.h"
+#if defined(BUILDING_GTK__)
#include "WKAPICast.h"
#include "WebPageProxy.h"
#include "WebTextChecker.h"
+#endif
using namespace WebKit;
+void WKTextCheckerSetTestingMode(bool enabled)
+{
+ TextChecker::setTestingMode(enabled);
+}
+
+#if defined(BUILDING_GTK__)
+
void WKTextCheckerSetClient(const WKTextCheckerClientBase* wkClient)
{
if (wkClient && wkClient->version)
return;
- WebTextChecker::shared()->setClient(wkClient);
+ WebTextChecker::singleton()->setClient(wkClient);
}
void WKTextCheckerContinuousSpellCheckingEnabledStateChanged(bool enabled)
{
- WebTextChecker::shared()->continuousSpellCheckingEnabledStateChanged(enabled);
+ WebTextChecker::singleton()->continuousSpellCheckingEnabledStateChanged(enabled);
}
void WKTextCheckerGrammarCheckingEnabledStateChanged(bool enabled)
{
- WebTextChecker::shared()->grammarCheckingEnabledStateChanged(enabled);
+ WebTextChecker::singleton()->grammarCheckingEnabledStateChanged(enabled);
}
void WKTextCheckerCheckSpelling(WKPageRef page, bool startBeforeSelection)
{
- WebTextChecker::shared()->checkSpelling(toImpl(page), startBeforeSelection);
+ WebTextChecker::singleton()->checkSpelling(toImpl(page), startBeforeSelection);
}
void WKTextCheckerChangeSpellingToWord(WKPageRef page, WKStringRef word)
{
- WebTextChecker::shared()->changeSpellingToWord(toImpl(page), toWTFString(word));
+ WebTextChecker::singleton()->changeSpellingToWord(toImpl(page), toWTFString(word));
}
+
+#endif
diff --git a/Source/WebKit2/UIProcess/API/C/WKTextChecker.h b/Source/WebKit2/UIProcess/API/C/WKTextChecker.h
index af72c75b7..f52d9c700 100644
--- a/Source/WebKit2/UIProcess/API/C/WKTextChecker.h
+++ b/Source/WebKit2/UIProcess/API/C/WKTextChecker.h
@@ -26,12 +26,16 @@
#ifndef WKTextChecker_h
#define WKTextChecker_h
-#include <WebKit2/WKBase.h>
+#include <WebKit/WKBase.h>
#ifdef __cplusplus
extern "C" {
#endif
+WK_EXPORT void WKTextCheckerSetTestingMode(bool enabled);
+
+#if defined(BUILDING_GTK__)
+
// TextChecker Client
typedef bool (*WKTextCheckerContinousSpellCheckingAllowed)(const void *clientInfo);
typedef bool (*WKTextCheckerContinousSpellCheckingEnabled)(const void *clientInfo);
@@ -84,6 +88,8 @@ WK_EXPORT void WKTextCheckerGrammarCheckingEnabledStateChanged(bool);
WK_EXPORT void WKTextCheckerCheckSpelling(WKPageRef page, bool startBeforeSelection);
WK_EXPORT void WKTextCheckerChangeSpellingToWord(WKPageRef page, WKStringRef word);
+#endif
+
#ifdef __cplusplus
}
#endif
diff --git a/Source/WebKit2/UIProcess/API/C/WKUserContentControllerRef.cpp b/Source/WebKit2/UIProcess/API/C/WKUserContentControllerRef.cpp
new file mode 100644
index 000000000..bb73853ba
--- /dev/null
+++ b/Source/WebKit2/UIProcess/API/C/WKUserContentControllerRef.cpp
@@ -0,0 +1,74 @@
+/*
+ * Copyright (C) 2015 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "WKUserContentControllerRef.h"
+
+#include "APIUserContentExtension.h"
+#include "APIUserScript.h"
+#include "WKAPICast.h"
+#include "WebUserContentControllerProxy.h"
+
+using namespace WebKit;
+
+WKTypeID WKUserContentControllerGetTypeID()
+{
+ return toAPI(WebUserContentControllerProxy::APIType);
+}
+
+WKUserContentControllerRef WKUserContentControllerCreate()
+{
+ return toAPI(&WebUserContentControllerProxy::create().leakRef());
+}
+
+WKArrayRef WKUserContentControllerCopyUserScripts(WKUserContentControllerRef userContentControllerRef)
+{
+ Ref<API::Array> userScripts = toImpl(userContentControllerRef)->userScripts().copy();
+ return toAPI(&userScripts.leakRef());
+}
+
+void WKUserContentControllerAddUserScript(WKUserContentControllerRef userContentControllerRef, WKUserScriptRef userScriptRef)
+{
+ toImpl(userContentControllerRef)->addUserScript(*toImpl(userScriptRef));
+}
+
+void WKUserContentControllerRemoveAllUserScripts(WKUserContentControllerRef userContentControllerRef)
+{
+ toImpl(userContentControllerRef)->removeAllUserScripts();
+}
+
+void WKUserContentControllerAddUserContentFilter(WKUserContentControllerRef userContentControllerRef, WKUserContentFilterRef userContentFilterRef)
+{
+#if ENABLE(CONTENT_EXTENSIONS)
+ toImpl(userContentControllerRef)->addUserContentExtension(*toImpl(userContentFilterRef));
+#endif
+}
+
+void WKUserContentControllerRemoveAllUserContentFilters(WKUserContentControllerRef userContentControllerRef)
+{
+#if ENABLE(CONTENT_EXTENSIONS)
+ toImpl(userContentControllerRef)->removeAllUserContentExtensions();
+#endif
+}
diff --git a/Source/WebKit2/UIProcess/API/C/WKUserContentControllerRef.h b/Source/WebKit2/UIProcess/API/C/WKUserContentControllerRef.h
new file mode 100644
index 000000000..d462e99b1
--- /dev/null
+++ b/Source/WebKit2/UIProcess/API/C/WKUserContentControllerRef.h
@@ -0,0 +1,50 @@
+/*
+ * Copyright (C) 2015 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef WKUserContentControllerRef_h
+#define WKUserContentControllerRef_h
+
+#include <WebKit/WKBase.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+WK_EXPORT WKTypeID WKUserContentControllerGetTypeID();
+
+WK_EXPORT WKUserContentControllerRef WKUserContentControllerCreate();
+
+WK_EXPORT WKArrayRef WKUserContentControllerCopyUserScripts(WKUserContentControllerRef userContentController);
+WK_EXPORT void WKUserContentControllerAddUserScript(WKUserContentControllerRef userContentController, WKUserScriptRef userScript);
+WK_EXPORT void WKUserContentControllerRemoveAllUserScripts(WKUserContentControllerRef userContentController);
+
+WK_EXPORT void WKUserContentControllerAddUserContentFilter(WKUserContentControllerRef userContentController, WKUserContentFilterRef userContentFilter);
+WK_EXPORT void WKUserContentControllerRemoveAllUserContentFilters(WKUserContentControllerRef userContentController);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* WKUserContentControllerRef_h */
diff --git a/Source/WebKit2/UIProcess/API/C/WKUserContentExtensionStoreRef.cpp b/Source/WebKit2/UIProcess/API/C/WKUserContentExtensionStoreRef.cpp
new file mode 100644
index 000000000..6fe872e62
--- /dev/null
+++ b/Source/WebKit2/UIProcess/API/C/WKUserContentExtensionStoreRef.cpp
@@ -0,0 +1,41 @@
+/*
+ * Copyright (C) 2015 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "WKUserContentExtensionStoreRef.h"
+
+#include "APIUserContentExtensionStore.h"
+#include "WKAPICast.h"
+
+using namespace WebKit;
+
+WKTypeID WKUserContentExtensionStoreGetTypeID()
+{
+#if ENABLE(CONTENT_EXTENSIONS)
+ return toAPI(API::UserContentExtensionStore::APIType);
+#else
+ return 0;
+#endif
+}
diff --git a/Source/WebKit2/UIProcess/API/C/WKUserContentExtensionStoreRef.h b/Source/WebKit2/UIProcess/API/C/WKUserContentExtensionStoreRef.h
new file mode 100644
index 000000000..53598ec80
--- /dev/null
+++ b/Source/WebKit2/UIProcess/API/C/WKUserContentExtensionStoreRef.h
@@ -0,0 +1,41 @@
+/*
+ * Copyright (C) 2015 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef WKUserContentExtensionStoreRef_h
+#define WKUserContentExtensionStoreRef_h
+
+#include <WebKit/WKBase.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+WK_EXPORT WKTypeID WKUserContentExtensionStoreGetTypeID();
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* WKUserContentExtensionStoreRef_h */
diff --git a/Source/WebKit2/UIProcess/API/C/WKUserMediaPermissionCheck.cpp b/Source/WebKit2/UIProcess/API/C/WKUserMediaPermissionCheck.cpp
new file mode 100644
index 000000000..4403cd75f
--- /dev/null
+++ b/Source/WebKit2/UIProcess/API/C/WKUserMediaPermissionCheck.cpp
@@ -0,0 +1,47 @@
+/*
+ * Copyright (C) 2015 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE, INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ */
+
+#include "config.h"
+#include "WKUserMediaPermissionCheck.h"
+
+#include "UserMediaPermissionCheckProxy.h"
+#include "WKAPICast.h"
+#include "WKArray.h"
+#include "WKMutableArray.h"
+#include "WKString.h"
+
+using namespace WebKit;
+
+WKTypeID WKUserMediaPermissionCheckGetTypeID()
+{
+ return toAPI(UserMediaPermissionCheckProxy::APIType);
+}
+
+void WKUserMediaPermissionCheckSetUserMediaAccessInfo(WKUserMediaPermissionCheckRef userMediaPermissionRequestRef, WKStringRef mediaDeviceIdentifierHashSalt, bool allowed)
+{
+ toImpl(userMediaPermissionRequestRef)->setUserMediaAccessInfo(toWTFString(mediaDeviceIdentifierHashSalt), allowed);
+}
+
diff --git a/Source/WebKit2/UIProcess/API/C/WKUserMediaPermissionCheck.h b/Source/WebKit2/UIProcess/API/C/WKUserMediaPermissionCheck.h
new file mode 100644
index 000000000..d257845e4
--- /dev/null
+++ b/Source/WebKit2/UIProcess/API/C/WKUserMediaPermissionCheck.h
@@ -0,0 +1,44 @@
+/*
+ * Copyright (C) 2015 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE, INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ */
+
+#ifndef WKUserMediaPermissionCheck_h
+#define WKUserMediaPermissionCheck_h
+
+#include <WebKit/WKBase.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+WK_EXPORT WKTypeID WKUserMediaPermissionCheckGetTypeID();
+
+WK_EXPORT void WKUserMediaPermissionCheckSetUserMediaAccessInfo(WKUserMediaPermissionCheckRef, WKStringRef, bool);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* WKMediaDevicesRequest_h */
diff --git a/Source/WebKit2/UIProcess/API/C/WKUserMediaPermissionRequest.cpp b/Source/WebKit2/UIProcess/API/C/WKUserMediaPermissionRequest.cpp
new file mode 100644
index 000000000..453669512
--- /dev/null
+++ b/Source/WebKit2/UIProcess/API/C/WKUserMediaPermissionRequest.cpp
@@ -0,0 +1,96 @@
+/*
+ * Copyright (C) 2014 Igalia S.L
+ * Copyright (C) 2016 Apple Inc. All rights reserved.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include "config.h"
+#include "WKUserMediaPermissionRequest.h"
+
+#include "UserMediaPermissionRequestProxy.h"
+#include "WKAPICast.h"
+#include "WKArray.h"
+#include "WKMutableArray.h"
+#include "WKString.h"
+
+using namespace WebKit;
+
+WKTypeID WKUserMediaPermissionRequestGetTypeID()
+{
+ return toAPI(UserMediaPermissionRequestProxy::APIType);
+}
+
+
+void WKUserMediaPermissionRequestAllow(WKUserMediaPermissionRequestRef userMediaPermissionRequestRef, WKStringRef audioDeviceUID, WKStringRef videoDeviceUID)
+{
+ toImpl(userMediaPermissionRequestRef)->allow(toWTFString(audioDeviceUID), toWTFString(videoDeviceUID));
+}
+
+static UserMediaPermissionRequestProxy::UserMediaAccessDenialReason toWK(UserMediaPermissionRequestDenialReason reason)
+{
+ switch (reason) {
+ case kWKNoConstraints:
+ return UserMediaPermissionRequestProxy::UserMediaAccessDenialReason::NoConstraints;
+ break;
+ case kWKUserMediaDisabled:
+ return UserMediaPermissionRequestProxy::UserMediaAccessDenialReason::UserMediaDisabled;
+ break;
+ case kWKNoCaptureDevices:
+ return UserMediaPermissionRequestProxy::UserMediaAccessDenialReason::NoCaptureDevices;
+ break;
+ case kWKInvalidConstraint:
+ return UserMediaPermissionRequestProxy::UserMediaAccessDenialReason::InvalidConstraint;
+ break;
+ case kWKHardwareError:
+ return UserMediaPermissionRequestProxy::UserMediaAccessDenialReason::HardwareError;
+ break;
+ case kWKPermissionDenied:
+ return UserMediaPermissionRequestProxy::UserMediaAccessDenialReason::PermissionDenied;
+ break;
+ case kWKOtherFailure:
+ return UserMediaPermissionRequestProxy::UserMediaAccessDenialReason::OtherFailure;
+ break;
+ }
+
+ ASSERT_NOT_REACHED();
+ return UserMediaPermissionRequestProxy::UserMediaAccessDenialReason::OtherFailure;
+
+}
+
+void WKUserMediaPermissionRequestDeny(WKUserMediaPermissionRequestRef userMediaPermissionRequestRef, UserMediaPermissionRequestDenialReason reason)
+{
+ toImpl(userMediaPermissionRequestRef)->deny(toWK(reason));
+}
+
+WKArrayRef WKUserMediaPermissionRequestVideoDeviceUIDs(WKUserMediaPermissionRequestRef userMediaPermissionRef)
+{
+ WKMutableArrayRef array = WKMutableArrayCreate();
+#if ENABLE(MEDIA_STREAM)
+ for (auto& deviceUID : toImpl(userMediaPermissionRef)->videoDeviceUIDs())
+ WKArrayAppendItem(array, toAPI(API::String::create(deviceUID).ptr()));
+#endif
+ return array;
+}
+
+WKArrayRef WKUserMediaPermissionRequestAudioDeviceUIDs(WKUserMediaPermissionRequestRef userMediaPermissionRef)
+{
+ WKMutableArrayRef array = WKMutableArrayCreate();
+#if ENABLE(MEDIA_STREAM)
+ for (auto& deviceUID : toImpl(userMediaPermissionRef)->audioDeviceUIDs())
+ WKArrayAppendItem(array, toAPI(API::String::create(deviceUID).ptr()));
+#endif
+ return array;
+}
diff --git a/Source/WebKit2/UIProcess/API/C/WKUserMediaPermissionRequest.h b/Source/WebKit2/UIProcess/API/C/WKUserMediaPermissionRequest.h
new file mode 100644
index 000000000..2f9c1b4e8
--- /dev/null
+++ b/Source/WebKit2/UIProcess/API/C/WKUserMediaPermissionRequest.h
@@ -0,0 +1,52 @@
+/*
+ * Copyright (C) 2014 Igalia S.L
+ * Copyright (C) 2016 Apple Inc. All rights reserved.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef WKUserMediaPermissionRequest_h
+#define WKUserMediaPermissionRequest_h
+
+#include <WebKit/WKBase.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+WK_EXPORT WKTypeID WKUserMediaPermissionRequestGetTypeID();
+
+enum {
+ kWKNoConstraints = 0,
+ kWKUserMediaDisabled,
+ kWKNoCaptureDevices,
+ kWKInvalidConstraint,
+ kWKHardwareError,
+ kWKPermissionDenied,
+ kWKOtherFailure
+};
+typedef uint32_t UserMediaPermissionRequestDenialReason;
+
+WK_EXPORT void WKUserMediaPermissionRequestAllow(WKUserMediaPermissionRequestRef, WKStringRef audioDeviceUID, WKStringRef videoDeviceUID);
+WK_EXPORT void WKUserMediaPermissionRequestDeny(WKUserMediaPermissionRequestRef, UserMediaPermissionRequestDenialReason);
+
+WK_EXPORT WKArrayRef WKUserMediaPermissionRequestVideoDeviceUIDs(WKUserMediaPermissionRequestRef);
+WK_EXPORT WKArrayRef WKUserMediaPermissionRequestAudioDeviceUIDs(WKUserMediaPermissionRequestRef);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* WKUserMediaPermissionRequest_h */
diff --git a/Source/WebKit2/UIProcess/API/C/WKMediaCacheManager.cpp b/Source/WebKit2/UIProcess/API/C/WKUserScriptRef.cpp
index 6e2ecce06..17e762961 100644
--- a/Source/WebKit2/UIProcess/API/C/WKMediaCacheManager.cpp
+++ b/Source/WebKit2/UIProcess/API/C/WKUserScriptRef.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2011 Apple Inc. All rights reserved.
+ * Copyright (C) 2015 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -24,29 +24,34 @@
*/
#include "config.h"
-#include "WKMediaCacheManager.h"
+#include "WKUserScriptRef.h"
+#include "APIUserScript.h"
#include "WKAPICast.h"
-#include "WebMediaCacheManagerProxy.h"
using namespace WebKit;
-WKTypeID WKMediaCacheManagerGetTypeID()
+WKTypeID WKUserScriptGetTypeID()
{
- return toAPI(WebMediaCacheManagerProxy::APIType);
+ return toAPI(API::UserScript::APIType);
}
-void WKMediaCacheManagerGetHostnamesWithMediaCache(WKMediaCacheManagerRef mediaCacheManagerRef, void* context, WKMediaCacheManagerGetHostnamesWithMediaCacheFunction callback)
+WKUserScriptRef WKUserScriptCreateWithSource(WKStringRef sourceRef, _WKUserScriptInjectionTime injectionTime, bool forMainFrameOnly)
{
- toImpl(mediaCacheManagerRef)->getHostnamesWithMediaCache(ArrayCallback::create(context, callback));
+ return toAPI(&API::UserScript::create(WebCore::UserScript { toWTFString(sourceRef), API::UserScript::generateUniqueURL(), { }, { }, toUserScriptInjectionTime(injectionTime), forMainFrameOnly ? WebCore::InjectInTopFrameOnly : WebCore::InjectInAllFrames }, API::UserContentWorld::normalWorld()).leakRef());
}
-void WKMediaCacheManagerClearCacheForHostname(WKMediaCacheManagerRef mediaCacheManagerRef, WKStringRef hostname)
+WKStringRef WKUserScriptCopySource(WKUserScriptRef userScriptRef)
{
- toImpl(mediaCacheManagerRef)->clearCacheForHostname(toWTFString(hostname));
+ return toCopiedAPI(toImpl(userScriptRef)->userScript().source());
}
-void WKMediaCacheManagerClearCacheForAllHostnames(WKMediaCacheManagerRef mediaCacheManagerRef)
+_WKUserScriptInjectionTime WKUserScriptGetInjectionTime(WKUserScriptRef userScriptRef)
{
- toImpl(mediaCacheManagerRef)->clearCacheForAllHostnames();
+ return toWKUserScriptInjectionTime(toImpl(userScriptRef)->userScript().injectionTime());
+}
+
+bool WKUserScriptGetMainFrameOnly(WKUserScriptRef userScriptRef)
+{
+ return toImpl(userScriptRef)->userScript().injectedFrames() == WebCore::InjectInTopFrameOnly;
}
diff --git a/Source/WebKit2/UIProcess/API/C/WKUserScriptRef.h b/Source/WebKit2/UIProcess/API/C/WKUserScriptRef.h
new file mode 100644
index 000000000..610f9fb58
--- /dev/null
+++ b/Source/WebKit2/UIProcess/API/C/WKUserScriptRef.h
@@ -0,0 +1,48 @@
+/*
+ * Copyright (C) 2015 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef WKUserScriptRef_h
+#define WKUserScriptRef_h
+
+#include <WebKit/WKBase.h>
+#include <WebKit/WKUserScriptInjectionTime.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+WK_EXPORT WKTypeID WKUserScriptGetTypeID();
+
+WK_EXPORT WKUserScriptRef WKUserScriptCreateWithSource(WKStringRef source, _WKUserScriptInjectionTime injectionTime, bool forMainFrameOnly);
+
+WK_EXPORT WKStringRef WKUserScriptCopySource(WKUserScriptRef userScript);
+WK_EXPORT _WKUserScriptInjectionTime WKUserScriptGetInjectionTime(WKUserScriptRef userScript);
+WK_EXPORT bool WKUserScriptGetMainFrameOnly(WKUserScriptRef userScript);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* WKUserScriptRef_h */
diff --git a/Source/WebKit2/UIProcess/API/C/WKVibration.h b/Source/WebKit2/UIProcess/API/C/WKVibration.h
index c18000bf1..965749c86 100644
--- a/Source/WebKit2/UIProcess/API/C/WKVibration.h
+++ b/Source/WebKit2/UIProcess/API/C/WKVibration.h
@@ -26,7 +26,7 @@
#ifndef WKVibration_h
#define WKVibration_h
-#include <WebKit2/WKBase.h>
+#include <WebKit/WKBase.h>
#ifdef __cplusplus
extern "C" {
diff --git a/Source/WebKit2/UIProcess/API/C/WKViewportAttributes.cpp b/Source/WebKit2/UIProcess/API/C/WKViewportAttributes.cpp
new file mode 100644
index 000000000..e30af5666
--- /dev/null
+++ b/Source/WebKit2/UIProcess/API/C/WKViewportAttributes.cpp
@@ -0,0 +1,37 @@
+/*
+ * Copyright (C) 2013 Intel Corporation. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the followlayoutSizeing disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list Viewof conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "WKViewportAttributes.h"
+
+#include "WKAPICast.h"
+#include "WebViewportAttributes.h"
+
+using namespace WebKit;
+
+WKTypeID WKViewportAttributesGetTypeID()
+{
+ return toAPI(WebViewportAttributes::APIType);
+}
diff --git a/Source/WebKit2/UIProcess/API/C/WKViewportAttributes.h b/Source/WebKit2/UIProcess/API/C/WKViewportAttributes.h
new file mode 100644
index 000000000..8ab84edac
--- /dev/null
+++ b/Source/WebKit2/UIProcess/API/C/WKViewportAttributes.h
@@ -0,0 +1,42 @@
+/*
+ * Copyright (C) 2013 Intel Corporation. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list Viewof conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef WKViewportAttributes_h
+#define WKViewportAttributes_h
+
+#include <WebKit/WKBase.h>
+#include <WebKit/WKGeometry.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+WK_EXPORT WKTypeID WKViewportAttributesGetTypeID();
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* WKViewportAttributes_h */
diff --git a/Source/WebKit2/UIProcess/API/C/WKWebsiteDataStoreRef.cpp b/Source/WebKit2/UIProcess/API/C/WKWebsiteDataStoreRef.cpp
new file mode 100644
index 000000000..a77c1a89d
--- /dev/null
+++ b/Source/WebKit2/UIProcess/API/C/WKWebsiteDataStoreRef.cpp
@@ -0,0 +1,62 @@
+/*
+ * Copyright (C) 2015 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "WKWebsiteDataStoreRef.h"
+
+#include "APIWebsiteDataStore.h"
+#include "WKAPICast.h"
+#include "WebsiteDataType.h"
+
+WKTypeID WKWebsiteDataStoreGetTypeID()
+{
+ return WebKit::toAPI(API::WebsiteDataStore::APIType);
+}
+
+WKWebsiteDataStoreRef WKWebsiteDataStoreGetDefaultDataStore()
+{
+ return WebKit::toAPI(API::WebsiteDataStore::defaultDataStore().get());
+}
+
+WKWebsiteDataStoreRef WKWebsiteDataStoreCreateNonPersistentDataStore()
+{
+ return WebKit::toAPI(&API::WebsiteDataStore::createNonPersistentDataStore().leakRef());
+}
+
+void WKWebsiteDataStoreSetResourceLoadStatisticsEnabled(WKWebsiteDataStoreRef dataStoreRef, bool enable)
+{
+ WebKit::toImpl(dataStoreRef)->setResourceLoadStatisticsEnabled(enable);
+}
+
+bool WKWebsiteDataStoreGetResourceLoadStatisticsEnabled(WKWebsiteDataStoreRef dataStoreRef)
+{
+ return WebKit::toImpl(dataStoreRef)->resourceLoadStatisticsEnabled();
+}
+
+void WKWebsiteDataStoreRemoveAllIndexedDatabases(WKWebsiteDataStoreRef dataStoreRef)
+{
+ OptionSet<WebKit::WebsiteDataType> dataTypes = WebKit::WebsiteDataType::IndexedDBDatabases;
+ WebKit::toImpl(dataStoreRef)->websiteDataStore().removeData(dataTypes, std::chrono::system_clock::time_point::min(), [] { });
+}
diff --git a/Source/WebKit2/UIProcess/API/C/WKWebsiteDataStoreRef.h b/Source/WebKit2/UIProcess/API/C/WKWebsiteDataStoreRef.h
new file mode 100644
index 000000000..da57838d2
--- /dev/null
+++ b/Source/WebKit2/UIProcess/API/C/WKWebsiteDataStoreRef.h
@@ -0,0 +1,48 @@
+/*
+ * Copyright (C) 2015 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef WKWebsiteDataStoreRef_h
+#define WKWebsiteDataStoreRef_h
+
+#include <WebKit/WKBase.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+WK_EXPORT WKTypeID WKWebsiteDataStoreGetTypeID();
+
+WK_EXPORT WKWebsiteDataStoreRef WKWebsiteDataStoreGetDefaultDataStore();
+WK_EXPORT WKWebsiteDataStoreRef WKWebsiteDataStoreCreateNonPersistentDataStore();
+
+WK_EXPORT bool WKWebsiteDataStoreGetResourceLoadStatisticsEnabled(WKWebsiteDataStoreRef dataStoreRef);
+WK_EXPORT void WKWebsiteDataStoreSetResourceLoadStatisticsEnabled(WKWebsiteDataStoreRef dataStoreRef, bool enable);
+WK_EXPORT void WKWebsiteDataStoreRemoveAllIndexedDatabases(WKWebsiteDataStoreRef dataStoreRef);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* WKWebsiteDataStoreRef_h */
diff --git a/Source/WebKit2/UIProcess/API/C/WKWebsitePolicies.cpp b/Source/WebKit2/UIProcess/API/C/WKWebsitePolicies.cpp
new file mode 100644
index 000000000..b9709a68d
--- /dev/null
+++ b/Source/WebKit2/UIProcess/API/C/WKWebsitePolicies.cpp
@@ -0,0 +1,88 @@
+/*
+ * Copyright (C) 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
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "WKWebsitePolicies.h"
+
+#include "APIWebsitePolicies.h"
+#include "WKAPICast.h"
+#include "WebsitePolicies.h"
+
+using namespace WebKit;
+
+WKTypeID WKWebsitePoliciesGetTypeID()
+{
+ return toAPI(API::WebsitePolicies::APIType);
+}
+
+WKWebsitePoliciesRef WKWebsitePoliciesCreate()
+{
+ return toAPI(&API::WebsitePolicies::create().leakRef());
+}
+
+void WKWebsitePoliciesSetContentBlockersEnabled(WKWebsitePoliciesRef websitePolicies, bool enabled)
+{
+ toImpl(websitePolicies)->setContentBlockersEnabled(enabled);
+}
+
+bool WKWebsitePoliciesGetContentBlockersEnabled(WKWebsitePoliciesRef websitePolicies)
+{
+ return toImpl(websitePolicies)->contentBlockersEnabled();
+}
+
+WKWebsiteAutoplayPolicy WKWebsitePoliciesGetAutoplayPolicy(WKWebsitePoliciesRef websitePolicies)
+{
+ switch (toImpl(websitePolicies)->autoplayPolicy()) {
+ case WebKit::WebsiteAutoplayPolicy::Default:
+ return kWKWebsiteAutoplayPolicyDefault;
+ case WebsiteAutoplayPolicy::Allow:
+ return kWKWebsiteAutoplayPolicyAllow;
+ case WebsiteAutoplayPolicy::AllowWithoutSound:
+ return kWKWebsiteAutoplayPolicyAllowWithoutSound;
+ case WebsiteAutoplayPolicy::Deny:
+ return kWKWebsiteAutoplayPolicyDeny;
+ }
+ ASSERT_NOT_REACHED();
+ return kWKWebsiteAutoplayPolicyDefault;
+}
+
+void WKWebsitePoliciesSetAutoplayPolicy(WKWebsitePoliciesRef websitePolicies, WKWebsiteAutoplayPolicy policy)
+{
+ switch (policy) {
+ case kWKWebsiteAutoplayPolicyDefault:
+ toImpl(websitePolicies)->setAutoplayPolicy(WebsiteAutoplayPolicy::Default);
+ return;
+ case kWKWebsiteAutoplayPolicyAllow:
+ toImpl(websitePolicies)->setAutoplayPolicy(WebsiteAutoplayPolicy::Allow);
+ return;
+ case kWKWebsiteAutoplayPolicyAllowWithoutSound:
+ toImpl(websitePolicies)->setAutoplayPolicy(WebsiteAutoplayPolicy::AllowWithoutSound);
+ return;
+ case kWKWebsiteAutoplayPolicyDeny:
+ toImpl(websitePolicies)->setAutoplayPolicy(WebsiteAutoplayPolicy::Deny);
+ return;
+ }
+ ASSERT_NOT_REACHED();
+}
diff --git a/Source/WebKit2/UIProcess/API/C/WKMediaCacheManager.h b/Source/WebKit2/UIProcess/API/C/WKWebsitePolicies.h
index eee1b9291..0c8e34f15 100644
--- a/Source/WebKit2/UIProcess/API/C/WKMediaCacheManager.h
+++ b/Source/WebKit2/UIProcess/API/C/WKWebsitePolicies.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2011 Apple Inc. All rights reserved.
+ * Copyright (C) 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
@@ -23,25 +23,31 @@
* THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef WKMediaCacheManager_h
-#define WKMediaCacheManager_h
+#pragma once
-#include <WebKit2/WKBase.h>
+#include <WebKit/WKBase.h>
#ifdef __cplusplus
extern "C" {
#endif
-WK_EXPORT WKTypeID WKMediaCacheManagerGetTypeID();
+WK_EXPORT WKTypeID WKWebsitePoliciesGetTypeID();
-typedef void (*WKMediaCacheManagerGetHostnamesWithMediaCacheFunction)(WKArrayRef, WKErrorRef, void*);
-WK_EXPORT void WKMediaCacheManagerGetHostnamesWithMediaCache(WKMediaCacheManagerRef mediaCacheManager, void* context, WKMediaCacheManagerGetHostnamesWithMediaCacheFunction function);
+enum WKWebsiteAutoplayPolicy {
+ kWKWebsiteAutoplayPolicyDefault,
+ kWKWebsiteAutoplayPolicyAllow,
+ kWKWebsiteAutoplayPolicyAllowWithoutSound,
+ kWKWebsiteAutoplayPolicyDeny
+};
-WK_EXPORT void WKMediaCacheManagerClearCacheForHostname(WKMediaCacheManagerRef mediaCacheManager, WKStringRef hostname);
-WK_EXPORT void WKMediaCacheManagerClearCacheForAllHostnames(WKMediaCacheManagerRef mediaCacheManager);
+WK_EXPORT WKWebsitePoliciesRef WKWebsitePoliciesCreate();
+
+WK_EXPORT bool WKWebsitePoliciesGetContentBlockersEnabled(WKWebsitePoliciesRef);
+WK_EXPORT void WKWebsitePoliciesSetContentBlockersEnabled(WKWebsitePoliciesRef, bool);
+
+WK_EXPORT WKWebsiteAutoplayPolicy WKWebsitePoliciesGetAutoplayPolicy(WKWebsitePoliciesRef);
+WK_EXPORT void WKWebsitePoliciesSetAutoplayPolicy(WKWebsitePoliciesRef, WKWebsiteAutoplayPolicy);
#ifdef __cplusplus
}
#endif
-
-#endif // WKMediaCacheManager_h
diff --git a/Source/WebKit2/UIProcess/API/C/WKWindowFeaturesRef.cpp b/Source/WebKit2/UIProcess/API/C/WKWindowFeaturesRef.cpp
new file mode 100644
index 000000000..e9338a662
--- /dev/null
+++ b/Source/WebKit2/UIProcess/API/C/WKWindowFeaturesRef.cpp
@@ -0,0 +1,35 @@
+/*
+ * Copyright (C) 2015 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "WKWindowFeaturesRef.h"
+
+#include "APIWindowFeatures.h"
+#include "WKAPICast.h"
+
+WKTypeID WKWindowFeaturesGetTypeID()
+{
+ return WebKit::toAPI(API::WindowFeatures::APIType);
+}
diff --git a/Source/WebKit2/UIProcess/API/C/WKWindowFeaturesRef.h b/Source/WebKit2/UIProcess/API/C/WKWindowFeaturesRef.h
new file mode 100644
index 000000000..5dc940477
--- /dev/null
+++ b/Source/WebKit2/UIProcess/API/C/WKWindowFeaturesRef.h
@@ -0,0 +1,41 @@
+/*
+ * Copyright (C) 2015 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef WKWindowFeaturesRef_h
+#define WKWindowFeaturesRef_h
+
+#include <WebKit/WKBase.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+WK_EXPORT WKTypeID WKWindowFeaturesGetTypeID();
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif // WKWindowFeaturesRef_h
diff --git a/Source/WebKit2/UIProcess/API/C/WebKit2_C.h b/Source/WebKit2/UIProcess/API/C/WebKit2_C.h
index 21c9eeaab..4f82b7f92 100644
--- a/Source/WebKit2/UIProcess/API/C/WebKit2_C.h
+++ b/Source/WebKit2/UIProcess/API/C/WebKit2_C.h
@@ -26,42 +26,46 @@
#ifndef WebKit2_C_h
#define WebKit2_C_h
-#include <WebKit2/WKBase.h>
-#include <WebKit2/WKType.h>
+#include <WebKit/WKBase.h>
+#include <WebKit/WKType.h>
-#include <WebKit2/WKArray.h>
-#include <WebKit2/WKBackForwardListRef.h>
-#include <WebKit2/WKBackForwardListItemRef.h>
-#include <WebKit2/WKConnectionRef.h>
-#include <WebKit2/WKContext.h>
-#include <WebKit2/WKData.h>
-#include <WebKit2/WKDictionary.h>
-#include <WebKit2/WKError.h>
-#include <WebKit2/WKFormSubmissionListener.h>
-#include <WebKit2/WKFrame.h>
-#include <WebKit2/WKFramePolicyListener.h>
-#include <WebKit2/WKGeolocationManager.h>
-#include <WebKit2/WKGeolocationPermissionRequest.h>
-#include <WebKit2/WKGeolocationPosition.h>
-#include <WebKit2/WKHitTestResult.h>
-#include <WebKit2/WKMutableArray.h>
-#include <WebKit2/WKMutableDictionary.h>
-#include <WebKit2/WKNavigationDataRef.h>
-#include <WebKit2/WKNumber.h>
-#include <WebKit2/WKOpenPanelParameters.h>
-#include <WebKit2/WKOpenPanelResultListener.h>
-#include <WebKit2/WKPage.h>
-#include <WebKit2/WKPageGroup.h>
-#include <WebKit2/WKPreferencesRef.h>
-#include <WebKit2/WKString.h>
-#include <WebKit2/WKURL.h>
-#include <WebKit2/WKURLRequest.h>
-#include <WebKit2/WKURLResponse.h>
+#include <WebKit/WKArray.h>
+#include <WebKit/WKBackForwardListRef.h>
+#include <WebKit/WKBackForwardListItemRef.h>
+#include <WebKit/WKConnectionRef.h>
+#include <WebKit/WKContext.h>
+#include <WebKit/WKData.h>
+#include <WebKit/WKDictionary.h>
+#include <WebKit/WKErrorRef.h>
+#include <WebKit/WKFormSubmissionListener.h>
+#include <WebKit/WKFrame.h>
+#include <WebKit/WKFramePolicyListener.h>
+#include <WebKit/WKGeolocationManager.h>
+#include <WebKit/WKGeolocationPermissionRequest.h>
+#include <WebKit/WKGeolocationPosition.h>
+#include <WebKit/WKHitTestResult.h>
+#include <WebKit/WKMutableArray.h>
+#include <WebKit/WKMutableDictionary.h>
+#include <WebKit/WKNavigationDataRef.h>
+#include <WebKit/WKNumber.h>
+#include <WebKit/WKOpenPanelParametersRef.h>
+#include <WebKit/WKOpenPanelResultListener.h>
+#include <WebKit/WKPage.h>
+#include <WebKit/WKPageConfigurationRef.h>
+#include <WebKit/WKPageGroup.h>
+#include <WebKit/WKPreferencesRef.h>
+#include <WebKit/WKString.h>
+#include <WebKit/WKURL.h>
+#include <WebKit/WKURLRequest.h>
+#include <WebKit/WKURLResponse.h>
+#include <WebKit/WKUserContentControllerRef.h>
+#include <WebKit/WKUserMediaPermissionRequest.h>
+#include <WebKit/WKUserScriptRef.h>
#if defined(__OBJC__) && __OBJC__
-#import <WebKit2/WKView.h>
+#import <WebKit/WKView.h>
#elif !(defined(__APPLE__) && __APPLE__)
-#include <WebKit2/WKView.h>
+#include <WebKit/WKView.h>
#endif
#endif /* WebKit2_C_h */
diff --git a/Source/WebKit2/UIProcess/API/C/cairo/WKIconDatabaseCairo.cpp b/Source/WebKit2/UIProcess/API/C/cairo/WKIconDatabaseCairo.cpp
new file mode 100644
index 000000000..118c4d8cb
--- /dev/null
+++ b/Source/WebKit2/UIProcess/API/C/cairo/WKIconDatabaseCairo.cpp
@@ -0,0 +1,38 @@
+/*
+ * Copyright (C) 2013 Intel Corporation. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "WKIconDatabaseCairo.h"
+
+#include "WKAPICast.h"
+#include "WebIconDatabase.h"
+
+using namespace WebCore;
+using namespace WebKit;
+
+cairo_surface_t* WKIconDatabaseTryGetCairoSurfaceForURL(WKIconDatabaseRef iconDatabase, WKURLRef url)
+{
+ return toImpl(iconDatabase)->nativeImageForPageURL(toWTFString(url)).get();
+}
diff --git a/Source/WebKit2/UIProcess/API/C/cairo/WKIconDatabaseCairo.h b/Source/WebKit2/UIProcess/API/C/cairo/WKIconDatabaseCairo.h
new file mode 100644
index 000000000..5830177df
--- /dev/null
+++ b/Source/WebKit2/UIProcess/API/C/cairo/WKIconDatabaseCairo.h
@@ -0,0 +1,38 @@
+/*
+ * Copyright (C) 2013 Intel Corporation. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <WebKit/WKBase.h>
+
+typedef struct _cairo_surface cairo_surface_t;
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+WK_EXPORT cairo_surface_t* WKIconDatabaseTryGetCairoSurfaceForURL(WKIconDatabaseRef iconDatabase, WKURLRef url);
+
+#ifdef __cplusplus
+}
+#endif
diff --git a/Source/WebKit2/UIProcess/API/C/gtk/WKAPICastGtk.h b/Source/WebKit2/UIProcess/API/C/gtk/WKAPICastGtk.h
index 9eb0c78ad..a06292b2e 100644
--- a/Source/WebKit2/UIProcess/API/C/gtk/WKAPICastGtk.h
+++ b/Source/WebKit2/UIProcess/API/C/gtk/WKAPICastGtk.h
@@ -37,6 +37,18 @@ namespace WebKit {
WK_ADD_API_MAPPING(WKViewRef, WebKitWebViewBase)
+template<>
+inline WKViewRef toAPI<>(WebKitWebViewBase* view)
+{
+ return reinterpret_cast<WKViewRef>(static_cast<void*>(view));
+}
+
+template<>
+inline WebKitWebViewBase* toImpl<>(WKViewRef view)
+{
+ return static_cast<WebKitWebViewBase*>(static_cast<void*>(const_cast<typename std::remove_const<typename std::remove_pointer<WKViewRef>::type>::type*>(view)));
+}
+
}
#endif // WKAPICastGtk_h
diff --git a/Source/WebKit2/UIProcess/API/C/gtk/WKFullScreenClientGtk.h b/Source/WebKit2/UIProcess/API/C/gtk/WKFullScreenClientGtk.h
index a292dda11..cece1057b 100644
--- a/Source/WebKit2/UIProcess/API/C/gtk/WKFullScreenClientGtk.h
+++ b/Source/WebKit2/UIProcess/API/C/gtk/WKFullScreenClientGtk.h
@@ -26,7 +26,7 @@
#ifndef WKFullScreenClientGtk_h
#define WKFullScreenClientGtk_h
-#include <WebKit2/WKBase.h>
+#include <WebKit/WKBase.h>
#ifdef __cplusplus
extern "C" {
diff --git a/Source/WebKit2/UIProcess/API/C/gtk/WKInspectorClientGtk.h b/Source/WebKit2/UIProcess/API/C/gtk/WKInspectorClientGtk.h
index 28242da09..2e60bc793 100644
--- a/Source/WebKit2/UIProcess/API/C/gtk/WKInspectorClientGtk.h
+++ b/Source/WebKit2/UIProcess/API/C/gtk/WKInspectorClientGtk.h
@@ -26,7 +26,7 @@
#ifndef WKInspectorClientGtk_h
#define WKInspectorClientGtk_h
-#include <WebKit2/WKBase.h>
+#include <WebKit/WKBase.h>
#ifdef __cplusplus
extern "C" {
@@ -37,6 +37,7 @@ typedef void (*WKInspectorClientGtkInspectorDidCloseCallback)(WKInspectorRef ins
typedef void (*WKInspectorClientGtkInspectedURLChangedCallback)(WKInspectorRef inspector, WKStringRef url, const void* clientInfo);
typedef void (*WKInspectorClientGtkDidChangeAttachedHeightCallback)(WKInspectorRef inspector, unsigned height, const void* clientInfo);
typedef void (*WKInspectorClientGtkDidChangeAttachedWidthCallback)(WKInspectorRef inspector, unsigned width, const void* clientInfo);
+typedef void (*WKInspectorClientGtkDidChangeAttachAvailabilityCallback)(WKInspectorRef inspector, bool available, const void* clientInfo);
typedef struct WKInspectorClientGtkBase {
int version;
@@ -54,6 +55,7 @@ typedef struct WKInspectorClientGtkV0 {
WKInspectorClientGtkInspectorCallback detach;
WKInspectorClientGtkDidChangeAttachedHeightCallback didChangeAttachedHeight;
WKInspectorClientGtkDidChangeAttachedWidthCallback didChangeAttachedWidth;
+ WKInspectorClientGtkDidChangeAttachAvailabilityCallback didChangeAttachAvailability;
} WKInspectorClientGtkV0;
WK_EXPORT void WKInspectorSetInspectorClientGtk(WKInspectorRef inspectorRef, const WKInspectorClientGtkBase* client);
diff --git a/Source/WebKit2/UIProcess/API/C/gtk/WKTextCheckerGtk.cpp b/Source/WebKit2/UIProcess/API/C/gtk/WKTextCheckerGtk.cpp
new file mode 100644
index 000000000..2924ba6db
--- /dev/null
+++ b/Source/WebKit2/UIProcess/API/C/gtk/WKTextCheckerGtk.cpp
@@ -0,0 +1,39 @@
+/*
+ * Copyright (C) 2015 Igalia S.L.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "WKTextCheckerGtk.h"
+
+#include "TextChecker.h"
+
+void WKTextCheckerSetSpellCheckingLanguages(const char* const* languages)
+{
+#if ENABLE(SPELLCHECK)
+ Vector<String> spellCheckingLanguages;
+ for (size_t i = 0; languages[i]; ++i)
+ spellCheckingLanguages.append(String::fromUTF8(languages[i]));
+ WebKit::TextChecker::setSpellCheckingLanguages(spellCheckingLanguages);
+#endif
+}
diff --git a/Source/WebKit2/UIProcess/API/C/gtk/WKTextCheckerGtk.h b/Source/WebKit2/UIProcess/API/C/gtk/WKTextCheckerGtk.h
new file mode 100644
index 000000000..1f6e55a66
--- /dev/null
+++ b/Source/WebKit2/UIProcess/API/C/gtk/WKTextCheckerGtk.h
@@ -0,0 +1,41 @@
+/*
+ * Copyright (C) 2015 Igalia S.L.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef WKTextCheckerGtk_h
+#define WKTextCheckerGtk_h
+
+#include <WebKit/WKBase.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+WK_EXPORT void WKTextCheckerSetSpellCheckingLanguages(const char* const* languages);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* WKTextCheckerGtk_h */
diff --git a/Source/WebKit2/UIProcess/API/C/gtk/WKView.cpp b/Source/WebKit2/UIProcess/API/C/gtk/WKView.cpp
index 6f0c04bf2..48c41ac77 100644
--- a/Source/WebKit2/UIProcess/API/C/gtk/WKView.cpp
+++ b/Source/WebKit2/UIProcess/API/C/gtk/WKView.cpp
@@ -33,11 +33,10 @@
#include "WebKitWebViewBasePrivate.h"
using namespace WebKit;
-using namespace WebCore;
-WKViewRef WKViewCreate(WKContextRef contextRef, WKPageGroupRef pageGroupRef)
+WKViewRef WKViewCreate(WKPageConfigurationRef configuration)
{
- return toAPI(webkitWebViewBaseCreate(toImpl(contextRef), toImpl(pageGroupRef), nullptr));
+ return toAPI(webkitWebViewBaseCreate(*toImpl(configuration)));
}
WKPageRef WKViewGetPage(WKViewRef viewRef)
diff --git a/Source/WebKit2/UIProcess/API/C/gtk/WKView.h b/Source/WebKit2/UIProcess/API/C/gtk/WKView.h
index 291dfe1b6..989ab66a2 100644
--- a/Source/WebKit2/UIProcess/API/C/gtk/WKView.h
+++ b/Source/WebKit2/UIProcess/API/C/gtk/WKView.h
@@ -28,13 +28,13 @@
#ifndef WKView_h
#define WKView_h
-#include <WebKit2/WKBase.h>
+#include <WebKit/WKBase.h>
#ifdef __cplusplus
extern "C" {
#endif
-WK_EXPORT WKViewRef WKViewCreate(WKContextRef context, WKPageGroupRef pageGroup);
+WK_EXPORT WKViewRef WKViewCreate(WKPageConfigurationRef configuration);
WK_EXPORT WKPageRef WKViewGetPage(WKViewRef view);
diff --git a/Source/WebKit2/UIProcess/API/C/gtk/WKViewPrivate.h b/Source/WebKit2/UIProcess/API/C/gtk/WKViewPrivate.h
index 2c1b2d1f0..acabfd3af 100644
--- a/Source/WebKit2/UIProcess/API/C/gtk/WKViewPrivate.h
+++ b/Source/WebKit2/UIProcess/API/C/gtk/WKViewPrivate.h
@@ -26,7 +26,7 @@
#ifndef WKViewPrivate_h
#define WKViewPrivate_h
-#include <WebKit2/WKBase.h>
+#include <WebKit/WKBase.h>
#ifdef __cplusplus
extern "C" {
diff --git a/Source/WebKit2/UIProcess/API/C/WKBatteryStatus.cpp b/Source/WebKit2/UIProcess/API/C/soup/WKCookieManagerSoup.cpp
index 953850d8b..86b31aa47 100644
--- a/Source/WebKit2/UIProcess/API/C/WKBatteryStatus.cpp
+++ b/Source/WebKit2/UIProcess/API/C/soup/WKCookieManagerSoup.cpp
@@ -24,36 +24,28 @@
*/
#include "config.h"
-#include "WKBatteryStatus.h"
+#include "WKCookieManagerSoup.h"
+#include "SoupCookiePersistentStorageType.h"
#include "WKAPICast.h"
-
-#if ENABLE(BATTERY_STATUS)
-#include "WebBatteryStatus.h"
-#endif
+#include "WebCookieManagerProxy.h"
using namespace WebKit;
-WKTypeID WKBatteryStatusGetTypeID()
+inline SoupCookiePersistentStorageType toSoupCookiePersistentStorageType(WKCookieStorageType wkCookieStorageType)
{
-#if ENABLE(BATTERY_STATUS)
- return toAPI(WebBatteryStatus::APIType);
-#else
- return 0;
-#endif
+ switch (wkCookieStorageType) {
+ case kWKCookieStorageTypeText:
+ return SoupCookiePersistentStorageText;
+ case kWKCookieStorageTypeSQLite:
+ return SoupCookiePersistentStorageSQLite;
+ }
+
+ ASSERT_NOT_REACHED();
+ return SoupCookiePersistentStorageText;
}
-WKBatteryStatusRef WKBatteryStatusCreate(bool isCharging, double chargingTime, double dischargingTime, double level)
+void WKCookieManagerSetCookiePersistentStorage(WKCookieManagerRef cookieManager, WKStringRef storagePath, WKCookieStorageType storageType)
{
-#if ENABLE(BATTERY_STATUS)
- RefPtr<WebBatteryStatus> status = WebBatteryStatus::create(isCharging, chargingTime, dischargingTime, level);
- return toAPI(status.release().leakRef());
-#else
- UNUSED_PARAM(isCharging);
- UNUSED_PARAM(chargingTime);
- UNUSED_PARAM(dischargingTime);
- UNUSED_PARAM(level);
- return 0;
-#endif
+ toImpl(cookieManager)->setCookiePersistentStorage(toWTFString(storagePath), storageType);
}
-
diff --git a/Source/WebKit2/UIProcess/API/C/soup/WKAPICastSoup.h b/Source/WebKit2/UIProcess/API/C/soup/WKCookieManagerSoup.h
index 0333335ba..90cafca21 100644
--- a/Source/WebKit2/UIProcess/API/C/soup/WKAPICastSoup.h
+++ b/Source/WebKit2/UIProcess/API/C/soup/WKCookieManagerSoup.h
@@ -1,5 +1,5 @@
/*
- * Portions Copyright (c) 2012 Igalia S.L.
+ * Copyright (C) 2012 Intel Corporation. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -23,24 +23,25 @@
* THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef WKAPICastSoup_h
-#define WKAPICastSoup_h
+#ifndef WKCookieManagerSoup_h
+#define WKCookieManagerSoup_h
-#ifndef WKAPICast_h
-#error "Please #include \"WKAPICast.h\" instead of this file directly."
-#endif
+#include <WebKit/WKBase.h>
-namespace WebKit {
+#ifdef __cplusplus
+extern "C" {
+#endif
-class WebSoupCustomProtocolRequestManager;
-class WebSoupRequestManagerProxy;
+enum {
+ kWKCookieStorageTypeText = 0,
+ kWKCookieStorageTypeSQLite = 1
+};
+typedef uint32_t WKCookieStorageType;
-#if ENABLE(CUSTOM_PROTOCOLS)
-WK_ADD_API_MAPPING(WKSoupCustomProtocolRequestManagerRef, WebSoupCustomProtocolRequestManager)
-#else
-WK_ADD_API_MAPPING(WKSoupRequestManagerRef, WebSoupRequestManagerProxy)
-#endif
+WK_EXPORT void WKCookieManagerSetCookiePersistentStorage(WKCookieManagerRef cookieManager, WKStringRef storagePath, WKCookieStorageType storageType);
+#ifdef __cplusplus
}
+#endif
-#endif // WKAPICastSoup_h
+#endif // WKCookieManagerSoup_h
diff --git a/Source/WebKit2/UIProcess/API/C/soup/WKSoupCustomProtocolRequestManager.h b/Source/WebKit2/UIProcess/API/C/soup/WKSoupCustomProtocolRequestManager.h
deleted file mode 100644
index cb0edc72f..000000000
--- a/Source/WebKit2/UIProcess/API/C/soup/WKSoupCustomProtocolRequestManager.h
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Copyright (C) 2013 Igalia S.L.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef WKSoupCustomProtocolRequestManager_h
-#define WKSoupCustomProtocolRequestManager_h
-
-#include <WebKit2/WKBase.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-typedef void (*WKSoupCustomProtocolRequestManagerStartLoadingCallback)(WKSoupCustomProtocolRequestManagerRef soupManagerRef, uint64_t customProtocolID, WKURLRequestRef requestRef, const void* clientInfo);
-typedef void (*WKSoupCustomProtocolRequestManagerStopLoadingCallback)(WKSoupCustomProtocolRequestManagerRef soupManagerRef, uint64_t customProtocolID, const void* clientInfo);
-
-typedef struct WKSoupCustomProtocolRequestManagerClientBase {
- int version;
- const void* clientInfo;
-} WKSoupCustomProtocolRequestManagerClientBase;
-
-typedef struct WKSoupCustomProtocolRequestManagerClientV0 {
- WKSoupCustomProtocolRequestManagerClientBase base;
-
- WKSoupCustomProtocolRequestManagerStartLoadingCallback startLoading;
- WKSoupCustomProtocolRequestManagerStopLoadingCallback stopLoading;
-} WKSoupCustomProtocolRequestManagerClientV0;
-
-WK_EXPORT WKTypeID WKSoupCustomProtocolRequestManagerGetTypeID();
-
-WK_EXPORT void WKSoupCustomProtocolRequestManagerSetClient(WKSoupCustomProtocolRequestManagerRef, const WKSoupCustomProtocolRequestManagerClientBase*);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* WKSoupCustomProtocolRequestManager_h */