Index: cloud_print/gcp20/prototype/dns_sd_server.cc |
diff --git a/cloud_print/gcp20/prototype/dns_sd_server.cc b/cloud_print/gcp20/prototype/dns_sd_server.cc |
index 1419cc7b4190e8565e202960f1ab767dc550c851..23280cb127cf7384c515dabf14cdcf2d74f87746 100644 |
--- a/cloud_print/gcp20/prototype/dns_sd_server.cc |
+++ b/cloud_print/gcp20/prototype/dns_sd_server.cc |
@@ -13,6 +13,7 @@ |
#include "base/strings/stringprintf.h" |
#include "cloud_print/gcp20/prototype/dns_packet_parser.h" |
#include "cloud_print/gcp20/prototype/dns_response_builder.h" |
+#include "cloud_print/gcp20/prototype/gcp20_switches.h" |
#include "net/base/dns_util.h" |
#include "net/base/net_errors.h" |
#include "net/base/net_util.h" |
@@ -97,7 +98,7 @@ void DnsSdServer::UpdateMetadata(const std::vector<std::string>& metadata) { |
// then send it now. |
uint32 current_ttl = GetCurrentTLL(); |
- if (!CommandLine::ForCurrentProcess()->HasSwitch("no-announcement")) { |
+ if (!CommandLine::ForCurrentProcess()->HasSwitch(switches::kNoAnnouncement)) { |
DnsResponseBuilder builder(current_ttl); |
builder.AppendTxt(serv_params_.service_name_, current_ttl, metadata_, true); |
@@ -183,7 +184,7 @@ void DnsSdServer::ProcessMessage(int len, net::IOBufferWithSize* buf) { |
VLOG(1) << "Current TTL for respond: " << current_ttl; |
bool unicast_respond = |
- CommandLine::ForCurrentProcess()->HasSwitch("unicast-respond"); |
+ CommandLine::ForCurrentProcess()->HasSwitch(switches::kUnicastRespond); |
socket_->SendTo(buffer.get(), buffer.get()->size(), |
unicast_respond ? recv_address_ : multicast_address_, |
base::Bind(&DoNothingAfterSendToSocket)); |
@@ -204,7 +205,8 @@ void DnsSdServer::ProccessQuery(uint32 current_ttl, const DnsQueryRecord& query, |
builder->AppendPtr(query.qname, current_ttl, |
serv_params_.service_name_, true); |
- if (CommandLine::ForCurrentProcess()->HasSwitch("extended-response")) { |
+ if (CommandLine::ForCurrentProcess()->HasSwitch( |
+ switches::kExtendedResponce)) { |
builder->AppendSrv(serv_params_.service_name_, current_ttl, |
kSrvPriority, kSrvWeight, serv_params_.http_port_, |
serv_params_.service_domain_name_, false); |
@@ -278,7 +280,7 @@ void DnsSdServer::OnDatagramReceived() { |
} |
void DnsSdServer::SendAnnouncement(uint32 ttl) { |
- if (!CommandLine::ForCurrentProcess()->HasSwitch("no-announcement")) { |
+ if (!CommandLine::ForCurrentProcess()->HasSwitch(switches::kNoAnnouncement)) { |
DnsResponseBuilder builder(ttl); |
builder.AppendPtr(serv_params_.service_type_, ttl, |