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

Issue 132113015: IPC interface for font management. (Closed)

Created:
6 years, 10 months ago by bungeman-chromium
Modified:
6 years, 7 months ago
CC:
chromium-reviews, joi+watch-content_chromium.org, darin-cc_chromium.org, jam
Visibility:
Public.

Description

IPC interface for font management. This is motivated by DirectWrite, but it also designed with the idea of moving the FontConfig and CoreText IPC into this interface. Specific existing bugs this aims to avoid are 285303 and 82957. This depends on Skia CL https://codereview.chromium.org/206683002/ . To see the changes in Blink, https://codereview.chromium.org/206693003 is required. BUG=333029

Patch Set 1 : Initial proposal #

Patch Set 2 : Checkpoint #

Total comments: 32

Patch Set 3 : A bit cleaner. #

Patch Set 4 : Fix some lint. #

Patch Set 5 : #

Patch Set 6 : Match final interface and cleanup usage. #

Total comments: 7
Unified diffs Side-by-side diffs Delta from patch set Stats (+784 lines, -3 lines) Patch
A content/browser/renderer_host/fontmgr_message_filter.h View 1 2 3 4 5 1 chunk +69 lines, -0 lines 0 comments Download
A content/browser/renderer_host/fontmgr_message_filter.cc View 1 2 3 4 5 1 chunk +103 lines, -0 lines 0 comments Download
M content/browser/renderer_host/render_process_host_impl.cc View 1 2 3 4 3 chunks +9 lines, -0 lines 0 comments Download
M content/common/content_message_generator.h View 1 2 3 4 1 chunk +1 line, -0 lines 0 comments Download
A content/common/fontmgr_messages.h View 1 2 3 4 1 chunk +166 lines, -0 lines 0 comments Download
A content/common/fontmgr_messages.cc View 1 2 3 4 1 chunk +213 lines, -0 lines 7 comments Download
M content/content_browser.gypi View 1 2 3 4 1 chunk +2 lines, -0 lines 0 comments Download
M content/content_common.gypi View 1 2 3 4 1 chunk +2 lines, -0 lines 0 comments Download
M content/content_renderer.gypi View 1 2 3 4 1 chunk +2 lines, -0 lines 0 comments Download
A content/renderer/fontmgr_proxy.h View 1 2 3 4 5 1 chunk +48 lines, -0 lines 0 comments Download
A content/renderer/fontmgr_proxy.cc View 1 2 3 4 5 1 chunk +95 lines, -0 lines 0 comments Download
M content/renderer/renderer_main_platform_delegate_win.cc View 1 2 3 4 5 2 chunks +13 lines, -0 lines 0 comments Download
M ipc/ipc_message_start.h View 1 2 3 4 1 chunk +1 line, -0 lines 0 comments Download
A skia/ext/fontmgr_default_win.h View 1 2 1 chunk +13 lines, -0 lines 0 comments Download
A skia/ext/fontmgr_default_win.cc View 1 2 3 4 5 1 chunk +29 lines, -0 lines 0 comments Download
M skia/skia_chrome.gypi View 1 2 3 4 1 chunk +2 lines, -0 lines 0 comments Download
M skia/skia_library.gypi View 1 2 3 4 4 chunks +16 lines, -3 lines 0 comments Download

Messages

