Title: [289702] trunk/Source/WebKit
Revision
289702
Author
[email protected]
Date
2022-02-12 17:05:02 -0800 (Sat, 12 Feb 2022)

Log Message

Update preference location used for CaptivePortalMode.
https://bugs.webkit.org/show_bug.cgi?id=236135
<rdar://problem/88486544>

Patch by Gavin Phillips <[email protected]> on 2022-02-12
Reviewed by Geoffrey Garen.

* PlatformMac.cmake:
* SourcesCocoa.txt:
* UIProcess/API/Cocoa/_WKSystemPreferences.h: Added.
* UIProcess/API/Cocoa/_WKSystemPreferences.mm: Added.
(+[_WKSystemPreferences isCaptivePortalModeEnabled]):
(+[_WKSystemPreferences setCaptivePortalModeEnabled:]):
(+[_WKSystemPreferences isCaptivePortalModeIgnored:]):
(+[_WKSystemPreferences setCaptivePortalModeIgnored:ignore:]):
* UIProcess/API/Cocoa/_WKSystemPreferencesInternal.h: Added.
* UIProcess/Cocoa/PreferenceObserver.mm:
(-[WKUserDefaults findPreferenceChangesAndNotifyForKeys:toValuesForKeys:]):
* UIProcess/Cocoa/WebPageProxyCocoa.mm:
* UIProcess/Cocoa/WebProcessPoolCocoa.mm:
(WebKit::WebProcessPool::captivePortalModeConfigUpdateCallback):
(WebKit::WebProcessPool::registerNotificationObservers):
(WebKit::WebProcessPool::unregisterNotificationObservers):
(WebKit::isCaptivePortalModeEnabledBySystemIgnoringCaching):
(WebKit::WebProcessPool::notifyPreferencesChanged):
* UIProcess/WebProcessPool.h:
* UIProcess/mac/DisplayCaptureSessionManager.h:
* UIProcess/mac/DisplayCaptureSessionManager.mm:
(WebKit::DisplayCaptureSessionManager::promptForGetDisplayMedia):
* WebKit.xcodeproj/project.pbxproj:

Modified Paths

Added Paths

Diff

Modified: trunk/Source/WebKit/ChangeLog (289701 => 289702)


--- trunk/Source/WebKit/ChangeLog	2022-02-12 22:57:46 UTC (rev 289701)
+++ trunk/Source/WebKit/ChangeLog	2022-02-13 01:05:02 UTC (rev 289702)
@@ -1,3 +1,35 @@
+2022-02-12  Gavin Phillips  <[email protected]>
+        
+        Update preference location used for CaptivePortalMode.
+        https://bugs.webkit.org/show_bug.cgi?id=236135
+        <rdar://problem/88486544>
+
+        Reviewed by Geoffrey Garen.
+
+        * PlatformMac.cmake:
+        * SourcesCocoa.txt:
+        * UIProcess/API/Cocoa/_WKSystemPreferences.h: Added.
+        * UIProcess/API/Cocoa/_WKSystemPreferences.mm: Added.
+        (+[_WKSystemPreferences isCaptivePortalModeEnabled]):
+        (+[_WKSystemPreferences setCaptivePortalModeEnabled:]):
+        (+[_WKSystemPreferences isCaptivePortalModeIgnored:]):
+        (+[_WKSystemPreferences setCaptivePortalModeIgnored:ignore:]):
+        * UIProcess/API/Cocoa/_WKSystemPreferencesInternal.h: Added.
+        * UIProcess/Cocoa/PreferenceObserver.mm:
+        (-[WKUserDefaults findPreferenceChangesAndNotifyForKeys:toValuesForKeys:]):
+        * UIProcess/Cocoa/WebPageProxyCocoa.mm:
+        * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
+        (WebKit::WebProcessPool::captivePortalModeConfigUpdateCallback):
+        (WebKit::WebProcessPool::registerNotificationObservers):
+        (WebKit::WebProcessPool::unregisterNotificationObservers):
+        (WebKit::isCaptivePortalModeEnabledBySystemIgnoringCaching):
+        (WebKit::WebProcessPool::notifyPreferencesChanged):
+        * UIProcess/WebProcessPool.h:
+        * UIProcess/mac/DisplayCaptureSessionManager.h:
+        * UIProcess/mac/DisplayCaptureSessionManager.mm:
+        (WebKit::DisplayCaptureSessionManager::promptForGetDisplayMedia):
+        * WebKit.xcodeproj/project.pbxproj:
+
 2022-02-12  Jer Noble  <[email protected]>
 
         Add settings to restrict media containers and codecs when in Captive Portal mode

