Disable ObjC WebGL policy SPI on iOS
authorachristensen@apple.com <achristensen@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 1 Sep 2017 18:47:41 +0000 (18:47 +0000)
committerachristensen@apple.com <achristensen@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 1 Sep 2017 18:47:41 +0000 (18:47 +0000)
https://bugs.webkit.org/show_bug.cgi?id=176233

Reviewed by Tim Horton.
Source/WebKit:

In r221465 I uploaded new SPI that is only needed on Mac with a beautiful test that only works on Mac.
Since it fails on iOS and is not needed on iOS, let's just disable it on iOS.

* UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h:
* UIProcess/Cocoa/NavigationState.h:
* UIProcess/Cocoa/NavigationState.mm:
(WebKit::NavigationState::setNavigationDelegate):

Tools:

* TestWebKitAPI/Tests/WebKitCocoa/WebGLPolicy.mm:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@221486 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebKit/ChangeLog
Source/WebKit/UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h
Source/WebKit/UIProcess/Cocoa/NavigationState.h
Source/WebKit/UIProcess/Cocoa/NavigationState.mm
Tools/ChangeLog
Tools/TestWebKitAPI/Tests/WebKitCocoa/WebGLPolicy.mm

index c0b07e3..78bcbf3 100644 (file)
@@ -1,3 +1,18 @@
+2017-09-01  Alex Christensen  <achristensen@webkit.org>
+
+        Disable ObjC WebGL policy SPI on iOS
+        https://bugs.webkit.org/show_bug.cgi?id=176233
+
+        Reviewed by Tim Horton.
+        
+        In r221465 I uploaded new SPI that is only needed on Mac with a beautiful test that only works on Mac.
+        Since it fails on iOS and is not needed on iOS, let's just disable it on iOS.
+
+        * UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h:
+        * UIProcess/Cocoa/NavigationState.h:
+        * UIProcess/Cocoa/NavigationState.mm:
+        (WebKit::NavigationState::setNavigationDelegate):
+
 2017-09-01  Andy Estes  <aestes@apple.com>
 
         [CG] Upstream CoreGraphics-related WebKitSystemInterface functions
index fa9709c..0a3306b 100644 (file)
 
 @class _WKWebsitePolicies;
 
+#if !TARGET_OS_IPHONE
 typedef NS_ENUM(NSInteger, _WKWebGLLoadPolicy) {
     _WKWebGLLoadPolicyBlockCreation,
     _WKWebGLLoadPolicyAllowCreation,
     _WKWebGLLoadPolicyPendingCreation,
-} WK_API_AVAILABLE(macosx(WK_MAC_TBA), ios(WK_IOS_TBA));
+} WK_API_AVAILABLE(macosx(WK_MAC_TBA));
+#endif
 
 static const WKNavigationActionPolicy _WKNavigationActionPolicyDownload = (WKNavigationActionPolicy)(WKNavigationActionPolicyAllow + 1);
 static const WKNavigationActionPolicy WK_API_AVAILABLE(macosx(10.11), ios(9.0)) _WKNavigationActionPolicyAllowWithoutTryingAppLink = (WKNavigationActionPolicy)(WKNavigationActionPolicyAllow + 2);
@@ -80,11 +82,11 @@ static const WKNavigationResponsePolicy _WKNavigationResponsePolicyBecomeDownloa
 - (void)_webView:(WKWebView *)webView didStartLoadForQuickLookDocumentInMainFrameWithFileName:(NSString *)fileName uti:(NSString *)uti;
 - (void)_webView:(WKWebView *)webView didFinishLoadForQuickLookDocumentInMainFrame:(NSData *)documentData;
 - (void)_webViewDidRequestPasswordForQuickLookDocument:(WKWebView *)webView WK_API_AVAILABLE(ios(WK_IOS_TBA));
+#else
+- (void)_webView:(WKWebView *)webView webGLLoadPolicyForURL:(NSURL *)url decisionHandler:(void (^)(_WKWebGLLoadPolicy))decisionHandler WK_API_AVAILABLE(macosx(WK_MAC_TBA));
+- (void)_webView:(WKWebView *)webView resolveWebGLLoadPolicyForURL:(NSURL *)url decisionHandler:(void (^)(_WKWebGLLoadPolicy))decisionHandler WK_API_AVAILABLE(macosx(WK_MAC_TBA));
 #endif
 
