DescriptionEnsure that the DirectWrite font cache works in Chrome canary on Windows 8+ with AppContainer protection
The original patch attempting to fix this was reverted due to perf regressions caused by opening font files in the sandbox which
end up being brokered to the browser.
The DirectWrite font cache is mapped as a shared section by the renderer processes. The browser creates
the section. On Windows 8+ with AppContainer protection the renderers are unable to open this shared section
as the BaseNamedObjects object directory is virtualized to \Sessions\SessionId\AppContainerNamedObjects.
This effectively means that the renderers now fallback to the old method of enumerating all fonts while DirectWrite
builds up its font cache. This hurts performance.
To share the font cache shared section handle with the renderer we now open the font cache shared section in
RenderProcessHostImpl::Init() and add it to the TargetPolicy when the renderer is about to be spawned. The sandbox broker reads
the handles from the policy along with other handles like stderr/stdout etc and adds this information to STARTUPINFOEX.
This enables these handles to be shared with the target.
We also need a change in the SharedMemory class to allow us to open a shared section in inheritable mode. This is achieved by
adding a method called set_inheritable to the SharedMemory class.
BUG=481285
R=cpu
Committed: https://crrev.com/5d498ac79386ec8155fb2a768541e2b4b18c7d49
Cr-Commit-Position: refs/heads/master@{#329041}
Patch Set 1 #Patch Set 2 : Fix comment #Patch Set 3 : #
Total comments: 6
Patch Set 4 : Move the DirectWrite font cache opening code and sharing it via the command line to content sandbox. #Patch Set 5 : Reverted changes to shared memory #
Total comments: 4
Patch Set 6 : Address review comments #Patch Set 7 : Attempt to fix redness #Patch Set 8 : Rebased to tip #
Messages
Total messages: 25 (7 generated)
|