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

Side by Side Diff: components/browser_watcher/postmortem_report_collector.cc

Issue 2372633002: Use the correct product/version for postmortem reports (Closed)
Patch Set: Created 4 years, 2 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 unified diff | Download patch
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "components/browser_watcher/postmortem_report_collector.h" 5 #include "components/browser_watcher/postmortem_report_collector.h"
6 6
7 #include <string>
7 #include <utility> 8 #include <utility>
8 9
9 #include "base/debug/activity_analyzer.h" 10 #include "base/debug/activity_analyzer.h"
10 #include "base/files/file_enumerator.h" 11 #include "base/files/file_enumerator.h"
11 #include "base/files/file_util.h" 12 #include "base/files/file_util.h"
12 #include "base/logging.h" 13 #include "base/logging.h"
13 #include "base/metrics/histogram_macros.h" 14 #include "base/metrics/histogram_macros.h"
14 #include "base/path_service.h" 15 #include "base/path_service.h"
16 #include "base/strings/string16.h"
17 #include "base/strings/utf_string_conversions.h"
15 #include "components/browser_watcher/postmortem_minidump_writer.h" 18 #include "components/browser_watcher/postmortem_minidump_writer.h"
16 #include "components/version_info/version_info.h" 19 #include "components/crash/content/app/crash_reporter_client.h"
17 #include "third_party/crashpad/crashpad/client/settings.h" 20 #include "third_party/crashpad/crashpad/client/settings.h"
18 #include "third_party/crashpad/crashpad/util/misc/uuid.h" 21 #include "third_party/crashpad/crashpad/util/misc/uuid.h"
19 22
20 using base::FilePath; 23 using base::FilePath;
21 24
22 namespace browser_watcher { 25 namespace browser_watcher {
23 26
24 using base::debug::GlobalActivityAnalyzer; 27 using base::debug::GlobalActivityAnalyzer;
25 using base::debug::ThreadActivityAnalyzer; 28 using base::debug::ThreadActivityAnalyzer;
26 using crashpad::CrashReportDatabase; 29 using crashpad::CrashReportDatabase;
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after
180 } 183 }
181 184
182 return SUCCESS; 185 return SUCCESS;
183 } 186 }
184 187
185 bool PostmortemReportCollector::WriteReportToMinidump( 188 bool PostmortemReportCollector::WriteReportToMinidump(
186 const StabilityReport& report, 189 const StabilityReport& report,
187 const crashpad::UUID& client_id, 190 const crashpad::UUID& client_id,
188 const crashpad::UUID& report_id, 191 const crashpad::UUID& report_id,
189 base::PlatformFile minidump_file) { 192 base::PlatformFile minidump_file) {
193 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
194 wchar_t exe_file[MAX_PATH] = {};
195 CHECK(::GetModuleFileName(nullptr, exe_file, arraysize(exe_file)));
196 base::string16 product_name, version_number, special_build, channel_name;
197 reporter_client->GetProductNameAndVersion(
198 exe_file, &product_name, &version_number, &special_build, &channel_name);
199
190 MinidumpInfo minidump_info; 200 MinidumpInfo minidump_info;
191 minidump_info.client_id = client_id; 201 minidump_info.client_id = client_id;
192 minidump_info.report_id = report_id; 202 minidump_info.report_id = report_id;
193 minidump_info.product_name = version_info::GetProductName(); 203 minidump_info.product_name = base::UTF16ToUTF8(product_name);
194 minidump_info.version_number = version_info::GetVersionNumber(); 204 minidump_info.version_number = base::UTF16ToUTF8(version_number);
205 minidump_info.channel_name = base::UTF16ToUTF8(channel_name);
206 #if defined(ARCH_CPU_X86)
207 minidump_info.platform = std::string("Win32");
208 #elif defined(ARCH_CPU_X86_64)
209 minidump_info.platform = std::string("Win64");
210 #endif
195 211
196 return WritePostmortemDump(minidump_file, report, minidump_info); 212 return WritePostmortemDump(minidump_file, report, minidump_info);
197 } 213 }
198 214
199 } // namespace browser_watcher 215 } // namespace browser_watcher
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698