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

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

Issue 835633003: Enable libc++ on Android (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Really fix AOSP Created 5 years, 10 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
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 #include <net/if.h> 7 #include <net/if.h>
8 #include <netinet/in.h> 8 #include <netinet/in.h>
9 #include <set> 9 #include <set>
10 #include <sys/types.h> 10 #include <sys/types.h>
11 11
12 #include "base/files/file_path.h" 12 #include "base/files/file_path.h"
13 #include "base/logging.h" 13 #include "base/logging.h"
14 #include "base/memory/scoped_ptr.h" 14 #include "base/memory/scoped_ptr.h"
15 #include "base/stl_util.h"
15 #include "base/strings/string_number_conversions.h" 16 #include "base/strings/string_number_conversions.h"
16 #include "base/strings/string_tokenizer.h" 17 #include "base/strings/string_tokenizer.h"
17 #include "base/strings/string_util.h" 18 #include "base/strings/string_util.h"
18 #include "base/threading/thread_restrictions.h" 19 #include "base/threading/thread_restrictions.h"
19 #include "net/base/address_tracker_linux.h" 20 #include "net/base/address_tracker_linux.h"
20 #include "net/base/escape.h" 21 #include "net/base/escape.h"
21 #include "net/base/ip_endpoint.h" 22 #include "net/base/ip_endpoint.h"
22 #include "net/base/net_errors.h" 23 #include "net/base/net_errors.h"
23 #include "net/base/net_util_posix.h" 24 #include "net/base/net_util_posix.h"
24 #include "url/gurl.h" 25 #include "url/gurl.h"
(...skipping 30 matching lines...) Expand all
55 } 56 }
56 57
57 return true; 58 return true;
58 } 59 }
59 60
60 } // namespace 61 } // namespace
61 62
62 namespace internal { 63 namespace internal {
63 64
64 inline const unsigned char* GetIPAddressData(const IPAddressNumber& ip) { 65 inline const unsigned char* GetIPAddressData(const IPAddressNumber& ip) {
65 #if defined(OS_ANDROID) 66 return vector_as_array(&ip);
66 return ip.begin();
67 #else
68 return ip.data();
69 #endif
70 } 67 }
71 68
72 bool GetNetworkListImpl( 69 bool GetNetworkListImpl(
73 NetworkInterfaceList* networks, 70 NetworkInterfaceList* networks,
74 int policy, 71 int policy,
75 const base::hash_set<int>& online_links, 72 const base::hash_set<int>& online_links,
76 const internal::AddressTrackerLinux::AddressMap& address_map, 73 const internal::AddressTrackerLinux::AddressMap& address_map,
77 GetInterfaceNameFunction get_interface_name) { 74 GetInterfaceNameFunction get_interface_name) {
78 std::map<int, std::string> ifnames; 75 std::map<int, std::string> ifnames;
79 76
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
145 142
146 internal::AddressTrackerLinux tracker; 143 internal::AddressTrackerLinux tracker;
147 tracker.Init(); 144 tracker.Init();
148 145
149 return internal::GetNetworkListImpl(networks, policy, 146 return internal::GetNetworkListImpl(networks, policy,
150 tracker.GetOnlineLinks(), 147 tracker.GetOnlineLinks(),
151 tracker.GetAddressMap(), &if_indextoname); 148 tracker.GetAddressMap(), &if_indextoname);
152 } 149 }
153 150
154 } // namespace net 151 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698