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

Unified Diff: net/base/network_change_notifier.h

Issue 895853003: Update from https://crrev.com/314320 (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: 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
« no previous file with comments | « net/base/net_util_unittest.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 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();
« no previous file with comments | « net/base/net_util_unittest.cc ('k') | net/base/network_change_notifier.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698