Modified: trunk/Source/WebKit/PlatformMac.cmake (289701 => 289702)


--- trunk/Source/WebKit/PlatformMac.cmake	2022-02-12 22:57:46 UTC (rev 289701)
+++ trunk/Source/WebKit/PlatformMac.cmake	2022-02-13 01:05:02 UTC (rev 289702)
@@ -460,6 +460,7 @@
     UIProcess/API/Cocoa/_WKResourceLoadStatisticsFirstParty.h
     UIProcess/API/Cocoa/_WKResourceLoadStatisticsThirdParty.h
     UIProcess/API/Cocoa/_WKSessionState.h
+    UIProcess/API/Cocoa/_WKSystemPreferences.h
     UIProcess/API/Cocoa/_WKTapHandlingResult.h
     UIProcess/API/Cocoa/_WKTextInputContext.h
     UIProcess/API/Cocoa/_WKTextManipulationConfiguration.h

Modified: trunk/Source/WebKit/SourcesCocoa.txt (289701 => 289702)


--- trunk/Source/WebKit/SourcesCocoa.txt	2022-02-12 22:57:46 UTC (rev 289701)
+++ trunk/Source/WebKit/SourcesCocoa.txt	2022-02-13 01:05:02 UTC (rev 289702)
@@ -298,6 +298,7 @@
 UIProcess/API/Cocoa/_WKRemoteWebInspectorViewController.mm
 UIProcess/API/Cocoa/_WKResourceLoadInfo.mm
 UIProcess/API/Cocoa/_WKSessionState.mm
+UIProcess/API/Cocoa/_WKSystemPreferences.mm
 UIProcess/API/Cocoa/_WKTextInputContext.mm
 UIProcess/API/Cocoa/_WKTextManipulationConfiguration.mm
 UIProcess/API/Cocoa/_WKTextManipulationExclusionRule.mm

Added: trunk/Source/WebKit/UIProcess/API/Cocoa/_WKSystemPreferences.h (0 => 289702)


--- trunk/Source/WebKit/UIProcess/API/Cocoa/_WKSystemPreferences.h	                        (rev 0)
+++ trunk/Source/WebKit/UIProcess/API/Cocoa/_WKSystemPreferences.h	2022-02-13 01:05:02 UTC (rev 289702)
@@ -0,0 +1,37 @@
+/*
+ * Copyright (C) 2022 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.
+ */
+
+#import <Foundation/Foundation.h>
+#import <WebKit/WKFoundation.h>
+
+WK_CLASS_AVAILABLE(macos(WK_MAC_TBA), ios(WK_IOS_TBA))
+@interface _WKSystemPreferences : NSObject
+
++ (BOOL)isCaptivePortalModeEnabled;
++ (void)setCaptivePortalModeEnabled:(BOOL)enabled;
++ (BOOL)isCaptivePortalModeIgnored:(NSString *)containerPath;
++ (void)setCaptivePortalModeIgnored:(NSString *)containerPath ignore:(BOOL)ignore;
+
+@end

Added: trunk/Source/WebKit/UIProcess/API/Cocoa/_WKSystemPreferences.mm (0 => 289702)


