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

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: 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 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..c41273a59ba416f20700d4c38e9d7a773d10cb99 100644
--- a/chrome_elf/chrome_elf_main.cc
+++ b/chrome_elf/chrome_elf_main.cc
@@ -6,19 +6,39 @@
#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/crashpad_helper.h"
+#include "components/crash/content/app/crashpad.h"
+namespace {
+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.
+ 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) {
install_static::InitializeProcessType();
- InitializeCrashReporting();
+ 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
__try {
blacklist::Initialize(false); // Don't force, abort if beacon is present.

Powered by Google App Engine
This is Rietveld 408576698