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

Unified Diff: headless/lib/browser/headless_browser_impl.cc

Issue 2762593002: Add --headless flag to Windows (Closed)
Patch Set: re-add missing HEADLESS_EXPORT and child_lib dep to headles_shell and headless_example 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
« no previous file with comments | « headless/lib/browser/DEPS ('k') | headless/lib/headless_browser_browsertest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: headless/lib/browser/headless_browser_impl.cc
diff --git a/headless/lib/browser/headless_browser_impl.cc b/headless/lib/browser/headless_browser_impl.cc
index 37a9c928ba25d33869d18a89cb9203c3e123cbd3..435f0f33b8b1e6039f8f3002a87dcfc804ff908c 100644
--- a/headless/lib/browser/headless_browser_impl.cc
+++ b/headless/lib/browser/headless_browser_impl.cc
@@ -25,11 +25,6 @@
#include "ui/events/devices/device_data_manager.h"
#include "ui/gfx/geometry/size.h"
-#if defined(OS_WIN)
-#include "content/public/app/sandbox_helper_win.h"
-#include "sandbox/win/src/sandbox_types.h"
-#endif
-
namespace headless {
namespace {
@@ -38,9 +33,10 @@ int RunContentMain(
const base::Callback<void(HeadlessBrowser*)>& on_browser_start_callback) {
content::ContentMainParams params(nullptr);
#if defined(OS_WIN)
- sandbox::SandboxInterfaceInfo sandbox_info = {0};
- content::InitializeSandboxInfo(&sandbox_info);
- params.sandbox_info = &sandbox_info;
+ // Sandbox info has to be set and initialized.
+ CHECK(options.sandbox_info);
+ params.instance = options.instance;
+ params.sandbox_info = std::move(options.sandbox_info);
#elif !defined(OS_ANDROID)
params.argc = options.argc;
params.argv = options.argv;
@@ -198,6 +194,7 @@ HeadlessBrowserContext* HeadlessBrowserImpl::GetBrowserContextForId(
return find_it->second.get();
}
+#if !defined(OS_WIN)
void RunChildProcessIfNeeded(int argc, const char** argv) {
base::CommandLine::Init(argc, argv);
if (!base::CommandLine::ForCurrentProcess()->HasSwitch(
@@ -208,6 +205,7 @@ void RunChildProcessIfNeeded(int argc, const char** argv) {
exit(RunContentMain(builder.Build(),
base::Callback<void(HeadlessBrowser*)>()));
}
+#endif
Sami 2017/03/28 11:49:33 nit: // !defined(OS_WIN)
dvallet 2017/03/29 06:27:56 Done.
dvallet 2017/03/29 06:27:56 Done.
int HeadlessBrowserMain(
HeadlessBrowser::Options options,
« no previous file with comments | « headless/lib/browser/DEPS ('k') | headless/lib/headless_browser_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698