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

Unified Diff: net/base/network_change_notifier.cc

Issue 307943004: Adds bluetooth connection type to NetworkChangeNotifier. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@netinfo
Patch Set: Updating spec url Created 6 years, 7 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 | « net/base/network_change_notifier.h ('k') | net/tools/net_watcher/net_watcher.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/base/network_change_notifier.cc
diff --git a/net/base/network_change_notifier.cc b/net/base/network_change_notifier.cc
index aef83563ffc08fb44f03a696efb9232cab9e59bb..c55be07d731178ceaf85a013c936bc4f7180ec08 100644
--- a/net/base/network_change_notifier.cc
+++ b/net/base/network_change_notifier.cc
@@ -151,6 +151,11 @@ class HistogramWatcher
UMA_HISTOGRAM_TIMES("NCN.CM.FastestRTTOnNone",
fastest_RTT_since_last_connection_change_);
break;
+ case NetworkChangeNotifier::CONNECTION_BLUETOOTH:
+ UMA_HISTOGRAM_TIMES("NCN.CM.FirstReadOnBluetooth",
+ first_byte_after_connection_change_);
+ UMA_HISTOGRAM_TIMES("NCN.CM.FastestRTTOnBluetooth",
+ fastest_RTT_since_last_connection_change_);
}
}
if (peak_kbps_since_last_connection_change_) {
@@ -183,6 +188,10 @@ class HistogramWatcher
UMA_HISTOGRAM_COUNTS("NCN.CM.PeakKbpsOnNone",
peak_kbps_since_last_connection_change_);
break;
+ case NetworkChangeNotifier::CONNECTION_BLUETOOTH:
+ UMA_HISTOGRAM_COUNTS("NCN.CM.PeakKbpsOnBluetooth",
+ peak_kbps_since_last_connection_change_);
+ break;
}
}
switch (last_connection_type_) {
@@ -214,6 +223,10 @@ class HistogramWatcher
UMA_HISTOGRAM_LONG_TIMES("NCN.CM.TimeOnNone", state_duration);
UMA_HISTOGRAM_COUNTS("NCN.CM.KBTransferedOnNone", kilobytes_read);
break;
+ case NetworkChangeNotifier::CONNECTION_BLUETOOTH:
+ UMA_HISTOGRAM_LONG_TIMES("NCN.CM.TimeOnBluetooth", state_duration);
+ UMA_HISTOGRAM_COUNTS("NCN.CM.KBTransferedOnBluetooth", kilobytes_read);
+ break;
}
if (type != NetworkChangeNotifier::CONNECTION_NONE) {
@@ -540,13 +553,14 @@ const char* NetworkChangeNotifier::ConnectionTypeToString(
"CONNECTION_2G",
"CONNECTION_3G",
"CONNECTION_4G",
- "CONNECTION_NONE"
+ "CONNECTION_NONE",
+ "CONNECTION_BLUETOOTH"
};
COMPILE_ASSERT(
arraysize(kConnectionTypeNames) ==
- NetworkChangeNotifier::CONNECTION_NONE + 1,
+ NetworkChangeNotifier::CONNECTION_LAST + 1,
ConnectionType_name_count_mismatch);
- if (type < CONNECTION_UNKNOWN || type > CONNECTION_NONE) {
+ if (type < CONNECTION_UNKNOWN || type > CONNECTION_LAST) {
NOTREACHED();
return "CONNECTION_INVALID";
}
@@ -625,6 +639,7 @@ bool NetworkChangeNotifier::IsConnectionCellular(ConnectionType type) {
case CONNECTION_ETHERNET:
case CONNECTION_WIFI:
case CONNECTION_NONE:
+ case CONNECTION_BLUETOOTH:
is_cellular = false;
break;
}
« no previous file with comments | « net/base/network_change_notifier.h ('k') | net/tools/net_watcher/net_watcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698