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

Unified Diff: chrome/browser/chrome_browser_field_trials_desktop.cc

Issue 2556813002: Record executable version details to stability file (Closed)
Patch Set: Merge Created 4 years 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/BUILD.gn ('k') | components/browser_watcher/BUILD.gn » ('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 6b562d565c9d1ab2b064348e2fe35648272d8bd0..3634168cb7e1cd3d842b0b3815c087b7e1a34004 100644
--- a/chrome/browser/chrome_browser_field_trials_desktop.cc
+++ b/chrome/browser/chrome_browser_field_trials_desktop.cc
@@ -4,6 +4,10 @@
#include "chrome/browser/chrome_browser_field_trials_desktop.h"
+#if defined(OS_WIN)
+#include <windows.h>
+#endif
+
#include <map>
#include <string>
@@ -24,6 +28,8 @@
#include "media/media_features.h"
#if defined(OS_WIN)
+#include "chrome/install_static/install_util.h"
+#include "components/browser_watcher/stability_data_names.h"
#include "components/browser_watcher/stability_debugging_win.h"
#endif
@@ -102,6 +108,35 @@ void SetupStabilityDebugging() {
base::debug::GlobalActivityTracker::CreateWithFile(
stability_file, kMemorySize, kAllocatorId,
browser_watcher::kStabilityDebuggingFeature.name, kStackDepth);
+
+ // Record basic information: product, version, channel, special build and
+ // platform.
+ base::debug::GlobalActivityTracker* global_tracker =
+ base::debug::GlobalActivityTracker::Get();
+ if (global_tracker) {
+ wchar_t exe_file[MAX_PATH] = {};
+ CHECK(::GetModuleFileName(nullptr, exe_file, arraysize(exe_file)));
+
+ base::string16 product_name;
+ base::string16 version_number;
+ base::string16 channel_name;
+ base::string16 special_build;
+ install_static::GetExecutableVersionDetails(exe_file, &product_name,
+ &version_number, &special_build,
+ &channel_name);
+
+ base::debug::ActivityUserData& global_data = global_tracker->user_data();
+ global_data.SetString(browser_watcher::kStabilityProduct, product_name);
+ global_data.SetString(browser_watcher::kStabilityVersion, version_number);
+ global_data.SetString(browser_watcher::kStabilityChannel, channel_name);
+ global_data.SetString(browser_watcher::kStabilitySpecialBuild,
+ special_build);
+#if defined(ARCH_CPU_X86)
+ global_data.SetString(browser_watcher::kStabilityPlatform, "Win32");
+#elif defined(ARCH_CPU_X86_64)
+ global_data.SetString(browser_watcher::kStabilityPlatform, "Win64");
+#endif
+ }
}
#endif // defined(OS_WIN)
« no previous file with comments | « chrome/browser/BUILD.gn ('k') | components/browser_watcher/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698