-- (void)_webView:(WKWebView *)webView webGLLoadPolicyForURL:(NSURL *)url decisionHandler:(void (^)(_WKWebGLLoadPolicy))decisionHandler WK_API_AVAILABLE(macosx(WK_MAC_TBA), ios(WK_IOS_TBA));
-- (void)_webView:(WKWebView *)webView resolveWebGLLoadPolicyForURL:(NSURL *)url decisionHandler:(void (^)(_WKWebGLLoadPolicy))decisionHandler WK_API_AVAILABLE(macosx(WK_MAC_TBA), ios(WK_IOS_TBA));
-
 @end
 
 #endif
index 0dff6ba..807860b 100644 (file)
@@ -116,7 +116,7 @@ private:
         void didFinishLoadForQuickLookDocumentInMainFrame(const QuickLookDocumentData&) override;
 #endif
 
-#if ENABLE(WEBGL)
+#if ENABLE(WEBGL) && PLATFORM(MAC)
         void webGLLoadPolicy(WebPageProxy&, const WebCore::URL&, WTF::Function<void(WebCore::WebGLLoadPolicy)>&& completionHandler) const final;
         void resolveWebGLLoadPolicy(WebPageProxy&, const WebCore::URL&, WTF::Function<void(WebCore::WebGLLoadPolicy)>&& completionHandler) const final;
 #endif
@@ -207,7 +207,7 @@ private:
         bool webViewDidRequestPasswordForQuickLookDocument : 1;
 #endif
 
-#if ENABLE(WEBGL)
+#if ENABLE(WEBGL) && PLATFORM(MAC)
         bool webViewWebGLLoadPolicyForURL : 1;
         bool webViewResolveWebGLLoadPolicyForURL : 1;
 #endif
index e18e7a8..32148b9 100644 (file)
@@ -173,7 +173,7 @@ void NavigationState::setNavigationDelegate(id <WKNavigationDelegate> delegate)
     m_navigationDelegateMethods.webViewDidFinishLoadForQuickLookDocumentInMainFrame = [delegate respondsToSelector:@selector(_webView:didFinishLoadForQuickLookDocumentInMainFrame:)];
     m_navigationDelegateMethods.webViewDidRequestPasswordForQuickLookDocument = [delegate respondsToSelector:@selector(_webViewDidRequestPasswordForQuickLookDocument:)];
 #endif
-#if ENABLE(WEBGL)
+#if ENABLE(WEBGL) && PLATFORM(MAC)
     m_navigationDelegateMethods.webViewWebGLLoadPolicyForURL = [delegate respondsToSelector:@selector(_webView:webGLLoadPolicyForURL:decisionHandler:)];
     m_navigationDelegateMethods.webViewResolveWebGLLoadPolicyForURL = [delegate respondsToSelector:@selector(_webView:resolveWebGLLoadPolicyForURL:decisionHandler:)];
 #endif
@@ -289,6 +289,7 @@ NavigationState::NavigationClient::~NavigationClient()
 {
 }
 
+#if PLATFORM(MAC)
 inline WebCore::WebGLLoadPolicy toWebCoreWebGLLoadPolicy(_WKWebGLLoadPolicy policy)
 {
     switch (policy) {
@@ -333,6 +334,7 @@ void NavigationState::NavigationClient::resolveWebGLLoadPolicy(WebPageProxy&, co
         completionHandler(toWebCoreWebGLLoadPolicy(policy));
     }).get()];
 }
+#endif
 
 static void tryAppLink(RefPtr<API::NavigationAction>&& navigationAction, const String& currentMainFrameURL, WTF::Function<void(bool)>&& completionHandler)
 {
index 2f3e9d7..21c0e8a 100644 (file)
@@ -1,3 +1,12 @@
+2017-09-01  Alex Christensen  <achristensen@webkit.org>
+
+        Disable ObjC WebGL policy SPI on iOS
+        https://bugs.webkit.org/show_bug.cgi?id=176233
+
+        Reviewed by Tim Horton.
+
+        * TestWebKitAPI/Tests/WebKitCocoa/WebGLPolicy.mm:
+
 2017-08-31  Carlos Garcia Campos  <cgarcia@igalia.com>
 
         [GTK] Improve the way unit test are run and the results reported
index e3eaf55..306ac0c 100644 (file)
@@ -25,7 +25,7 @@
 
 #import "config.h"
 
-#if WK_API_ENABLED
+#if WK_API_ENABLED && PLATFORM(MAC)
 
 #import "TestWKWebView.h"
 #import "Utilities.h"