summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkkosztyo.u-szeged <kkosztyo.u-szeged@partner.samsung.com>2014-12-04 01:54:36 -0800
committerCommit bot <commit-bot@chromium.org>2014-12-04 09:55:03 +0000
commitb33617cb4d1eacfec6f06cc8dc42d096e236edd7 (patch)
tree349d8c9140984d379b45e30476805493668ae140
parente69fcbd9b7ce482380eb70f987a2020c46f65001 (diff)
downloadchromium_src-b33617cb4d1eacfec6f06cc8dc42d096e236edd7.zip
chromium_src-b33617cb4d1eacfec6f06cc8dc42d096e236edd7.tar.gz
chromium_src-b33617cb4d1eacfec6f06cc8dc42d096e236edd7.tar.bz2
Prefix CommandLine usage with base namespace (Part 9: components)
Prefix all CommandLine usage in the components/ directory's following subdirectories: feedback, gcm_driver, google, infobars, invalidation, keyed_service, metrics, nacl, omnibox and os_crypt with the base:: namespace BUG=422426 Review URL: https://codereview.chromium.org/774933004 Cr-Commit-Position: refs/heads/master@{#306790}
-rw-r--r--components/feedback/feedback_uploader_chrome.cc7
-rw-r--r--components/gcm_driver/gcm_channel_status_syncer.cc7
-rw-r--r--components/google/core/browser/google_url_tracker.cc3
-rw-r--r--components/google/core/browser/google_util.cc2
-rw-r--r--components/google/core/browser/google_util_unittest.cc16
-rw-r--r--components/infobars/core/infobar_manager.cc3
-rw-r--r--components/invalidation/invalidation_service_util.cc2
-rw-r--r--components/invalidation/p2p_invalidation_service.cc2
-rw-r--r--components/invalidation/ticl_invalidation_service.cc2
-rw-r--r--components/keyed_service/content/browser_context_dependency_manager.cc2
-rw-r--r--components/metrics/metrics_state_manager.cc2
-rw-r--r--components/metrics/metrics_state_manager_unittest.cc2
-rw-r--r--components/nacl/broker/nacl_broker_listener.cc4
-rw-r--r--components/nacl/browser/nacl_broker_host_win.cc2
-rw-r--r--components/nacl/browser/nacl_process_host.cc38
-rw-r--r--components/nacl/common/nacl_cmd_line.cc5
-rw-r--r--components/nacl/common/nacl_nonsfi_util.cc2
-rw-r--r--components/nacl/loader/nacl_helper_linux.cc9
-rw-r--r--components/nacl/loader/nacl_helper_win_64.cc3
-rw-r--r--components/nacl/loader/nacl_listener.cc2
-rw-r--r--components/nacl/loader/nacl_main.cc2
-rw-r--r--components/nacl/loader/nonsfi/nonsfi_listener.cc2
-rw-r--r--components/nacl/loader/sandbox_linux/nacl_sandbox_linux.cc2
-rw-r--r--components/nacl/renderer/ppb_nacl_private_impl.cc5
-rw-r--r--components/nacl/zygote/nacl_fork_delegate_linux.cc9
-rw-r--r--components/omnibox/keyword_provider_unittest.cc2
-rw-r--r--components/omnibox/omnibox_field_trial.cc2
-rw-r--r--components/os_crypt/os_crypt_mac.mm2
28 files changed, 76 insertions, 65 deletions
diff --git a/components/feedback/feedback_uploader_chrome.cc b/components/feedback/feedback_uploader_chrome.cc
index 75d6e90..7ecbf03 100644
--- a/components/feedback/feedback_uploader_chrome.cc
+++ b/components/feedback/feedback_uploader_chrome.cc
@@ -33,9 +33,10 @@ FeedbackUploaderChrome::FeedbackUploaderChrome(
BrowserThread::GetBlockingPool()),
context_(context) {
CHECK(context_);
- if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kFeedbackServer))
- url_ = CommandLine::ForCurrentProcess()->GetSwitchValueASCII(
- switches::kFeedbackServer);
+ const base::CommandLine& command_line =
+ *base::CommandLine::ForCurrentProcess();
+ if (command_line.HasSwitch(switches::kFeedbackServer))
+ url_ = command_line.GetSwitchValueASCII(switches::kFeedbackServer);
}
void FeedbackUploaderChrome::DispatchReport(const std::string& data) {
diff --git a/components/gcm_driver/gcm_channel_status_syncer.cc b/components/gcm_driver/gcm_channel_status_syncer.cc
index 958d3c3..a83ac63 100644
--- a/components/gcm_driver/gcm_channel_status_syncer.cc
+++ b/components/gcm_driver/gcm_channel_status_syncer.cc
@@ -108,9 +108,10 @@ GCMChannelStatusSyncer::GCMChannelStatusSyncer(
poll_interval_seconds_ =
GCMChannelStatusRequest::min_poll_interval_seconds();
}
- if (CommandLine::ForCurrentProcess()->HasSwitch(
- switches::kCustomPollIntervalMinutes)) {
- std::string value(CommandLine::ForCurrentProcess()->GetSwitchValueASCII(
+ const base::CommandLine& command_line =
+ *base::CommandLine::ForCurrentProcess();
+ if (command_line.HasSwitch(switches::kCustomPollIntervalMinutes)) {
+ std::string value(command_line.GetSwitchValueASCII(
switches::kCustomPollIntervalMinutes));
int minutes = 0;
if (base::StringToInt(value, &minutes)) {
diff --git a/components/google/core/browser/google_url_tracker.cc b/components/google/core/browser/google_url_tracker.cc
index be9296b..8896629 100644
--- a/components/google/core/browser/google_url_tracker.cc
+++ b/components/google/core/browser/google_url_tracker.cc
@@ -233,7 +233,8 @@ void GoogleURLTracker::StartFetchIfDesirable() {
// specified a Google base URL manually, we shouldn't bother to look up any
// alternatives or offer to switch to them.
if (!client_->IsBackgroundNetworkingEnabled() ||
- CommandLine::ForCurrentProcess()->HasSwitch(switches::kGoogleBaseURL))
+ base::CommandLine::ForCurrentProcess()->HasSwitch(
+ switches::kGoogleBaseURL))
return;
already_fetched_ = true;
diff --git a/components/google/core/browser/google_util.cc b/components/google/core/browser/google_util.cc
index 800b1bc..a1cf2f2 100644
--- a/components/google/core/browser/google_util.cc
+++ b/components/google/core/browser/google_util.cc
@@ -147,7 +147,7 @@ GURL CommandLineGoogleBaseURL() {
CR_DEFINE_STATIC_LOCAL(std::string, switch_value, ());
CR_DEFINE_STATIC_LOCAL(GURL, base_url, ());
std::string current_switch_value(
- CommandLine::ForCurrentProcess()->GetSwitchValueASCII(
+ base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII(
switches::kGoogleBaseURL));
if (current_switch_value != switch_value) {
switch_value = current_switch_value;
diff --git a/components/google/core/browser/google_util_unittest.cc b/components/google/core/browser/google_util_unittest.cc
index 94e9b73..7bb67f7 100644
--- a/components/google/core/browser/google_util_unittest.cc
+++ b/components/google/core/browser/google_util_unittest.cc
@@ -310,8 +310,8 @@ TEST(GoogleUtilTest, GoogleBaseURLNotSpecified) {
EXPECT_FALSE(IsSearch("http://www.foo.com/search?q=a"));
// Override the Google base URL on the command line.
- CommandLine::ForCurrentProcess()->AppendSwitchASCII(switches::kGoogleBaseURL,
- "http://www.foo.com/");
+ base::CommandLine::ForCurrentProcess()->AppendSwitchASCII(
+ switches::kGoogleBaseURL, "http://www.foo.com/");
// Only URLs which start with exactly the string on the command line should
// cause StartsWithCommandLineGoogleBaseURL() to return true.
@@ -336,20 +336,20 @@ TEST(GoogleUtilTest, GoogleBaseURLNotSpecified) {
}
TEST(GoogleUtilTest, GoogleBaseURLDisallowQuery) {
- CommandLine::ForCurrentProcess()->AppendSwitchASCII(switches::kGoogleBaseURL,
- "http://www.foo.com/?q=");
+ base::CommandLine::ForCurrentProcess()->AppendSwitchASCII(
+ switches::kGoogleBaseURL, "http://www.foo.com/?q=");
EXPECT_FALSE(google_util::CommandLineGoogleBaseURL().is_valid());
}
TEST(GoogleUtilTest, GoogleBaseURLDisallowRef) {
- CommandLine::ForCurrentProcess()->AppendSwitchASCII(switches::kGoogleBaseURL,
- "http://www.foo.com/#q=");
+ base::CommandLine::ForCurrentProcess()->AppendSwitchASCII(
+ switches::kGoogleBaseURL, "http://www.foo.com/#q=");
EXPECT_FALSE(google_util::CommandLineGoogleBaseURL().is_valid());
}
TEST(GoogleUtilTest, GoogleBaseURLFixup) {
- CommandLine::ForCurrentProcess()->AppendSwitchASCII(switches::kGoogleBaseURL,
- "www.foo.com");
+ base::CommandLine::ForCurrentProcess()->AppendSwitchASCII(
+ switches::kGoogleBaseURL, "www.foo.com");
ASSERT_TRUE(google_util::CommandLineGoogleBaseURL().is_valid());
EXPECT_EQ("http://www.foo.com/",
google_util::CommandLineGoogleBaseURL().spec());
diff --git a/components/infobars/core/infobar_manager.cc b/components/infobars/core/infobar_manager.cc
index ed26603..c93f05e 100644
--- a/components/infobars/core/infobar_manager.cc
+++ b/components/infobars/core/infobar_manager.cc
@@ -101,7 +101,8 @@ void InfoBarManager::RemoveObserver(Observer* obs) {
InfoBarManager::InfoBarManager()
: infobars_enabled_(true) {
- if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kDisableInfoBars))
+ if (base::CommandLine::ForCurrentProcess()->HasSwitch(
+ switches::kDisableInfoBars))
infobars_enabled_ = false;
}
diff --git a/components/invalidation/invalidation_service_util.cc b/components/invalidation/invalidation_service_util.cc
index b3b8680..0049bca 100644
--- a/components/invalidation/invalidation_service_util.cc
+++ b/components/invalidation/invalidation_service_util.cc
@@ -13,7 +13,7 @@
namespace invalidation {
notifier::NotifierOptions ParseNotifierOptions(
- const CommandLine& command_line) {
+ const base::CommandLine& command_line) {
notifier::NotifierOptions notifier_options;
if (command_line.HasSwitch(switches::kSyncNotificationHostPort)) {
diff --git a/components/invalidation/p2p_invalidation_service.cc b/components/invalidation/p2p_invalidation_service.cc
index b24625b0..9829415 100644
--- a/components/invalidation/p2p_invalidation_service.cc
+++ b/components/invalidation/p2p_invalidation_service.cc
@@ -24,7 +24,7 @@ P2PInvalidationService::P2PInvalidationService(
syncer::P2PNotificationTarget notification_target)
: identity_provider_(identity_provider.Pass()) {
notifier::NotifierOptions notifier_options =
- ParseNotifierOptions(*CommandLine::ForCurrentProcess());
+ ParseNotifierOptions(*base::CommandLine::ForCurrentProcess());
notifier_options.request_context_getter = request_context;
invalidator_id_ = GenerateInvalidatorClientId();
invalidator_.reset(new syncer::P2PInvalidator(
diff --git a/components/invalidation/ticl_invalidation_service.cc b/components/invalidation/ticl_invalidation_service.cc
index 7fe5aee..c606c28 100644
--- a/components/invalidation/ticl_invalidation_service.cc
+++ b/components/invalidation/ticl_invalidation_service.cc
@@ -358,7 +358,7 @@ void TiclInvalidationService::StartInvalidator(
switch (network_channel) {
case PUSH_CLIENT_CHANNEL: {
notifier::NotifierOptions options =
- ParseNotifierOptions(*CommandLine::ForCurrentProcess());
+ ParseNotifierOptions(*base::CommandLine::ForCurrentProcess());
options.request_context_getter = request_context_;
options.auth_mechanism = "X-OAUTH2";
network_channel_options_.SetString("Options.HostPort",
diff --git a/components/keyed_service/content/browser_context_dependency_manager.cc b/components/keyed_service/content/browser_context_dependency_manager.cc
index 9498320..576d1a6 100644
--- a/components/keyed_service/content/browser_context_dependency_manager.cc
+++ b/components/keyed_service/content/browser_context_dependency_manager.cc
@@ -83,7 +83,7 @@ void BrowserContextDependencyManager::DumpContextDependencies(
const base::SupportsUserData* context) const {
// Whenever we try to build a destruction ordering, we should also dump a
// dependency graph to "/path/to/context/context-dependencies.dot".
- if (CommandLine::ForCurrentProcess()->HasSwitch(
+ if (base::CommandLine::ForCurrentProcess()->HasSwitch(
kDumpBrowserContextDependencyGraphFlag)) {
base::FilePath dot_file =
static_cast<const content::BrowserContext*>(context)
diff --git a/components/metrics/metrics_state_manager.cc b/components/metrics/metrics_state_manager.cc
index ae15823..98b7af5 100644
--- a/components/metrics/metrics_state_manager.cc
+++ b/components/metrics/metrics_state_manager.cc
@@ -270,7 +270,7 @@ int MetricsStateManager::GetLowEntropySource() {
if (low_entropy_source_ != kLowEntropySourceNotSet)
return low_entropy_source_;
- const CommandLine* command_line(CommandLine::ForCurrentProcess());
+ const base::CommandLine* command_line(base::CommandLine::ForCurrentProcess());
// Only try to load the value from prefs if the user did not request a
// reset.
// Otherwise, skip to generating a new value.
diff --git a/components/metrics/metrics_state_manager_unittest.cc b/components/metrics/metrics_state_manager_unittest.cc
index acd0ebf..1972dae 100644
--- a/components/metrics/metrics_state_manager_unittest.cc
+++ b/components/metrics/metrics_state_manager_unittest.cc
@@ -173,7 +173,7 @@ TEST_F(MetricsStateManagerTest,
// Verify that the cache does get reset if --reset-variations-state is passed.
{
- CommandLine::ForCurrentProcess()->AppendSwitch(
+ base::CommandLine::ForCurrentProcess()->AppendSwitch(
switches::kResetVariationState);
scoped_ptr<MetricsStateManager> state_manager(CreateStateManager());
diff --git a/components/nacl/broker/nacl_broker_listener.cc b/components/nacl/broker/nacl_broker_listener.cc
index e1ee046..928475b 100644
--- a/components/nacl/broker/nacl_broker_listener.cc
+++ b/components/nacl/broker/nacl_broker_listener.cc
@@ -40,7 +40,7 @@ NaClBrokerListener::~NaClBrokerListener() {
void NaClBrokerListener::Listen() {
std::string channel_name =
- CommandLine::ForCurrentProcess()->GetSwitchValueASCII(
+ base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII(
switches::kProcessChannelID);
channel_ = IPC::Channel::CreateClient(channel_name, this);
CHECK(channel_->Connect());
@@ -94,7 +94,7 @@ void NaClBrokerListener::OnLaunchLoaderThroughBroker(
base::FilePath exe_path;
PathService::Get(base::FILE_EXE, &exe_path);
if (!exe_path.empty()) {
- CommandLine* cmd_line = new CommandLine(exe_path);
+ base::CommandLine* cmd_line = new base::CommandLine(exe_path);
nacl::CopyNaClCommandLineArguments(cmd_line);
cmd_line->AppendSwitchASCII(switches::kProcessType,
diff --git a/components/nacl/browser/nacl_broker_host_win.cc b/components/nacl/browser/nacl_broker_host_win.cc
index 1967b68..a8c5350 100644
--- a/components/nacl/browser/nacl_broker_host_win.cc
+++ b/components/nacl/browser/nacl_broker_host_win.cc
@@ -57,7 +57,7 @@ bool NaClBrokerHost::Init() {
if (!NaClBrowser::GetInstance()->GetNaCl64ExePath(&nacl_path))
return false;
- CommandLine* cmd_line = new CommandLine(nacl_path);
+ base::CommandLine* cmd_line = new base::CommandLine(nacl_path);
CopyNaClCommandLineArguments(cmd_line);
cmd_line->AppendSwitchASCII(switches::kProcessType,
diff --git a/components/nacl/browser/nacl_process_host.cc b/components/nacl/browser/nacl_process_host.cc
index 16c0da3..ca7b5c88 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,
diff --git a/components/nacl/common/nacl_cmd_line.cc b/components/nacl/common/nacl_cmd_line.cc
index 7ecb674..31dedcd 100644
--- a/components/nacl/common/nacl_cmd_line.cc
+++ b/components/nacl/common/nacl_cmd_line.cc
@@ -10,8 +10,9 @@
namespace nacl {
-void CopyNaClCommandLineArguments(CommandLine* cmd_line) {
- const CommandLine& browser_command_line = *CommandLine::ForCurrentProcess();
+void CopyNaClCommandLineArguments(base::CommandLine* cmd_line) {
+ const base::CommandLine& browser_command_line =
+ *base::CommandLine::ForCurrentProcess();
// Propagate the following switches to the NaCl loader command line (along
// with any associated values) if present in the browser command line.
diff --git a/components/nacl/common/nacl_nonsfi_util.cc b/components/nacl/common/nacl_nonsfi_util.cc
index d56cea6..9797fc1 100644
--- a/components/nacl/common/nacl_nonsfi_util.cc
+++ b/components/nacl/common/nacl_nonsfi_util.cc
@@ -14,7 +14,7 @@ bool IsNonSFIModeEnabled() {
#if defined(OS_CHROMEOS) && defined(ARCH_CPU_ARMEL)
return true;
#elif defined(OS_LINUX)
- return CommandLine::ForCurrentProcess()->HasSwitch(
+ return base::CommandLine::ForCurrentProcess()->HasSwitch(
switches::kEnableNaClNonSfiMode);
#else
return false;
diff --git a/components/nacl/loader/nacl_helper_linux.cc b/components/nacl/loader/nacl_helper_linux.cc
index d5a650f..6f79819 100644
--- a/components/nacl/loader/nacl_helper_linux.cc
+++ b/components/nacl/loader/nacl_helper_linux.cc
@@ -158,7 +158,7 @@ void ChildNaClLoaderInit(ScopedVector<base::ScopedFD> child_fds,
CHECK(content::SendZygoteChildPing(
child_fds[content::ZygoteForkDelegate::kPIDOracleFDIndex]->get()));
- CommandLine::ForCurrentProcess()->AppendSwitchASCII(
+ base::CommandLine::ForCurrentProcess()->AppendSwitchASCII(
switches::kProcessChannelID, channel_id);
// Save the browser socket and close the rest.
@@ -362,7 +362,8 @@ static const char kNaClHelperRDebug[] = "r_debug";
// process the --r_debug option.
static void CheckRDebug(char* argv0) {
std::string r_debug_switch_value =
- CommandLine::ForCurrentProcess()->GetSwitchValueASCII(kNaClHelperRDebug);
+ base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII(
+ kNaClHelperRDebug);
if (!r_debug_switch_value.empty()) {
char* endp;
uintptr_t r_debug_addr = strtoul(r_debug_switch_value.c_str(), &endp, 0);
@@ -394,7 +395,7 @@ static void CheckRDebug(char* argv0) {
static size_t CheckReservedAtZero() {
size_t prereserved_sandbox_size = 0;
std::string reserved_at_zero_switch_value =
- CommandLine::ForCurrentProcess()->GetSwitchValueASCII(
+ base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII(
kNaClHelperReservedAtZero);
if (!reserved_at_zero_switch_value.empty()) {
char* endp;
@@ -430,7 +431,7 @@ const char* __asan_default_options() {
#endif
int main(int argc, char* argv[]) {
- CommandLine::Init(argc, argv);
+ base::CommandLine::Init(argc, argv);
base::AtExitManager exit_manager;
base::RandUint64(); // acquire /dev/urandom fd before sandbox is raised
diff --git a/components/nacl/loader/nacl_helper_win_64.cc b/components/nacl/loader/nacl_helper_win_64.cc
index fbb5265..d67b7b3 100644
--- a/components/nacl/loader/nacl_helper_win_64.cc
+++ b/components/nacl/loader/nacl_helper_win_64.cc
@@ -49,7 +49,8 @@ int NaClWin64Main() {
sandbox::SandboxInterfaceInfo sandbox_info = {0};
content::InitializeSandboxInfo(&sandbox_info);
- const CommandLine& command_line = *CommandLine::ForCurrentProcess();
+ const base::CommandLine& command_line =
+ *base::CommandLine::ForCurrentProcess();
std::string process_type =
command_line.GetSwitchValueASCII(switches::kProcessType);
diff --git a/components/nacl/loader/nacl_listener.cc b/components/nacl/loader/nacl_listener.cc
index 5e7562e..4f8d9fe 100644
--- a/components/nacl/loader/nacl_listener.cc
+++ b/components/nacl/loader/nacl_listener.cc
@@ -250,7 +250,7 @@ class FileTokenMessageFilter : public IPC::MessageFilter {
void NaClListener::Listen() {
std::string channel_name =
- CommandLine::ForCurrentProcess()->GetSwitchValueASCII(
+ base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII(
switches::kProcessChannelID);
channel_ = IPC::SyncChannel::Create(
this, io_thread_.message_loop_proxy().get(), &shutdown_event_);
diff --git a/components/nacl/loader/nacl_main.cc b/components/nacl/loader/nacl_main.cc
index 9375d1c..9139c70 100644
--- a/components/nacl/loader/nacl_main.cc
+++ b/components/nacl/loader/nacl_main.cc
@@ -16,7 +16,7 @@
// main() routine for the NaCl loader process.
int NaClMain(const content::MainFunctionParams& parameters) {
- const CommandLine& parsed_command_line = parameters.command_line;
+ const base::CommandLine& parsed_command_line = parameters.command_line;
// The main thread of the plugin services IO.
base::MessageLoopForIO main_message_loop;
diff --git a/components/nacl/loader/nonsfi/nonsfi_listener.cc b/components/nacl/loader/nonsfi/nonsfi_listener.cc
index 09f30b2..d0d51f1 100644
--- a/components/nacl/loader/nonsfi/nonsfi_listener.cc
+++ b/components/nacl/loader/nonsfi/nonsfi_listener.cc
@@ -44,7 +44,7 @@ NonSfiListener::~NonSfiListener() {
void NonSfiListener::Listen() {
channel_ = IPC::SyncChannel::Create(
- CommandLine::ForCurrentProcess()->GetSwitchValueASCII(
+ base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII(
switches::kProcessChannelID),
IPC::Channel::MODE_CLIENT,
this, // As a Listener.
diff --git a/components/nacl/loader/sandbox_linux/nacl_sandbox_linux.cc b/components/nacl/loader/sandbox_linux/nacl_sandbox_linux.cc
index 65bb596..5c4fa42 100644
--- a/components/nacl/loader/sandbox_linux/nacl_sandbox_linux.cc
+++ b/components/nacl/loader/sandbox_linux/nacl_sandbox_linux.cc
@@ -148,7 +148,7 @@ void NaClSandbox::CheckSandboxingStateWithPolicy() {
" this is not allowed in this configuration.";
const bool no_sandbox_for_nonsfi_ok =
- CommandLine::ForCurrentProcess()->HasSwitch(
+ base::CommandLine::ForCurrentProcess()->HasSwitch(
switches::kNaClDangerousNoSandboxNonSfi);
const bool can_be_no_sandbox =
!layer_two_is_nonsfi_ || no_sandbox_for_nonsfi_ok;
diff --git a/components/nacl/renderer/ppb_nacl_private_impl.cc b/components/nacl/renderer/ppb_nacl_private_impl.cc
index d923f2a..88a5cb3 100644
--- a/components/nacl/renderer/ppb_nacl_private_impl.cc
+++ b/components/nacl/renderer/ppb_nacl_private_impl.cc
@@ -507,7 +507,7 @@ int UrandomFD(void) {
}
PP_Bool Are3DInterfacesDisabled() {
- return PP_FromBool(CommandLine::ForCurrentProcess()->HasSwitch(
+ return PP_FromBool(base::CommandLine::ForCurrentProcess()->HasSwitch(
switches::kDisable3DAPIs));
}
@@ -766,7 +766,8 @@ void InstanceDestroyed(PP_Instance instance) {
}
PP_Bool NaClDebugEnabledForURL(const char* alleged_nmf_url) {
- if (!CommandLine::ForCurrentProcess()->HasSwitch(switches::kEnableNaClDebug))
+ if (!base::CommandLine::ForCurrentProcess()->HasSwitch(
+ switches::kEnableNaClDebug))
return PP_FALSE;
IPC::Sender* sender = content::RenderThread::Get();
DCHECK(sender);
diff --git a/components/nacl/zygote/nacl_fork_delegate_linux.cc b/components/nacl/zygote/nacl_fork_delegate_linux.cc
index 2b13cfb..71cac68 100644
--- a/components/nacl/zygote/nacl_fork_delegate_linux.cc
+++ b/components/nacl/zygote/nacl_fork_delegate_linux.cc
@@ -199,9 +199,9 @@ void NaClForkDelegate::Init(const int sandboxdesc,
} else if (RunningOnValgrind()) {
status_ = kNaClHelperValgrind;
} else {
- CommandLine::StringVector argv_to_launch;
+ base::CommandLine::StringVector argv_to_launch;
{
- CommandLine cmd_line(CommandLine::NO_PROGRAM);
+ base::CommandLine cmd_line(base::CommandLine::NO_PROGRAM);
if (use_nacl_bootstrap)
cmd_line.SetProgram(helper_bootstrap_exe);
else
@@ -214,7 +214,8 @@ void NaClForkDelegate::Init(const int sandboxdesc,
switches::kNaClDangerousNoSandboxNonSfi,
switches::kNoSandbox,
};
- const CommandLine& current_cmd_line = *CommandLine::ForCurrentProcess();
+ const base::CommandLine& current_cmd_line =
+ *base::CommandLine::ForCurrentProcess();
cmd_line.CopySwitchesFrom(current_cmd_line, kForwardSwitches,
arraysize(kForwardSwitches));
@@ -226,7 +227,7 @@ void NaClForkDelegate::Init(const int sandboxdesc,
if (use_nacl_bootstrap) {
// Arguments to the bootstrap helper which need to be at the start
// of the command line, right after the helper's path.
- CommandLine::StringVector bootstrap_prepend;
+ base::CommandLine::StringVector bootstrap_prepend;
bootstrap_prepend.push_back(helper_exe.value());
bootstrap_prepend.push_back(kNaClHelperReservedAtZero);
bootstrap_prepend.push_back(kNaClHelperRDebug);
diff --git a/components/omnibox/keyword_provider_unittest.cc b/components/omnibox/keyword_provider_unittest.cc
index cbfc0b9..c03fcff 100644
--- a/components/omnibox/keyword_provider_unittest.cc
+++ b/components/omnibox/keyword_provider_unittest.cc
@@ -354,7 +354,7 @@ TEST_F(KeywordProviderTest, GetSubstitutingTemplateURLForInput) {
// If extra query params are specified on the command line, they should be
// reflected (only) in the default search provider's destination URL.
TEST_F(KeywordProviderTest, ExtraQueryParams) {
- CommandLine::ForCurrentProcess()->AppendSwitchASCII(
+ base::CommandLine::ForCurrentProcess()->AppendSwitchASCII(
switches::kExtraSearchQueryParams, "a=b");
TestData<GURL> url_cases[] = {
diff --git a/components/omnibox/omnibox_field_trial.cc b/components/omnibox/omnibox_field_trial.cc
index 0955eea..6e7706b 100644
--- a/components/omnibox/omnibox_field_trial.cc
+++ b/components/omnibox/omnibox_field_trial.cc
@@ -308,7 +308,7 @@ bool OmniboxFieldTrial::DisableInlining() {
}
bool OmniboxFieldTrial::EnableAnswersInSuggest() {
- const CommandLine* cl = CommandLine::ForCurrentProcess();
+ const base::CommandLine* cl = base::CommandLine::ForCurrentProcess();
if (cl->HasSwitch(switches::kDisableAnswersInSuggest))
return false;
if (cl->HasSwitch(switches::kEnableAnswersInSuggest))
diff --git a/components/os_crypt/os_crypt_mac.mm b/components/os_crypt/os_crypt_mac.mm
index ab19283..5079931 100644
--- a/components/os_crypt/os_crypt_mac.mm
+++ b/components/os_crypt/os_crypt_mac.mm
@@ -52,7 +52,7 @@ crypto::SymmetricKey* GetEncryptionKey() {
return cached_encryption_key;
static bool mock_keychain_command_line_flag =
- CommandLine::ForCurrentProcess()->HasSwitch(
+ base::CommandLine::ForCurrentProcess()->HasSwitch(
os_crypt::switches::kUseMockKeychain);
std::string password;