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

Unified 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: 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 side-by-side diff with in-line comments
Download patch
Index: chrome_elf/chrome_elf_main.cc
diff --git a/chrome_elf/chrome_elf_main.cc b/chrome_elf/chrome_elf_main.cc
index 8ee176f9501cd57ef513e71ae17a32c8fa2ad66d..b79b5731868666e601272383f846f0c17354b637 100644
--- a/chrome_elf/chrome_elf_main.cc
+++ b/chrome_elf/chrome_elf_main.cc
@@ -6,19 +6,40 @@
#include <windows.h>
+#include "base/lazy_instance.h"
+#include "chrome/app/chrome_crash_reporter_client_win.h"
#include "chrome/install_static/install_util.h"
#include "chrome_elf/blacklist/blacklist.h"
-#include "chrome_elf/breakpad.h"
+#include "chrome_elf/blacklist/crashpad_helper.h"
+#include "components/crash/content/app/crashpad.h"
+namespace {
+
+base::LazyInstance<std::vector<crash_reporter::Report>>::Leaky
+ g_crash_reports = LAZY_INSTANCE_INITIALIZER;
+
+} // namespace
void SignalChromeElf() {
blacklist::ResetBeacon();
}
+// This helper is invoked by code in chrome.dll to retrieve the crash reports.
+// See CrashUploadListCrashpad. Note that we do not pass an std::vector here,
+// because we do not want to allocate/free in different modules. The returned
+// pointer is read-only.
+extern "C" __declspec(dllexport) void GetCrashReportsImpl(
+ const crash_reporter::Report** reports,
+ size_t* report_count) {
+ crash_reporter::GetReports(g_crash_reports.Pointer());
+ *reports = g_crash_reports.Pointer()->data();
+ *report_count = g_crash_reports.Pointer()->size();
+}
+
BOOL APIENTRY DllMain(HMODULE module, DWORD reason, LPVOID reserved) {
if (reason == DLL_PROCESS_ATTACH) {
+ ChromeCrashReporterClient::InitializeCrashReportingForProcess();
install_static::InitializeProcessType();
- InitializeCrashReporting();
__try {
blacklist::Initialize(false); // Don't force, abort if beacon is present.
« chrome/browser/crash_upload_list/crash_upload_list_crashpad.cc ('K') | « chrome_elf/chrome_elf.gyp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698