--- trunk/Source/WebKit/UIProcess/API/Cocoa/_WKSystemPreferences.mm	                        (rev 0)
+++ trunk/Source/WebKit/UIProcess/API/Cocoa/_WKSystemPreferences.mm	2022-02-13 01:05:02 UTC (rev 289702)
@@ -0,0 +1,75 @@
+/*
+ * Copyright (C) 2022 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.
+ */
+
+#import "config.h"
+#import "_WKSystemPreferencesInternal.h"
+
+#import <wtf/Assertions.h>
+#import <wtf/RetainPtr.h>
+
+constexpr auto CaptivePortalConfigurationIgnoreFileName = @"com.apple.WebKit.cpmconfig_ignore";
+
+@implementation _WKSystemPreferences
+
++ (BOOL)isCaptivePortalModeEnabled
+{
+    auto changedNotificationKey = adoptCF(CFStringCreateWithCString(kCFAllocatorDefault, WKCaptivePortalModeEnabledKey, kCFStringEncodingUTF8));
+    auto preferenceValue = adoptCF(CFPreferencesCopyValue(changedNotificationKey.get(), kCFPreferencesAnyApplication, kCFPreferencesAnyUser, kCFPreferencesCurrentHost));
+    return preferenceValue.get() == kCFBooleanTrue;
+}
+
++ (void)setCaptivePortalModeEnabled:(BOOL)enabled
+{
+    auto changedNotificationKey = adoptCF(CFStringCreateWithCString(kCFAllocatorDefault, WKCaptivePortalModeEnabledKey, kCFStringEncodingUTF8));
+    CFPreferencesSetValue(changedNotificationKey.get(), enabled ? kCFBooleanTrue : kCFBooleanFalse, kCFPreferencesAnyApplication, kCFPreferencesAnyUser, kCFPreferencesCurrentHost);
+    CFPreferencesSynchronize(kCFPreferencesAnyApplication, kCFPreferencesAnyUser, kCFPreferencesAnyHost);
+}
+
++ (BOOL)isCaptivePortalModeIgnored:(NSString *)containerPath
+{
+#if PLATFORM(IOS_FAMILY)
+    NSString *cpmconfigIgnoreFilePath = [NSString pathWithComponents:@[containerPath, @"Library/Preferences/", CaptivePortalConfigurationIgnoreFileName]];
+    return [[NSFileManager defaultManager] fileExistsAtPath:cpmconfigIgnoreFilePath];
+#endif
+    return false;
+}
+
++ (void)setCaptivePortalModeIgnored:(NSString *)containerPath ignore:(BOOL)ignore
+{
+#if PLATFORM(IOS_FAMILY)
+    NSString *cpmconfigIgnoreFilePath = [NSString pathWithComponents:@[containerPath, @"Library/Preferences/", CaptivePortalConfigurationIgnoreFileName]];
+    if ([[NSFileManager defaultManager] fileExistsAtPath:cpmconfigIgnoreFilePath] == ignore)
+        return;
+    
+    if (ignore)
+        [[NSFileManager defaultManager] createFileAtPath:cpmconfigIgnoreFilePath contents:NULL attributes:NULL];
+    else
+        [[NSFileManager defaultManager] removeItemAtPath:cpmconfigIgnoreFilePath error:NULL];
+
+    CFNotificationCenterPostNotification(CFNotificationCenterGetDarwinNotifyCenter(), (__bridge CFStringRef)WKCaptivePortalModeContainerConfigurationChangedNotification, nullptr, nullptr, true);
+#endif
+}
+
+@end

Added: trunk/Source/WebKit/UIProcess/API/Cocoa/_WKSystemPreferencesInternal.h (0 => 289702)


--- trunk/Source/WebKit/UIProcess/API/Cocoa/_WKSystemPreferencesInternal.h	                        (rev 0)
+++ trunk/Source/WebKit/UIProcess/API/Cocoa/_WKSystemPreferencesInternal.h	2022-02-13 01:05:02 UTC (rev 289702)
@@ -0,0 +1,29 @@
+/*
+ * Copyright (C) 2022 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.
+ */
+
+#import "_WKSystemPreferences.h"
+
+constexpr auto WKCaptivePortalModeEnabledKey = "WKCaptivePortalModeEnabled";
+constexpr auto WKCaptivePortalModeContainerConfigurationChangedNotification = @"WKCaptivePortalModeContainerConfigurationChanged";

Modified: trunk/Source/WebKit/UIProcess/Cocoa/PreferenceObserver.mm (289701 => 289702)


