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

Side by Side Diff: chrome/browser/crash_upload_list/crash_upload_list_crashpad.cc

Issue 2088133002: Switch chrome_elf exception handling from breakpad to crashpad. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address review comments Created 4 years, 6 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "chrome/browser/crash_upload_list/crash_upload_list_crashpad.h" 5 #include "chrome/browser/crash_upload_list/crash_upload_list_crashpad.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include "base/threading/sequenced_worker_pool.h" 9 #include "base/threading/sequenced_worker_pool.h"
10 #include "base/time/time.h" 10 #include "base/time/time.h"
11 #include "build/build_config.h" 11 #include "build/build_config.h"
12 #include "chrome/common/chrome_constants.h" 12 #include "chrome/common/chrome_constants.h"
scottmg 2016/06/22 21:18:24 This can be removed I think. (Is there a constant
ananta 2016/06/22 21:25:08 Thanks. done. There is no constant for chrome_elf.
13 #include "components/crash/content/app/crashpad.h" 13 #include "components/crash/content/app/crashpad.h"
14 14
15 namespace { 15 namespace {
16 16
17 #if defined(OS_WIN) 17 #if defined(OS_WIN)
18 typedef void (*GetCrashReportsPointer)( 18 typedef void (*GetCrashReportsPointer)(
19 const crash_reporter::Report** reports, 19 const crash_reporter::Report** reports,
20 size_t* report_count); 20 size_t* report_count);
21 21
22 void GetReportsThunk( 22 void GetReportsThunk(
23 std::vector<crash_reporter::Report>* reports) { 23 std::vector<crash_reporter::Report>* reports) {
24 static GetCrashReportsPointer get_crash_reports = []() { 24 static GetCrashReportsPointer get_crash_reports = []() {
25 HMODULE exe_module = GetModuleHandle(chrome::kBrowserProcessExecutableName); 25 // The crash reporting is handled by chrome_elf.dll which loads early in
26 // the chrome process.
27 HMODULE elf_module = GetModuleHandle(L"chrome_elf.dll");
26 return reinterpret_cast<GetCrashReportsPointer>( 28 return reinterpret_cast<GetCrashReportsPointer>(
27 exe_module ? GetProcAddress(exe_module, "GetCrashReportsImpl") 29 elf_module ? GetProcAddress(elf_module, "GetCrashReportsImpl")
28 : nullptr); 30 : nullptr);
29 }(); 31 }();
30 32
31 if (get_crash_reports) { 33 if (get_crash_reports) {
32 const crash_reporter::Report* reports_pointer; 34 const crash_reporter::Report* reports_pointer;
33 size_t report_count; 35 size_t report_count;
34 get_crash_reports(&reports_pointer, &report_count); 36 get_crash_reports(&reports_pointer, &report_count);
35 *reports = std::vector<crash_reporter::Report>( 37 *reports = std::vector<crash_reporter::Report>(
36 reports_pointer, reports_pointer + report_count); 38 reports_pointer, reports_pointer + report_count);
37 } 39 }
38 } 40 }
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
77 crash_reporter::GetReports(&reports); 79 crash_reporter::GetReports(&reports);
78 #endif 80 #endif
79 81
80 for (const crash_reporter::Report& report : reports) { 82 for (const crash_reporter::Report& report : reports) {
81 uploads->push_back( 83 uploads->push_back(
82 UploadInfo(report.remote_id, base::Time::FromTimeT(report.upload_time), 84 UploadInfo(report.remote_id, base::Time::FromTimeT(report.upload_time),
83 report.local_id, base::Time::FromTimeT(report.capture_time), 85 report.local_id, base::Time::FromTimeT(report.capture_time),
84 ReportUploadStateToUploadInfoState(report.state))); 86 ReportUploadStateToUploadInfoState(report.state)));
85 } 87 }
86 } 88 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698