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

Unified Diff: net/base/network_change_notifier.h

Issue 739983005: Determine connection type in NetworkChangeNotifierLinux. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address comments in patchset 9 Created 5 years, 11 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 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();

Powered by Google App Engine
This is Rietveld 408576698