Guard AppBound domain protections with PLATFORM(iOS_FAMILY)
authorkatherine_cheney@apple.com <katherine_cheney@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 26 Mar 2020 20:45:54 +0000 (20:45 +0000)
committerkatherine_cheney@apple.com <katherine_cheney@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 26 Mar 2020 20:45:54 +0000 (20:45 +0000)
https://bugs.webkit.org/show_bug.cgi?id=209615
<rdar://problem/60931014>

Reviewed by Darin Adler.

Source/WebKit:

* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::setIsNavigatingToAppBoundDomain):

Tools:

Tests should only be run on iOS.

* TestWebKitAPI/Tests/WebKitCocoa/InAppBrowserPrivacy.mm:

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

Source/WebKit/ChangeLog
Source/WebKit/UIProcess/WebPageProxy.cpp
Tools/ChangeLog
Tools/TestWebKitAPI/Tests/WebKitCocoa/InAppBrowserPrivacy.mm

index b8d2c76..92c1b5f 100644 (file)
@@ -1,3 +1,14 @@
+2020-03-26  Kate Cheney  <katherine_cheney@apple.com>
+
+        Guard AppBound domain protections with PLATFORM(iOS_FAMILY)
+        https://bugs.webkit.org/show_bug.cgi?id=209615
+        <rdar://problem/60931014>
+
+        Reviewed by Darin Adler.
+
+        * UIProcess/WebPageProxy.cpp:
+        (WebKit::WebPageProxy::setIsNavigatingToAppBoundDomain):
+
 2020-03-26  Brent Fulgham  <bfulgham@apple.com>
 
         [iOS] Deny mach lookup to 'com.apple.webinspector' in the WebContent process.
index 484db9c..bba84b0 100644 (file)
@@ -3099,13 +3099,16 @@ private:
     PolicyCheckIdentifier m_identifier;
 };
 
+#if PLATFORM(IOS_FAMILY)
 static bool shouldBeTreatedAsAppBound(const URL& requestURL)
 {
     return requestURL.protocolIsAbout() || requestURL.protocolIsData() || requestURL.protocolIsBlob() || requestURL.isLocalFile();
 }
+#endif
 
 void WebPageProxy::setIsNavigatingToAppBoundDomain(bool isMainFrame, const URL& requestURL, NavigatingToAppBoundDomain isNavigatingToAppBoundDomain)
 {
+#if PLATFORM(IOS_FAMILY)
     if (isMainFrame && (m_preferences->isInAppBrowserPrivacyEnabled() || WEB_PAGE_PROXY_ADDITIONS_SETISNAVIGATINGTOAPPBOUNDDOMAIN_2)) {
         if (m_ignoresAppBoundDomains)
             return;
@@ -3122,6 +3125,11 @@ void WebPageProxy::setIsNavigatingToAppBoundDomain(bool isMainFrame, const URL&
         m_configuration->setWebViewCategory(WebViewCategory::AppBoundDomain);
         m_isNavigatingToAppBoundDomain = NavigatingToAppBoundDomain::Yes;
     }
+#else
+    UNUSED_PARAM(isMainFrame);
+    UNUSED_PARAM(requestURL);
+    UNUSED_PARAM(isNavigatingToAppBoundDomain);
+#endif
 }
 
 void WebPageProxy::setIsNavigatingToAppBoundDomainTesting(bool isNavigatingToAppBoundDomain, CompletionHandler<void()>&& completionHandler)
index 0352f2c..883b119 100644 (file)
@@ -1,3 +1,15 @@
+2020-03-26  Kate Cheney  <katherine_cheney@apple.com>
+
+        Guard AppBound domain protections with PLATFORM(iOS_FAMILY)
+        https://bugs.webkit.org/show_bug.cgi?id=209615
+        <rdar://problem/60931014>
+
+        Reviewed by Darin Adler.
+
+        Tests should only be run on iOS.
+
+        * TestWebKitAPI/Tests/WebKitCocoa/InAppBrowserPrivacy.mm:
+
 2020-03-26  Aakash Jain  <aakash_jain@apple.com>
 
         [ews] status-bubble for tester queues should point to tester queue while waiting in queue (Follow-up fix)
index 3b4f590..d9e6181 100644 (file)
@@ -39,6 +39,8 @@
 #import <wtf/RunLoop.h>
 #import <wtf/text/WTFString.h>
 
+#if PLATFORM(IOS_FAMILY)
+
 #if USE(APPLE_INTERNAL_SDK)
 #include <WebKitAdditions/InAppBrowserPrivacyTestAdditions.h>
 
@@ -506,3 +508,4 @@ TEST(InAppBrowserPrivacy, NonAppBoundUserStyleSheetAffectingAllFramesFails)
 
 #endif // USE(APPLE_INTERNAL_SDK)
 
+#endif // PLATFORM(IOS_FAMILY)