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

Side by Side Diff: chrome_elf/chrome_elf_main.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: Update commments and attempt to fix dependency failure 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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_elf/chrome_elf_main.h" 5 #include "chrome_elf/chrome_elf_main.h"
6 6
7 #include <windows.h> 7 #include <windows.h>
8 8
9 #include "base/lazy_instance.h"
10 #include "chrome/app/chrome_crash_reporter_client_win.h"
9 #include "chrome/install_static/install_util.h" 11 #include "chrome/install_static/install_util.h"
10 #include "chrome_elf/blacklist/blacklist.h" 12 #include "chrome_elf/blacklist/blacklist.h"
11 #include "chrome_elf/breakpad.h" 13 #include "chrome_elf/crashpad_helper.h"
14 #include "components/crash/content/app/crashpad.h"
12 15
16 namespace {
17 base::LazyInstance<std::vector<crash_reporter::Report>>::Leaky
scottmg 2016/06/22 19:38:07 Add \n here, or remove after definition.
ananta 2016/06/22 21:08:20 Done.
18 g_crash_reports = LAZY_INSTANCE_INITIALIZER;
19
20 } // namespace
13 21
14 void SignalChromeElf() { 22 void SignalChromeElf() {
15 blacklist::ResetBeacon(); 23 blacklist::ResetBeacon();
16 } 24 }
17 25
26 // This helper is invoked by code in chrome.dll to retrieve the crash reports.
27 // See CrashUploadListCrashpad. Note that we do not pass an std::vector here,
28 // because we do not want to allocate/free in different modules. The returned
29 // pointer is read-only.
30 extern "C" __declspec(dllexport) void GetCrashReportsImpl(
31 const crash_reporter::Report** reports,
32 size_t* report_count) {
33 crash_reporter::GetReports(g_crash_reports.Pointer());
34 *reports = g_crash_reports.Pointer()->data();
35 *report_count = g_crash_reports.Pointer()->size();
36 }
37
18 BOOL APIENTRY DllMain(HMODULE module, DWORD reason, LPVOID reserved) { 38 BOOL APIENTRY DllMain(HMODULE module, DWORD reason, LPVOID reserved) {
19 if (reason == DLL_PROCESS_ATTACH) { 39 if (reason == DLL_PROCESS_ATTACH) {
20 install_static::InitializeProcessType(); 40 install_static::InitializeProcessType();
21 InitializeCrashReporting(); 41 ChromeCrashReporterClient::InitializeCrashReportingForProcess();
scottmg 2016/06/22 19:38:07 It looks like InitializeCrashReportingForProcess r
ananta 2016/06/22 21:08:20 Switched the order. g_process_type identifies a pr
22 42
23 __try { 43 __try {
24 blacklist::Initialize(false); // Don't force, abort if beacon is present. 44 blacklist::Initialize(false); // Don't force, abort if beacon is present.
25 } __except(GenerateCrashDump(GetExceptionInformation())) { 45 } __except(GenerateCrashDump(GetExceptionInformation())) {
26 } 46 }
27 } 47 }
28 48
29 return TRUE; 49 return TRUE;
30 } 50 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698