Diff
Modified: trunk/Source/WebKit/ChangeLog (236435 => 236436)
--- trunk/Source/WebKit/ChangeLog 2018-09-24 23:04:06 UTC (rev 236435)
+++ trunk/Source/WebKit/ChangeLog 2018-09-24 23:04:56 UTC (rev 236436)
@@ -1,3 +1,17 @@
+2018-09-24 Alex Christensen <[email protected]>
+
+ Begin deprecating C API
+ https://bugs.webkit.org/show_bug.cgi?id=189810
+
+ Reviewed by Andy Estes.
+
+ * Shared/API/c/WKDeprecated.h: Added.
+ * UIProcess/API/C/WKPage.h:
+ * UIProcess/API/Cocoa/WKBrowsingContextController.mm:
+ (setUpPagePolicyClient):
+ (-[WKBrowsingContextController setPolicyDelegate:]):
+ * WebKit.xcodeproj/project.pbxproj:
+
2018-09-24 Chris Dumez <[email protected]>
Unreviewed, rolling out r236368.
Added: trunk/Source/WebKit/Shared/API/c/WKDeprecated.h (0 => 236436)
--- trunk/Source/WebKit/Shared/API/c/WKDeprecated.h (rev 0)
+++ trunk/Source/WebKit/Shared/API/c/WKDeprecated.h 2018-09-24 23:04:56 UTC (rev 236436)
@@ -0,0 +1,32 @@
+/*
+ * Copyright (C) 2018 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
+
+#ifdef _MSC_VER
+#define WK_C_API_DEPRECATED_WITH_REPLACEMENT(...)
+#else
+#define WK_C_API_DEPRECATED_WITH_REPLACEMENT(_replacement, ...) __attribute__((deprecated("use " #_replacement)))
+#endif
Modified: trunk/Source/WebKit/UIProcess/API/C/WKPage.h (236435 => 236436)
--- trunk/Source/WebKit/UIProcess/API/C/WKPage.h 2018-09-24 23:04:06 UTC (rev 236435)
+++ trunk/Source/WebKit/UIProcess/API/C/WKPage.h 2018-09-24 23:04:56 UTC (rev 236436)
@@ -27,6 +27,7 @@
#define WKPage_h
#include <WebKit/WKBase.h>
+#include <WebKit/WKDeprecated.h>
#include <WebKit/WKErrorRef.h>
#include <WebKit/WKEvent.h>
#include <WebKit/WKFindOptions.h>
@@ -224,8 +225,8 @@
WK_EXPORT void WKPageSetPageInjectedBundleClient(WKPageRef page, const WKPageInjectedBundleClientBase* client);
// 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 WKPageSetPageLoaderClient(WKPageRef page, const WKPageLoaderClientBase* client) WK_C_API_DEPRECATED_WITH_REPLACEMENT(WKPageSetPageNavigationClient, macosx(WK_MAC_TBA));
+WK_EXPORT void WKPageSetPagePolicyClient(WKPageRef page, const WKPagePolicyClientBase* client) WK_C_API_DEPRECATED_WITH_REPLACEMENT(WKPageSetPageNavigationClient, macosx(WK_MAC_TBA));
WK_EXPORT void WKPageSetPageNavigationClient(WKPageRef page, const WKPageNavigationClientBase* client);
typedef void (*WKPageRunJavaScriptFunction)(WKSerializedScriptValueRef, WKErrorRef, void*);
Modified: trunk/Source/WebKit/UIProcess/API/Cocoa/WKBrowsingContextController.mm (236435 => 236436)
--- trunk/Source/WebKit/UIProcess/API/Cocoa/WKBrowsingContextController.mm 2018-09-24 23:04:06 UTC (rev 236435)
+++ trunk/Source/WebKit/UIProcess/API/Cocoa/WKBrowsingContextController.mm 2018-09-24 23:04:56 UTC (rev 236436)
@@ -514,7 +514,9 @@
WKFramePolicyListenerUse(listener);
};
+ ALLOW_DEPRECATED_DECLARATIONS_BEGIN
WKPageSetPagePolicyClient(toAPI(&page), &policyClient.base);
+ ALLOW_DEPRECATED_DECLARATIONS_END
}
- (id <WKBrowsingContextLoadDelegate>)loadDelegate
@@ -543,8 +545,11 @@
if (policyDelegate)
setUpPagePolicyClient(self, *_page);
- else
+ else {
+ ALLOW_DEPRECATED_DECLARATIONS_BEGIN
WKPageSetPagePolicyClient(toAPI(_page.get()), nullptr);
+ ALLOW_DEPRECATED_DECLARATIONS_END
+ }
}
- (id <WKBrowsingContextHistoryDelegate>)historyDelegate
Modified: trunk/Source/WebKit/WebKit.xcodeproj/project.pbxproj (236435 => 236436)
--- trunk/Source/WebKit/WebKit.xcodeproj/project.pbxproj 2018-09-24 23:04:06 UTC (rev 236435)
+++ trunk/Source/WebKit/WebKit.xcodeproj/project.pbxproj 2018-09-24 23:04:56 UTC (rev 236436)
@@ -1050,6 +1050,7 @@
5C20CBA01BB1ECD800895BB1 /* NetworkSession.h in Headers */ = {isa = PBXBuildFile; fileRef = 5C20CB9E1BB0DD1800895BB1 /* NetworkSession.h */; };
5C26958520043212005C439B /* WKOpenPanelParametersPrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = 5C26958420042F12005C439B /* WKOpenPanelParametersPrivate.h */; settings = {ATTRIBUTES = (Private, ); }; };
5C298DA01C3DF02100470AFE /* PendingDownload.h in Headers */ = {isa = PBXBuildFile; fileRef = 5C298D9E1C3DEF2900470AFE /* PendingDownload.h */; };
+ 5C359C0D2154739F009E7948 /* WKDeprecated.h in Headers */ = {isa = PBXBuildFile; fileRef = 5C359C0C21547321009E7948 /* WKDeprecated.h */; settings = {ATTRIBUTES = (Private, ); }; };
5C4B9D8B210A8CCF008F14D1 /* UndoOrRedo.h in Headers */ = {isa = PBXBuildFile; fileRef = 5C4B9D8A210A8C46008F14D1 /* UndoOrRedo.h */; };
5C62FDF91EFC271C00CE072E /* WKURLSchemeTaskPrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = 5C62FDF81EFC263C00CE072E /* WKURLSchemeTaskPrivate.h */; settings = {ATTRIBUTES = (Private, ); }; };
5C8DD3801FE4521600F2A556 /* WebsiteAutoplayPolicy.h in Headers */ = {isa = PBXBuildFile; fileRef = 5C8DD37F1FE4519200F2A556 /* WebsiteAutoplayPolicy.h */; };
@@ -3424,6 +3425,7 @@
5C20CB9E1BB0DD1800895BB1 /* NetworkSession.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NetworkSession.h; sourceTree = "<group>"; };
5C26958420042F12005C439B /* WKOpenPanelParametersPrivate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKOpenPanelParametersPrivate.h; sourceTree = "<group>"; };
5C298D9E1C3DEF2900470AFE /* PendingDownload.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PendingDownload.h; sourceTree = "<group>"; };
+ 5C359C0C21547321009E7948 /* WKDeprecated.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKDeprecated.h; sourceTree = "<group>"; };
5C3AEA8E1FE1F1DF002318D3 /* WebsitePoliciesData.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebsitePoliciesData.cpp; sourceTree = "<group>"; };
5C4B9D8A210A8C46008F14D1 /* UndoOrRedo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UndoOrRedo.h; sourceTree = "<group>"; };
5C62FDF81EFC263C00CE072E /* WKURLSchemeTaskPrivate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = WKURLSchemeTaskPrivate.h; sourceTree = "<group>"; };
@@ -8233,6 +8235,7 @@
BC4075DB124FF0270068F20A /* WKData.cpp */,
BC4075DC124FF0270068F20A /* WKData.h */,
377EAD4417E2C51A002D193D /* WKDeclarationSpecifiers.h */,
+ 5C359C0C21547321009E7948 /* WKDeprecated.h */,
1AFF48FE1833DE78009AB15A /* WKDeprecatedFunctions.cpp */,
8372DB2E1A677D4A00C697C5 /* WKDiagnosticLoggingResultType.h */,
BC4075DD124FF0270068F20A /* WKDictionary.cpp */,
@@ -9583,6 +9586,7 @@
37A709A91E3EA40C00CA5969 /* WKDataDetectorTypesInternal.h in Headers */,
2E94FC1620351A6D00974BA0 /* WKDatePickerViewController.h in Headers */,
377EAD4517E2C51A002D193D /* WKDeclarationSpecifiers.h in Headers */,
+ 5C359C0D2154739F009E7948 /* WKDeprecated.h in Headers */,
8372DB2F1A677D4A00C697C5 /* WKDiagnosticLoggingResultType.h in Headers */,
BC4075FA124FF0270068F20A /* WKDictionary.h in Headers */,
BC017D0716260FF4007054F5 /* WKDOMDocument.h in Headers */,