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

Side by Side Diff: net/base/network_change_notifier.cc

Issue 2896203003: [NetworkChangeNotifier] Return more specific network connection types (ethernet/wifi) on OSX (Closed)
Patch Set: Address issues from PS5 Created 3 years, 6 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 unified diff | Download patch
« no previous file with comments | « no previous file | net/base/network_change_notifier_mac.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "net/base/network_change_notifier.h" 5 #include "net/base/network_change_notifier.h"
6 6
7 #include <limits> 7 #include <limits>
8 #include <unordered_set> 8 #include <unordered_set>
9 9
10 #include "base/macros.h" 10 #include "base/macros.h"
(...skipping 797 matching lines...) Expand 10 before | Expand all | Expand 10 after
808 NetworkChangeNotifier::ConnectionType 808 NetworkChangeNotifier::ConnectionType
809 NetworkChangeNotifier::ConnectionTypeFromInterfaceList( 809 NetworkChangeNotifier::ConnectionTypeFromInterfaceList(
810 const NetworkInterfaceList& interfaces) { 810 const NetworkInterfaceList& interfaces) {
811 bool first = true; 811 bool first = true;
812 ConnectionType result = CONNECTION_NONE; 812 ConnectionType result = CONNECTION_NONE;
813 for (size_t i = 0; i < interfaces.size(); ++i) { 813 for (size_t i = 0; i < interfaces.size(); ++i) {
814 #if defined(OS_WIN) 814 #if defined(OS_WIN)
815 if (interfaces[i].friendly_name == "Teredo Tunneling Pseudo-Interface") 815 if (interfaces[i].friendly_name == "Teredo Tunneling Pseudo-Interface")
816 continue; 816 continue;
817 #endif 817 #endif
818 #if defined(OS_MACOSX)
819 // Ignore tunnel and airdrop interfaces.
820 if (base::StartsWith(interfaces[i].friendly_name, "utun",
821 base::CompareCase::SENSITIVE) ||
822 base::StartsWith(interfaces[i].friendly_name, "awdl",
823 base::CompareCase::SENSITIVE)) {
824 continue;
825 }
826 #endif
827
818 // Remove VMware network interfaces as they're internal and should not be 828 // Remove VMware network interfaces as they're internal and should not be
819 // used to determine the network connection type. 829 // used to determine the network connection type.
820 if (base::ToLowerASCII(interfaces[i].friendly_name).find("vmnet") != 830 if (base::ToLowerASCII(interfaces[i].friendly_name).find("vmnet") !=
821 std::string::npos) { 831 std::string::npos) {
822 continue; 832 continue;
823 } 833 }
824 if (first) { 834 if (first) {
825 first = false; 835 first = false;
826 result = interfaces[i].type; 836 result = interfaces[i].type;
827 } else if (result != interfaces[i].type) { 837 } else if (result != interfaces[i].type) {
(...skipping 369 matching lines...) Expand 10 before | Expand all | Expand 10 after
1197 1207
1198 NetworkChangeNotifier::DisableForTest::~DisableForTest() { 1208 NetworkChangeNotifier::DisableForTest::~DisableForTest() {
1199 DCHECK(!g_network_change_notifier); 1209 DCHECK(!g_network_change_notifier);
1200 g_network_change_notifier = network_change_notifier_; 1210 g_network_change_notifier = network_change_notifier_;
1201 } 1211 }
1202 1212
1203 void NetworkChangeNotifier::DNSObserver::OnInitialDNSConfigRead() { 1213 void NetworkChangeNotifier::DNSObserver::OnInitialDNSConfigRead() {
1204 } 1214 }
1205 1215
1206 } // namespace net 1216 } // namespace net
OLDNEW
« no previous file with comments | « no previous file | net/base/network_change_notifier_mac.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698