Index: net/base/network_change_notifier.h |
diff --git a/net/base/network_change_notifier.h b/net/base/network_change_notifier.h |
index 73842d4bd5f66a5475625595d3a4c84d8c8634d8..964fcf3c4b9a3a050a8030fe65da8bd0b4b0a304 100644 |
--- a/net/base/network_change_notifier.h |
+++ b/net/base/network_change_notifier.h |
@@ -5,6 +5,8 @@ |
#ifndef NET_BASE_NETWORK_CHANGE_NOTIFIER_H_ |
#define NET_BASE_NETWORK_CHANGE_NOTIFIER_H_ |
+#include <vector> |
+ |
#include "base/basictypes.h" |
#include "base/observer_list_threadsafe.h" |
#include "base/time/time.h" |
@@ -17,6 +19,8 @@ namespace net { |
struct DnsConfig; |
class HistogramWatcher; |
class NetworkChangeNotifierFactory; |
+struct NetworkInterface; |
+typedef std::vector<NetworkInterface> NetworkInterfaceList; |
class URLRequest; |
#if defined(OS_LINUX) |
@@ -258,6 +262,13 @@ class NET_EXPORT NetworkChangeNotifier { |
// current connection is cellular. |
static bool IsConnectionCellular(ConnectionType type); |
+ // Gets the current connection type based on |interfaces|. Returns |
+ // CONNECTION_NONE if there are no interfaces, CONNECTION_UNKNOWN if two |
+ // interfaces have different connection types or the connection type of all |
+ // interfaces if they have the same interface type. |
+ static ConnectionType ConnectionTypeFromInterfaceList( |
+ const NetworkInterfaceList& interfaces); |
+ |
// Like Create(), but for use in tests. The mock object doesn't monitor any |
// events, it merely rebroadcasts notifications when requested. |
static NetworkChangeNotifier* CreateMock(); |