Bug 230159

Summary: Send preference updates to the GPU Process
Product: WebKit Reporter: Per Arne Vollan <pvollan>
Component: WebKit Misc.Assignee: Per Arne Vollan <pvollan>
Status: RESOLVED FIXED    
Severity: Normal CC: bfulgham, cfleizach, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
ews-feeder: commit-queue-
Patch
bfulgham: review+
Patch none

Description Per Arne Vollan 2021-09-10 09:52:15 PDT
Like the WebContent process, the GPU process should also receive preference updates since it is blocking the preference service in the sandbox.
Comment 1 Per Arne Vollan 2021-09-10 09:52:58 PDT
<rdar://81049367>
Comment 2 Per Arne Vollan 2021-09-10 10:02:16 PDT
Created attachment 437886 [details]
Patch
Comment 3 chris fleizach 2021-09-10 10:44:41 PDT
Comment on attachment 437886 [details]
Patch

AuxiliaryProcessCocoa.mm:166:1: error: extraneous closing brace ('}')
Comment 4 Per Arne Vollan 2021-09-10 11:08:33 PDT
Created attachment 437891 [details]
Patch
Comment 5 Per Arne Vollan 2021-09-10 11:09:10 PDT
(In reply to chris fleizach from comment #3)
> Comment on attachment 437886 [details]
> Patch
> 
> AuxiliaryProcessCocoa.mm:166:1: error: extraneous closing brace ('}')

Patch updated.

Thanks for reviewing!
Comment 6 Brent Fulgham 2021-09-10 11:21:19 PDT
Comment on attachment 437891 [details]
Patch

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

r=me

> Source/WebKit/Shared/Cocoa/AuxiliaryProcessCocoa.mm:134
> +id AuxiliaryProcess::decodePreferenceValue(const std::optional<String>& encodedValue)

Oh, nice! We have centralized this now.

> Source/WebKit/Shared/Cocoa/AuxiliaryProcessCocoa.mm:143
> +    auto classes = [NSSet setWithArray:@[[NSString class], [NSNumber class], [NSDate class], [NSDictionary class], [NSArray class], [NSData class]]];

I wonder if there is any perf benefit to making this a "NeverDestroyed" thing, since we presumably construct this set every time we try to decode preference values.
Comment 7 Per Arne Vollan 2021-09-13 11:11:11 PDT
(In reply to Brent Fulgham from comment #6)
> Comment on attachment 437891 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=437891&action=review
> 
> r=me
> 
> > Source/WebKit/Shared/Cocoa/AuxiliaryProcessCocoa.mm:134
> > +id AuxiliaryProcess::decodePreferenceValue(const std::optional<String>& encodedValue)
> 
> Oh, nice! We have centralized this now.
> 
> > Source/WebKit/Shared/Cocoa/AuxiliaryProcessCocoa.mm:143
> > +    auto classes = [NSSet setWithArray:@[[NSString class], [NSNumber class], [NSDate class], [NSDictionary class], [NSArray class], [NSData class]]];
> 
> I wonder if there is any perf benefit to making this a "NeverDestroyed"
> thing, since we presumably construct this set every time we try to decode
> preference values.

That is a good point. I think there will be a performance benefit from this, although since this should not be a hot path, I think it also could be good to avoid the small added memory cost by making this NeverDestroyed.

Thanks for reviewing!
Comment 8 Per Arne Vollan 2021-09-13 11:13:42 PDT
Created attachment 438058 [details]
Patch
Comment 9 EWS 2021-09-13 15:01:47 PDT
Committed r282364 (241627@main): <https://commits.webkit.org/241627@main>

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