Bug 211960

Summary: Reorder entitlement check in WebKit::applicationType()
Product: WebKit Reporter: David Quesada <david_quesada>
Component: WebKit2Assignee: Nobody <webkit-unassigned>
Status: NEW ---    
Severity: Normal    
Priority: P2    
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   

Description David Quesada 2020-05-15 09:12:04 PDT
The operands in the expression `WTF::processHasEntitlement("com.apple.UIKit.vends-view-services") && window._isHostedInAnotherProcess` could be swapped to avoid the entitlement check by short-circuit evaluation. Loading and parsing the app’s entitlements can be non-trivial (at least compared to the -_isHostedInAnotherProcess method call), and most web views aren’t added to windows in view services, so the entitlement check is often unneeded.