| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |