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 2836823002: Fix DCHECH errors on 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/app/headless_shell.cc ('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/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 c45408f9e38013ca3c1602cb97439a2633178ea7..0bc9ab655a50646c8602f235a61e2e829d803304 100644
--- a/headless/lib/browser/headless_browser_impl.cc
+++ b/headless/lib/browser/headless_browser_impl.cc
@@ -196,16 +196,24 @@ HeadlessBrowserContext* HeadlessBrowserImpl::GetBrowserContextForId(
return find_it->second.get();
}
-#if !defined(OS_WIN)
+#if defined(OS_WIN)
+void RunChildProcessIfNeeded(HINSTANCE instance,
+ sandbox::SandboxInterfaceInfo* sandbox_info) {
+ base::CommandLine::Init(0, nullptr);
+ HeadlessBrowser::Options::Builder builder(0, nullptr);
+ builder.SetInstance(instance);
+ builder.SetSandboxInfo(std::move(sandbox_info));
+#else
void RunChildProcessIfNeeded(int argc, const char** argv) {
base::CommandLine::Init(argc, argv);
+ HeadlessBrowser::Options::Builder builder(argc, argv);
+#endif // defined(OS_WIN)
const base::CommandLine& command_line(
*base::CommandLine::ForCurrentProcess());
if (!command_line.HasSwitch(::switches::kProcessType))
return;
- HeadlessBrowser::Options::Builder builder(argc, argv);
if (command_line.HasSwitch(switches::kUserAgent)) {
std::string ua = command_line.GetSwitchValueASCII(switches::kUserAgent);
if (net::HttpUtil::IsValidHeaderValue(ua))
@@ -215,7 +223,6 @@ void RunChildProcessIfNeeded(int argc, const char** argv) {
exit(RunContentMain(builder.Build(),
base::Callback<void(HeadlessBrowser*)>()));
}
-#endif // !defined(OS_WIN)
int HeadlessBrowserMain(
HeadlessBrowser::Options options,
« no previous file with comments | « headless/app/headless_shell.cc ('k') | headless/lib/headless_content_main_delegate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698