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

Issue 7044012: Support getting the font list in Pepper. This currently only works out of (Closed)

Created:
9 years, 7 months ago by brettw
Modified:
9 years, 7 months ago
Reviewers:
viettrungluu
CC:
chromium-reviews, pam+watch_chromium.org, piman+watch_chromium.org, jam, darin-cc_chromium.org
Visibility:
Public.

Description

Support getting the font list in Pepper. This currently only works out of process. This adds a function to the font interface to get the font list. Since we don't have arrays or dictionaries in Pepper yet, I used a string with nulls separating the names. A previous attempt to make a "font list resource" proved excessively complicated and not actually much easier for clients to deal with. This refactors the existing font list getting that used to be in the options for the browser. I moved it to content and split it into two pieces, the synchronous version, and then an asynchronous wrapper around that which both the prefs code and the pepper code use. This cleaned up some of the preferences code, and also fixes the leak of the entire font list in the code. I used the new callback/bind system for the async font loading. I had to add BrowserThread support for the new system. This uses the PepperMessageFilter to listen for font load requests from the plugin in the browser process. This is nice because we can add stuff here and have messages serviced for both in-process and out-of-process plugins. This proved to be complicated due to the HostResolver used in some of the existing code, and thread restrictions for how to deal with it. This is why there are two modes for the filter object. I changed the delegates around for the Dispatcher. Now the PluginDispatcher has the delegate interface since the HostDispatcher didn't actually need any of them and we were accumulating a lot of empty functions in the PepperPluginRegistry. It's possible for the fonts to be loaded on Windows and Mac without IPC, since enumerating fonts should be possible inside the sandbox. I didn't implement this since it adds extra complexity and probably doesn't give that much benefit. TEST=manual BUG=none Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=85827

Patch Set 1 #

Patch Set 2 : '' #

Total comments: 33

Patch Set 3 : '' #

Unified diffs Side-by-side diffs Delta from patch set Stats (+688 lines, -450 lines) Patch
D chrome/browser/ui/webui/options/font_settings_fonts_list_loader.h View 1 chunk +0 lines, -60 lines 0 comments Download
D chrome/browser/ui/webui/options/font_settings_fonts_list_loader.cc View 1 chunk +0 lines, -48 lines 0 comments Download
M chrome/browser/ui/webui/options/font_settings_handler.h View 3 chunks +6 lines, -8 lines 0 comments Download
M chrome/browser/ui/webui/options/font_settings_handler.cc View 4 chunks +7 lines, -8 lines 0 comments Download
M chrome/browser/ui/webui/options/font_settings_utils.h View 1 chunk +0 lines, -2 lines 0 comments Download
M chrome/browser/ui/webui/options/font_settings_utils_gtk.cc View 1 2 1 chunk +2 lines, -35 lines 0 comments Download
M chrome/browser/ui/webui/options/font_settings_utils_mac.mm View 1 2 1 chunk +1 line, -18 lines 0 comments Download
M chrome/browser/ui/webui/options/font_settings_utils_win.cc View 1 2 1 chunk +2 lines, -46 lines 0 comments Download
M chrome/chrome_browser.gypi View 1 chunk +0 lines, -2 lines 0 comments Download
M content/browser/browser_thread.h View 1 2 3 chunks +29 lines, -3 lines 0 comments Download
M content/browser/browser_thread.cc View 2 chunks +70 lines, -0 lines 0 comments Download
A content/browser/font_list_async.h View 1 2 1 chunk +42 lines, -0 lines 0 comments Download
A content/browser/font_list_async.cc View 1 2 1 chunk +51 lines, -0 lines 0 comments Download
M content/browser/plugin_service.h View 1 chunk +2 lines, -1 line 0 comments Download
M content/browser/plugin_service.cc View 4 chunks +7 lines, -3 lines 0 comments Download
M content/browser/ppapi_plugin_process_host.h View 4 chunks +17 lines, -2 lines 0 comments Download
M content/browser/ppapi_plugin_process_host.cc View 1 2 1 chunk +4 lines, -2 lines 0 comments Download
M content/browser/renderer_host/pepper_message_filter.h View 3 chunks +26 lines, -2 lines 0 comments Download
M content/browser/renderer_host/pepper_message_filter.cc View 1 6 chunks +55 lines, -2 lines 0 comments Download
M content/browser/renderer_host/render_message_filter.cc View 3 chunks +13 lines, -2 lines 0 comments Download
A content/common/font_list.h View 1 2 1 chunk +26 lines, -0 lines 0 comments Download
A + content/common/font_list_gtk.cc View 2 chunks +8 lines, -8 lines 0 comments Download
A + content/common/font_list_mac.mm View 1 2 2 chunks +4 lines, -26 lines 0 comments Download
A + content/common/font_list_win.cc View 1 2 3 chunks +15 lines, -15 lines 0 comments Download
M content/common/pepper_plugin_registry.h View 3 chunks +3 lines, -7 lines 0 comments Download
M content/common/pepper_plugin_registry.cc View 1 chunk +0 lines, -19 lines 0 comments Download
M content/content_browser.gypi View 1 chunk +2 lines, -0 lines 0 comments Download
M content/content_common.gypi View 1 chunk +4 lines, -0 lines 0 comments Download
M content/ppapi_plugin/ppapi_thread.h View 3 chunks +3 lines, -2 lines 0 comments Download
M content/ppapi_plugin/ppapi_thread.cc View 2 chunks +10 lines, -5 lines 0 comments Download
M ppapi/c/dev/ppb_font_dev.h View 1 4 chunks +125 lines, -71 lines 0 comments Download
M ppapi/cpp/dev/font_dev.h View 1 chunk +1 line, -0 lines 0 comments Download
M ppapi/cpp/dev/font_dev.cc View 1 chunk +9 lines, -0 lines 0 comments Download
M ppapi/proxy/dispatcher.h View 3 chunks +0 lines, -25 lines 0 comments Download
M ppapi/proxy/dispatcher.cc View 2 chunks +0 lines, -6 lines 0 comments Download
M ppapi/proxy/host_dispatcher.cc View 1 chunk +0 lines, -1 line 0 comments Download
M ppapi/proxy/plugin_dispatcher.h View 1 2 4 chunks +31 lines, -3 lines 0 comments Download
M ppapi/proxy/plugin_dispatcher.cc View 5 chunks +13 lines, -5 lines 0 comments Download
M ppapi/proxy/ppapi_messages.h View 1 chunk +4 lines, -0 lines 0 comments Download
M ppapi/proxy/ppb_font_proxy.h View 1 chunk +11 lines, -3 lines 0 comments Download
M ppapi/proxy/ppb_font_proxy.cc View 2 chunks +24 lines, -0 lines 0 comments Download
M ppapi/shared_impl/function_group_base.h View 2 chunks +6 lines, -0 lines 0 comments Download
M ppapi/thunk/ppb_font_api.h View 1 chunk +11 lines, -0 lines 0 comments Download
M ppapi/thunk/ppb_font_thunk.cc View 2 chunks +8 lines, -0 lines 0 comments Download
M webkit/plugins/ppapi/plugin_module.cc View 1 chunk +1 line, -1 line 0 comments Download
M webkit/plugins/ppapi/ppb_font_impl.h View 1 2 2 chunks +16 lines, -4 lines 0 comments Download
M webkit/plugins/ppapi/ppb_font_impl.cc View 2 chunks +15 lines, -5 lines 0 comments Download
M webkit/plugins/ppapi/resource_tracker.cc View 1 2 2 chunks +4 lines, -0 lines 0 comments Download

