Changeset 290482 in webkit
- Timestamp:
- Feb 24, 2022, 5:44:44 PM (4 years ago)
- Location:
- trunk/Source/WebKit
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit/ChangeLog
r290481 r290482 1 2022-02-24 Gavin Phillips <gavin.p@apple.com> 2 3 Port CaptivePortalMode preferences to AnyHost in order to support CFPrefs Direct Mode propagation 4 https://bugs.webkit.org/show_bug.cgi?id=237098 5 6 Reviewed by Brent Fulgham. 7 8 Move our CaptivePortalMode preference to AnyHost in order to correctly support 9 CFPrefs Direct Mode propagation. We also now dispatch a CFNotification to ensure our preference 10 observer is always notified of the change. 11 12 * UIProcess/Cocoa/PreferenceObserver.mm: 13 (-[WKUserDefaults findPreferenceChangesAndNotifyForKeys:toValuesForKeys:]): 14 15 * Shared/Cocoa/AuxiliaryProcessCocoa.mm: 16 (WebKit::AuxiliaryProcess::setPreferenceValue): 17 * UIProcess/API/Cocoa/_WKSystemPreferences.mm: 18 (+[_WKSystemPreferences isCaptivePortalModeEnabled]): 19 (+[_WKSystemPreferences setCaptivePortalModeEnabled:]): 20 * UIProcess/Cocoa/WebProcessPoolCocoa.mm: 21 (WebKit::WebProcessPool::captivePortalModeConfigUpdateCallback): 22 (WebKit::WebProcessPool::registerNotificationObservers): 23 (WebKit::WebProcessPool::unregisterNotificationObservers): 24 * UIProcess/WebProcessPool.h: 25 1 26 2022-02-24 Aditya Keerthi <akeerthi@apple.com> 2 27 -
trunk/Source/WebKit/UIProcess/API/Cocoa/_WKSystemPreferences.mm
r290144 r290482 37 37 { 38 38 auto changedNotificationKey = adoptCF(CFStringCreateWithCString(kCFAllocatorDefault, WKCaptivePortalModeEnabledKey, kCFStringEncodingUTF8)); 39 auto preferenceValue = adoptCF(CFPreferencesCopyValue(changedNotificationKey.get(), kCFPreferencesAnyApplication, kCFPreferencesCurrentUser, kCFPreferences CurrentHost));39 auto preferenceValue = adoptCF(CFPreferencesCopyValue(changedNotificationKey.get(), kCFPreferencesAnyApplication, kCFPreferencesCurrentUser, kCFPreferencesAnyHost)); 40 40 return preferenceValue.get() == kCFBooleanTrue; 41 41 } … … 44 44 { 45 45 auto changedNotificationKey = adoptCF(CFStringCreateWithCString(kCFAllocatorDefault, WKCaptivePortalModeEnabledKey, kCFStringEncodingUTF8)); 46 CFPreferencesSetValue(changedNotificationKey.get(), enabled ? kCFBooleanTrue : kCFBooleanFalse, kCFPreferencesAnyApplication, kCFPreferencesCurrentUser, kCFPreferencesCurrentHost); 47 CFPreferencesSynchronize(kCFPreferencesAnyApplication, kCFPreferencesAnyUser, kCFPreferencesAnyHost); 46 CFPreferencesSetValue(changedNotificationKey.get(), enabled ? kCFBooleanTrue : kCFBooleanFalse, kCFPreferencesAnyApplication, kCFPreferencesCurrentUser, kCFPreferencesAnyHost); 47 CFPreferencesSynchronize(kCFPreferencesAnyApplication, kCFPreferencesCurrentUser, kCFPreferencesAnyHost); 48 CFNotificationCenterPostNotification(CFNotificationCenterGetDarwinNotifyCenter(), (__bridge CFStringRef)WKCaptivePortalModeContainerConfigurationChangedNotification, nullptr, nullptr, true); 48 49 } 49 50 -
trunk/Source/WebKit/UIProcess/Cocoa/WebProcessPoolCocoa.mm
r290394 r290482 625 625 #endif 626 626 627 #if PLATFORM( IOS_FAMILY)627 #if PLATFORM(COCOA) 628 628 void WebProcessPool::captivePortalModeConfigUpdateCallback(CFNotificationCenterRef, void* observer, CFStringRef, const void*, CFDictionaryRef) 629 629 { … … 746 746 }); 747 747 748 #if PLATFORM( IOS_FAMILY)748 #if PLATFORM(COCOA) 749 749 addCFNotificationObserver(captivePortalModeConfigUpdateCallback, (__bridge CFStringRef)WKCaptivePortalModeContainerConfigurationChangedNotification); 750 750 #endif … … 794 794 m_powerSourceNotifier = nullptr; 795 795 796 #if PLATFORM( IOS_FAMILY)796 #if PLATFORM(COCOA) 797 797 removeCFNotificationObserver((__bridge CFStringRef)WKCaptivePortalModeContainerConfigurationChangedNotification); 798 798 #endif -
trunk/Source/WebKit/UIProcess/WebProcessPool.h
r290387 r290482 586 586 #endif 587 587 588 #if PLATFORM( IOS_FAMILY)588 #if PLATFORM(COCOA) 589 589 static void captivePortalModeConfigUpdateCallback(CFNotificationCenterRef, void* observer, CFStringRef name, const void* postingObject, CFDictionaryRef userInfo); 590 590 #endif
Note:
See TracChangeset
for help on using the changeset viewer.