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

Unified Diff: cloud_print/gcp20/prototype/dns_sd_server.cc

Issue 587103002: GCP 2.0 prototype switches code cleanup. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Sun Sep 21 21:20:21 PDT 2014 Created 6 years, 3 months 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 | « cloud_print/gcp20/prototype/command_line_reader.cc ('k') | cloud_print/gcp20/prototype/gcp20_device.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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,
« no previous file with comments | « cloud_print/gcp20/prototype/command_line_reader.cc ('k') | cloud_print/gcp20/prototype/gcp20_device.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698