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. |