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

Unified Diff: net/base/net_util.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 3 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/net_util.cc
diff --git a/net/base/net_util.cc b/net/base/net_util.cc
index 3b49dffb5c20d889003a09755276ddaa8e41542d..d842c5ac853f304953791cdb1f82142a445e64ff 100644
--- a/net/base/net_util.cc
+++ b/net/base/net_util.cc
@@ -1037,6 +1037,18 @@ NetworkInterface::NetworkInterface(const std::string& name,
NetworkInterface::~NetworkInterface() {
}
+NetworkChangeNotifier::ConnectionType ConnectionTypeFromInterfaceList(
pauljensen 2015/01/15 15:05:10 Please move to network_change_notifier.cc
derekjchow1 2015/01/15 20:32:51 Done.
+ const NetworkInterfaceList& interfaces) {
+ if (interfaces.empty())
+ return NetworkChangeNotifier::CONNECTION_NONE;
+
pauljensen 2015/01/15 15:05:10 Please rework this to ignore the terredo interface
derekjchow1 2015/01/15 20:32:51 Done.
+ for (size_t i = 1; i < interfaces.size(); ++i) {
+ if (interfaces[i].type != interfaces[0].type)
+ return NetworkChangeNotifier::CONNECTION_UNKNOWN;
+ }
+ return interfaces[0].type;
+}
+
unsigned CommonPrefixLength(const IPAddressNumber& a1,
const IPAddressNumber& a2) {
DCHECK_EQ(a1.size(), a2.size());

Powered by Google App Engine
This is Rietveld 408576698