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

Issue 337203003: Move PPB_TrueTypeFont_Dev host from renderer to browser. (Closed)

Created:
6 years, 6 months ago by bbudge
Modified:
6 years, 5 months ago
CC:
chromium-reviews, darin-cc_chromium.org, jam, scottmg
Project:
chromium
Visibility:
Public.

Description

Move PPB_TrueTypeFont_Dev host from renderer to browser. On Linux, we can now use FontConfig in the browser process since it is thread-safe, so we don't need to use SandboxIPC from the renderer. In the browser, the needed functionality is split off from SandboxIPCHandler into a static function, MatchFontFaceWithFallback in a new pair of files, font_utils_linux.*. This change also moves any potentially blocking font creation and reading to the browser's blocking thread pool. I reworked the PepperTrueTypeFont base class to make Create simpler. - Added an Initialize method which returns the font descriptor. - Removed the Describe method. I reworked the resource to delay calls to the host until we receive the desc and initialization is complete. Describe will now wait until Initialize completes, and the host uses a SequencedTaskRunner to serialize tasks, so Initialize completes before GetTableTags and GetTable calls complete. The Describe method can be implemented without IPC since we have the desc on the plugin side. BUG=382729 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=280107

Patch Set 1 : #

Patch Set 2 : #

Total comments: 21

Patch Set 3 : Rework so creation can happen on blocking pool thread. #

Patch Set 4 : Add scopers, fix builds. #

Total comments: 12

Patch Set 5 : Use SequencedTaskRunner in the host. #

Total comments: 2

Patch Set 6 : Check fd / HANDLE / FontRef for validity. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+908 lines, -1557 lines) Patch
A content/browser/renderer_host/font_utils_linux.h View 1 chunk +20 lines, -0 lines 0 comments Download
A content/browser/renderer_host/font_utils_linux.cc View 1 2 3 1 chunk +261 lines, -0 lines 0 comments Download
M content/browser/renderer_host/pepper/content_browser_pepper_host_factory.cc View 3 chunks +16 lines, -0 lines 0 comments Download
A content/browser/renderer_host/pepper/pepper_truetype_font.h View 1 2 3 4 5 1 chunk +55 lines, -0 lines 0 comments Download
A + content/browser/renderer_host/pepper/pepper_truetype_font_android.cc View 1 2 1 chunk +4 lines, -5 lines 0 comments Download
A content/browser/renderer_host/pepper/pepper_truetype_font_host.h View 1 2 3 4 1 chunk +69 lines, -0 lines 0 comments Download
A content/browser/renderer_host/pepper/pepper_truetype_font_host.cc View 1 2 3 4 5 1 chunk +159 lines, -0 lines 0 comments Download
A + content/browser/renderer_host/pepper/pepper_truetype_font_linux.cc View 1 2 3 4 5 6 chunks +44 lines, -46 lines 0 comments Download
A + content/browser/renderer_host/pepper/pepper_truetype_font_mac.mm View 1 2 3 4 5 14 chunks +128 lines, -123 lines 0 comments Download
A + content/browser/renderer_host/pepper/pepper_truetype_font_win.cc View 1 2 3 4 5 8 chunks +59 lines, -67 lines 0 comments Download
M content/browser/renderer_host/sandbox_ipc_linux.cc View 5 chunks +3 lines, -238 lines 0 comments Download
M content/content_browser.gypi View 3 chunks +9 lines, -0 lines 0 comments Download
M content/content_renderer.gypi View 1 chunk +0 lines, -7 lines 0 comments Download
M content/renderer/pepper/content_renderer_pepper_host_factory.cc View 3 chunks +0 lines, -16 lines 0 comments Download
D content/renderer/pepper/pepper_truetype_font.h View 1 chunk +0 lines, -50 lines 0 comments Download
D content/renderer/pepper/pepper_truetype_font_android.cc View 1 chunk +0 lines, -17 lines 0 comments Download
D content/renderer/pepper/pepper_truetype_font_host.h View 1 chunk +0 lines, -50 lines 0 comments Download
D content/renderer/pepper/pepper_truetype_font_host.cc View 1 chunk +0 lines, -93 lines 0 comments Download
D content/renderer/pepper/pepper_truetype_font_linux.cc View 1 chunk +0 lines, -159 lines 0 comments Download
D content/renderer/pepper/pepper_truetype_font_mac.mm View 1 chunk +0 lines, -408 lines 0 comments Download
D content/renderer/pepper/pepper_truetype_font_win.cc View 1 chunk +0 lines, -245 lines 0 comments Download
M ppapi/proxy/ppapi_messages.h View 1 2 1 chunk +4 lines, -3 lines 0 comments Download
M ppapi/proxy/truetype_font_resource.h View 1 2 3 4 4 chunks +18 lines, -5 lines 0 comments Download
M ppapi/proxy/truetype_font_resource.cc View 1 2 3 4 3 chunks +59 lines, -25 lines 0 comments Download

