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

Issue 2153343002: Implement support for loading font files from outside system directory (Closed)

Created:
4 years, 5 months ago by Ilya Kulshin
Modified:
4 years, 4 months ago
Reviewers:
ananta, nasko, brucedawson
CC:
chromium-reviews, darin-cc_chromium.org, jam, Will Harris
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Implement support for loading font files from outside system directory Implement support for loading font files from outside system directory. When a font file is installed outside the system font dir, we will now have the browser give the renderer a handle to the file that it can use to access the font data. This change will bypass sandbox restrictions that normally prevents the renderer from opening fonts outside the windows fonts directory. BUG=610466 Committed: https://crrev.com/96ce8347f39ce0eebd10de476afb08c0afb406c9 Cr-Commit-Position: refs/heads/master@{#407658}

Patch Set 1 #

Patch Set 2 : Delete temp file #

Patch Set 3 : Remove more temp files #

Patch Set 4 : Add missing include #

Patch Set 5 : Unittests #

Patch Set 6 : Refactor cast #

Total comments: 22

Patch Set 7 : Review feedback #

Patch Set 8 : Test patchset to run try job #

Total comments: 4

Patch Set 9 : Switch to using IPC::PlatformFileForTransit #

Patch Set 10 : Add command line flag to control custom font file loading #

Total comments: 4

Patch Set 11 : Switch command flags to use feature API instead #

Total comments: 3

Patch Set 12 : Add some more comments #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+212 lines, -65 lines) Patch
M content/browser/renderer_host/dwrite_font_proxy_message_filter_win.h View 1 2 3 4 5 6 7 8 9 4 chunks +12 lines, -2 lines 0 comments Download
M content/browser/renderer_host/dwrite_font_proxy_message_filter_win.cc View 1 2 3 4 5 6 7 8 9 10 11 12 chunks +57 lines, -23 lines 0 comments Download
M content/browser/renderer_host/dwrite_font_proxy_message_filter_win_unittest.cc View 1 2 3 4 5 6 7 8 4 chunks +31 lines, -2 lines 0 comments Download
M content/child/dwrite_font_proxy/dwrite_font_proxy_win.h View 1 2 3 4 5 6 7 8 9 10 2 chunks +3 lines, -5 lines 0 comments Download
M content/child/dwrite_font_proxy/dwrite_font_proxy_win.cc View 1 2 3 4 5 6 7 8 9 10 11 8 chunks +53 lines, -25 lines 1 comment Download
M content/child/dwrite_font_proxy/dwrite_font_proxy_win_unittest.cc View 1 2 3 4 5 6 7 8 1 chunk +33 lines, -0 lines 0 comments Download
M content/common/dwrite_font_proxy_messages.h View 1 2 3 4 5 6 7 8 2 chunks +6 lines, -3 lines 0 comments Download
M content/test/dwrite_font_fake_sender_win.h View 1 2 3 4 5 6 7 8 5 chunks +11 lines, -2 lines 0 comments Download
M content/test/dwrite_font_fake_sender_win.cc View 1 2 3 4 5 6 7 8 2 chunks +6 lines, -3 lines 0 comments Download

Messages

