summaryrefslogtreecommitdiffstats
path: root/net/base/net_util_posix.cc
diff options
context:
space:
mode:
authormichaelbai@google.com <michaelbai@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2011-07-11 19:54:37 +0000
committermichaelbai@google.com <michaelbai@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2011-07-11 19:54:37 +0000
commit39588997bced271d4f1f199e7fd99b51438d080e (patch)
tree09f3869fd0c89efad297de22943ba3e833a8fbb5 /net/base/net_util_posix.cc
parent76730d0e90f60b0e9b1d4b89d2387855211c59a3 (diff)
downloadchromium_src-39588997bced271d4f1f199e7fd99b51438d080e.zip
chromium_src-39588997bced271d4f1f199e7fd99b51438d080e.tar.gz
chromium_src-39588997bced271d4f1f199e7fd99b51438d080e.tar.bz2
Upstream android net related code (part 1)
BUG= TEST= Review URL: http://codereview.chromium.org/7277057 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@92040 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/base/net_util_posix.cc')
-rw-r--r--net/base/net_util_posix.cc14
1 files changed, 13 insertions, 1 deletions
diff --git a/net/base/net_util_posix.cc b/net/base/net_util_posix.cc
index af3d5d1..0412792 100644
--- a/net/base/net_util_posix.cc
+++ b/net/base/net_util_posix.cc
@@ -4,7 +4,6 @@
#include "net/base/net_util.h"
-#include <ifaddrs.h>
#include <sys/types.h>
#include "base/eintr_wrapper.h"
@@ -17,6 +16,10 @@
#include "net/base/ip_endpoint.h"
#include "net/base/net_errors.h"
+#if !defined(OS_ANDROID)
+#include <ifaddrs.h>
+#endif
+
namespace net {
bool FileURLToFilePath(const GURL& url, FilePath* path) {
@@ -54,6 +57,14 @@ bool FileURLToFilePath(const GURL& url, FilePath* path) {
}
bool GetNetworkList(NetworkInterfaceList* networks) {
+#if defined(OS_ANDROID)
+ // TODO: Android API doesn't support ifaddrs. This method was only used by
+ // P2PMessage. Consider to implement it until really needed. The possible
+ // approach is implementing the similar feature by
+ // java.net.NetworkInterface through JNI.
+ NOTIMPLEMENTED();
+ return false;
+#else
// getifaddrs() may require IO operations.
base::ThreadRestrictions::AssertIOAllowed();
@@ -79,6 +90,7 @@ bool GetNetworkList(NetworkInterfaceList* networks) {
freeifaddrs(ifaddr);
return true;
+#endif
}
} // namespace net