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

Unified Diff: headless/app/headless_shell.cc

Issue 2835913002: Added crashpad support for Windows (Closed)
Patch Set: 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/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 dfab4bac8c94401b936c55568e3e0d2a04524795..bd0638d7a58ec6d2941b8c4abacf0350a2ab637e 100644
--- a/headless/app/headless_shell.cc
+++ b/headless/app/headless_shell.cc
@@ -30,6 +30,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
@@ -505,6 +507,15 @@ bool ValidateCommandLine(const base::CommandLine& command_line) {
#if defined(OS_WIN)
int HeadlessShellMain(HINSTANCE instance,
sandbox::SandboxInterfaceInfo* sandbox_info) {
+ base::CommandLine::Init(0, nullptr);
+ 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);
+ }
+
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