--- trunk/Source/WebKit/UIProcess/Cocoa/PreferenceObserver.mm	2022-02-12 22:57:46 UTC (rev 289701)
+++ trunk/Source/WebKit/UIProcess/Cocoa/PreferenceObserver.mm	2022-02-13 01:05:02 UTC (rev 289702)
@@ -71,6 +71,7 @@
             encodedString = [data base64EncodedStringWithOptions:0];
         }
 
+        auto systemValue = adoptCF(CFPreferencesCopyValue((__bridge CFStringRef)key, kCFPreferencesAnyApplication, kCFPreferencesAnyUser, kCFPreferencesAnyHost));
         auto globalValue = adoptCF(CFPreferencesCopyValue((__bridge CFStringRef)key, kCFPreferencesAnyApplication, kCFPreferencesCurrentUser, kCFPreferencesAnyHost));
         auto domainValue = adoptCF(CFPreferencesCopyValue((__bridge CFStringRef)key, (__bridge CFStringRef)m_suiteName.get(), kCFPreferencesCurrentUser, kCFPreferencesAnyHost));
 
@@ -78,7 +79,7 @@
             return a == b || [a isEqual:b];
         };
 
-        if (preferenceValuesAreEqual((__bridge id)globalValue.get(), newValue))
+        if (preferenceValuesAreEqual((__bridge id)systemValue.get(), newValue) || preferenceValuesAreEqual((__bridge id)globalValue.get(), newValue))
             [m_observer preferenceDidChange:nil key:key encodedValue:encodedString];
 
         if (preferenceValuesAreEqual((__bridge id)domainValue.get(), newValue))

Modified: trunk/Source/WebKit/UIProcess/Cocoa/WebPageProxyCocoa.mm (289701 => 289702)


--- trunk/Source/WebKit/UIProcess/Cocoa/WebPageProxyCocoa.mm	2022-02-12 22:57:46 UTC (rev 289701)
+++ trunk/Source/WebKit/UIProcess/Cocoa/WebPageProxyCocoa.mm	2022-02-13 01:05:02 UTC (rev 289702)
@@ -37,6 +37,7 @@
 #import "LoadParameters.h"
 #import "ModalContainerControlClassifier.h"
 #import "PageClient.h"
+#import "PlaybackSessionManagerProxy.h"
 #import "QuarantineSPI.h"
 #import "QuickLookThumbnailLoader.h"
 #import "SafeBrowsingSPI.h"
@@ -43,6 +44,7 @@
 #import "SafeBrowsingWarning.h"
 #import "SharedBufferCopy.h"
 #import "SynapseSPI.h"
+#import "VideoFullscreenManagerProxy.h"
 #import "WebContextMenuProxy.h"
 #import "WebPage.h"
 #import "WebPageMessages.h"

Modified: trunk/Source/WebKit/UIProcess/Cocoa/WebProcessPoolCocoa.mm (289701 => 289702)


--- trunk/Source/WebKit/UIProcess/Cocoa/WebProcessPoolCocoa.mm	2022-02-12 22:57:46 UTC (rev 289701)
+++ trunk/Source/WebKit/UIProcess/Cocoa/WebProcessPoolCocoa.mm	2022-02-13 01:05:02 UTC (rev 289702)
@@ -52,6 +52,7 @@
 #import "WebProcessCreationParameters.h"
 #import "WebProcessMessages.h"
 #import "WindowServerConnection.h"
+#import "_WKSystemPreferencesInternal.h"
 #import <WebCore/AGXCompilerService.h>
 #import <WebCore/Color.h>
 #import <WebCore/LocalizedDeviceModel.h>
@@ -70,6 +71,7 @@
 #import <wtf/FileSystem.h>
 #import <wtf/ProcessPrivilege.h>
 #import <wtf/SoftLinking.h>
+#import <wtf/cf/TypeCastsCF.h>
 #import <wtf/cocoa/Entitlements.h>
 #import <wtf/cocoa/RuntimeApplicationChecksCocoa.h>
 #import <wtf/cocoa/TypeCastsCocoa.h>
