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

Unified Diff: headless/app/headless_shell.cc

Issue 2837093003: Revert of Add --headless flag to Windows (Closed)
Patch Set: Fix compilation issue 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.h ('k') | headless/app/headless_shell_main.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: headless/app/headless_shell.cc
diff --git a/headless/app/headless_shell.cc b/headless/app/headless_shell.cc
index e12d12c2a3fa3106cf6cb34bec25128cb1de992c..ff670db059b80d023d289528e3a23b4e870123f2 100644
--- a/headless/app/headless_shell.cc
+++ b/headless/app/headless_shell.cc
@@ -18,7 +18,6 @@
#include "base/memory/weak_ptr.h"
#include "base/numerics/safe_conversions.h"
#include "base/strings/string_number_conversions.h"
-#include "content/public/app/content_main.h"
#include "headless/app/headless_shell.h"
#include "headless/app/headless_shell_switches.h"
#include "headless/public/headless_devtools_target.h"
@@ -29,10 +28,6 @@
#include "net/http/http_util.h"
#include "ui/gfx/geometry/size.h"
-#if defined(OS_WIN)
-#include "sandbox/win/src/sandbox_types.h"
-#endif
-
namespace headless {
namespace {
// Address where to listen to incoming DevTools connections.
@@ -429,10 +424,10 @@ void HeadlessShell::OnFileOpened(const std::string& base64_data,
}
void HeadlessShell::OnFileWritten(const base::FilePath file_name,
- const size_t length,
+ const int length,
base::File::Error error_code,
int write_result) {
- if (write_result < static_cast<int>(length)) {
+ if (write_result < length) {
// TODO(eseckler): Support recovering from partial writes.
LOG(ERROR) << "Writing to file " << file_name.value()
<< " was unsuccessful: "
@@ -502,20 +497,11 @@ bool ValidateCommandLine(const base::CommandLine& command_line) {
return true;
}
-#if defined(OS_WIN)
-int HeadlessShellMain(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
int HeadlessShellMain(int argc, const char** argv) {
base::CommandLine::Init(argc, argv);
RunChildProcessIfNeeded(argc, argv);
- HeadlessBrowser::Options::Builder builder(argc, argv);
-#endif // defined(OS_WIN)
HeadlessShell shell;
+ HeadlessBrowser::Options::Builder builder(argc, argv);
// Enable devtools if requested.
const base::CommandLine& command_line(
@@ -523,7 +509,7 @@ int HeadlessShellMain(int argc, const char** argv) {
if (!ValidateCommandLine(command_line))
return EXIT_FAILURE;
- if (command_line.HasSwitch(switches::kEnableCrashReporter))
+ if (command_line.HasSwitch(::switches::kEnableCrashReporter))
builder.SetCrashReporterEnabled(true);
if (command_line.HasSwitch(switches::kCrashDumpsDir)) {
builder.SetCrashDumpsDir(
@@ -611,12 +597,4 @@ int HeadlessShellMain(int argc, const char** argv) {
base::Bind(&HeadlessShell::OnStart, base::Unretained(&shell)));
}
-int HeadlessShellMain(const content::ContentMainParams& params) {
-#if defined(OS_WIN)
- return HeadlessShellMain(params.instance, params.sandbox_info);
-#else
- return HeadlessShellMain(params.argc, params.argv);
-#endif
-}
-
} // namespace headless
« no previous file with comments | « headless/app/headless_shell.h ('k') | headless/app/headless_shell_main.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698