Add run-time flag for in-app browser privacy
authorkatherine_cheney@apple.com <katherine_cheney@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 17 Dec 2019 23:40:07 +0000 (23:40 +0000)
committerkatherine_cheney@apple.com <katherine_cheney@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 17 Dec 2019 23:40:07 +0000 (23:40 +0000)
https://bugs.webkit.org/show_bug.cgi?id=205288
<rdar://problem/57569206>

Reviewed by John Wilander.

Source/WebCore:

* page/RuntimeEnabledFeatures.h:
(WebCore::RuntimeEnabledFeatures::setInAppBrowserPrivacyEnabled):
(WebCore::RuntimeEnabledFeatures::isInAppBrowserPrivacyEnabled const):
* page/Settings.yaml:

Source/WebKit:

* Shared/WebPreferences.yaml:

Source/WebKitLegacy/mac:

* WebView/WebPreferenceKeysPrivate.h:
* WebView/WebPreferences.mm:
(+[WebPreferences initialize]):
(-[WebPreferences isInAppBrowserPrivacyEnabled]):
(-[WebPreferences setInAppBrowserPrivacyEnabled:]):
* WebView/WebPreferencesPrivate.h:
* WebView/WebView.mm:
(-[WebView _preferencesChanged:]):

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

Source/WebCore/ChangeLog
Source/WebCore/page/RuntimeEnabledFeatures.h
Source/WebCore/page/Settings.yaml
Source/WebKit/ChangeLog
Source/WebKit/Shared/WebPreferences.yaml
Source/WebKitLegacy/mac/ChangeLog
Source/WebKitLegacy/mac/WebView/WebPreferenceKeysPrivate.h
Source/WebKitLegacy/mac/WebView/WebPreferences.mm
Source/WebKitLegacy/mac/WebView/WebPreferencesPrivate.h
Source/WebKitLegacy/mac/WebView/WebView.mm

index 4c3389c..1e05040 100644 (file)
@@ -1,3 +1,16 @@
+2019-12-17  Kate Cheney  <katherine_cheney@apple.com>
+
+        Add run-time flag for in-app browser privacy
+        https://bugs.webkit.org/show_bug.cgi?id=205288
+        <rdar://problem/57569206>
+
+        Reviewed by John Wilander.
+
+        * page/RuntimeEnabledFeatures.h:
+        (WebCore::RuntimeEnabledFeatures::setInAppBrowserPrivacyEnabled):
+        (WebCore::RuntimeEnabledFeatures::isInAppBrowserPrivacyEnabled const):
+        * page/Settings.yaml:
+
 2019-12-17  Ryosuke Niwa  <rniwa@webkit.org>
 
         executeIfJavaScriptURL should check requester's security origin
index 5ef85df..513e994 100644 (file)
@@ -389,6 +389,9 @@ public:
     bool secureContextChecksEnabled() const { return m_secureContextChecksEnabled; }
     void setSecureContextChecksEnabled(bool isEnabled) { m_secureContextChecksEnabled = isEnabled; }
 
+    void setIsInAppBrowserPrivacyEnabled(bool isEnabled) { m_isInAppBrowserPrivacyEnabled = isEnabled; }
+    bool isInAppBrowserPrivacyEnabled() const { return m_isInAppBrowserPrivacyEnabled; }
+
 private:
     // Never instantiate.
     RuntimeEnabledFeatures();
@@ -584,6 +587,8 @@ private:
     bool m_secureContextChecksEnabled { true };
     bool m_isCSSShadowPartsEnabled { true };
 
+    bool m_isInAppBrowserPrivacyEnabled { false };
+
     friend class WTF::NeverDestroyed<RuntimeEnabledFeatures>;
 };
 
index a92f303..d519d8c 100644 (file)
@@ -906,6 +906,9 @@ legacyGetUserMediaEnabled:
   initial: false
   conditional: MEDIA_STREAM
 
+isInAppBrowserPrivacyEnabled:
+  initial: false
+
 # Deprecated
 
 iceCandidateFilteringEnabled:
index a72b161..312526e 100644 (file)
@@ -1,3 +1,13 @@
+2019-12-17  Kate Cheney  <katherine_cheney@apple.com>
+
+        Add run-time flag for in-app browser privacy
+        https://bugs.webkit.org/show_bug.cgi?id=205288
+        <rdar://problem/57569206>
+
+        Reviewed by John Wilander.
+
+        * Shared/WebPreferences.yaml:
+
 2019-12-17  Ben Nham  <nham@apple.com>
 
         Navigation from empty page doesn't use cached web process
index b60a7e4..e9f7cf4 100644 (file)
@@ -1877,6 +1877,14 @@ UseGPUProcessForMedia:
     category: internal
     webcoreName: useGPUProcessForMedia
 
