Commit 18f84065 authored by sergeyu@chromium.org's avatar sergeyu@chromium.org

Compile src/net for PNaCl

The new net_nacl target builds net code for PNaCl. It will be used for
remoting client, and so it excludes parts that are not used in the
remoting, e.g. net/disk_cache, net/proxy, net/spdy, net/quic.

BUG=276739

Review URL: https://codereview.chromium.org/188873004

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@263069 0039d316-1c4b-4281-b951-d872f2087c98
parent dfd41d44
...@@ -20,13 +20,15 @@ ...@@ -20,13 +20,15 @@
#pragma comment(lib, "iphlpapi.lib") #pragma comment(lib, "iphlpapi.lib")
#elif defined(OS_POSIX) #elif defined(OS_POSIX)
#include <fcntl.h> #include <fcntl.h>
#if !defined(OS_ANDROID)
#include <ifaddrs.h>
#endif
#include <net/if.h>
#include <netdb.h> #include <netdb.h>
#include <netinet/in.h> #include <netinet/in.h>
#endif #if !defined(OS_NACL)
#include <net/if.h>
#if !defined(OS_ANDROID)
#include <ifaddrs.h>
#endif // !defined(OS_NACL)
#endif // !defined(OS_ANDROID)
#endif // defined(OS_POSIX)
#include "base/basictypes.h" #include "base/basictypes.h"
#include "base/i18n/time_formatting.h" #include "base/i18n/time_formatting.h"
...@@ -55,16 +57,10 @@ ...@@ -55,16 +57,10 @@
#include "url/url_canon.h" #include "url/url_canon.h"
#include "url/url_canon_ip.h" #include "url/url_canon_ip.h"
#include "url/url_parse.h" #include "url/url_parse.h"
#if defined(OS_ANDROID)
#include "net/android/network_library.h"
#endif
#include "net/base/dns_util.h" #include "net/base/dns_util.h"
#include "net/base/escape.h" #include "net/base/escape.h"
#include "net/base/net_module.h" #include "net/base/net_module.h"
#include "net/base/registry_controlled_domains/registry_controlled_domain.h" #include "net/base/registry_controlled_domains/registry_controlled_domain.h"
#if defined(OS_WIN)
#include "net/base/winsock_init.h"
#endif
#include "net/http/http_content_disposition.h" #include "net/http/http_content_disposition.h"
#include "third_party/icu/source/common/unicode/uidna.h" #include "third_party/icu/source/common/unicode/uidna.h"
#include "third_party/icu/source/common/unicode/uniset.h" #include "third_party/icu/source/common/unicode/uniset.h"
...@@ -74,6 +70,13 @@ ...@@ -74,6 +70,13 @@
#include "third_party/icu/source/i18n/unicode/regex.h" #include "third_party/icu/source/i18n/unicode/regex.h"
#include "third_party/icu/source/i18n/unicode/ulocdata.h" #include "third_party/icu/source/i18n/unicode/ulocdata.h"
#if defined(OS_ANDROID)
#include "net/android/network_library.h"
#endif
#if defined(OS_WIN)
#include "net/base/winsock_init.h"
#endif
using base::Time; using base::Time;
namespace net { namespace net {
...@@ -1264,6 +1267,10 @@ std::string IPAddressToPackedString(const IPAddressNumber& addr) { ...@@ -1264,6 +1267,10 @@ std::string IPAddressToPackedString(const IPAddressNumber& addr) {
} }
std::string GetHostName() { std::string GetHostName() {
#if defined(OS_NACL)
NOTIMPLEMENTED();
return std::string();
#else // defined(OS_NACL)
#if defined(OS_WIN) #if defined(OS_WIN)
EnsureWinsockInit(); EnsureWinsockInit();
#endif #endif
...@@ -1276,6 +1283,7 @@ std::string GetHostName() { ...@@ -1276,6 +1283,7 @@ std::string GetHostName() {
buffer[0] = '\0'; buffer[0] = '\0';
} }
return std::string(buffer); return std::string(buffer);
#endif // !defined(OS_NACL)
} }
void GetIdentityFromURL(const GURL& url, void GetIdentityFromURL(const GURL& url,
...@@ -1541,6 +1549,9 @@ ScopedPortException::~ScopedPortException() { ...@@ -1541,6 +1549,9 @@ ScopedPortException::~ScopedPortException() {
bool HaveOnlyLoopbackAddresses() { bool HaveOnlyLoopbackAddresses() {
#if defined(OS_ANDROID) #if defined(OS_ANDROID)
return android::HaveOnlyLoopbackAddresses(); return android::HaveOnlyLoopbackAddresses();
#elif defined(OS_NACL)
NOTIMPLEMENTED();
return false;
#elif defined(OS_POSIX) #elif defined(OS_POSIX)
struct ifaddrs* interface_addr = NULL; struct ifaddrs* interface_addr = NULL;
int rv = getifaddrs(&interface_addr); int rv = getifaddrs(&interface_addr);
......
...@@ -18,11 +18,11 @@ ...@@ -18,11 +18,11 @@
#include "net/base/net_errors.h" #include "net/base/net_errors.h"
#include "url/gurl.h" #include "url/gurl.h"
#if !defined(OS_ANDROID) #if !defined(OS_ANDROID) && !defined(OS_NACL)
#include <ifaddrs.h> #include <ifaddrs.h>
#endif
#include <net/if.h> #include <net/if.h>
#include <netinet/in.h> #include <netinet/in.h>
#endif
#if defined(OS_MACOSX) && !defined(OS_IOS) #if defined(OS_MACOSX) && !defined(OS_IOS)
#include <netinet/in_var.h> #include <netinet/in_var.h>
...@@ -86,7 +86,10 @@ void RemovePermanentIPv6AddressesWhereTemporaryExists( ...@@ -86,7 +86,10 @@ void RemovePermanentIPv6AddressesWhereTemporaryExists(
} // namespace } // namespace
bool GetNetworkList(NetworkInterfaceList* networks, int policy) { bool GetNetworkList(NetworkInterfaceList* networks, int policy) {
#if defined(OS_ANDROID) #if defined(OS_NACL)
NOTIMPLEMENTED();
return false;
#elif defined(OS_ANDROID)
std::string network_list = android::GetNetworkList(); std::string network_list = android::GetNetworkList();
base::StringTokenizer network_interfaces(network_list, "\n"); base::StringTokenizer network_interfaces(network_list, "\n");
while (network_interfaces.GetNext()) { while (network_interfaces.GetNext()) {
......
This diff is collapsed.
# Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
{
'variables': {
# Subset of net source files that are compiled for NaCl (net_nacl target).
# These files must not depend on files listed in sources list in the net
# target.
'net_nacl_common_sources' : [
'base/address_family.h',
'base/address_list.cc',
'base/address_list.h',
'base/auth.cc',
'base/auth.h',
'base/completion_callback.h',
'base/connection_type_histograms.cc',
'base/connection_type_histograms.h',
'base/dns_util.cc',
'base/dns_util.h',
'base/escape.cc',
'base/escape.h',
'base/hash_value.cc',
'base/hash_value.h',
'base/load_timing_info.cc',
'base/load_timing_info.h',
'base/host_port_pair.cc',
'base/host_port_pair.h',
'base/io_buffer.cc',
'base/io_buffer.h',
'base/ip_endpoint.cc',
'base/ip_endpoint.h',
'base/net_error_list.h',
'base/net_errors.cc',
'base/net_errors.h',
'base/net_errors_posix.cc',
'base/net_export.h',
'base/net_log.cc',
'base/net_log.h',
'base/net_log_event_type_list.h',
'base/net_log_source_type_list.h',
'base/net_module.cc',
'base/net_module.h',
'base/net_util.cc',
'base/net_util.h',
'base/net_util_posix.cc',
'base/openssl_private_key_store.h',
'base/openssl_private_key_store_android.cc',
'base/openssl_private_key_store_memory.cc',
'base/rand_callback.h',
'base/registry_controlled_domains/registry_controlled_domain.cc',
'base/registry_controlled_domains/registry_controlled_domain.h',
'base/sys_addrinfo.h',
'base/zap.cc',
'base/zap.h',
'cert/asn1_util.cc',
'cert/asn1_util.h',
'cert/cert_database.cc',
'cert/cert_database.h',
'cert/cert_database_openssl.cc',
'cert/cert_status_flags.cc',
'cert/cert_status_flags.h',
'cert/cert_verifier.cc',
'cert/cert_verifier.h',
'cert/cert_verify_result.cc',
'cert/cert_verify_result.h',
'cert/pem_tokenizer.cc',
'cert/pem_tokenizer.h',
'cert/signed_certificate_timestamp.cc',
'cert/signed_certificate_timestamp.h',
'cert/single_request_cert_verifier.cc',
'cert/single_request_cert_verifier.h',
'cert/x509_cert_types.cc',
'cert/x509_cert_types.h',
'cert/x509_certificate.cc',
'cert/x509_certificate.h',
'cert/x509_certificate_net_log_param.cc',
'cert/x509_certificate_net_log_param.h',
'cert/x509_certificate_openssl.cc',
'cert/x509_util.cc',
'cert/x509_util.h',
'cert/x509_util_openssl.cc',
'cert/x509_util_openssl.h',
'http/http_auth_challenge_tokenizer.cc',
'http/http_auth_challenge_tokenizer.h',
'http/http_byte_range.cc',
'http/http_byte_range.h',
'http/http_log_util.cc',
'http/http_log_util.h',
'http/http_request_headers.cc',
'http/http_request_headers.h',
'http/http_response_headers.cc',
'http/http_response_headers.h',
'http/http_response_info.cc',
'http/http_response_info.h',
'http/http_security_headers.cc',
'http/http_security_headers.h',
'http/http_util.cc',
'http/http_util.h',
'http/http_util_icu.cc',
'http/http_vary_data.cc',
'http/http_vary_data.h',
'http/transport_security_state.cc',
'http/transport_security_state.h',
'socket/client_socket_handle.cc',
'socket/client_socket_handle.h',
'socket/client_socket_pool_histograms.cc',
'socket/client_socket_pool_histograms.h',
'socket/next_proto.h',
'socket/socket.h',
'socket/ssl_client_socket.cc',
'socket/ssl_client_socket.h',
'socket/ssl_client_socket_openssl.cc',
'socket/ssl_client_socket_openssl.h',
'socket/ssl_client_socket_pool.cc',
'socket/ssl_client_socket_pool.h',
'socket/ssl_error_params.cc',
'socket/ssl_error_params.h',
'socket/ssl_session_cache_openssl.cc',
'socket/ssl_session_cache_openssl.h',
'socket/ssl_socket.h',
'ssl/default_server_bound_cert_store.cc',
'ssl/default_server_bound_cert_store.h',
'ssl/openssl_client_key_store.cc',
'ssl/openssl_client_key_store.h',
'ssl/server_bound_cert_service.cc',
'ssl/server_bound_cert_service.h',
'ssl/server_bound_cert_store.cc',
'ssl/server_bound_cert_store.h',
'ssl/signed_certificate_timestamp_and_status.cc',
'ssl/signed_certificate_timestamp_and_status.h',
'ssl/ssl_cert_request_info.cc',
'ssl/ssl_cert_request_info.h',
'ssl/ssl_client_auth_cache.cc',
'ssl/ssl_client_auth_cache.h',
'ssl/ssl_client_cert_type.h',
'ssl/ssl_config.cc',
'ssl/ssl_config.h',
'ssl/ssl_info.cc',
'ssl/ssl_info.h',
],
}
}
# Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
{
'variables': {
'chromium_code': 1,
},
'includes': [
'../native_client/build/untrusted.gypi',
'net.gypi',
],
'targets': [
{
'target_name': 'net_nacl',
'type': 'none',
'variables': {
'nacl_untrusted_build': 1,
'nlib_target': 'libnet_nacl.a',
'build_glibc': 0,
'build_newlib': 0,
'build_pnacl_newlib': 1,
},
'dependencies': [
'../crypto/crypto_nacl.gyp:crypto_nacl',
'../native_client/tools.gyp:prep_toolchain',
'../native_client_sdk/native_client_sdk_untrusted.gyp:nacl_io_untrusted',
'../third_party/openssl/openssl_nacl.gyp:openssl_nacl',
'../url/url_nacl.gyp:url_nacl',
'net.gyp:net_resources',
],
'defines': [
'NET_IMPLEMENTATION',
],
'pnacl_compile_flags': [
'-Wno-bind-to-temporary-copy',
],
'sources': [
'<@(net_nacl_common_sources)',
],
},
],
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment