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

Unified Diff: runtime/bin/socket_android.cc

Issue 17860002: Fix runtime build for Android (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/bin/secure_socket_unsupported.cc ('k') | runtime/embedders/openglui/common/extension.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/bin/socket_android.cc
diff --git a/runtime/bin/socket_android.cc b/runtime/bin/socket_android.cc
index d83789297b2af6c7a75870e990c498aa19e7c0b7..12a35a28b367d13eaa57bf33c50074cefdcd64e8 100644
--- a/runtime/bin/socket_android.cc
+++ b/runtime/bin/socket_android.cc
@@ -12,7 +12,6 @@
#include <sys/stat.h> // NOLINT
#include <unistd.h> // NOLINT
#include <netinet/tcp.h> // NOLINT
-#include <ifaddrs.h> // NOLINT
#include "bin/fdutils.h"
#include "bin/file.h"
@@ -246,50 +245,12 @@ bool Socket::ReverseLookup(RawAddr addr,
}
-static bool ShouldIncludeIfaAddrs(struct ifaddrs* ifa, int lookup_family) {
- int family = ifa->ifa_addr->sa_family;
- if (lookup_family == family) return true;
- if (lookup_family == AF_UNSPEC &&
- (family == AF_INET || family == AF_INET6)) {
- return true;
- }
- return false;
-}
-
-
AddressList<InterfaceSocketAddress>* Socket::ListInterfaces(
int type,
OSError** os_error) {
- struct ifaddrs* ifaddr;
-
- int status = getifaddrs(&ifaddr);
- if (status != 0) {
- ASSERT(*os_error == NULL);
- *os_error = new OSError(status,
- gai_strerror(status),
- OSError::kGetAddressInfo);
- return NULL;
- }
-
- int lookup_family = SocketAddress::FromType(type);
-
- intptr_t count = 0;
- for (struct ifaddrs* ifa = ifaddr; ifa != NULL; ifa = ifa->ifa_next) {
- if (ShouldIncludeIfaAddrs(ifa, lookup_family)) count++;
- }
-
- AddressList<InterfaceSocketAddress>* addresses =
- new AddressList<InterfaceSocketAddress>(count);
- int i = 0;
- for (struct ifaddrs* ifa = ifaddr; ifa != NULL; ifa = ifa->ifa_next) {
- if (ShouldIncludeIfaAddrs(ifa, lookup_family)) {
- addresses->SetAt(i, new InterfaceSocketAddress(
- ifa->ifa_addr, strdup(ifa->ifa_name)));
- i++;
- }
- }
- freeifaddrs(ifaddr);
- return addresses;
+ // The ifaddrs.h header is not provided on Android. An Android
+ // implementation would have to use IOCTL or netlink.
+ return NULL;
}
« no previous file with comments | « runtime/bin/secure_socket_unsupported.cc ('k') | runtime/embedders/openglui/common/extension.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698