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

Side by Side Diff: headless/app/headless_shell.cc

Issue 2081423004: headless: Add a dedicated child process entrypoint (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove unneccessary include Created 4 years, 5 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 unified diff | Download patch
« no previous file with comments | « no previous file | headless/lib/browser/headless_browser_impl.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include <iostream> 5 #include <iostream>
6 #include <memory> 6 #include <memory>
7 #include <string> 7 #include <string>
8 8
9 #include "base/base64.h" 9 #include "base/base64.h"
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 267 matching lines...) Expand 10 before | Expand all | Expand 10 after
278 HeadlessBrowser* browser_; // Not owned. 278 HeadlessBrowser* browser_; // Not owned.
279 std::unique_ptr<HeadlessDevToolsClient> devtools_client_; 279 std::unique_ptr<HeadlessDevToolsClient> devtools_client_;
280 HeadlessWebContents* web_contents_; 280 HeadlessWebContents* web_contents_;
281 bool processed_page_ready_; 281 bool processed_page_ready_;
282 std::unique_ptr<net::FileStream> screenshot_file_stream_; 282 std::unique_ptr<net::FileStream> screenshot_file_stream_;
283 283
284 DISALLOW_COPY_AND_ASSIGN(HeadlessShell); 284 DISALLOW_COPY_AND_ASSIGN(HeadlessShell);
285 }; 285 };
286 286
287 int main(int argc, const char** argv) { 287 int main(int argc, const char** argv) {
288 headless::RunChildProcessIfNeeded(argc, argv);
288 HeadlessShell shell; 289 HeadlessShell shell;
289 HeadlessBrowser::Options::Builder builder(argc, argv); 290 HeadlessBrowser::Options::Builder builder(argc, argv);
290 291
291 // Enable devtools if requested. 292 // Enable devtools if requested.
292 base::CommandLine command_line(argc, argv); 293 base::CommandLine command_line(argc, argv);
293 if (command_line.HasSwitch(switches::kRemoteDebuggingPort)) { 294 if (command_line.HasSwitch(switches::kRemoteDebuggingPort)) {
294 std::string address = kDevToolsHttpServerAddress; 295 std::string address = kDevToolsHttpServerAddress;
295 if (command_line.HasSwitch(headless::switches::kRemoteDebuggingAddress)) { 296 if (command_line.HasSwitch(headless::switches::kRemoteDebuggingAddress)) {
296 address = command_line.GetSwitchValueASCII( 297 address = command_line.GetSwitchValueASCII(
297 headless::switches::kRemoteDebuggingAddress); 298 headless::switches::kRemoteDebuggingAddress);
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
330 331
331 if (command_line.HasSwitch(switches::kHostResolverRules)) { 332 if (command_line.HasSwitch(switches::kHostResolverRules)) {
332 builder.SetHostResolverRules( 333 builder.SetHostResolverRules(
333 command_line.GetSwitchValueASCII(switches::kHostResolverRules)); 334 command_line.GetSwitchValueASCII(switches::kHostResolverRules));
334 } 335 }
335 336
336 return HeadlessBrowserMain( 337 return HeadlessBrowserMain(
337 builder.Build(), 338 builder.Build(),
338 base::Bind(&HeadlessShell::OnStart, base::Unretained(&shell))); 339 base::Bind(&HeadlessShell::OnStart, base::Unretained(&shell)));
339 } 340 }
OLDNEW
« no previous file with comments | « no previous file | headless/lib/browser/headless_browser_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698