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

Unified Diff: net/base/network_change_notifier.h

Issue 11115009: Helper functions in NetworkChangeNotifier related to WWAN use (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Typo Created 8 years, 2 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 | « chrome/browser/chromeos/drive/drive_sync_client.cc ('k') | net/base/network_change_notifier.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/base/network_change_notifier.h
diff --git a/net/base/network_change_notifier.h b/net/base/network_change_notifier.h
index 731c305bebbf6279a0dd4e10d41488a3dbe4d3d4..521b0a789b651e2928475136bea426f2824cf584 100644
--- a/net/base/network_change_notifier.h
+++ b/net/base/network_change_notifier.h
@@ -111,6 +111,10 @@ 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.
static ConnectionType GetConnectionType();
// Retrieve the last read DnsConfig. This could be expensive if the system has
@@ -130,9 +134,14 @@ class NET_EXPORT NetworkChangeNotifier {
// |false| is inconclusive; even if some link is up, it is uncertain
// whether a particular connection attempt to a particular remote site
// will be successfully.
- static bool IsOffline() {
- return GetConnectionType() == CONNECTION_NONE;
- }
+ static bool IsOffline();
+
+ // Returns true if |type| is a cellular connection.
+ // Returns false if |type| is CONNECTION_UNKNOWN, and thus, depending on the
+ // implementation of GetConnectionType(), it is possible that
+ // IsConnectionCellular(GetConnectionType()) returns false even if the
+ // current connection is cellular.
+ static bool IsConnectionCellular(ConnectionType type);
// Like Create(), but for use in tests. The mock object doesn't monitor any
// events, it merely rebroadcasts notifications when requested.
« no previous file with comments | « chrome/browser/chromeos/drive/drive_sync_client.cc ('k') | net/base/network_change_notifier.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698