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 d5da2bea7d04ff36461f250c2a53cff8d21df9dc..da083233fb2f7fccb082bb85c9d33e77b69249e9 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 |
@@ -31,13 +31,33 @@ |
// Windows-only DirectWrite support. These warm up the DirectWrite paths |
// before sandbox lock down to allow Skia access to the Font Manager service. |
void CreateDirectWriteFactory(IDWriteFactory** factory) { |
+ typedef decltype(DWriteCreateFactory)* DWriteCreateFactoryProc; |
+ HMODULE dwrite_dll = LoadLibraryW(L"dwrite.dll"); |
+ // TODO(scottmg): Temporary code to track crash in http://crbug.com/387867. |
+ if (!dwrite_dll) { |
+ DWORD load_library_get_last_error = GetLastError(); |
+ base::debug::Alias(&dwrite_dll); |
+ base::debug::Alias(&load_library_get_last_error); |
+ CHECK(false); |
+ } |
+ |
// This shouldn't be necessary, but not having this causes breakage in |
// content_browsertests, and possibly other high-stress cases. |
PatchServiceManagerCalls(); |
- CHECK(SUCCEEDED(DWriteCreateFactory(DWRITE_FACTORY_TYPE_ISOLATED, |
- __uuidof(IDWriteFactory), |
- reinterpret_cast<IUnknown**>(factory)))); |
+ DWriteCreateFactoryProc dwrite_create_factory_proc = |
+ reinterpret_cast<DWriteCreateFactoryProc>( |
+ GetProcAddress(dwrite_dll, "DWriteCreateFactory")); |
+ // TODO(scottmg): Temporary code to track crash in http://crbug.com/387867. |
+ if (!dwrite_create_factory_proc) { |
+ DWORD get_proc_address_get_last_error = GetLastError(); |
+ base::debug::Alias(&dwrite_create_factory_proc); |
+ base::debug::Alias(&get_proc_address_get_last_error); |
+ CHECK(false); |
+ } |
+ CHECK(SUCCEEDED(dwrite_create_factory_proc( |
+ DWRITE_FACTORY_TYPE_ISOLATED, __uuidof(IDWriteFactory), |
+ reinterpret_cast<IUnknown**>(factory)))); |
} |
} // namespace |