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

Unified Diff: chrome/app/chrome_exe_main_win.cc

Issue 2123443002: Revert of Switch chrome_elf exception handling from breakpad to crashpad (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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
« no previous file with comments | « chrome/app/chrome_crash_reporter_client_win.cc ('k') | chrome/app/chrome_main.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/app/chrome_exe_main_win.cc
diff --git a/chrome/app/chrome_exe_main_win.cc b/chrome/app/chrome_exe_main_win.cc
index ccc27ed8883aae3addee9ea6a332ae9e7151afb2..86677bf87e7255515594a1417cf827e4257dc42f 100644
--- a/chrome/app/chrome_exe_main_win.cc
+++ b/chrome/app/chrome_exe_main_win.cc
@@ -23,6 +23,7 @@
#include "base/time/time.h"
#include "base/win/registry.h"
#include "base/win/windows_version.h"
+#include "chrome/app/chrome_crash_reporter_client_win.h"
#include "chrome/app/main_dll_loader_win.h"
#include "chrome/browser/policy/policy_path_parser.h"
#include "chrome/browser/win/chrome_process_finder.h"
@@ -30,6 +31,7 @@
#include "chrome/common/chrome_switches.h"
#include "chrome/installer/util/browser_distribution.h"
#include "chrome_elf/chrome_elf_main.h"
+#include "components/crash/content/app/crash_reporter_client.h"
#include "components/crash/content/app/crash_switches.h"
#include "components/crash/content/app/crashpad.h"
#include "components/crash/content/app/run_as_crashpad_handler_win.h"
@@ -39,6 +41,12 @@
#include "content/public/common/result_codes.h"
namespace {
+
+base::LazyInstance<ChromeCrashReporterClient>::Leaky g_chrome_crash_client =
+ LAZY_INSTANCE_INITIALIZER;
+
+base::LazyInstance<std::vector<crash_reporter::Report>>::Leaky g_crash_reports =
+ LAZY_INSTANCE_INITIALIZER;
// List of switches that it's safe to rendezvous early with. Fast start should
// not be done if a command line contains a switch not in this set.
@@ -188,6 +196,18 @@
} // namespace
+// This helper is looked up in the browser 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();
+}
+
#if !defined(WIN_CONSOLE_APP)
int APIENTRY wWinMain(HINSTANCE instance, HINSTANCE prev, wchar_t*, int) {
#else
@@ -217,6 +237,10 @@
*base::CommandLine::ForCurrentProcess());
}
+ crash_reporter::SetCrashReporterClient(g_chrome_crash_client.Pointer());
+ crash_reporter::InitializeCrashpadWithEmbeddedHandler(process_type.empty(),
+ process_type);
+
startup_metric_utils::RecordExeMainEntryPointTime(base::Time::Now());
// Signal Chrome Elf that Chrome has begun to start.
« no previous file with comments | « chrome/app/chrome_crash_reporter_client_win.cc ('k') | chrome/app/chrome_main.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698