| OLD | NEW |
| 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 <memory> | 5 #include <memory> |
| 6 #include <sstream> | 6 #include <sstream> |
| 7 #include <string> | 7 #include <string> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/base64.h" | 10 #include "base/base64.h" |
| (...skipping 487 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 498 LOG(ERROR) << "Virtual time budget is disabled " | 498 LOG(ERROR) << "Virtual time budget is disabled " |
| 499 << "when remote debugging is enabled."; | 499 << "when remote debugging is enabled."; |
| 500 return false; | 500 return false; |
| 501 } | 501 } |
| 502 return true; | 502 return true; |
| 503 } | 503 } |
| 504 | 504 |
| 505 #if defined(OS_WIN) | 505 #if defined(OS_WIN) |
| 506 int HeadlessShellMain(HINSTANCE instance, | 506 int HeadlessShellMain(HINSTANCE instance, |
| 507 sandbox::SandboxInterfaceInfo* sandbox_info) { | 507 sandbox::SandboxInterfaceInfo* sandbox_info) { |
| 508 base::CommandLine::Init(0, nullptr); | 508 RunChildProcessIfNeeded(instance, sandbox_info); |
| 509 HeadlessBrowser::Options::Builder builder(0, nullptr); | 509 HeadlessBrowser::Options::Builder builder(0, nullptr); |
| 510 builder.SetInstance(instance); | 510 builder.SetInstance(instance); |
| 511 builder.SetSandboxInfo(std::move(sandbox_info)); | 511 builder.SetSandboxInfo(std::move(sandbox_info)); |
| 512 #else | 512 #else |
| 513 int HeadlessShellMain(int argc, const char** argv) { | 513 int HeadlessShellMain(int argc, const char** argv) { |
| 514 base::CommandLine::Init(argc, argv); | |
| 515 RunChildProcessIfNeeded(argc, argv); | 514 RunChildProcessIfNeeded(argc, argv); |
| 516 HeadlessBrowser::Options::Builder builder(argc, argv); | 515 HeadlessBrowser::Options::Builder builder(argc, argv); |
| 517 #endif // defined(OS_WIN) | 516 #endif // defined(OS_WIN) |
| 518 HeadlessShell shell; | 517 HeadlessShell shell; |
| 519 | 518 |
| 520 // Enable devtools if requested. | 519 // Enable devtools if requested. |
| 521 const base::CommandLine& command_line( | 520 const base::CommandLine& command_line( |
| 522 *base::CommandLine::ForCurrentProcess()); | 521 *base::CommandLine::ForCurrentProcess()); |
| 523 if (!ValidateCommandLine(command_line)) | 522 if (!ValidateCommandLine(command_line)) |
| 524 return EXIT_FAILURE; | 523 return EXIT_FAILURE; |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 613 | 612 |
| 614 int HeadlessShellMain(const content::ContentMainParams& params) { | 613 int HeadlessShellMain(const content::ContentMainParams& params) { |
| 615 #if defined(OS_WIN) | 614 #if defined(OS_WIN) |
| 616 return HeadlessShellMain(params.instance, params.sandbox_info); | 615 return HeadlessShellMain(params.instance, params.sandbox_info); |
| 617 #else | 616 #else |
| 618 return HeadlessShellMain(params.argc, params.argv); | 617 return HeadlessShellMain(params.argc, params.argv); |
| 619 #endif | 618 #endif |
| 620 } | 619 } |
| 621 | 620 |
| 622 } // namespace headless | 621 } // namespace headless |
| OLD | NEW |