summaryrefslogtreecommitdiffstats
path: root/cloud_print/gcp20/prototype/dns_sd_server.cc
diff options
context:
space:
mode:
authorvitalybuka <vitalybuka@chromium.org>2014-09-21 21:53:24 -0700
committerCommit bot <commit-bot@chromium.org>2014-09-22 04:53:36 +0000
commit8e5841144fb76fa5f3d55f2a6f1e37f013fd661a (patch)
tree7898a7804d27e591322442e59a619480df7ef4c2 /cloud_print/gcp20/prototype/dns_sd_server.cc
parentb44e7c8f01adfe3cc7e62fcb8a087ff99e6efd5b (diff)
downloadchromium_src-8e5841144fb76fa5f3d55f2a6f1e37f013fd661a.zip
chromium_src-8e5841144fb76fa5f3d55f2a6f1e37f013fd661a.tar.gz
chromium_src-8e5841144fb76fa5f3d55f2a6f1e37f013fd661a.tar.bz2
GCP 2.0 prototype switches code cleanup.
TBR=gene@chromium.org Review URL: https://codereview.chromium.org/587103002 Cr-Commit-Position: refs/heads/master@{#295925}
Diffstat (limited to 'cloud_print/gcp20/prototype/dns_sd_server.cc')
-rw-r--r--cloud_print/gcp20/prototype/dns_sd_server.cc10
1 files changed, 6 insertions, 4 deletions
diff --git a/cloud_print/gcp20/prototype/dns_sd_server.cc b/cloud_print/gcp20/prototype/dns_sd_server.cc
index 1419cc7..23280cb 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,