Total messages: 62 (46 generated)
Ilya Kulshin
ptal ananta@ - content/browser*, content/child/*, content/test/* nasko@ - content/common/dwrite_font_proxy_messages.h
4 years, 5 months ago (2016-07-19 19:10:54 UTC) #18
ananta
https://codereview.chromium.org/2153343002/diff/100001/content/browser/renderer_host/dwrite_font_proxy_message_filter_win_unittest.cc File content/browser/renderer_host/dwrite_font_proxy_message_filter_win_unittest.cc (right): https://codereview.chromium.org/2153343002/diff/100001/content/browser/renderer_host/dwrite_font_proxy_message_filter_win_unittest.cc#newcode232 content/browser/renderer_host/dwrite_font_proxy_message_filter_win_unittest.cc:232: EXPECT_LT(0u, handles.size()); Perhaps using EXPECT_FALSE(handles.empty()) would make this more ...
4 years, 5 months ago (2016-07-20 01:34:59 UTC) #21
nasko
https://codereview.chromium.org/2153343002/diff/100001/content/browser/renderer_host/dwrite_font_proxy_message_filter_win.cc File content/browser/renderer_host/dwrite_font_proxy_message_filter_win.cc (right): https://codereview.chromium.org/2153343002/diff/100001/content/browser/renderer_host/dwrite_font_proxy_message_filter_win.cc#newcode549 content/browser/renderer_host/dwrite_font_proxy_message_filter_win.cc:549: base::File::FLAG_EXCLUSIVE_WRITE); Why do we need write access? Shouldn't the ...
4 years, 5 months ago (2016-07-20 16:40:03 UTC) #22
Ilya Kulshin
ptal. I changed my approach, so that instead of storing both paths and handles I ...
4 years, 5 months ago (2016-07-21 04:17:38 UTC) #26
nasko
I don't know much about fonts, so can't sign off on how the font-specific changes ...
4 years, 5 months ago (2016-07-21 21:45:56 UTC) #34
Will Harris
I think this code should be using handle attachment brokering - exposed via IPC::GetPlatformFileForTransit interface. ...
4 years, 5 months ago (2016-07-21 22:02:20 UTC) #35
Ilya Kulshin
ptal. Thanks for the tip about PlatformFileForTransit. https://codereview.chromium.org/2153343002/diff/180001/content/browser/renderer_host/dwrite_font_proxy_message_filter_win.cc File content/browser/renderer_host/dwrite_font_proxy_message_filter_win.cc (right): https://codereview.chromium.org/2153343002/diff/180001/content/browser/renderer_host/dwrite_font_proxy_message_filter_win.cc#newcode279 content/browser/renderer_host/dwrite_font_proxy_message_filter_win.cc:279: // https://msdn.microsoft.com/en-us/library/windows/desktop/aa384203%28v=vs.85%29.aspx ...
4 years, 5 months ago (2016-07-22 03:30:37 UTC) #38
nasko
Much better! Thanks for converting it. IPC LGTM, though I'd still like someone more familiar ...
4 years, 5 months ago (2016-07-22 23:51:30 UTC) #42
Ilya Kulshin
ptal, sorry for the churn. I switched from using command line flags to the Chromium ...
4 years, 5 months ago (2016-07-25 21:22:45 UTC) #43
ananta
https://codereview.chromium.org/2153343002/diff/240001/content/child/dwrite_font_proxy/dwrite_font_proxy_win.cc File content/child/dwrite_font_proxy/dwrite_font_proxy_win.cc (right): https://codereview.chromium.org/2153343002/diff/240001/content/child/dwrite_font_proxy/dwrite_font_proxy_win.cc#newcode208 content/child/dwrite_font_proxy/dwrite_font_proxy_win.cc:208: // CreateFontFileStream, and DirectWrite requires the reference keys to ...
4 years, 5 months ago (2016-07-25 22:21:39 UTC) #46
Ilya Kulshin
https://codereview.chromium.org/2153343002/diff/240001/content/child/dwrite_font_proxy/dwrite_font_proxy_win.cc File content/child/dwrite_font_proxy/dwrite_font_proxy_win.cc (right): https://codereview.chromium.org/2153343002/diff/240001/content/child/dwrite_font_proxy/dwrite_font_proxy_win.cc#newcode208 content/child/dwrite_font_proxy/dwrite_font_proxy_win.cc:208: // CreateFontFileStream, and DirectWrite requires the reference keys to ...
4 years, 5 months ago (2016-07-25 22:38:52 UTC) #47
ananta
lgtm % comment request https://codereview.chromium.org/2153343002/diff/240001/content/child/dwrite_font_proxy/dwrite_font_proxy_win.cc File content/child/dwrite_font_proxy/dwrite_font_proxy_win.cc (right): https://codereview.chromium.org/2153343002/diff/240001/content/child/dwrite_font_proxy/dwrite_font_proxy_win.cc#newcode208 content/child/dwrite_font_proxy/dwrite_font_proxy_win.cc:208: // CreateFontFileStream, and DirectWrite requires ...
4 years, 5 months ago (2016-07-25 23:08:20 UTC) #50
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2153343002/260001
4 years, 5 months ago (2016-07-25 23:47:12 UTC) #56
commit-bot: I haz the power
Committed patchset #12 (id:260001)
4 years, 4 months ago (2016-07-26 00:46:17 UTC) #58
commit-bot: I haz the power
Patchset 12 (id:??) landed as https://crrev.com/96ce8347f39ce0eebd10de476afb08c0afb406c9 Cr-Commit-Position: refs/heads/master@{#407658}
4 years, 4 months ago (2016-07-26 00:49:42 UTC) #60
brucedawson
4 years, 4 months ago (2016-08-02 00:44:47 UTC) #62
Message was sent while issue was closed.
Drive-by nit...

https://codereview.chromium.org/2153343002/diff/260001/content/child/dwrite_f...
File content/child/dwrite_font_proxy/dwrite_font_proxy_win.cc (right):

https://codereview.chromium.org/2153343002/diff/260001/content/child/dwrite_f...
content/child/dwrite_font_proxy/dwrite_font_proxy_win.cc:542:
reinterpret_cast<const void*>(&files_[current_file_]),
This cast isn't actually needed, is it? Pointers decay naturally to void*/const
void*. The code certainly compiles without it, and extraneous casts confuse me.

It looks like the cast was unnecessary in the previous version as well, although
I didn't test that.

Powered by Google App Engine
This is Rietveld 408576698