Bug 213261

Summary: Check for inAppBrowserPrivacyEnabled flag in WebsiteDataStore::initializeAppBoundDomains is expensive and calls a non-static function WebsiteDataStore::parameters().
Product: WebKit Reporter: Kate Cheney <katherine_cheney>
Component: WebKit Misc.Assignee: Kate Cheney <katherine_cheney>
Status: RESOLVED FIXED    
Severity: Normal CC: bfulgham, mjs, webkit-bug-importer, wilander
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Patch for landing none

Description Kate Cheney 2020-06-16 14:34:11 PDT
appBoundDomains() is static, so initializing it should not rely on non-static functions, like WebsiteDataStore::parameters(). Also the call to WebsiteDataStore::parameters() is expensive and unnecessary when we really only need to check the value of one flag.
Comment 1 Kate Cheney 2020-06-16 14:34:36 PDT
<rdar://problem/64317084>
Comment 2 Kate Cheney 2020-06-16 14:59:53 PDT
Created attachment 402043 [details]
Patch
Comment 3 Brent Fulgham 2020-06-16 15:11:54 PDT
Comment on attachment 402043 [details]
Patch

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

> Source/WebKit/UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:455
> +        RunLoop::main().dispatch([this, protectedThis = makeRef(*this), completionHandler = WTFMove(completionHandler)] () mutable {

I think we could just WTFMove(protectedThis).
Comment 4 Kate Cheney 2020-06-16 15:21:35 PDT
Created attachment 402047 [details]
Patch for landing
Comment 5 Kate Cheney 2020-06-16 15:22:13 PDT
(In reply to Brent Fulgham from comment #3)
> Comment on attachment 402043 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=402043&action=review
> 
> > Source/WebKit/UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:455
> > +        RunLoop::main().dispatch([this, protectedThis = makeRef(*this), completionHandler = WTFMove(completionHandler)] () mutable {
> 
> I think we could just WTFMove(protectedThis).

Good call, thanks for the review!
Comment 6 EWS 2020-06-16 15:57:11 PDT
Committed r263122: <https://trac.webkit.org/changeset/263122>

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