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, |