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

Unified Diff: net/base/network_change_notifier.h

Issue 2776523003: Expose connection subtype from NetworkChangeNotifier (Closed)
Patch Set: Add test Created 3 years, 9 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
Index: net/base/network_change_notifier.h
diff --git a/net/base/network_change_notifier.h b/net/base/network_change_notifier.h
index 1cefe85ff6e15b29af41828e90157e4bd81b15d6..2d5529f17049d738cc15b0066ff5d615fff35491 100644
--- a/net/base/network_change_notifier.h
+++ b/net/base/network_change_notifier.h
@@ -270,12 +270,18 @@ class NET_EXPORT NetworkChangeNotifier {
// value doesn't imply that the user will be able to connect to remote sites;
// even if some link is up, it is uncertain whether a particular connection
// attempt to a particular remote site will be successful.
- // The returned value only describes the connection currently used by the
- // device, and does not take into account other machines on the network. For
- // example, if the device is connected using Wifi to a 3G gateway to access
- // the internet, the connection type is CONNECTION_WIFI.
+ // The returned value only describes the first-hop connection, for example if
+ // the device is connected via WiFi to a 4G hotspot, the returned value will
+ // be CONNECTION_WIFI, not CONNECTION_4G.
static ConnectionType GetConnectionType();
+ // Returns the device's current default active network connection's subtype.
+ // The returned value only describes the first-hop connection, for example if
+ // the device is connected via WiFi to a 4G hotspot, the returned value will
+ // reflect WiFi, not 4G. This method may return SUBTYPE_UNKNOWN even if the
+ // connection type is known.
+ static ConnectionSubtype GetConnectionSubtype();
+
// Sets |max_bandwidth_mbps| to a theoretical upper limit on download
// bandwidth, potentially based on underlying connection type, signal
// strength, or some other signal. If the network subtype is unknown then
@@ -498,6 +504,7 @@ class NET_EXPORT NetworkChangeNotifier {
// Implementations must be thread-safe. Implementations must also be
// cheap as they are called often.
virtual ConnectionType GetCurrentConnectionType() const = 0;
+ virtual ConnectionSubtype GetCurrentConnectionSubtype() const;
virtual void GetCurrentMaxBandwidthAndConnectionType(
double* max_bandwidth_mbps,
ConnectionType* connection_type) const;

Powered by Google App Engine
This is Rietveld 408576698