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

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

Issue 951983002: Reland "Enable libc++ on Android" (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix clang+mesa Created 5 years, 7 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 | « build/config/compiler/BUILD.gn ('k') | third_party/mesa/mesa.gyp » ('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/net_util_linux.h" 5 #include "net/base/net_util_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 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 } 61 }
62 62
63 return true; 63 return true;
64 } 64 }
65 65
66 } // namespace 66 } // namespace
67 67
68 namespace internal { 68 namespace internal {
69 69
70 inline const unsigned char* GetIPAddressData(const IPAddressNumber& ip) { 70 inline const unsigned char* GetIPAddressData(const IPAddressNumber& ip) {
71 #if defined(OS_ANDROID)
72 return ip.begin();
73 #else
74 return ip.data(); 71 return ip.data();
75 #endif
76 } 72 }
77 73
78 // Gets the connection type for interface |ifname| by checking for wireless 74 // Gets the connection type for interface |ifname| by checking for wireless
79 // or ethtool extensions. 75 // or ethtool extensions.
80 NetworkChangeNotifier::ConnectionType GetInterfaceConnectionType( 76 NetworkChangeNotifier::ConnectionType GetInterfaceConnectionType(
81 const std::string& ifname) { 77 const std::string& ifname) {
82 base::ScopedFD s(socket(AF_INET, SOCK_STREAM, 0)); 78 base::ScopedFD s(socket(AF_INET, SOCK_STREAM, 0));
83 if (!s.is_valid()) 79 if (!s.is_valid())
84 return NetworkChangeNotifier::CONNECTION_UNKNOWN; 80 return NetworkChangeNotifier::CONNECTION_UNKNOWN;
85 81
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after
221 std::string GetWifiSSID() { 217 std::string GetWifiSSID() {
222 NetworkInterfaceList networks; 218 NetworkInterfaceList networks;
223 if (GetNetworkList(&networks, INCLUDE_HOST_SCOPE_VIRTUAL_INTERFACES)) { 219 if (GetNetworkList(&networks, INCLUDE_HOST_SCOPE_VIRTUAL_INTERFACES)) {
224 return internal::GetWifiSSIDFromInterfaceListInternal( 220 return internal::GetWifiSSIDFromInterfaceListInternal(
225 networks, internal::GetInterfaceSSID); 221 networks, internal::GetInterfaceSSID);
226 } 222 }
227 return ""; 223 return "";
228 } 224 }
229 225
230 } // namespace net 226 } // namespace net
OLDNEW
« no previous file with comments | « build/config/compiler/BUILD.gn ('k') | third_party/mesa/mesa.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698