Bug 213145

Summary: [iOS] Preferences are not being observed if the process pool is being created after activation
Product: WebKit Reporter: Per Arne Vollan <pvollan>
Component: WebKit Misc.Assignee: Per Arne Vollan <pvollan>
Status: RESOLVED FIXED    
Severity: Normal CC: bfulgham, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Patch
bfulgham: review+
Patch
none
Patch none

Description Per Arne Vollan 2020-06-12 13:36:13 PDT
If the app is creating the Web process pool after being activated, preferences will not be observed until the app is being backgrounded and then foregrounded again, since the preference observer is initialized when handling the app activation notification.
Comment 1 Per Arne Vollan 2020-06-12 13:36:43 PDT
rdar://problem/63720477
Comment 2 Per Arne Vollan 2020-06-12 13:43:26 PDT
Created attachment 401774 [details]
Patch
Comment 3 Per Arne Vollan 2020-06-12 14:05:21 PDT
Created attachment 401778 [details]
Patch
Comment 4 Brent Fulgham 2020-06-12 14:16:19 PDT
Comment on attachment 401778 [details]
Patch

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

r=me

> Source/WebKit/UIProcess/Cocoa/WebProcessPoolCocoa.mm:474
> +            startObservingPreferenceChanges();

Do we need to do anything special to stop observing preferences in this case? Or is it handled automatically by the normal code paths?
Comment 5 Per Arne Vollan 2020-06-12 14:26:07 PDT
Created attachment 401782 [details]
Patch
Comment 6 Per Arne Vollan 2020-06-12 14:29:12 PDT
Created attachment 401783 [details]
Patch
Comment 7 Per Arne Vollan 2020-06-12 14:30:46 PDT
(In reply to Brent Fulgham from comment #4)
> Comment on attachment 401778 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=401778&action=review
> 
> r=me
> 
> > Source/WebKit/UIProcess/Cocoa/WebProcessPoolCocoa.mm:474
> > +            startObservingPreferenceChanges();
> 
> Do we need to do anything special to stop observing preferences in this
> case? Or is it handled automatically by the normal code paths?

Actually, we will observe preference changes during the full lifetime of the UI process.

Thanks for reviewing!
Comment 8 EWS 2020-06-12 15:38:31 PDT
Committed r262984: <https://trac.webkit.org/changeset/262984>

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