@@ -128,7 +130,7 @@
 static NSString *WebKitApplicationDidChangeAccessibilityEnhancedUserInterfaceNotification = @"NSApplicationDidChangeAccessibilityEnhancedUserInterfaceNotification";
 static CFStringRef AppleColorPreferencesChangedNotification = CFSTR("AppleColorPreferencesChangedNotification");
 #endif
-static const char* const WebKitCaptivePortalModeChangedNotification = "WebKitCaptivePortalModeEnabled";
+static const char* const WebKitCaptivePortalModeChangedNotification_Legacy = "WebKitCaptivePortalModeEnabled";
 
 static NSString * const WebKitSuppressMemoryPressureHandlerDefaultsKey = @"WebKitSuppressMemoryPressureHandler";
 
@@ -622,6 +624,14 @@
 }
 #endif
 
+#if PLATFORM(IOS_FAMILY)
+void WebProcessPool::captivePortalModeConfigUpdateCallback(CFNotificationCenterRef, void* observer, CFStringRef, const void*, CFDictionaryRef)
+{
+    if (auto pool = extractWebProcessPool(observer))
+        pool->captivePortalModeStateChanged();
+}
+#endif
+
 #if ENABLE(CFPREFS_DIRECT_MODE)
 void WebProcessPool::startObservingPreferenceChanges()
 {
@@ -735,6 +745,10 @@
         sendToAllProcesses(Messages::WebProcess::PowerSourceDidChange(hasAC));
     });
 
+#if PLATFORM(IOS_FAMILY)
+    addCFNotificationObserver(captivePortalModeConfigUpdateCallback, (__bridge CFStringRef)WKCaptivePortalModeContainerConfigurationChangedNotification);
+#endif
+
 #if HAVE(PER_APP_ACCESSIBILITY_PREFERENCES)
     addCFNotificationObserver(accessibilityPreferencesChangedCallback, kAXSReduceMotionChangedNotification);
     addCFNotificationObserver(accessibilityPreferencesChangedCallback, kAXSIncreaseButtonLegibilityNotification);
@@ -778,6 +792,10 @@
     [[NSNotificationCenter defaultCenter] removeObserver:m_activationObserver.get()];
 
     m_powerSourceNotifier = nullptr;
+    
+#if PLATFORM(IOS_FAMILY)
+    removeCFNotificationObserver((__bridge CFStringRef)WKCaptivePortalModeContainerConfigurationChangedNotification);
+#endif
 
 #if HAVE(PER_APP_ACCESSIBILITY_PREFERENCES)
     removeCFNotificationObserver(kAXSReduceMotionChangedNotification);
@@ -930,7 +948,23 @@
     if (auto& enabledForTesting = isCaptivePortalModeEnabledGloballyForTesting())
         return *enabledForTesting;
 
-    return [[NSUserDefaults standardUserDefaults] boolForKey:[NSString stringWithUTF8String:WebKitCaptivePortalModeChangedNotification]];
+    if ([[NSUserDefaults standardUserDefaults] boolForKey:[NSString stringWithUTF8String:WebKitCaptivePortalModeChangedNotification_Legacy]])
+        return true;
+
+    if (![_WKSystemPreferences isCaptivePortalModeEnabled])
+        return false;
+
+#if PLATFORM(IOS_FAMILY)
+    if (processHasContainer() && [_WKSystemPreferences isCaptivePortalModeIgnored:pathForProcessContainer()])
+        return false;
+#endif
+    
+#if PLATFORM(MAC)
+    if (!WebCore::MacApplication::isSafari() && !WebCore::MacApplication::isMiniBrowser())
+        return false;
+#endif
+    
+    return true;
 }
 
 void WebProcessPool::captivePortalModeStateChanged()
@@ -1063,7 +1097,7 @@
         webAuthnProcess->send(Messages::WebAuthnProcess::NotifyPreferencesChanged(domain, key, encodedValue), 0);
 #endif
 
-    if (key == WebKitCaptivePortalModeChangedNotification)
+    if (key == WKCaptivePortalModeEnabledKey || key == WebKitCaptivePortalModeChangedNotification_Legacy)
         captivePortalModeStateChanged();
 }
 #endif // ENABLE(CFPREFS_DIRECT_MODE)

