Chromium Code Reviews| 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 #include <string> | 6 #include <string> |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/metrics/histogram.h" | 9 #include "base/metrics/histogram.h" |
| 10 #include "base/sys_byteorder.h" | 10 #include "base/sys_byteorder.h" |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 81 memcpy(&address, &it->address[0], sizeof(uint32)); | 81 memcpy(&address, &it->address[0], sizeof(uint32)); |
| 82 address = rtc::NetworkToHost32(address); | 82 address = rtc::NetworkToHost32(address); |
| 83 rtc::IPAddress prefix = | 83 rtc::IPAddress prefix = |
| 84 rtc::TruncateIP(rtc::IPAddress(address), it->prefix_length); | 84 rtc::TruncateIP(rtc::IPAddress(address), it->prefix_length); |
| 85 rtc::Network* network = | 85 rtc::Network* network = |
| 86 new rtc::Network(it->name, it->name, prefix, it->prefix_length, | 86 new rtc::Network(it->name, it->name, prefix, it->prefix_length, |
| 87 ConvertConnectionTypeToAdapterType(it->type)); | 87 ConvertConnectionTypeToAdapterType(it->type)); |
| 88 network->AddIP(rtc::IPAddress(address)); | 88 network->AddIP(rtc::IPAddress(address)); |
| 89 networks.push_back(network); | 89 networks.push_back(network); |
| 90 } else if (it->address.size() == net::kIPv6AddressSize) { | 90 } else if (it->address.size() == net::kIPv6AddressSize) { |
| 91 | |
| 92 // Only allow temporary address. crbug.com/413437 | |
|
juberti2
2015/03/07 00:29:54
suggest mentioning "to ensure the MAC is not inclu
| |
| 93 if (!(it->ip_address_attributes & net::IP_ADDRESS_ATTRIBUTE_TEMPORARY)) | |
| 94 continue; | |
| 95 | |
| 91 in6_addr address; | 96 in6_addr address; |
| 92 memcpy(&address, &it->address[0], sizeof(in6_addr)); | 97 memcpy(&address, &it->address[0], sizeof(in6_addr)); |
| 93 rtc::IPAddress ip6_addr(address); | 98 rtc::IPAddress ip6_addr(address); |
| 94 if (!rtc::IPIsPrivate(ip6_addr)) { | 99 if (!rtc::IPIsPrivate(ip6_addr)) { |
| 95 rtc::IPAddress prefix = | 100 rtc::IPAddress prefix = |
| 96 rtc::TruncateIP(rtc::IPAddress(ip6_addr), it->prefix_length); | 101 rtc::TruncateIP(rtc::IPAddress(ip6_addr), it->prefix_length); |
| 97 rtc::Network* network = | 102 rtc::Network* network = |
| 98 new rtc::Network(it->name, it->name, prefix, it->prefix_length, | 103 new rtc::Network(it->name, it->name, prefix, it->prefix_length, |
| 99 ConvertConnectionTypeToAdapterType(it->type)); | 104 ConvertConnectionTypeToAdapterType(it->type)); |
| 100 network->AddIP(ip6_addr); | 105 network->AddIP(ip6_addr); |
| (...skipping 30 matching lines...) Expand all Loading... | |
| 131 stats.ipv4_network_count); | 136 stats.ipv4_network_count); |
| 132 UMA_HISTOGRAM_COUNTS_100("WebRTC.PeerConnection.IPv6Interfaces", | 137 UMA_HISTOGRAM_COUNTS_100("WebRTC.PeerConnection.IPv6Interfaces", |
| 133 stats.ipv6_network_count); | 138 stats.ipv6_network_count); |
| 134 } | 139 } |
| 135 | 140 |
| 136 void IpcNetworkManager::SendNetworksChangedSignal() { | 141 void IpcNetworkManager::SendNetworksChangedSignal() { |
| 137 SignalNetworksChanged(); | 142 SignalNetworksChanged(); |
| 138 } | 143 } |
| 139 | 144 |
| 140 } // namespace content | 145 } // namespace content |
| OLD | NEW |