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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 | 43 |
44 void MDnsSocketFactoryImpl::CreateSockets( | 44 void MDnsSocketFactoryImpl::CreateSockets( |
45 ScopedVector<DatagramServerSocket>* sockets) { | 45 ScopedVector<DatagramServerSocket>* sockets) { |
46 InterfaceIndexFamilyList interfaces(GetMDnsInterfacesToBind()); | 46 InterfaceIndexFamilyList interfaces(GetMDnsInterfacesToBind()); |
47 for (size_t i = 0; i < interfaces.size(); ++i) { | 47 for (size_t i = 0; i < interfaces.size(); ++i) { |
48 DCHECK(interfaces[i].second == ADDRESS_FAMILY_IPV4 || | 48 DCHECK(interfaces[i].second == ADDRESS_FAMILY_IPV4 || |
49 interfaces[i].second == ADDRESS_FAMILY_IPV6); | 49 interfaces[i].second == ADDRESS_FAMILY_IPV6); |
50 scoped_ptr<DatagramServerSocket> socket( | 50 scoped_ptr<DatagramServerSocket> socket( |
51 CreateAndBindMDnsSocket(interfaces[i].second, interfaces[i].first)); | 51 CreateAndBindMDnsSocket(interfaces[i].second, interfaces[i].first)); |
52 if (socket) | 52 if (socket) |
53 sockets->push_back(socket.release()); | 53 sockets->push_back(socket.Pass()); |
54 } | 54 } |
55 } | 55 } |
56 | 56 |
57 MDnsConnection::SocketHandler::SocketHandler( | 57 MDnsConnection::SocketHandler::SocketHandler( |
58 scoped_ptr<DatagramServerSocket> socket, | 58 scoped_ptr<DatagramServerSocket> socket, |
59 MDnsConnection* connection) | 59 MDnsConnection* connection) |
60 : socket_(socket.Pass()), | 60 : socket_(socket.Pass()), |
61 connection_(connection), | 61 connection_(connection), |
62 response_(dns_protocol::kMaxMulticastSize), | 62 response_(dns_protocol::kMaxMulticastSize), |
63 send_in_progress_(false) { | 63 send_in_progress_(false) { |
(...skipping 674 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
738 | 738 |
739 void MDnsTransactionImpl::OnNsecRecord(const std::string& name, unsigned type) { | 739 void MDnsTransactionImpl::OnNsecRecord(const std::string& name, unsigned type) { |
740 TriggerCallback(RESULT_NSEC, NULL); | 740 TriggerCallback(RESULT_NSEC, NULL); |
741 } | 741 } |
742 | 742 |
743 void MDnsTransactionImpl::OnCachePurged() { | 743 void MDnsTransactionImpl::OnCachePurged() { |
744 // TODO(noamsml): Cache purge situations not yet implemented | 744 // TODO(noamsml): Cache purge situations not yet implemented |
745 } | 745 } |
746 | 746 |
747 } // namespace net | 747 } // namespace net |
OLD | NEW |