Modified: trunk/Source/WebKit/UIProcess/WebProcessPool.h (289701 => 289702)


--- trunk/Source/WebKit/UIProcess/WebProcessPool.h	2022-02-12 22:57:46 UTC (rev 289701)
+++ trunk/Source/WebKit/UIProcess/WebProcessPool.h	2022-02-13 01:05:02 UTC (rev 289702)
@@ -584,6 +584,10 @@
 #endif
 #endif
 
+#if PLATFORM(IOS_FAMILY)
+    static void captivePortalModeConfigUpdateCallback(CFNotificationCenterRef, void* observer, CFStringRef name, const void* postingObject, CFDictionaryRef userInfo);
+#endif
+    
 #if PLATFORM(COCOA)
     static void accessibilityPreferencesChangedCallback(CFNotificationCenterRef, void* observer, CFStringRef name, const void* postingObject, CFDictionaryRef userInfo);
 #endif

Modified: trunk/Source/WebKit/UIProcess/mac/DisplayCaptureSessionManager.h (289701 => 289702)


--- trunk/Source/WebKit/UIProcess/mac/DisplayCaptureSessionManager.h	2022-02-12 22:57:46 UTC (rev 289701)
+++ trunk/Source/WebKit/UIProcess/mac/DisplayCaptureSessionManager.h	2022-02-13 01:05:02 UTC (rev 289702)
@@ -28,6 +28,7 @@
 #if PLATFORM(COCOA) && ENABLE(MEDIA_STREAM)
 
 #include "UserMediaPermissionRequestProxy.h"
+#include "WebPageProxy.h"
 #include <WebCore/SecurityOriginData.h>
 #include <wtf/CompletionHandler.h>
 #include <wtf/WeakPtr.h>

Modified: trunk/Source/WebKit/UIProcess/mac/DisplayCaptureSessionManager.mm (289701 => 289702)


--- trunk/Source/WebKit/UIProcess/mac/DisplayCaptureSessionManager.mm	2022-02-12 22:57:46 UTC (rev 289701)
+++ trunk/Source/WebKit/UIProcess/mac/DisplayCaptureSessionManager.mm	2022-02-13 01:05:02 UTC (rev 289702)
@@ -269,7 +269,7 @@
 {
 }
 
-void DisplayCaptureSessionManager::promptForGetDisplayMedia(UserMediaPermissionRequestProxy::UserMediaDisplayCapturePromptType promptType, WebPageProxy& page, const WebCore::SecurityOriginData& origin, CompletionHandler<void(std::optional<CaptureDevice>)>&& completionHandler)
+void DisplayCaptureSessionManager::promptForGetDisplayMedia(UserMediaPermissionRequestProxy::UserMediaDisplayCapturePromptType promptType, WebPageProxy& page, const WebCore::SecurityOriginData& origin, CompletionHandler<void(std::optional<WebCore::CaptureDevice>)>&& completionHandler)
 {
     ASSERT(isAvailable());
 

Modified: trunk/Source/WebKit/WebKit.xcodeproj/project.pbxproj (289701 => 289702)


--- trunk/Source/WebKit/WebKit.xcodeproj/project.pbxproj	2022-02-12 22:57:46 UTC (rev 289701)
+++ trunk/Source/WebKit/WebKit.xcodeproj/project.pbxproj	2022-02-13 01:05:02 UTC (rev 289702)
@@ -1412,6 +1412,8 @@
 		83F1A07A1F96E7790045B94E /* WebSWOriginTable.h in Headers */ = {isa = PBXBuildFile; fileRef = 83F1A0781F96E7710045B94E /* WebSWOriginTable.h */; };
 		83F9644E1FA0F76E00C47750 /* SharedStringHashTableReadOnly.h in Headers */ = {isa = PBXBuildFile; fileRef = 83F9644C1FA0F76300C47750 /* SharedStringHashTableReadOnly.h */; };
 		84477853176FCC0800CDC7BB /* InjectedBundleHitTestResultMediaType.h in Headers */ = {isa = PBXBuildFile; fileRef = 84477851176FCAC100CDC7BB /* InjectedBundleHitTestResultMediaType.h */; };
+		8644890B27B47020007A1C66 /* _WKSystemPreferences.h in Headers */ = {isa = PBXBuildFile; fileRef = 8644890A27B47020007A1C66 /* _WKSystemPreferences.h */; settings = {ATTRIBUTES = (Private, ); }; };
+		8644890F27B5CB43007A1C66 /* _WKSystemPreferencesInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = 8644890E27B5CB43007A1C66 /* _WKSystemPreferencesInternal.h */; };
 		86E67A251910B9D100004AB7 /* ProcessThrottler.h in Headers */ = {isa = PBXBuildFile; fileRef = 86E67A21190F411800004AB7 /* ProcessThrottler.h */; };
 		86F9536518FF58F5001DB2EF /* ProcessAssertion.h in Headers */ = {isa = PBXBuildFile; fileRef = 86F9536018FF4FD4001DB2EF /* ProcessAssertion.h */; };
 		8DC2EF530486A6940098B216 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 089C1666FE841158C02AAC07 /* InfoPlist.strings */; };
