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

Unified Diff: chrome/child/pdf_child_init.cc

Issue 1852143002: win: Remove GetModuleFromAddress, deduplicate __ImageBase code. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 4 years, 9 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: chrome/child/pdf_child_init.cc
diff --git a/chrome/child/pdf_child_init.cc b/chrome/child/pdf_child_init.cc
index 1df57329e456ba2cd9ef3f555fa327a5194ada9f..873e352f41302aa64a5e7909b722f8d977b7d7b8 100644
--- a/chrome/child/pdf_child_init.cc
+++ b/chrome/child/pdf_child_init.cc
@@ -12,6 +12,7 @@
#include "content/public/child/child_thread.h"
#if defined(OS_WIN)
+#include "base/win/current_module.h"
#include "base/win/iat_patch_function.h"
#endif
@@ -64,16 +65,11 @@ DWORD WINAPI GetFontDataPatch(HDC hdc,
} // namespace
-#if defined(OS_WIN)
-// http://blogs.msdn.com/oldnewthing/archive/2004/10/25/247180.aspx
-extern "C" IMAGE_DOS_HEADER __ImageBase;
-#endif // OS_WIN
-
void InitializePDF() {
#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 = reinterpret_cast<HMODULE>(&__ImageBase);
+ HMODULE current_module = CURRENT_MODULE();
g_iat_patch_createdca.PatchFromModule(current_module, "gdi32.dll",
"CreateDCA", CreateDCAPatch);
g_iat_patch_get_font_data.PatchFromModule(current_module, "gdi32.dll",

Powered by Google App Engine
This is Rietveld 408576698