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

Unified Diff: net/base/network_change_notifier.cc

Issue 739983005: Determine connection type in NetworkChangeNotifierLinux. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address comments from patch set 4 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.cc
diff --git a/net/base/network_change_notifier.cc b/net/base/network_change_notifier.cc
index 05c72a103b8a29a50e71cca9d849ca89896f0f90..ad911163bcfe13c8bb1f11d185fbe3ddd1534557 100644
--- a/net/base/network_change_notifier.cc
+++ b/net/base/network_change_notifier.cc
@@ -656,6 +656,27 @@ bool NetworkChangeNotifier::IsConnectionCellular(ConnectionType type) {
}
// static
+NetworkChangeNotifier::ConnectionType
+NetworkChangeNotifier::ConnectionTypeFromInterfaceList(
+ const NetworkInterfaceList& interfaces) {
+ bool first = true;
+ ConnectionType result = CONNECTION_NONE;
+ for (size_t i = 0; i < interfaces.size(); ++i) {
+#if defined(OS_WIN)
+ if (interfaces[i].friendly_name == "Teredo Tunneling Pseudo-Interface")
+ continue;
+#endif
+ if (first) {
+ first = false;
+ result = interfaces[i].type;
+ } else if (result != interfaces[i].type) {
+ return CONNECTION_UNKNOWN;
+ }
+ }
+ return result;
+}
+
+// static
NetworkChangeNotifier* NetworkChangeNotifier::CreateMock() {
return new MockNetworkChangeNotifier();
}

Powered by Google App Engine
This is Rietveld 408576698