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

Unified Diff: components/browser_watcher/postmortem_report_collector.cc

Issue 2372633002: Use the correct product/version for postmortem reports (Closed)
Patch Set: Merge 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..60602008ae684b67f6f3765d4198ef8d69d2893d 100644
--- a/components/browser_watcher/postmortem_report_collector.cc
+++ b/components/browser_watcher/postmortem_report_collector.cc
@@ -6,14 +6,15 @@
#include <utility>
+#include "base/callback.h"
#include "base/debug/activity_analyzer.h"
#include "base/files/file_enumerator.h"
#include "base/files/file_util.h"
#include "base/logging.h"
#include "base/metrics/histogram_macros.h"
#include "base/path_service.h"
+#include "base/strings/utf_string_conversions.h"
#include "components/browser_watcher/postmortem_minidump_writer.h"
-#include "components/version_info/version_info.h"
#include "third_party/crashpad/crashpad/client/settings.h"
#include "third_party/crashpad/crashpad/util/misc/uuid.h"
@@ -25,6 +26,18 @@ using base::debug::GlobalActivityAnalyzer;
using base::debug::ThreadActivityAnalyzer;
using crashpad::CrashReportDatabase;
+PostmortemReportCollector::PostmortemReportCollector(
+ const GetExecutableDetailsCallback& exe_details_cb) {
+ DCHECK(!exe_details_cb.is_null());
+
+ base::string16 product_name, version_number, channel_name;
+ exe_details_cb.Run(&product_name, &version_number, &channel_name);
+
+ product_name_ = base::UTF16ToUTF8(product_name);
+ version_number_ = base::UTF16ToUTF8(version_number);
+ channel_name_ = base::UTF16ToUTF8(channel_name);
+}
+
int PostmortemReportCollector::CollectAndSubmitForUpload(
const base::FilePath& debug_info_dir,
const base::FilePath::StringType& debug_file_pattern,
@@ -190,8 +203,18 @@ bool PostmortemReportCollector::WriteReportToMinidump(
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();
+ // TODO(manzagop): replace this information, i.e. the reporter's attributes,
+ // by that of the reportee. Doing so requires adding this information to the
+ // stability report. In the meantime, there is a tolerable information
+ // mismatch after upgrades.
+ minidump_info.product_name = product_name();
+ minidump_info.version_number = version_number();
+ minidump_info.channel_name = 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