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

Unified Diff: chrome/child/pdf_child_init.cc

Issue 899033002: Revert of Combine PDF plugin into the Chromium binary. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 10 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 | « chrome/browser/resources/pdf/pdf_extension_test.cc ('k') | chrome/chrome.isolate » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/child/pdf_child_init.cc
diff --git a/chrome/child/pdf_child_init.cc b/chrome/child/pdf_child_init.cc
index 1178f4698b2b1e75d7902211b804bdcb421b897d..ac17072a22aa3edc72ca11f75211c3ba6722c9a3 100644
--- a/chrome/child/pdf_child_init.cc
+++ b/chrome/child/pdf_child_init.cc
@@ -59,20 +59,15 @@
#if defined(OS_WIN)
// Need to patch a few functions for font loading to work correctly. This can
// be removed once we switch PDF to use Skia.
- HMODULE current_module = NULL;
- wchar_t current_module_name[MAX_PATH];
- CHECK(GetModuleHandleEx(GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS,
- reinterpret_cast<LPCWSTR>(InitializePDF),
- &current_module));
- DWORD result = GetModuleFileNameW(current_module, current_module_name,
- MAX_PATH);
- if (!result || result == MAX_PATH)
- return;
- g_iat_patch_createdca.Patch(current_module_name, "gdi32.dll", "CreateDCA",
- CreateDCAPatch);
- g_iat_patch_get_font_data.Patch(current_module_name, "gdi32.dll",
- "GetFontData", GetFontDataPatch);
-#endif // OS_WIN
+ base::FilePath pdf;
+ if (PathService::Get(chrome::FILE_PDF_PLUGIN, &pdf) &&
+ base::PathExists(pdf)) {
+ g_iat_patch_createdca.Patch(pdf.value().c_str(), "gdi32.dll", "CreateDCA",
+ CreateDCAPatch);
+ g_iat_patch_get_font_data.Patch(pdf.value().c_str(), "gdi32.dll",
+ "GetFontData", GetFontDataPatch);
+ }
+#endif
}
} // namespace chrome
« no previous file with comments | « chrome/browser/resources/pdf/pdf_extension_test.cc ('k') | chrome/chrome.isolate » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698