Chromium Code Reviews| 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..c8e6d59143889c4b697b9374e458035320ba0fe0 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 |
| + g_crash_reports = LAZY_INSTANCE_INITIALIZER; |
| + |
| +} // namespace |
| void SignalChromeElf() { |
| blacklist::ResetBeacon(); |
| } |
| +// This helper is looked up in the browser to retrieve the crash reports. See |
|
robertshield
2016/06/22 04:09:32
perhaps s/looked up in the browser/looked up by co
ananta
2016/06/22 19:30:33
Done.
|
| +// 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(); |
| __try { |
| blacklist::Initialize(false); // Don't force, abort if beacon is present. |