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

Side by Side Diff: net/dns/mdns_client_impl.cc

Issue 1349783006: Cleanup: Pass std::string as const reference if possible (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Revert third_party changes Created 5 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 unified diff | Download patch
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "net/dns/mdns_client_impl.h" 5 #include "net/dns/mdns_client_impl.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <queue> 8 #include <queue>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after
205 } 205 }
206 206
207 MDnsClientImpl::Core::~Core() { 207 MDnsClientImpl::Core::~Core() {
208 STLDeleteValues(&listeners_); 208 STLDeleteValues(&listeners_);
209 } 209 }
210 210
211 bool MDnsClientImpl::Core::Init(MDnsSocketFactory* socket_factory) { 211 bool MDnsClientImpl::Core::Init(MDnsSocketFactory* socket_factory) {
212 return connection_->Init(socket_factory); 212 return connection_->Init(socket_factory);
213 } 213 }
214 214
215 bool MDnsClientImpl::Core::SendQuery(uint16 rrtype, std::string name) { 215 bool MDnsClientImpl::Core::SendQuery(uint16 rrtype, const std::string& name) {
216 std::string name_dns; 216 std::string name_dns;
217 if (!DNSDomainFromDot(name, &name_dns)) 217 if (!DNSDomainFromDot(name, &name_dns))
218 return false; 218 return false;
219 219
220 DnsQuery query(0, name_dns, rrtype); 220 DnsQuery query(0, name_dns, rrtype);
221 query.set_flags(0); // Remove the RD flag from the query. It is unneeded. 221 query.set_flags(0); // Remove the RD flag from the query. It is unneeded.
222 222
223 connection_->Send(query.io_buffer(), query.io_buffer()->size()); 223 connection_->Send(query.io_buffer(), query.io_buffer()->size());
224 return true; 224 return true;
225 } 225 }
(...skipping 515 matching lines...) Expand 10 before | Expand all | Expand 10 after
741 741
742 void MDnsTransactionImpl::OnNsecRecord(const std::string& name, unsigned type) { 742 void MDnsTransactionImpl::OnNsecRecord(const std::string& name, unsigned type) {
743 TriggerCallback(RESULT_NSEC, NULL); 743 TriggerCallback(RESULT_NSEC, NULL);
744 } 744 }
745 745
746 void MDnsTransactionImpl::OnCachePurged() { 746 void MDnsTransactionImpl::OnCachePurged() {
747 // TODO(noamsml): Cache purge situations not yet implemented 747 // TODO(noamsml): Cache purge situations not yet implemented
748 } 748 }
749 749
750 } // namespace net 750 } // namespace net
OLDNEW
« no previous file with comments | « net/dns/mdns_client_impl.h ('k') | net/dns/mdns_client_unittest.cc » ('j') | url/gurl.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698