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

Unified Diff: components/metrics/metrics_log.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: components/metrics/metrics_log.cc
diff --git a/components/metrics/metrics_log.cc b/components/metrics/metrics_log.cc
index 789da555c19f0ad7a5f2da0571ffc4116e340972..32db41844628adfb84020fe2a2dcc3a3ce4e4819 100644
--- a/components/metrics/metrics_log.cc
+++ b/components/metrics/metrics_log.cc
@@ -40,8 +40,7 @@
#endif
#if defined(OS_WIN)
-// http://blogs.msdn.com/oldnewthing/archive/2004/10/25/247180.aspx
-extern "C" IMAGE_DOS_HEADER __ImageBase;
+#include "base/win/current_module.h"
#endif
using base::SampleCountIterator;
@@ -349,7 +348,7 @@ void MetricsLog::RecordEnvironment(
hardware->set_cpu_architecture(base::SysInfo::OperatingSystemArchitecture());
hardware->set_system_ram_mb(base::SysInfo::AmountOfPhysicalMemoryMB());
#if defined(OS_WIN)
- hardware->set_dll_base(reinterpret_cast<uint64_t>(&__ImageBase));
+ hardware->set_dll_base(reinterpret_cast<uint64_t>(CURRENT_MODULE()));
#endif
#if defined(OVERRIDE_OS_NAME_TO_BLIMP)

Powered by Google App Engine
This is Rietveld 408576698