+IsInAppBrowserPrivacyEnabled:
+    type: bool
+    defaultValue: true
+    humanReadableName: "In-App Browser Privacy"
+    humanReadableDescription: "Enable In-App Browser Privacy"
+    webcoreBinding: RuntimeEnabledFeatures
+    category: internal
+
 # Deprecated
 
 ICECandidateFilteringEnabled:
index 4293df4..0405c13 100644 (file)
@@ -1,3 +1,20 @@
+2019-12-17  Kate Cheney  <katherine_cheney@apple.com>
+
+        Add run-time flag for in-app browser privacy
+        https://bugs.webkit.org/show_bug.cgi?id=205288
+        <rdar://problem/57569206>
+
+        Reviewed by John Wilander.
+
+        * WebView/WebPreferenceKeysPrivate.h:
+        * WebView/WebPreferences.mm:
+        (+[WebPreferences initialize]):
+        (-[WebPreferences isInAppBrowserPrivacyEnabled]):
+        (-[WebPreferences setInAppBrowserPrivacyEnabled:]):
+        * WebView/WebPreferencesPrivate.h:
+        * WebView/WebView.mm:
+        (-[WebView _preferencesChanged:]):
+
 2019-12-16  Simon Fraser  <simon.fraser@apple.com>
 
         Change 'delegatesPageScaling' from a Setting to a flag on ScrollView
index a3c0d1b..ac14aaf 100644 (file)
 #define WebKitRequestIdleCallbackEnabledPreferenceKey @"WebKitRequestIdleCallbackEnabled"
 #define WebKitAsyncClipboardAPIEnabledPreferenceKey @"WebKitAsyncClipboardAPIEnabled"
 #define WebKitLinkPreloadResponsiveImagesEnabledPreferenceKey @"WebKitLinkPreloadResponsiveImagesEnabled"
+#define WebKitInAppBrowserPrivacyEnabledPreferenceKey @"WebKitInAppBrowserPrivacyEnabled"
 
index 9b2ea16..edf4d4d 100644 (file)
@@ -706,6 +706,7 @@ public:
         @NO, WebKitAsyncClipboardAPIEnabledPreferenceKey,
         @NO, WebKitLinkPreloadResponsiveImagesEnabledPreferenceKey,
         @YES, WebKitCSSShadowPartsEnabledPreferenceKey,
+        @NO, WebKitInAppBrowserPrivacyEnabledPreferenceKey,
         nil];
 
 #if !PLATFORM(IOS_FAMILY)
@@ -3601,6 +3602,17 @@ static NSString *classIBCreatorID = nil;
 {
     [self _setBoolValue:remotePlaybackEnabled forKey:WebKitRemotePlaybackEnabledPreferenceKey];
 }
+
+- (BOOL)isInAppBrowserPrivacyEnabled
+{
+    return [self _boolValueForKey:WebKitInAppBrowserPrivacyEnabledPreferenceKey];
+}
+
+- (void)setInAppBrowserPrivacyEnabled:(BOOL)flag
+{
+    [self _setBoolValue:flag forKey:WebKitInAppBrowserPrivacyEnabledPreferenceKey];
+}
+
 @end
 
 @implementation WebPreferences (WebInternal)
index 0681d6b..d03fd75 100644 (file)
@@ -630,6 +630,9 @@ extern NSString *WebPreferencesCacheModelChangedInternalNotification WEBKIT_DEPR
 - (void)setCSSShadowPartsEnabled:(BOOL)flag;
 - (BOOL)cssShadowPartsEnabled;
 
+- (BOOL)isInAppBrowserPrivacyEnabled;
+- (void)setInAppBrowserPrivacyEnabled:(BOOL)flag;
+
 @property (nonatomic) BOOL visualViewportAPIEnabled;
 @property (nonatomic) BOOL CSSOMViewScrollingAPIEnabled;
 @property (nonatomic) BOOL largeImageAsyncDecodingEnabled;
index c2f14ce..85f14eb 100644 (file)
@@ -3192,6 +3192,7 @@ static bool needsSelfRetainWhileLoadingQuirk()
     RuntimeEnabledFeatures::sharedFeatures().setDialogElementEnabled([preferences dialogElementEnabled]);
     RuntimeEnabledFeatures::sharedFeatures().setKeygenElementEnabled([preferences keygenElementEnabled]);
     RuntimeEnabledFeatures::sharedFeatures().setCSSShadowPartsEnabled([preferences cssShadowPartsEnabled]);
+    RuntimeEnabledFeatures::sharedFeatures().setIsInAppBrowserPrivacyEnabled([preferences isInAppBrowserPrivacyEnabled]);
 
 #if ENABLE(LEGACY_ENCRYPTED_MEDIA)
     RuntimeEnabledFeatures::sharedFeatures().setLegacyEncryptedMediaAPIEnabled(preferences.legacyEncryptedMediaAPIEnabled);