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

Unified Diff: headless/app/headless_shell.cc

Issue 2835913002: Added crashpad support for Windows (Closed)
Patch Set: Added comment Created 3 years, 7 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/BUILD.gn ('k') | headless/lib/headless_content_main_delegate.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: headless/app/headless_shell.cc
diff --git a/headless/app/headless_shell.cc b/headless/app/headless_shell.cc
index 244d3381d508716c82746ff1659bc7684c27f349..244e36d27a726be8bf35f4ef4ff703f07c40938c 100644
--- a/headless/app/headless_shell.cc
+++ b/headless/app/headless_shell.cc
@@ -32,6 +32,8 @@
#include "ui/gfx/geometry/size.h"
#if defined(OS_WIN)
+#include "components/crash/content/app/crash_switches.h"
+#include "components/crash/content/app/run_as_crashpad_handler_win.h"
#include "sandbox/win/src/sandbox_types.h"
#endif
@@ -547,6 +549,15 @@ bool ValidateCommandLine(const base::CommandLine& command_line) {
int HeadlessShellMain(HINSTANCE instance,
sandbox::SandboxInterfaceInfo* sandbox_info) {
base::CommandLine::Init(0, nullptr);
+#if defined(HEADLESS_USE_CRASPHAD)
+ std::string process_type =
+ base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII(
+ ::switches::kProcessType);
+ if (process_type == crash_reporter::switches::kCrashpadHandler) {
+ return crash_reporter::RunAsCrashpadHandler(
+ *base::CommandLine::ForCurrentProcess(), ::switches::kProcessType);
+ }
+#endif // defined(HEADLESS_USE_CRASPHAD)
RunChildProcessIfNeeded(instance, sandbox_info);
HeadlessBrowser::Options::Builder builder(0, nullptr);
builder.SetInstance(instance);
« no previous file with comments | « headless/BUILD.gn ('k') | headless/lib/headless_content_main_delegate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698