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

Unified Diff: content/ppapi_plugin/ppapi_plugin_main.cc

Issue 1378353006: Implementation of dwrite font proxy and removal of dwrite font cache (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: More codereview fixes. Jumped the gun on previous patchset. Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/content_tests.gypi ('k') | content/public/common/dwrite_font_platform_win.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/ppapi_plugin/ppapi_plugin_main.cc
diff --git a/content/ppapi_plugin/ppapi_plugin_main.cc b/content/ppapi_plugin/ppapi_plugin_main.cc
index 497e195df5b0d0ea6f31a95979699a25c3f8403a..d7f5571ea204d00197acd802cd0f5f0c184b8a6c 100644
--- a/content/ppapi_plugin/ppapi_plugin_main.cc
+++ b/content/ppapi_plugin/ppapi_plugin_main.cc
@@ -19,6 +19,7 @@
#include "content/public/common/content_switches.h"
#include "content/public/common/main_function_params.h"
#include "content/public/plugin/content_plugin_client.h"
+#include "ipc/ipc_sender.h"
#include "ppapi/proxy/plugin_globals.h"
#include "ppapi/proxy/proxy_module.h"
#include "ui/base/ui_base_switches.h"
@@ -26,7 +27,7 @@
#if defined(OS_WIN)
#include "base/win/win_util.h"
#include "base/win/windows_version.h"
-#include "content/common/font_warmup_win.h"
+#include "content/child/dwrite_font_proxy/dwrite_font_proxy_init_win.h"
#include "sandbox/win/src/sandbox.h"
#include "third_party/WebKit/public/web/win/WebFontRendering.h"
#include "third_party/skia/include/ports/SkTypeface_win.h"
@@ -66,6 +67,12 @@ void SkiaPreCacheFont(const LOGFONT& logfont) {
} // namespace
+// Helper function so that we can Bind() GetBrowserSender. We can't bind it
+// directly because PluginGlobals is not ref counted.
+IPC::Sender* GetPluginGlobalsSender() {
+ return ppapi::proxy::PluginGlobals::Get()->GetBrowserSender();
+}
+
// Main function for starting the PPAPI plugin process.
int PpapiPluginMain(const MainFunctionParams& parameters) {
const base::CommandLine& command_line = parameters.command_line;
@@ -138,7 +145,7 @@ int PpapiPluginMain(const MainFunctionParams& parameters) {
gfx::win::MaybeInitializeDirectWrite();
bool use_direct_write = gfx::win::IsDirectWriteEnabled();
if (use_direct_write) {
- WarmupDirectWrite();
+ InitializeDWriteFontProxy(base::Bind(&GetPluginGlobalsSender));
} else {
SkTypeface_SetEnsureLOGFONTAccessibleProc(SkiaPreCacheFont);
}
« no previous file with comments | « content/content_tests.gypi ('k') | content/public/common/dwrite_font_platform_win.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698