Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(60)

Issue 1122163002: Ensure that the DirectWrite font cache works in Chrome canary on Windows 8+ with AppContainer prote… (Closed)

Created:
5 years, 7 months ago by ananta
Modified:
5 years, 7 months ago
CC:
chromium-reviews, creis+watch_chromium.org, wfh+watch_chromium.org, nasko+codewatch_chromium.org, jam, gavinp+memory_chromium.org, rickyz+watch_chromium.org, darin-cc_chromium.org, erikwright+watch_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Ensure 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 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+34 lines, -18 lines) Patch
M content/browser/renderer_host/render_process_host_impl.cc View 1 2 3 4 5 6 7 1 chunk +0 lines, -3 lines 0 comments Download
M content/common/dwrite_font_platform_win.cc View 1 chunk +11 lines, -9 lines 0 comments Download
M content/common/sandbox_win.cc View 1 2 3 4 5 3 chunks +19 lines, -0 lines 0 comments Download
M content/public/common/content_switches.h View 1 2 3 4 5 6 7 1 chunk +2 lines, -3 lines 0 comments Download
M content/public/common/content_switches.cc View 1 2 3 4 5 6 7 1 chunk +2 lines, -3 lines 0 comments Download

Messages

Total messages: 25 (7 generated)
ananta
5 years, 7 months ago (2015-05-05 03:41:06 UTC) #1
ananta
+shrikant
5 years, 7 months ago (2015-05-05 18:46:58 UTC) #3
cpu_(ooo_6.6-7.5)
pls do a separate cl for the sandbox changes with a test. https://codereview.chromium.org/1122163002/diff/40001/sandbox/win/src/sandbox_policy.h File sandbox/win/src/sandbox_policy.h ...
5 years, 7 months ago (2015-05-05 20:42:39 UTC) #4
Shrikant Kelkar
https://codereview.chromium.org/1122163002/diff/40001/content/browser/renderer_host/render_process_host_impl.cc File content/browser/renderer_host/render_process_host_impl.cc (right): https://codereview.chromium.org/1122163002/diff/40001/content/browser/renderer_host/render_process_host_impl.cc#newcode374 content/browser/renderer_host/render_process_host_impl.cc:374: direct_write_font_cache_section_ = direct_write_font_cache_section; Scope/DuplicateHandle? https://codereview.chromium.org/1122163002/diff/40001/content/browser/renderer_host/render_process_host_impl.cc#newcode393 content/browser/renderer_host/render_process_host_impl.cc:393: base::SharedMemoryHandle direct_write_font_cache_section_; Scope? ...
5 years, 7 months ago (2015-05-05 20:43:16 UTC) #5
ananta
On 2015/05/05 20:42:39, cpu wrote: > pls do a separate cl for the sandbox changes ...
5 years, 7 months ago (2015-05-07 21:59:09 UTC) #6
ananta
https://codereview.chromium.org/1122163002/diff/40001/content/browser/renderer_host/render_process_host_impl.cc File content/browser/renderer_host/render_process_host_impl.cc (right): https://codereview.chromium.org/1122163002/diff/40001/content/browser/renderer_host/render_process_host_impl.cc#newcode374 content/browser/renderer_host/render_process_host_impl.cc:374: direct_write_font_cache_section_ = direct_write_font_cache_section; On 2015/05/05 20:43:16, Shrikant Kelkar wrote: ...
5 years, 7 months ago (2015-05-07 22:00:48 UTC) #7
Shrikant Kelkar
lgtm
5 years, 7 months ago (2015-05-07 22:50:11 UTC) #8
ananta
+avi for content owners review.
5 years, 7 months ago (2015-05-07 23:13:04 UTC) #10
cpu_(ooo_6.6-7.5)
https://codereview.chromium.org/1122163002/diff/80001/content/common/sandbox_win.cc File content/common/sandbox_win.cc (right): https://codereview.chromium.org/1122163002/diff/80001/content/common/sandbox_win.cc#newcode694 content/common/sandbox_win.cc:694: HANDLE shared_handle = use void*, we don't want future ...
5 years, 7 months ago (2015-05-08 03:03:25 UTC) #11
Avi (use Gerrit)
lgtm OK
5 years, 7 months ago (2015-05-08 03:04:53 UTC) #12
ananta
https://codereview.chromium.org/1122163002/diff/80001/content/common/sandbox_win.cc File content/common/sandbox_win.cc (right): https://codereview.chromium.org/1122163002/diff/80001/content/common/sandbox_win.cc#newcode699 content/common/sandbox_win.cc:699: } On 2015/05/08 03:03:24, cpu wrote: > is this ...
5 years, 7 months ago (2015-05-08 04:10:18 UTC) #13
ananta
https://codereview.chromium.org/1122163002/diff/80001/content/common/sandbox_win.cc File content/common/sandbox_win.cc (right): https://codereview.chromium.org/1122163002/diff/80001/content/common/sandbox_win.cc#newcode694 content/common/sandbox_win.cc:694: HANDLE shared_handle = On 2015/05/08 03:03:24, cpu wrote: > ...
5 years, 7 months ago (2015-05-08 19:08:19 UTC) #14
cpu_(ooo_6.6-7.5)
lgtm
5 years, 7 months ago (2015-05-08 19:56:15 UTC) #15
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1122163002/120001
5 years, 7 months ago (2015-05-08 19:56:59 UTC) #18
commit-bot: I haz the power
Try jobs failed on following builders: linux_chromium_compile_dbg_32_ng on tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_compile_dbg_32_ng/builds/51059)
5 years, 7 months ago (2015-05-08 20:02:10 UTC) #20
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1122163002/140001
5 years, 7 months ago (2015-05-08 20:24:20 UTC) #23
commit-bot: I haz the power
Committed patchset #8 (id:140001)
5 years, 7 months ago (2015-05-09 04:20:03 UTC) #24
commit-bot: I haz the power
5 years, 7 months ago (2015-05-09 04:21:51 UTC) #25
Message was sent while issue was closed.
Patchset 8 (id:??) landed as
https://crrev.com/5d498ac79386ec8155fb2a768541e2b4b18c7d49
Cr-Commit-Position: refs/heads/master@{#329041}

Powered by Google App Engine
This is Rietveld 408576698