Chromium Code Reviews| 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; |