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

Unified Diff: content/renderer/p2p/ipc_network_manager.cc

Issue 905663002: Use network counting from webrtc for UMA. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/p2p/ipc_network_manager.cc
diff --git a/content/renderer/p2p/ipc_network_manager.cc b/content/renderer/p2p/ipc_network_manager.cc
index f1db22b5f8443fed2bd19fe23847f4fcca123c82..ac7661209b516e1106ea249b8c002ffeb83ddfbf 100644
--- a/content/renderer/p2p/ipc_network_manager.cc
+++ b/content/renderer/p2p/ipc_network_manager.cc
@@ -74,8 +74,6 @@ void IpcNetworkManager::OnNetworkListChanged(
// rtc::Network uses these prefix_length to compare network
// interfaces discovered.
std::vector<rtc::Network*> networks;
- int ipv4_interfaces = 0;
- int ipv6_interfaces = 0;
for (net::NetworkInterfaceList::const_iterator it = list.begin();
it != list.end(); it++) {
if (it->address.size() == net::kIPv4AddressSize) {
@@ -89,7 +87,6 @@ void IpcNetworkManager::OnNetworkListChanged(
ConvertConnectionTypeToAdapterType(it->type));
network->AddIP(rtc::IPAddress(address));
networks.push_back(network);
- ++ipv4_interfaces;
} else if (it->address.size() == net::kIPv6AddressSize) {
in6_addr address;
memcpy(&address, &it->address[0], sizeof(in6_addr));
@@ -102,18 +99,10 @@ void IpcNetworkManager::OnNetworkListChanged(
ConvertConnectionTypeToAdapterType(it->type));
network->AddIP(ip6_addr);
networks.push_back(network);
- ++ipv6_interfaces;
}
}
}
-
- // Send interface counts to UMA.
- UMA_HISTOGRAM_COUNTS_100("WebRTC.PeerConnection.IPv4Interfaces",
- ipv4_interfaces);
- UMA_HISTOGRAM_COUNTS_100("WebRTC.PeerConnection.IPv6Interfaces",
- ipv6_interfaces);
-
if (base::CommandLine::ForCurrentProcess()->HasSwitch(
switches::kAllowLoopbackInPeerConnection)) {
std::string name_v4("loopback_ipv4");
@@ -132,9 +121,16 @@ void IpcNetworkManager::OnNetworkListChanged(
}
bool changed = false;
- MergeNetworkList(networks, &changed);
+ NetworkManager::Stats stats;
+ MergeNetworkList(networks, &changed, &stats);
if (changed)
SignalNetworksChanged();
+
+ // Send interface counts to UMA.
+ UMA_HISTOGRAM_COUNTS_100("WebRTC.PeerConnection.IPv4Interfaces",
+ stats.ipv4_network_count);
+ UMA_HISTOGRAM_COUNTS_100("WebRTC.PeerConnection.IPv6Interfaces",
+ stats.ipv6_network_count);
}
void IpcNetworkManager::SendNetworksChangedSignal() {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698