Total messages: 11 (0 generated)
reed1
6 years, 9 months ago (2014-03-10 17:16:54 UTC) #1
reed1
6 years, 9 months ago (2014-03-10 17:19:41 UTC) #2
brettw
I don't see any high-level problems. I noted some style nits https://codereview.chromium.org/132113015/diff/80001/content/browser/renderer_host/fontmgr_message_filter.cc File content/browser/renderer_host/fontmgr_message_filter.cc (right): ...
6 years, 9 months ago (2014-03-11 21:38:15 UTC) #3
bungeman-chromium
Cleaned up style and usage, most comments addressed (Will investigate need for SkStrings). https://codereview.chromium.org/132113015/diff/80001/content/browser/renderer_host/fontmgr_message_filter.cc File ...
6 years, 9 months ago (2014-03-13 22:33:31 UTC) #4
bungeman-chromium
PS5 addresses the issue with SkString (by removing it) now that the Skia side is ...
6 years, 9 months ago (2014-03-20 20:24:26 UTC) #5
jschuh
On 2014/03/20 20:24:26, bungeman2 wrote: > PS5 addresses the issue with SkString (by removing it) ...
6 years, 9 months ago (2014-03-20 22:13:01 UTC) #6
bungeman-chromium
On 2014/03/20 22:13:01, Justin Schuh wrote: > On 2014/03/20 20:24:26, bungeman2 wrote: > > PS5 ...
6 years, 9 months ago (2014-03-21 15:18:03 UTC) #7
bungeman-chromium
By request from Skia reviewers the interface now takes SkUnichar (int32_t) for characters, and the ...
6 years, 9 months ago (2014-03-21 22:41:44 UTC) #8
reed1
lgtm
6 years, 9 months ago (2014-03-24 13:21:58 UTC) #9
bungeman-chromium
On 2014/03/20 22:13:01, Justin Schuh wrote: > On 2014/03/20 20:24:26, bungeman2 wrote: > > PS5 ...
6 years, 9 months ago (2014-03-24 15:20:44 UTC) #10
cpu_(ooo_6.6-7.5)
6 years, 8 months ago (2014-03-26 20:02:38 UTC) #11
I am doing this review anyhow as I assume a fontmanager needs to be done anyhow
and this code seems pretty platform agnostic.

If not then please ignore my comments.

https://codereview.chromium.org/132113015/diff/160001/content/common/fontmgr_...
File content/common/fontmgr_messages.cc (right):

https://codereview.chromium.org/132113015/diff/160001/content/common/fontmgr_...
content/common/fontmgr_messages.cc:30: m->WriteData(reinterpret_cast<const char
*>(p->at(i)), p->atSize(i));
we want to avoid this 'bag of bytes' approach to IPC since it is hard to
validate, basically SkDataTableBuilder would have to have its own security
review in this case the append method just does a memcpy to create the
SkDataTable which in turn has scary methods like atStr().

I understand that some of the param traits are read on the renderer and write on
the browser, but once this kind of code lands in then it is very easy for
somebody else to reuse them in the other direction at some point.

https://codereview.chromium.org/132113015/diff/160001/content/common/fontmgr_...
content/common/fontmgr_messages.cc:52: SkDataTableBuilder builder(1024);
is there a limit in count? or the 1024 is just advisory?

https://codereview.chromium.org/132113015/diff/160001/content/common/fontmgr_...
content/common/fontmgr_messages.cc:84: count >= 0 && m->WriteInt(count) &&
m->WriteBytes(data, length);
we don't use that style in chrome afaik.

https://codereview.chromium.org/132113015/diff/160001/content/common/fontmgr_...
content/common/fontmgr_messages.cc:95: if (count < 0) {
count = -1 ?

https://codereview.chromium.org/132113015/diff/160001/content/common/fontmgr_...
content/common/fontmgr_messages.cc:100: int length = static_cast<int>(count *
sizeof(SkFontIdentity));
potential integer overflow at the * step.

https://codereview.chromium.org/132113015/diff/160001/content/common/fontmgr_...
content/common/fontmgr_messages.cc:135: m->WriteInt(0) && m->WriteBytes(NULL,
0);
same comment here of line 84 and elsewhere.

https://codereview.chromium.org/132113015/diff/160001/content/common/fontmgr_...
content/common/fontmgr_messages.cc:169: 
same comment as line 30.

Since the fonts are sent this way, how big do we expect each font to be (in
average) and how many fonts do we need to stream to render say google.com in
english, or whatever at hand number happens to be.

I guess how many bytes of fonts to render a common page would be the metric I
would like to know.

Powered by Google App Engine
This is Rietveld 408576698