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

Unified Diff: components/browser_watcher/postmortem_report_collector.cc

Issue 2372633002: Use the correct product/version for postmortem reports (Closed)
Patch Set: Created 4 years, 3 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/browser_watcher/postmortem_report_collector.cc
diff --git a/components/browser_watcher/postmortem_report_collector.cc b/components/browser_watcher/postmortem_report_collector.cc
index 8d16952414a433bce6f6e40eed6898d7fde5fd2f..715438712f50b4f8a68267244b500736956ad0d2 100644
--- a/components/browser_watcher/postmortem_report_collector.cc
+++ b/components/browser_watcher/postmortem_report_collector.cc
@@ -4,6 +4,7 @@
#include "components/browser_watcher/postmortem_report_collector.h"
+#include <string>
#include <utility>
#include "base/debug/activity_analyzer.h"
@@ -12,8 +13,10 @@
#include "base/logging.h"
#include "base/metrics/histogram_macros.h"
#include "base/path_service.h"
+#include "base/strings/string16.h"
+#include "base/strings/utf_string_conversions.h"
#include "components/browser_watcher/postmortem_minidump_writer.h"
-#include "components/version_info/version_info.h"
+#include "components/crash/content/app/crash_reporter_client.h"
#include "third_party/crashpad/crashpad/client/settings.h"
#include "third_party/crashpad/crashpad/util/misc/uuid.h"
@@ -187,11 +190,24 @@ bool PostmortemReportCollector::WriteReportToMinidump(
const crashpad::UUID& client_id,
const crashpad::UUID& report_id,
base::PlatformFile minidump_file) {
+ CrashReporterClient* reporter_client = GetCrashReporterClient();
grt (UTC plus 2) 2016/09/26 18:59:06 does this compile? GetCrashReporterClient is withi
manzagop (departed) 2016/09/27 19:37:52 It did. Not sure why though. Removed this code as
+ wchar_t exe_file[MAX_PATH] = {};
+ CHECK(::GetModuleFileName(nullptr, exe_file, arraysize(exe_file)));
+ base::string16 product_name, version_number, special_build, channel_name;
+ reporter_client->GetProductNameAndVersion(
+ exe_file, &product_name, &version_number, &special_build, &channel_name);
+
MinidumpInfo minidump_info;
minidump_info.client_id = client_id;
minidump_info.report_id = report_id;
- minidump_info.product_name = version_info::GetProductName();
- minidump_info.version_number = version_info::GetVersionNumber();
+ minidump_info.product_name = base::UTF16ToUTF8(product_name);
+ minidump_info.version_number = base::UTF16ToUTF8(version_number);
+ minidump_info.channel_name = base::UTF16ToUTF8(channel_name);
+#if defined(ARCH_CPU_X86)
+ minidump_info.platform = std::string("Win32");
+#elif defined(ARCH_CPU_X86_64)
+ minidump_info.platform = std::string("Win64");
+#endif
return WritePostmortemDump(minidump_file, report, minidump_info);
}

Powered by Google App Engine
This is Rietveld 408576698