@@ -5298,6 +5300,9 @@
 		83F9644B1FA0F76200C47750 /* SharedStringHashTableReadOnly.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SharedStringHashTableReadOnly.cpp; sourceTree = "<group>"; };
 		83F9644C1FA0F76300C47750 /* SharedStringHashTableReadOnly.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SharedStringHashTableReadOnly.h; sourceTree = "<group>"; };
 		84477851176FCAC100CDC7BB /* InjectedBundleHitTestResultMediaType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InjectedBundleHitTestResultMediaType.h; sourceTree = "<group>"; };
+		8644890A27B47020007A1C66 /* _WKSystemPreferences.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = _WKSystemPreferences.h; sourceTree = "<group>"; };
+		8644890C27B47045007A1C66 /* _WKSystemPreferences.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = _WKSystemPreferences.mm; sourceTree = "<group>"; };
+		8644890E27B5CB43007A1C66 /* _WKSystemPreferencesInternal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = _WKSystemPreferencesInternal.h; sourceTree = "<group>"; };
 		868160CD18763D4B0021E79D /* WindowServerConnection.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = WindowServerConnection.h; sourceTree = "<group>"; };
 		868160CF187645370021E79D /* WindowServerConnection.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = WindowServerConnection.mm; sourceTree = "<group>"; };
 		86E67A21190F411800004AB7 /* ProcessThrottler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ProcessThrottler.h; sourceTree = "<group>"; };
@@ -8899,6 +8904,9 @@
 				1A002D3F196B329400B9AD44 /* _WKSessionState.h */,
 				1A002D3E196B329400B9AD44 /* _WKSessionState.mm */,
 				1A002D42196B337000B9AD44 /* _WKSessionStateInternal.h */,
+				8644890A27B47020007A1C66 /* _WKSystemPreferences.h */,
+				8644890C27B47045007A1C66 /* _WKSystemPreferences.mm */,
+				8644890E27B5CB43007A1C66 /* _WKSystemPreferencesInternal.h */,
 				F4D985C72690FBEF00BBCCBE /* _WKTapHandlingResult.h */,
 				2DE9B1382231F61C005287B7 /* _WKTextInputContext.h */,
 				2DE9B1372231F61C005287B7 /* _WKTextInputContext.mm */,
@@ -12915,6 +12923,8 @@
 				376311FE1A3FB600005A2E51 /* _WKSameDocumentNavigationTypeInternal.h in Headers */,
 				1A002D44196B338900B9AD44 /* _WKSessionState.h in Headers */,
 				1A002D43196B337000B9AD44 /* _WKSessionStateInternal.h in Headers */,
+				8644890B27B47020007A1C66 /* _WKSystemPreferences.h in Headers */,
+				8644890F27B5CB43007A1C66 /* _WKSystemPreferencesInternal.h in Headers */,
 				F4D985C82690FC1200BBCCBE /* _WKTapHandlingResult.h in Headers */,
 				2DE9B13A2231F61C005287B7 /* _WKTextInputContext.h in Headers */,
 				2DE9B13C2231F77C005287B7 /* _WKTextInputContextInternal.h in Headers */,
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to