Messages

Total messages: 6 (0 generated)
brettw
9 years, 7 months ago (2011-05-18 19:40:26 UTC) #1
viettrungluu
So far, so good, but there's a lot more to go through.... http://codereview.chromium.org/7044012/diff/7004/chrome/browser/ui/webui/options/font_settings_utils_gtk.cc File chrome/browser/ui/webui/options/font_settings_utils_gtk.cc ...
9 years, 7 months ago (2011-05-18 20:21:18 UTC) #2
viettrungluu
http://codereview.chromium.org/7044012/diff/7004/content/browser/ppapi_plugin_process_host.cc File content/browser/ppapi_plugin_process_host.cc (right): http://codereview.chromium.org/7044012/diff/7004/content/browser/ppapi_plugin_process_host.cc#newcode113 content/browser/ppapi_plugin_process_host.cc:113: /* ? http://codereview.chromium.org/7044012/diff/7004/content/browser/renderer_host/pepper_message_filter.cc File content/browser/renderer_host/pepper_message_filter.cc (right): http://codereview.chromium.org/7044012/diff/7004/content/browser/renderer_host/pepper_message_filter.cc#newcode315 content/browser/renderer_host/pepper_message_filter.cc:315: this, ...
9 years, 7 months ago (2011-05-18 20:40:43 UTC) #3
viettrungluu
LGTM otherwise, I think. I'm sure there's something I'll regret. http://codereview.chromium.org/7044012/diff/7004/ppapi/cpp/dev/font_dev.h File ppapi/cpp/dev/font_dev.h (right): http://codereview.chromium.org/7044012/diff/7004/ppapi/cpp/dev/font_dev.h#newcode114 ...
9 years, 7 months ago (2011-05-18 21:07:46 UTC) #4
brettw
New snap up. http://codereview.chromium.org/7044012/diff/7004/chrome/browser/ui/webui/options/font_settings_utils_mac.mm File chrome/browser/ui/webui/options/font_settings_utils_mac.mm (right): http://codereview.chromium.org/7044012/diff/7004/chrome/browser/ui/webui/options/font_settings_utils_mac.mm#newcode17 chrome/browser/ui/webui/options/font_settings_utils_mac.mm:17: // The native font settings dialog ...
9 years, 7 months ago (2011-05-18 21:14:38 UTC) #5
viettrungluu
9 years, 7 months ago (2011-05-18 21:17:39 UTC) #6
Assuming you did all the things you said you did, LGTM.

Powered by Google App Engine
This is Rietveld 408576698