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

Unified Diff: headless/lib/headless_content_main_delegate.cc

Issue 2820453003: Reland Enable crashpad for Mac. (Closed)
Patch Set: Updated upstream Created 3 years, 8 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 | « headless/lib/headless_browser_browsertest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: headless/lib/headless_content_main_delegate.cc
diff --git a/headless/lib/headless_content_main_delegate.cc b/headless/lib/headless_content_main_delegate.cc
index 03e4b08aeb866e132645c3e7c5b07e679d6a0faa..8526274a3c0bb10061e7d9eedf241a568cac7503 100644
--- a/headless/lib/headless_content_main_delegate.cc
+++ b/headless/lib/headless_content_main_delegate.cc
@@ -36,6 +36,10 @@
#include "headless/lib/renderer/headless_content_renderer_client.h"
#endif
+#if defined(OS_MACOSX)
+#include "components/crash/content/app/crashpad.h"
+#endif
+
namespace headless {
namespace {
// Keep in sync with content/common/content_constants_internal.h.
@@ -162,16 +166,17 @@ void HeadlessContentMainDelegate::InitCrashReporter(
g_headless_crash_client.Pointer()->set_crash_dumps_dir(
browser_->options()->crash_dumps_dir);
-#if defined(OS_LINUX)
+#if defined(HEADLESS_USE_BREAKPAD)
if (!browser_->options()->enable_crash_reporter) {
DCHECK(!breakpad::IsCrashReporterEnabled());
return;
}
-#if defined(HEADLESS_USE_BREAKPAD)
if (process_type != switches::kZygoteProcess)
breakpad::InitCrashReporter(process_type);
+#elif defined(OS_MACOSX)
+ const bool browser_process = process_type.empty();
+ crash_reporter::InitializeCrashpad(browser_process, process_type);
#endif // defined(HEADLESS_USE_BREAKPAD)
-#endif // !defined(OS_LINUX)
}
void HeadlessContentMainDelegate::PreSandboxStartup() {
@@ -184,10 +189,8 @@ void HeadlessContentMainDelegate::PreSandboxStartup() {
#else
if (command_line.HasSwitch(switches::kEnableLogging))
InitLogging(command_line);
-#endif
-#if !defined(OS_MACOSX)
+#endif // defined(OS_WIN)
InitCrashReporter(command_line);
-#endif
InitializeResourceBundle();
}
« no previous file with comments | « headless/lib/headless_browser_browsertest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698