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

Unified Diff: content/child/dwrite_font_proxy/dwrite_font_proxy_init_win.cc

Issue 2204443002: Use ChildThreadImpl::thread_safe_sender in font proxy if available (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2785
Patch Set: Created 4 years, 5 months 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/child/dwrite_font_proxy/dwrite_font_proxy_init_win.cc
diff --git a/content/child/dwrite_font_proxy/dwrite_font_proxy_init_win.cc b/content/child/dwrite_font_proxy/dwrite_font_proxy_init_win.cc
index da083233fb2f7fccb082bb85c9d33e77b69249e9..7a9a9efef80a0f36e49101e4e566929a76ef30df 100644
--- a/content/child/dwrite_font_proxy/dwrite_font_proxy_init_win.cc
+++ b/content/child/dwrite_font_proxy/dwrite_font_proxy_init_win.cc
@@ -11,9 +11,11 @@
#include "base/debug/alias.h"
#include "base/win/iat_patch_function.h"
#include "base/win/windows_version.h"
+#include "content/child/child_thread_impl.h"
#include "content/child/dwrite_font_proxy/dwrite_font_proxy_win.h"
#include "content/child/dwrite_font_proxy/font_fallback_win.h"
#include "content/child/font_warmup_win.h"
+#include "content/child/thread_safe_sender.h"
#include "skia/ext/fontmgr_default_win.h"
#include "third_party/WebKit/public/web/win/WebFontRendering.h"
#include "third_party/skia/include/ports/SkFontMgr.h"
@@ -74,9 +76,17 @@ void InitializeDWriteFontProxy() {
mswr::ComPtr<IDWriteFontFallback> font_fallback;
mswr::ComPtr<IDWriteFactory2> factory2;
+ IPC::Sender* sender = g_sender_override;
+
+ // Hack for crbug.com/631254: set the sender if we can get one, so that when
+ // Flash calls into the font proxy from a different thread we will have a
+ // sender available.
+ if (!sender && ChildThreadImpl::current())
+ sender = ChildThreadImpl::current()->thread_safe_sender();
+
if (SUCCEEDED(factory.As(&factory2)) && factory2.Get()) {
mswr::MakeAndInitialize<FontFallback>(
- &font_fallback, g_font_collection.Get(), g_sender_override);
+ &font_fallback, g_font_collection.Get(), sender);
}
sk_sp<SkFontMgr> skia_font_manager(SkFontMgr_New_DirectWrite(
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698