summaryrefslogtreecommitdiffstats
path: root/cloud_print/gcp20
diff options
context:
space:
mode:
authorpgal.u-szeged <pgal.u-szeged@partner.samsung.com>2014-11-18 18:06:03 -0800
committerCommit bot <commit-bot@chromium.org>2014-11-19 02:06:18 +0000
commit588a3ead6ef36c3ccb9dd51dd028c251a4fb511b (patch)
tree07deba5a66eff63e8482ae1b1e87688c209014ff /cloud_print/gcp20
parent539d8860344b808a289bf9361da51621a57c03a4 (diff)
downloadchromium_src-588a3ead6ef36c3ccb9dd51dd028c251a4fb511b.zip
chromium_src-588a3ead6ef36c3ccb9dd51dd028c251a4fb511b.tar.gz
chromium_src-588a3ead6ef36c3ccb9dd51dd028c251a4fb511b.tar.bz2
Prefix CommandLine usage with base namespace (Part 7: cloud_print/)
Prefix all CommandLine usage in the cloud_print/ directory with the base:: namespace. R=vitalybuka@chromium.org BUG=422426 Review URL: https://codereview.chromium.org/735053002 Cr-Commit-Position: refs/heads/master@{#304744}
Diffstat (limited to 'cloud_print/gcp20')
-rw-r--r--cloud_print/gcp20/prototype/command_line_reader.cc14
-rw-r--r--cloud_print/gcp20/prototype/dns_sd_server.cc12
-rw-r--r--cloud_print/gcp20/prototype/gcp20_device.cc7
-rw-r--r--cloud_print/gcp20/prototype/print_job_handler.cc2
-rw-r--r--cloud_print/gcp20/prototype/printer.cc3
-rw-r--r--cloud_print/gcp20/prototype/privet_http_server.cc6
6 files changed, 26 insertions, 18 deletions
diff --git a/cloud_print/gcp20/prototype/command_line_reader.cc b/cloud_print/gcp20/prototype/command_line_reader.cc
index ecab579..8663efa 100644
--- a/cloud_print/gcp20/prototype/command_line_reader.cc
+++ b/cloud_print/gcp20/prototype/command_line_reader.cc
@@ -15,7 +15,7 @@ uint16 ReadHttpPort(uint16 default_value) {
uint32 http_port = 0;
std::string http_port_string =
- CommandLine::ForCurrentProcess()->GetSwitchValueASCII(
+ base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII(
switches::kHttpPort);
if (!base::StringToUint(http_port_string, &http_port))
@@ -32,9 +32,10 @@ uint16 ReadHttpPort(uint16 default_value) {
uint32 ReadTtl(uint32 default_value) {
uint32 ttl = 0;
+ base::CommandLine* command_line = base::CommandLine::ForCurrentProcess();
if (!base::StringToUint(
- CommandLine::ForCurrentProcess()->GetSwitchValueASCII(switches::kTtl),
+ command_line->GetSwitchValueASCII(switches::kTtl),
&ttl)) {
ttl = default_value;
}
@@ -45,7 +46,7 @@ uint32 ReadTtl(uint32 default_value) {
std::string ReadServiceNamePrefix(const std::string& default_value) {
std::string service_name =
- CommandLine::ForCurrentProcess()->GetSwitchValueASCII(
+ base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII(
switches::kServiceName);
return service_name.empty() ? default_value : service_name;
@@ -53,7 +54,7 @@ std::string ReadServiceNamePrefix(const std::string& default_value) {
std::string ReadDomainName(const std::string& default_value) {
std::string domain_name =
- CommandLine::ForCurrentProcess()->GetSwitchValueASCII(
+ base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII(
switches::kDomainName);
if (domain_name.empty())
@@ -75,8 +76,9 @@ std::string ReadDomainName(const std::string& default_value) {
}
std::string ReadStatePath(const std::string& default_value) {
- std::string filename = CommandLine::ForCurrentProcess()->GetSwitchValueASCII(
- switches::kStatePath);
+ std::string filename =
+ base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII(
+ switches::kStatePath);
if (filename.empty())
return default_value;
diff --git a/cloud_print/gcp20/prototype/dns_sd_server.cc b/cloud_print/gcp20/prototype/dns_sd_server.cc
index 23280cb..a43f9f0 100644
--- a/cloud_print/gcp20/prototype/dns_sd_server.cc
+++ b/cloud_print/gcp20/prototype/dns_sd_server.cc
@@ -98,7 +98,8 @@ void DnsSdServer::UpdateMetadata(const std::vector<std::string>& metadata) {
// then send it now.
uint32 current_ttl = GetCurrentTLL();
- if (!CommandLine::ForCurrentProcess()->HasSwitch(switches::kNoAnnouncement)) {
+ if (!base::CommandLine::ForCurrentProcess()->HasSwitch(
+ switches::kNoAnnouncement)) {
DnsResponseBuilder builder(current_ttl);
builder.AppendTxt(serv_params_.service_name_, current_ttl, metadata_, true);
@@ -183,8 +184,8 @@ void DnsSdServer::ProcessMessage(int len, net::IOBufferWithSize* buf) {
VLOG(1) << "Current TTL for respond: " << current_ttl;
- bool unicast_respond =
- CommandLine::ForCurrentProcess()->HasSwitch(switches::kUnicastRespond);
+ bool unicast_respond = base::CommandLine::ForCurrentProcess()->HasSwitch(
+ switches::kUnicastRespond);
socket_->SendTo(buffer.get(), buffer.get()->size(),
unicast_respond ? recv_address_ : multicast_address_,
base::Bind(&DoNothingAfterSendToSocket));
@@ -205,7 +206,7 @@ void DnsSdServer::ProccessQuery(uint32 current_ttl, const DnsQueryRecord& query,
builder->AppendPtr(query.qname, current_ttl,
serv_params_.service_name_, true);
- if (CommandLine::ForCurrentProcess()->HasSwitch(
+ if (base::CommandLine::ForCurrentProcess()->HasSwitch(
switches::kExtendedResponce)) {
builder->AppendSrv(serv_params_.service_name_, current_ttl,
kSrvPriority, kSrvWeight, serv_params_.http_port_,
@@ -280,7 +281,8 @@ void DnsSdServer::OnDatagramReceived() {
}
void DnsSdServer::SendAnnouncement(uint32 ttl) {
- if (!CommandLine::ForCurrentProcess()->HasSwitch(switches::kNoAnnouncement)) {
+ if (!base::CommandLine::ForCurrentProcess()->HasSwitch(
+ switches::kNoAnnouncement)) {
DnsResponseBuilder builder(ttl);
builder.AppendPtr(serv_params_.service_type_, ttl,
diff --git a/cloud_print/gcp20/prototype/gcp20_device.cc b/cloud_print/gcp20/prototype/gcp20_device.cc
index 9bb71b1..d174107 100644
--- a/cloud_print/gcp20/prototype/gcp20_device.cc
+++ b/cloud_print/gcp20/prototype/gcp20_device.cc
@@ -50,14 +50,15 @@ void OnAbort(int val) {
int main(int argc, char* argv[]) {
base::AtExitManager at_exit;
Printer printer;
- CommandLine::Init(argc, argv);
+ base::CommandLine::Init(argc, argv);
+ base::CommandLine* command_line = base::CommandLine::ForCurrentProcess();
logging::LoggingSettings settings;
settings.logging_dest = logging::LOG_TO_SYSTEM_DEBUG_LOG;
logging::InitLogging(settings);
- if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kHelp) ||
- CommandLine::ForCurrentProcess()->HasSwitch(switches::kHelpShort)) {
+ if (command_line->HasSwitch(switches::kHelp) ||
+ command_line->HasSwitch(switches::kHelpShort)) {
switches::PrintUsage();
return 0;
}
diff --git a/cloud_print/gcp20/prototype/print_job_handler.cc b/cloud_print/gcp20/prototype/print_job_handler.cc
index 28bf21c..6897a6c 100644
--- a/cloud_print/gcp20/prototype/print_job_handler.cc
+++ b/cloud_print/gcp20/prototype/print_job_handler.cc
@@ -85,7 +85,7 @@ LocalPrintJob::CreateResult PrintJobHandler::CreatePrintJob(
return LocalPrintJob::CREATE_INVALID_TICKET;
// Let's simulate at least some errors just for testing.
- if (CommandLine::ForCurrentProcess()->HasSwitch(
+ if (base::CommandLine::ForCurrentProcess()->HasSwitch(
switches::kSimulatePrintingErrors)) {
if (base::RandDouble() <= kPaperJamProbability) {
*error_description = "Paper jam, try again";
diff --git a/cloud_print/gcp20/prototype/printer.cc b/cloud_print/gcp20/prototype/printer.cc
index 24866a5..9820ace 100644
--- a/cloud_print/gcp20/prototype/printer.cc
+++ b/cloud_print/gcp20/prototype/printer.cc
@@ -233,7 +233,8 @@ PrivetHttpServer::RegistrationErrorStatus Printer::RegistrationStart(
state_.user = user;
state_.registration_state = PrinterState::REGISTRATION_STARTED;
- if (CommandLine::ForCurrentProcess()->HasSwitch("disable-confirmation")) {
+ if (base::CommandLine::ForCurrentProcess()->HasSwitch(
+ "disable-confirmation")) {
state_.confirmation_state = PrinterState::CONFIRMATION_CONFIRMED;
VLOG(0) << "Registration confirmed by default.";
} else {
diff --git a/cloud_print/gcp20/prototype/privet_http_server.cc b/cloud_print/gcp20/prototype/privet_http_server.cc
index 5b4086f..c033439 100644
--- a/cloud_print/gcp20/prototype/privet_http_server.cc
+++ b/cloud_print/gcp20/prototype/privet_http_server.cc
@@ -139,7 +139,8 @@ void PrivetHttpServer::OnHttpRequest(int connection_id,
if (!ValidateRequestMethod(connection_id, url.path(), info.method))
return;
- if (!CommandLine::ForCurrentProcess()->HasSwitch(switches::kDisableXTocken)) {
+ if (!base::CommandLine::ForCurrentProcess()->HasSwitch(
+ switches::kDisableXTocken)) {
net::HttpServerRequestInfo::HeadersMap::const_iterator iter =
info.headers.find("x-privet-token");
if (iter == info.headers.end()) {
@@ -192,7 +193,8 @@ bool PrivetHttpServer::ValidateRequestMethod(int connection_id,
return false;
}
- if (CommandLine::ForCurrentProcess()->HasSwitch("disable-method-check"))
+ if (base::CommandLine::ForCurrentProcess()->HasSwitch(
+ "disable-method-check"))
return true;
if ((IsGetMethod(request) && method != "GET") ||