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

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

Issue 1897033002: Reland 'Convert //net and //chromecast to std::unordered_*' (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix TestDownloadRequestHandler 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 #include <memory> 7 #include <memory>
8 8
9 #if !defined(OS_ANDROID) 9 #if !defined(OS_ANDROID)
10 #include <linux/ethtool.h> 10 #include <linux/ethtool.h>
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
107 wreq.u.essid.pointer = ssid; 107 wreq.u.essid.pointer = ssid;
108 wreq.u.essid.length = IW_ESSID_MAX_SIZE; 108 wreq.u.essid.length = IW_ESSID_MAX_SIZE;
109 if (ioctl(ioctl_socket.get(), SIOCGIWESSID, &wreq) != -1) 109 if (ioctl(ioctl_socket.get(), SIOCGIWESSID, &wreq) != -1)
110 return ssid; 110 return ssid;
111 return ""; 111 return "";
112 } 112 }
113 113
114 bool GetNetworkListImpl( 114 bool GetNetworkListImpl(
115 NetworkInterfaceList* networks, 115 NetworkInterfaceList* networks,
116 int policy, 116 int policy,
117 const base::hash_set<int>& online_links, 117 const std::unordered_set<int>& online_links,
118 const internal::AddressTrackerLinux::AddressMap& address_map, 118 const internal::AddressTrackerLinux::AddressMap& address_map,
119 GetInterfaceNameFunction get_interface_name) { 119 GetInterfaceNameFunction get_interface_name) {
120 std::map<int, std::string> ifnames; 120 std::map<int, std::string> ifnames;
121 121
122 for (internal::AddressTrackerLinux::AddressMap::const_iterator it = 122 for (internal::AddressTrackerLinux::AddressMap::const_iterator it =
123 address_map.begin(); 123 address_map.begin();
124 it != address_map.end(); ++it) { 124 it != address_map.end(); ++it) {
125 // Ignore addresses whose links are not online. 125 // Ignore addresses whose links are not online.
126 if (online_links.find(it->second.ifa_index) == online_links.end()) 126 if (online_links.find(it->second.ifa_index) == online_links.end())
127 continue; 127 continue;
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
214 std::string GetWifiSSID() { 214 std::string GetWifiSSID() {
215 NetworkInterfaceList networks; 215 NetworkInterfaceList networks;
216 if (GetNetworkList(&networks, INCLUDE_HOST_SCOPE_VIRTUAL_INTERFACES)) { 216 if (GetNetworkList(&networks, INCLUDE_HOST_SCOPE_VIRTUAL_INTERFACES)) {
217 return internal::GetWifiSSIDFromInterfaceListInternal( 217 return internal::GetWifiSSIDFromInterfaceListInternal(
218 networks, internal::GetInterfaceSSID); 218 networks, internal::GetInterfaceSSID);
219 } 219 }
220 return ""; 220 return "";
221 } 221 }
222 222
223 } // namespace net 223 } // 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