Bug 237098

Summary: Port CaptivePortalMode preferences to AnyHost in order to support CFPrefs Direct Mode propagation
Product: WebKit Reporter: Gavin <gavin.p>
Component: WebKit2Assignee: Gavin <gavin.p>
Status: RESOLVED FIXED    
Severity: Normal CC: bfulgham, kkinnunen, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: Other   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Patch
ews-feeder: commit-queue-
Patch none

Description Gavin 2022-02-23 11:45:44 PST
Modify our preference observation code to also provide notifications for changes to preferences stored as the currentHost.
Comment 1 Gavin 2022-02-23 11:50:29 PST
Created attachment 453007 [details]
Patch
Comment 2 Brent Fulgham 2022-02-23 12:01:30 PST
Comment on attachment 453007 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=453007&action=review

> Source/WebKit/UIProcess/Cocoa/PreferenceObserver.mm:76
> +        auto hostValue = adoptCF(CFPreferencesCopyValue((__bridge CFStringRef)key, kCFPreferencesAnyApplication, kCFPreferencesCurrentUser, kCFPreferencesCurrentHost));

If CurrentHost and AnyHost are treated the same on iOS, should we conditionalize this on PLATFORM(MAC), or maybe !PLATFORM(IOS)?
Comment 3 Brent Fulgham 2022-02-23 13:05:54 PST
Comment on attachment 453007 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=453007&action=review

r=me

>> Source/WebKit/UIProcess/Cocoa/PreferenceObserver.mm:76
>> +        auto hostValue = adoptCF(CFPreferencesCopyValue((__bridge CFStringRef)key, kCFPreferencesAnyApplication, kCFPreferencesCurrentUser, kCFPreferencesCurrentHost));
> 
> If CurrentHost and AnyHost are treated the same on iOS, should we conditionalize this on PLATFORM(MAC), or maybe !PLATFORM(IOS)?

I talked with Gavin offline, and we actually do want it to work this way on all platforms.
Comment 4 Radar WebKit Bug Importer 2022-02-23 13:06:17 PST
<rdar://problem/89373662>
Comment 5 Gavin 2022-02-24 08:43:15 PST
Created attachment 453102 [details]
Patch
Comment 6 Gavin 2022-02-24 09:00:11 PST
Created attachment 453105 [details]
Patch
Comment 7 Brent Fulgham 2022-02-24 09:21:02 PST
Comment on attachment 453105 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=453105&action=review

r=me

> Source/WebKit/ChangeLog:4
> +        https://bugs.webkit.org/show_bug.cgi?id=237098

<rdar://problem/89373662>

Please always include the Radar in Changelogs, as it makes it easier to find things using the Xcode change viewer.

> Source/WebKit/UIProcess/Cocoa/WebProcessPoolCocoa.mm:748
> +#if PLATFORM(COCOA)

Oops -- yes, this would never have worked properly for macOS!
Comment 8 EWS 2022-02-24 17:45:54 PST
Committed r290482 (247778@main): <https://commits.webkit.org/247778@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 453105 [details].