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

Unified Diff: chrome/browser/chrome_browser_field_trials_desktop.cc

Issue 2622863004: Record chrome module information (Closed)
Patch Set: Address siggi's comments Created 3 years, 11 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 | « no previous file | components/browser_watcher/stability_data_names.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chrome_browser_field_trials_desktop.cc
diff --git a/chrome/browser/chrome_browser_field_trials_desktop.cc b/chrome/browser/chrome_browser_field_trials_desktop.cc
index 03dc9668865178c351c9ef859f157a38f4f957af..5eb97f5229fc0be8d4344ce17744c5197538e188 100644
--- a/chrome/browser/chrome_browser_field_trials_desktop.cc
+++ b/chrome/browser/chrome_browser_field_trials_desktop.cc
@@ -29,10 +29,16 @@
#include "media/media_features.h"
#if defined(OS_WIN)
+#include "base/win/pe_image.h"
#include "chrome/install_static/install_util.h"
#include "components/browser_watcher/stability_data_names.h"
#endif
+#if defined(OS_WIN)
+// http://blogs.msdn.com/oldnewthing/archive/2004/10/25/247180.aspx
+extern "C" IMAGE_DOS_HEADER __ImageBase;
+#endif
+
namespace chrome {
namespace {
@@ -109,11 +115,11 @@ void SetupStabilityDebugging() {
stability_file, kMemorySize, kAllocatorId,
browser_watcher::kStabilityDebuggingFeature.name, kStackDepth);
- // Record basic information: product, version, channel, special build and
- // platform.
+ // Record basic information.
base::debug::GlobalActivityTracker* global_tracker =
base::debug::GlobalActivityTracker::Get();
if (global_tracker) {
+ // Record product, version, channel, special build and platform.
wchar_t exe_file[MAX_PATH] = {};
CHECK(::GetModuleFileName(nullptr, exe_file, arraysize(exe_file)));
@@ -136,6 +142,18 @@ void SetupStabilityDebugging() {
#elif defined(ARCH_CPU_X86_64)
global_data.SetString(browser_watcher::kStabilityPlatform, "Win64");
#endif
+
+ // Record information about chrome's module.
+ global_data.SetUint(browser_watcher::kStabilityModuleAddress,
+ reinterpret_cast<uint64_t>(&__ImageBase));
+
+ base::win::PEImage pe(&__ImageBase);
+ PIMAGE_NT_HEADERS headers = pe.GetNTHeaders();
+ CHECK(headers);
+ global_data.SetUint(browser_watcher::kStabilityModuleTimestamp,
+ headers->FileHeader.TimeDateStamp);
+ global_data.SetUint(browser_watcher::kStabilityModuleSize,
+ headers->OptionalHeader.SizeOfImage);
}
}
#endif // defined(OS_WIN)
« no previous file with comments | « no previous file | components/browser_watcher/stability_data_names.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698