Messages

Total messages: 28 (0 generated)
bbudge
teravest - /pepper stuff jorgelo - browser/renderer_host/*_linux sandbox files.
6 years, 6 months ago (2014-06-19 14:19:03 UTC) #1
bbudge
+ sky for content OWNERS Please feel free to suggest an alternate reviewer, perhaps a ...
6 years, 6 months ago (2014-06-19 14:21:16 UTC) #2
bbudge
6 years, 6 months ago (2014-06-19 14:21:32 UTC) #3
sky
I'm not a good reviewer for this. Maybe piman?
6 years, 6 months ago (2014-06-19 15:49:14 UTC) #4
Jorge Lucangeli Obes
On 2014/06/19 14:19:03, bbudge wrote: > teravest - /pepper stuff > jorgelo - browser/renderer_host/*_linux sandbox ...
6 years, 6 months ago (2014-06-19 16:20:35 UTC) #5
piman
https://codereview.chromium.org/337203003/diff/210001/content/browser/renderer_host/font_utils_linux.cc File content/browser/renderer_host/font_utils_linux.cc (right): https://codereview.chromium.org/337203003/diff/210001/content/browser/renderer_host/font_utils_linux.cc#newcode237 content/browser/renderer_host/font_utils_linux.cc:237: font_fd = open(reinterpret_cast<char*>(c_filename), O_RDONLY); Do we need to HANDLE_EINTR? ...
6 years, 6 months ago (2014-06-19 20:03:42 UTC) #6
teravest
I don't have much to add to the earlier review comments. https://codereview.chromium.org/337203003/diff/210001/content/browser/renderer_host/pepper/pepper_truetype_font_host.h File content/browser/renderer_host/pepper/pepper_truetype_font_host.h (right): ...
6 years, 6 months ago (2014-06-20 15:22:45 UTC) #7
bbudge
https://codereview.chromium.org/337203003/diff/210001/content/browser/renderer_host/font_utils_linux.cc File content/browser/renderer_host/font_utils_linux.cc (right): https://codereview.chromium.org/337203003/diff/210001/content/browser/renderer_host/font_utils_linux.cc#newcode237 content/browser/renderer_host/font_utils_linux.cc:237: font_fd = open(reinterpret_cast<char*>(c_filename), O_RDONLY); On 2014/06/19 20:03:42, piman wrote: ...
6 years, 6 months ago (2014-06-21 14:12:50 UTC) #8
bbudge
+tsepez for ppapi_messages.h
6 years, 6 months ago (2014-06-21 14:15:51 UTC) #9
piman
https://codereview.chromium.org/337203003/diff/210001/content/browser/renderer_host/pepper/pepper_truetype_font_mac.mm File content/browser/renderer_host/pepper/pepper_truetype_font_mac.mm (right): https://codereview.chromium.org/337203003/diff/210001/content/browser/renderer_host/pepper/pepper_truetype_font_mac.mm#newcode348 content/browser/renderer_host/pepper/pepper_truetype_font_mac.mm:348: while (search_range<num_tables>> 1) { On 2014/06/21 14:12:50, bbudge wrote: ...
6 years, 6 months ago (2014-06-23 18:21:13 UTC) #10
Tom Sepez
Messages themselves LGTM, but it looks like we are moving some more attack surface into ...
6 years, 6 months ago (2014-06-23 18:29:14 UTC) #11
bbudge
https://codereview.chromium.org/337203003/diff/300001/content/browser/renderer_host/pepper/pepper_truetype_font_host.cc File content/browser/renderer_host/pepper/pepper_truetype_font_host.cc (right): https://codereview.chromium.org/337203003/diff/300001/content/browser/renderer_host/pepper/pepper_truetype_font_host.cc#newcode74 content/browser/renderer_host/pepper/pepper_truetype_font_host.cc:74: font_ = NULL; On 2014/06/23 18:21:12, piman wrote: > ...
6 years, 6 months ago (2014-06-23 18:34:10 UTC) #12
Jorge Lucangeli Obes
https://codereview.chromium.org/337203003/diff/300001/content/browser/renderer_host/sandbox_ipc_linux.cc File content/browser/renderer_host/sandbox_ipc_linux.cc (left): https://codereview.chromium.org/337203003/diff/300001/content/browser/renderer_host/sandbox_ipc_linux.cc#oldcode585 content/browser/renderer_host/sandbox_ipc_linux.cc:585: FcPatternDestroy(pattern); Reiterating my previous comment to test this under ...
6 years, 6 months ago (2014-06-23 18:34:52 UTC) #13
piman
https://codereview.chromium.org/337203003/diff/300001/content/browser/renderer_host/pepper/pepper_truetype_font_host.cc File content/browser/renderer_host/pepper/pepper_truetype_font_host.cc (right): https://codereview.chromium.org/337203003/diff/300001/content/browser/renderer_host/pepper/pepper_truetype_font_host.cc#newcode74 content/browser/renderer_host/pepper/pepper_truetype_font_host.cc:74: font_ = NULL; On 2014/06/23 18:34:10, bbudge wrote: > ...
6 years, 6 months ago (2014-06-23 19:05:47 UTC) #14
bbudge
https://codereview.chromium.org/337203003/diff/300001/content/browser/renderer_host/pepper/pepper_truetype_font_host.cc File content/browser/renderer_host/pepper/pepper_truetype_font_host.cc (right): https://codereview.chromium.org/337203003/diff/300001/content/browser/renderer_host/pepper/pepper_truetype_font_host.cc#newcode74 content/browser/renderer_host/pepper/pepper_truetype_font_host.cc:74: font_ = NULL; On 2014/06/23 19:05:47, piman wrote: > ...
6 years, 6 months ago (2014-06-24 01:50:56 UTC) #15
Jorge Lucangeli Obes
sandbox_ipc_linux.* lgtm. you might want to run content_browsertests under TSan to make sure there's no ...
6 years, 6 months ago (2014-06-24 01:53:58 UTC) #16
piman
https://codereview.chromium.org/337203003/diff/300001/content/browser/renderer_host/pepper/pepper_truetype_font_linux.cc File content/browser/renderer_host/pepper/pepper_truetype_font_linux.cc (right): https://codereview.chromium.org/337203003/diff/300001/content/browser/renderer_host/pepper/pepper_truetype_font_linux.cc#newcode87 content/browser/renderer_host/pepper/pepper_truetype_font_linux.cc:87: if (!GetFontTable(fd_.get(), On 2014/06/24 01:50:56, bbudge wrote: > On ...
6 years, 6 months ago (2014-06-24 02:53:29 UTC) #17
jschuh
I vaguely recall that palmer@ gave the original code a very thorough security review. So, ...
6 years, 6 months ago (2014-06-24 06:11:45 UTC) #18
bbudge
On 2014/06/24 06:11:45, Justin Schuh wrote: > I vaguely recall that palmer@ gave the original ...
6 years, 6 months ago (2014-06-24 11:41:24 UTC) #19
bbudge
https://codereview.chromium.org/337203003/diff/300001/content/browser/renderer_host/pepper/pepper_truetype_font_linux.cc File content/browser/renderer_host/pepper/pepper_truetype_font_linux.cc (right): https://codereview.chromium.org/337203003/diff/300001/content/browser/renderer_host/pepper/pepper_truetype_font_linux.cc#newcode87 content/browser/renderer_host/pepper/pepper_truetype_font_linux.cc:87: if (!GetFontTable(fd_.get(), On 2014/06/24 02:53:29, piman wrote: > On ...
6 years, 6 months ago (2014-06-24 12:21:11 UTC) #20
piman
lgtm
6 years, 6 months ago (2014-06-24 18:17:21 UTC) #21
palmer
LGTM.
6 years, 6 months ago (2014-06-25 20:40:44 UTC) #22
teravest
lgtm
6 years, 6 months ago (2014-06-25 20:59:37 UTC) #23
bbudge
The CQ bit was checked by bbudge@chromium.org
6 years, 5 months ago (2014-06-26 20:00:03 UTC) #24
bbudge
On 2014/06/19 16:20:35, Jorge Lucangeli Obes wrote: > On 2014/06/19 14:19:03, bbudge wrote: > > ...
6 years, 5 months ago (2014-06-26 20:00:48 UTC) #25
bbudge
On 2014/06/19 16:20:35, Jorge Lucangeli Obes wrote: > On 2014/06/19 14:19:03, bbudge wrote: > > ...
6 years, 5 months ago (2014-06-26 20:00:48 UTC) #26
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/bbudge@chromium.org/337203003/360001
6 years, 5 months ago (2014-06-26 20:01:53 UTC) #27
commit-bot: I haz the power
6 years, 5 months ago (2014-06-26 21:28:27 UTC) #28
Message was sent while issue was closed.
Change committed as 280107

Powered by Google App Engine
This is Rietveld 408576698