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

Side by Side Diff: tools/android/forwarder2/host_forwarder_main.cc

Issue 819223002: Make callers of CommandLine use it via the base:: namespace. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix Created 5 years, 12 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 | « tools/android/forwarder2/device_forwarder_main.cc ('k') | tools/gn/command_check.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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 <errno.h> 5 #include <errno.h>
6 #include <signal.h> 6 #include <signal.h>
7 #include <sys/types.h> 7 #include <sys/types.h>
8 #include <sys/wait.h> 8 #include <sys/wait.h>
9 #include <unistd.h> 9 #include <unistd.h>
10 10
(...skipping 388 matching lines...) Expand 10 before | Expand all | Expand 10 after
399 // Note that 0 is a valid port (used for dynamic port allocation). 399 // Note that 0 is a valid port (used for dynamic port allocation).
400 if (!base::StringToInt(s, &value) || value < 0 || 400 if (!base::StringToInt(s, &value) || value < 0 ||
401 value > std::numeric_limits<uint16>::max()) { 401 value > std::numeric_limits<uint16>::max()) {
402 LOG(ERROR) << "Could not convert string " << s << " to port"; 402 LOG(ERROR) << "Could not convert string " << s << " to port";
403 ExitWithUsage(); 403 ExitWithUsage();
404 } 404 }
405 return value; 405 return value;
406 } 406 }
407 407
408 int RunHostForwarder(int argc, char** argv) { 408 int RunHostForwarder(int argc, char** argv) {
409 CommandLine::Init(argc, argv); 409 base::CommandLine::Init(argc, argv);
410 const CommandLine& cmd_line = *CommandLine::ForCurrentProcess(); 410 const base::CommandLine& cmd_line = *base::CommandLine::ForCurrentProcess();
411 bool kill_server = false; 411 bool kill_server = false;
412 412
413 Pickle pickle; 413 Pickle pickle;
414 pickle.WriteString( 414 pickle.WriteString(
415 cmd_line.HasSwitch("serial-id") ? 415 cmd_line.HasSwitch("serial-id") ?
416 cmd_line.GetSwitchValueASCII("serial-id") : std::string()); 416 cmd_line.GetSwitchValueASCII("serial-id") : std::string());
417 417
418 const std::vector<std::string> args = cmd_line.GetArgs(); 418 const std::vector<std::string> args = cmd_line.GetArgs();
419 if (cmd_line.HasSwitch("kill-server")) { 419 if (cmd_line.HasSwitch("kill-server")) {
420 kill_server = true; 420 kill_server = true;
(...skipping 27 matching lines...) Expand all
448 448
449 return client_delegate.has_failed() || daemon_delegate.has_failed(); 449 return client_delegate.has_failed() || daemon_delegate.has_failed();
450 } 450 }
451 451
452 } // namespace 452 } // namespace
453 } // namespace forwarder2 453 } // namespace forwarder2
454 454
455 int main(int argc, char** argv) { 455 int main(int argc, char** argv) {
456 return forwarder2::RunHostForwarder(argc, argv); 456 return forwarder2::RunHostForwarder(argc, argv);
457 } 457 }
OLDNEW
« no previous file with comments | « tools/android/forwarder2/device_forwarder_main.cc ('k') | tools/gn/command_check.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698