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

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

Issue 1884453002: Revert of Convert //net and //chromecast to std::unordered_* (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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 | « net/base/network_interfaces_linux.h ('k') | net/base/network_interfaces_unittest.cc » ('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) 2014 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2014 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_interfaces_linux.h" 5 #include "net/base/network_interfaces_linux.h"
6 6
7 #if !defined(OS_ANDROID) 7 #if !defined(OS_ANDROID)
8 #include <linux/ethtool.h> 8 #include <linux/ethtool.h>
9 #endif // !defined(OS_ANDROID) 9 #endif // !defined(OS_ANDROID)
10 #include <linux/if.h> 10 #include <linux/if.h>
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
106 wreq.u.essid.pointer = ssid; 106 wreq.u.essid.pointer = ssid;
107 wreq.u.essid.length = IW_ESSID_MAX_SIZE; 107 wreq.u.essid.length = IW_ESSID_MAX_SIZE;
108 if (ioctl(ioctl_socket.get(), SIOCGIWESSID, &wreq) != -1) 108 if (ioctl(ioctl_socket.get(), SIOCGIWESSID, &wreq) != -1)
109 return ssid; 109 return ssid;
110 return ""; 110 return "";
111 } 111 }
112 112
113 bool GetNetworkListImpl( 113 bool GetNetworkListImpl(
114 NetworkInterfaceList* networks, 114 NetworkInterfaceList* networks,
115 int policy, 115 int policy,
116 const std::unordered_set<int>& online_links, 116 const base::hash_set<int>& online_links,
117 const internal::AddressTrackerLinux::AddressMap& address_map, 117 const internal::AddressTrackerLinux::AddressMap& address_map,
118 GetInterfaceNameFunction get_interface_name) { 118 GetInterfaceNameFunction get_interface_name) {
119 std::map<int, std::string> ifnames; 119 std::map<int, std::string> ifnames;
120 120
121 for (internal::AddressTrackerLinux::AddressMap::const_iterator it = 121 for (internal::AddressTrackerLinux::AddressMap::const_iterator it =
122 address_map.begin(); 122 address_map.begin();
123 it != address_map.end(); ++it) { 123 it != address_map.end(); ++it) {
124 // Ignore addresses whose links are not online. 124 // Ignore addresses whose links are not online.
125 if (online_links.find(it->second.ifa_index) == online_links.end()) 125 if (online_links.find(it->second.ifa_index) == online_links.end())
126 continue; 126 continue;
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
213 std::string GetWifiSSID() { 213 std::string GetWifiSSID() {
214 NetworkInterfaceList networks; 214 NetworkInterfaceList networks;
215 if (GetNetworkList(&networks, INCLUDE_HOST_SCOPE_VIRTUAL_INTERFACES)) { 215 if (GetNetworkList(&networks, INCLUDE_HOST_SCOPE_VIRTUAL_INTERFACES)) {
216 return internal::GetWifiSSIDFromInterfaceListInternal( 216 return internal::GetWifiSSIDFromInterfaceListInternal(
217 networks, internal::GetInterfaceSSID); 217 networks, internal::GetInterfaceSSID);
218 } 218 }
219 return ""; 219 return "";
220 } 220 }
221 221
222 } // namespace net 222 } // namespace net
OLDNEW
« no previous file with comments | « net/base/network_interfaces_linux.h ('k') | net/base/network_interfaces_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698