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

Unified Diff: headless/app/headless_shell.cc

Issue 2762593002: Add --headless flag to Windows (Closed)
Patch Set: fix headless_shell build Created 3 years, 9 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
Index: headless/app/headless_shell.cc
diff --git a/headless/app/headless_shell.cc b/headless/app/headless_shell.cc
index d6d6adeb758a5ef06ce2821d3973911297b22c74..d91fea3bdfa15aca2983371a047844c0fba10b07 100644
--- a/headless/app/headless_shell.cc
+++ b/headless/app/headless_shell.cc
@@ -5,6 +5,7 @@
#include <memory>
#include <sstream>
#include <string>
+#include <utility>
#include "base/base64.h"
#include "base/base_switches.h"
@@ -26,6 +27,10 @@
#include "net/base/net_errors.h"
#include "ui/gfx/geometry/size.h"
+#if defined(OS_WIN)
+#include "sandbox/win/src/sandbox_types.h"
+#endif
+
namespace headless {
namespace {
// Address where to listen to incoming DevTools connections.
@@ -430,11 +435,20 @@ bool ValidateCommandLine(const base::CommandLine& command_line) {
return true;
}
+#if defined(OS_WIN)
+int HeadlessShellMain(HINSTANCE instance,
+ sandbox::SandboxInterfaceInfo* sandbox_info) {
+ base::CommandLine::Init(0, NULL);
+ HeadlessBrowser::Options::Builder builder(0, NULL);
+ builder.SetInstance(instance);
+ builder.SetSandboxInfo(std::move(sandbox_info));
+#else
int HeadlessShellMain(int argc, const char** argv) {
base::CommandLine::Init(argc, argv);
RunChildProcessIfNeeded(argc, argv);
- HeadlessShell shell;
HeadlessBrowser::Options::Builder builder(argc, argv);
+#endif // defined(OS_WIN)
+ HeadlessShell shell;
// Enable devtools if requested.
const base::CommandLine& command_line(

Powered by Google App Engine
This is Rietveld 408576698