| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "content/renderer/p2p/ipc_network_manager.h" | 5 #include "content/renderer/p2p/ipc_network_manager.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 #include "base/bind.h" | 8 #include "base/bind.h" |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/location.h" | 10 #include "base/location.h" |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 87 // rtc::Network uses these prefix_length to compare network | 87 // rtc::Network uses these prefix_length to compare network |
| 88 // interfaces discovered. | 88 // interfaces discovered. |
| 89 std::vector<rtc::Network*> networks; | 89 std::vector<rtc::Network*> networks; |
| 90 for (net::NetworkInterfaceList::const_iterator it = list.begin(); | 90 for (net::NetworkInterfaceList::const_iterator it = list.begin(); |
| 91 it != list.end(); it++) { | 91 it != list.end(); it++) { |
| 92 rtc::IPAddress ip_address = | 92 rtc::IPAddress ip_address = |
| 93 jingle_glue::NetIPAddressToRtcIPAddress(it->address); | 93 jingle_glue::NetIPAddressToRtcIPAddress(it->address); |
| 94 DCHECK(!ip_address.IsNil()); | 94 DCHECK(!ip_address.IsNil()); |
| 95 | 95 |
| 96 rtc::IPAddress prefix = rtc::TruncateIP(ip_address, it->prefix_length); | 96 rtc::IPAddress prefix = rtc::TruncateIP(ip_address, it->prefix_length); |
| 97 scoped_ptr<rtc::Network> network( | 97 std::unique_ptr<rtc::Network> network( |
| 98 new rtc::Network(it->name, it->name, prefix, it->prefix_length, | 98 new rtc::Network(it->name, it->name, prefix, it->prefix_length, |
| 99 ConvertConnectionTypeToAdapterType(it->type))); | 99 ConvertConnectionTypeToAdapterType(it->type))); |
| 100 network->set_default_local_address_provider(this); | 100 network->set_default_local_address_provider(this); |
| 101 | 101 |
| 102 rtc::InterfaceAddress iface_addr; | 102 rtc::InterfaceAddress iface_addr; |
| 103 if (it->address.IsIPv4()) { | 103 if (it->address.IsIPv4()) { |
| 104 use_default_ipv4_address |= (default_ipv4_local_address == it->address); | 104 use_default_ipv4_address |= (default_ipv4_local_address == it->address); |
| 105 iface_addr = rtc::InterfaceAddress(ip_address); | 105 iface_addr = rtc::InterfaceAddress(ip_address); |
| 106 } else { | 106 } else { |
| 107 DCHECK(it->address.IsIPv6()); | 107 DCHECK(it->address.IsIPv6()); |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 171 stats.ipv4_network_count); | 171 stats.ipv4_network_count); |
| 172 UMA_HISTOGRAM_COUNTS_100("WebRTC.PeerConnection.IPv6Interfaces", | 172 UMA_HISTOGRAM_COUNTS_100("WebRTC.PeerConnection.IPv6Interfaces", |
| 173 stats.ipv6_network_count); | 173 stats.ipv6_network_count); |
| 174 } | 174 } |
| 175 | 175 |
| 176 void IpcNetworkManager::SendNetworksChangedSignal() { | 176 void IpcNetworkManager::SendNetworksChangedSignal() { |
| 177 SignalNetworksChanged(); | 177 SignalNetworksChanged(); |
| 178 } | 178 } |
| 179 | 179 |
| 180 } // namespace content | 180 } // namespace content |
| OLD | NEW |