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

Unified Diff: components/nacl/browser/nacl_process_host.cc

Issue 774933004: Prefix CommandLine usage with base namespace (Part 9: components) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years 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 | « components/nacl/browser/nacl_broker_host_win.cc ('k') | components/nacl/common/nacl_cmd_line.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/nacl/browser/nacl_process_host.cc
diff --git a/components/nacl/browser/nacl_process_host.cc b/components/nacl/browser/nacl_process_host.cc
index 16c0da391ec5a3f7881786ecaf7d018e3e04756f..ca7b5c88236d7c956d781f3f80317d82d8b98fab 100644
--- a/components/nacl/browser/nacl_process_host.cc
+++ b/components/nacl/browser/nacl_process_host.cc
@@ -273,7 +273,7 @@ NaClProcessHost::NaClProcessHost(const GURL& manifest_url,
// for this use case.
process_->SetName(net::FormatUrl(manifest_url_, std::string()));
- enable_debug_stub_ = CommandLine::ForCurrentProcess()->HasSwitch(
+ enable_debug_stub_ = base::CommandLine::ForCurrentProcess()->HasSwitch(
switches::kEnableNaClDebug);
DCHECK(process_type_ != kUnknownNaClProcessType);
enable_crash_throttling_ = process_type_ != kNativeNaClProcessType;
@@ -310,7 +310,7 @@ NaClProcessHost::~NaClProcessHost() {
void NaClProcessHost::OnProcessCrashed(int exit_status) {
if (enable_crash_throttling_ &&
- !CommandLine::ForCurrentProcess()->HasSwitch(
+ !base::CommandLine::ForCurrentProcess()->HasSwitch(
switches::kDisablePnaclCrashThrottling)) {
NaClBrowser::GetInstance()->OnProcessCrashed();
}
@@ -326,7 +326,7 @@ void NaClProcessHost::EarlyStartup() {
// under us by autoupdate.
NaClBrowser::GetInstance()->EnsureIrtAvailable();
#endif
- CommandLine* cmd = CommandLine::ForCurrentProcess();
+ base::CommandLine* cmd = base::CommandLine::ForCurrentProcess();
UMA_HISTOGRAM_BOOLEAN(
"NaCl.nacl-gdb",
!cmd->GetSwitchValuePath(switches::kNaClGdb).empty());
@@ -364,7 +364,7 @@ void NaClProcessHost::Launch(
// Do not launch the requested NaCl module if NaCl is marked "unstable" due
// to too many crashes within a given time period.
if (enable_crash_throttling_ &&
- !CommandLine::ForCurrentProcess()->HasSwitch(
+ !base::CommandLine::ForCurrentProcess()->HasSwitch(
switches::kDisablePnaclCrashThrottling) &&
NaClBrowser::GetInstance()->IsThrottled()) {
SendErrorToRenderer("Process creation was throttled due to excessive"
@@ -373,7 +373,7 @@ void NaClProcessHost::Launch(
return;
}
- const CommandLine* cmd = CommandLine::ForCurrentProcess();
+ const base::CommandLine* cmd = base::CommandLine::ForCurrentProcess();
#if defined(OS_WIN)
if (cmd->HasSwitch(switches::kEnableNaClDebug) &&
!cmd->HasSwitch(switches::kNoSandbox)) {
@@ -455,7 +455,7 @@ void NaClProcessHost::Launch(
}
void NaClProcessHost::OnChannelConnected(int32 peer_pid) {
- if (!CommandLine::ForCurrentProcess()->GetSwitchValuePath(
+ if (!base::CommandLine::ForCurrentProcess()->GetSwitchValuePath(
switches::kNaClGdb).empty()) {
LaunchNaClGdb();
}
@@ -483,18 +483,20 @@ bool NaClProcessHost::Send(IPC::Message* msg) {
}
bool NaClProcessHost::LaunchNaClGdb() {
+ const base::CommandLine& command_line =
+ *base::CommandLine::ForCurrentProcess();
#if defined(OS_WIN)
base::FilePath nacl_gdb =
- CommandLine::ForCurrentProcess()->GetSwitchValuePath(switches::kNaClGdb);
- CommandLine cmd_line(nacl_gdb);
+ command_line.GetSwitchValuePath(switches::kNaClGdb);
+ base::CommandLine cmd_line(nacl_gdb);
#else
- CommandLine::StringType nacl_gdb =
- CommandLine::ForCurrentProcess()->GetSwitchValueNative(
- switches::kNaClGdb);
- CommandLine::StringVector argv;
+ base::CommandLine::StringType nacl_gdb =
+ command_line.GetSwitchValueNative(switches::kNaClGdb);
+ base::CommandLine::StringVector argv;
// We don't support spaces inside arguments in --nacl-gdb switch.
- base::SplitString(nacl_gdb, static_cast<CommandLine::CharType>(' '), &argv);
- CommandLine cmd_line(argv);
+ base::SplitString(nacl_gdb, static_cast<base::CommandLine::CharType>(' '),
+ &argv);
+ base::CommandLine cmd_line(argv);
#endif
cmd_line.AppendArg("--eval-command");
base::FilePath::StringType irt_path(
@@ -514,8 +516,8 @@ bool NaClProcessHost::LaunchNaClGdb() {
}
cmd_line.AppendArg("--eval-command");
cmd_line.AppendArg("target remote :4014");
- base::FilePath script = CommandLine::ForCurrentProcess()->GetSwitchValuePath(
- switches::kNaClGdbScript);
+ base::FilePath script =
+ command_line.GetSwitchValuePath(switches::kNaClGdbScript);
if (!script.empty()) {
cmd_line.AppendArg("--command");
cmd_line.AppendArgNative(script.value());
@@ -587,7 +589,7 @@ bool NaClProcessHost::LaunchSelLdr() {
}
#endif
- scoped_ptr<CommandLine> cmd_line(new CommandLine(exe_path));
+ scoped_ptr<base::CommandLine> cmd_line(new base::CommandLine(exe_path));
CopyNaClCommandLineArguments(cmd_line.get());
cmd_line->AppendSwitchASCII(switches::kProcessType,
@@ -967,7 +969,7 @@ void NaClProcessHost::OnPpapiChannelsCreated(
args.permissions = permissions_;
args.keepalive_throttle_interval_milliseconds =
keepalive_throttle_interval_milliseconds_;
- CommandLine* cmdline = CommandLine::ForCurrentProcess();
+ base::CommandLine* cmdline = base::CommandLine::ForCurrentProcess();
DCHECK(cmdline);
std::string flag_whitelist[] = {
switches::kV,
« no previous file with comments | « components/nacl/browser/nacl_broker_host_win.cc ('k') | components/nacl/common/nacl_cmd_line.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698