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

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

Issue 2182213004: Use ChildThreadImpl::thread_safe_sender in font proxy if available (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix unittests 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
Index: content/child/dwrite_font_proxy/dwrite_font_proxy_win.cc
diff --git a/content/child/dwrite_font_proxy/dwrite_font_proxy_win.cc b/content/child/dwrite_font_proxy/dwrite_font_proxy_win.cc
index 932393da9ddff68d39d3864e51ec66200a0a1c21..5b9f6eb9c84a4835335f83ce6afe7e2c41356d10 100644
--- a/content/child/dwrite_font_proxy/dwrite_font_proxy_win.cc
+++ b/content/child/dwrite_font_proxy/dwrite_font_proxy_win.cc
@@ -97,7 +97,7 @@ HRESULT DWriteFontCollectionProxy::FindFamilyName(const WCHAR* family_name,
return S_OK;
}
- if (!GetSender()->Send(
+ if (!sender_.Run()->Send(
new DWriteFontProxyMsg_FindFamily(name, &family_index))) {
LogFontProxyError(FIND_FAMILY_SEND_FAILED);
return E_FAIL;
@@ -142,7 +142,7 @@ UINT32 DWriteFontCollectionProxy::GetFontFamilyCount() {
TRACE_EVENT0("dwrite", "FontProxy::GetFontFamilyCount");
uint32_t family_count = 0;
- if (!GetSender()->Send(
+ if (!sender_.Run()->Send(
new DWriteFontProxyMsg_GetFamilyCount(&family_count))) {
LogFontProxyError(GET_FAMILY_COUNT_SEND_FAILED);
return 0;
@@ -195,7 +195,7 @@ HRESULT DWriteFontCollectionProxy::CreateEnumeratorFromKey(
std::vector<base::string16> file_names;
std::vector<IPC::PlatformFileForTransit> file_handles;
- if (!GetSender()->Send(new DWriteFontProxyMsg_GetFontFiles(
+ if (!sender_.Run()->Send(new DWriteFontProxyMsg_GetFontFiles(
*family_index, &file_names, &file_handles))) {
LogFontProxyError(GET_FONT_FILES_SEND_FAILED);
return E_FAIL;
@@ -259,11 +259,11 @@ HRESULT DWriteFontCollectionProxy::CreateStreamFromKey(
HRESULT DWriteFontCollectionProxy::RuntimeClassInitialize(
IDWriteFactory* factory,
- IPC::Sender* sender_override) {
+ const base::Callback<IPC::Sender*(void)>& sender) {
DCHECK(factory);
factory_ = factory;
- sender_override_ = sender_override;
+ sender_ = sender;
HRESULT hr = factory->RegisterFontCollectionLoader(this);
DCHECK(SUCCEEDED(hr));
@@ -314,7 +314,7 @@ bool DWriteFontCollectionProxy::LoadFamilyNames(
TRACE_EVENT0("dwrite", "FontProxy::LoadFamilyNames");
std::vector<std::pair<base::string16, base::string16>> strings;
- if (!GetSender()->Send(
+ if (!sender_.Run()->Send(
new DWriteFontProxyMsg_GetFamilyNames(family_index, &strings))) {
return false;
}
@@ -347,10 +347,6 @@ bool DWriteFontCollectionProxy::CreateFamily(UINT32 family_index) {
return true;
}
-IPC::Sender* DWriteFontCollectionProxy::GetSender() {
- return sender_override_ ? sender_override_ : ChildThread::Get();
jam 2016/07/28 16:34:31 you can fix this by changing ChildThread::Get() t
Ilya Kulshin 2016/07/28 19:01:13 thread_safe_sender still needs to be called from t
-}
-
DWriteFontFamilyProxy::DWriteFontFamilyProxy() = default;
DWriteFontFamilyProxy::~DWriteFontFamilyProxy() = default;

Powered by Google App Engine
This is Rietveld 408576698