Index: net/BUILD.gn |
diff --git a/net/BUILD.gn b/net/BUILD.gn |
index 61e60b5907e70dcf18fe1ddbd34eba4bdb66e7cd..aad29eebdffa618f52fb82b155176de9a3887a51 100644 |
--- a/net/BUILD.gn |
+++ b/net/BUILD.gn |
@@ -14,6 +14,7 @@ import("//testing/test.gni") |
import("//third_party/icu/config.gni") |
import("//third_party/protobuf/proto_library.gni") |
import("//tools/grit/grit_rule.gni") |
+import("//url/features.gni") |
if (is_android) { |
import("//build/config/android/config.gni") |
@@ -65,7 +66,6 @@ config("net_config") { |
} |
} |
-# net_internal_config is shared with net and net_small. |
config("net_internal_config") { |
defines = [ |
# TODO(GYP) Note that the GYP file supports linux_link_kerberos (defaults to |
@@ -89,12 +89,11 @@ config("net_internal_config") { |
} |
} |
-# net_shared_* are settings shared between net and net_small |
-net_shared_sources = gypi_values.net_nacl_common_sources |
+net_sources = gypi_values.net_nacl_common_sources |
-net_shared_unfiltered_sources = [] |
+net_unfiltered_sources = [] |
-net_shared_configs = [ |
+net_configs = [ |
":net_internal_config", |
"//build/config:precompiled_headers", |
@@ -102,13 +101,13 @@ net_shared_configs = [ |
"//build/config/compiler:no_size_t_to_int_warning", |
] |
-net_shared_public_deps = [ |
+net_public_deps = [ |
":net_quic_proto", |
"//crypto", |
"//crypto:platform", |
] |
-net_shared_deps = [ |
+net_deps = [ |
":net_resources", |
"//base", |
"//net/base/registry_controlled_domains", |
@@ -116,9 +115,9 @@ net_shared_deps = [ |
] |
if (!is_nacl) { |
- net_shared_sources += gypi_values.net_non_nacl_sources |
+ net_sources += gypi_values.net_non_nacl_sources |
- net_shared_deps += [ |
+ net_deps += [ |
"//base/third_party/dynamic_annotations", |
"//components/prefs", |
"//sdch", |
@@ -126,7 +125,7 @@ if (!is_nacl) { |
] |
if (!use_kerberos) { |
- net_shared_sources -= [ |
+ net_sources -= [ |
"http/http_auth_handler_negotiate.cc", |
"http/http_auth_handler_negotiate.h", |
] |
@@ -134,15 +133,14 @@ if (!is_nacl) { |
if (is_posix) { |
if (posix_avoid_mmap) { |
- net_shared_sources -= [ "disk_cache/blockfile/mapped_file_posix.cc" ] |
+ net_sources -= [ "disk_cache/blockfile/mapped_file_posix.cc" ] |
} else { |
- net_shared_sources -= |
- [ "disk_cache/blockfile/mapped_file_avoid_mmap_posix.cc" ] |
+ net_sources -= [ "disk_cache/blockfile/mapped_file_avoid_mmap_posix.cc" ] |
} |
} |
if (!enable_built_in_dns) { |
- net_shared_sources -= [ |
+ net_sources -= [ |
"dns/address_sorter_posix.cc", |
"dns/address_sorter_posix.h", |
"dns/dns_client.cc", |
@@ -150,7 +148,7 @@ if (!is_nacl) { |
} |
if (use_openssl) { |
- net_shared_sources -= [ |
+ net_sources -= [ |
"base/nss_memio.c", |
"base/nss_memio.h", |
"cert/ct_log_verifier_nss.cc", |
@@ -178,13 +176,13 @@ if (!is_nacl) { |
"ssl/token_binding_nss.cc", |
] |
if (is_ios) { |
- net_shared_sources -= [ |
+ net_sources -= [ |
"cert/x509_util_ios.cc", |
"cert/x509_util_ios.h", |
] |
} |
} else { |
- net_shared_sources -= [ |
+ net_sources -= [ |
"cert/ct_log_verifier_openssl.cc", |
"cert/ct_objects_extractor_openssl.cc", |
"cert/jwk_serializer_openssl.cc", |
@@ -225,7 +223,7 @@ if (!is_nacl) { |
} |
if (!use_openssl_certs) { |
- net_shared_sources -= [ |
+ net_sources -= [ |
"base/crypto_module_openssl.cc", |
"base/keygen_handler_openssl.cc", |
"base/openssl_private_key_store.h", |
@@ -239,12 +237,12 @@ if (!is_nacl) { |
"ssl/openssl_client_key_store.h", |
] |
if (is_android) { |
- net_shared_sources -= [ "base/openssl_private_key_store_android.cc" ] |
+ net_sources -= [ "base/openssl_private_key_store_android.cc" ] |
} |
} else { |
if (is_android) { |
# Android doesn't use these even when using OpenSSL. |
- net_shared_sources -= [ |
+ net_sources -= [ |
"base/openssl_private_key_store_memory.cc", |
"cert/cert_database_openssl.cc", |
"cert/cert_verify_proc_openssl.cc", |
@@ -254,23 +252,23 @@ if (!is_nacl) { |
} |
if (!use_kerberos || is_android) { |
- net_shared_sources -= [ |
+ net_sources -= [ |
"http/http_auth_gssapi_posix.cc", |
"http/http_auth_gssapi_posix.h", |
] |
} |
if (use_glib && use_gconf && !is_chromeos) { |
- net_shared_configs += [ "//build/config/linux:gconf" ] |
- net_shared_deps += [ "//build/linux:gio" ] |
+ net_configs += [ "//build/config/linux:gconf" ] |
+ net_deps += [ "//build/linux:gio" ] |
} |
if (is_linux) { |
- net_shared_configs += [ "//build/config/linux:libresolv" ] |
+ net_configs += [ "//build/config/linux:libresolv" ] |
} |
if (!use_nss_certs) { |
- net_shared_sources -= [ |
+ net_sources -= [ |
"base/crypto_module_nss.cc", |
"base/keygen_handler_nss.cc", |
"cert/cert_database_nss.cc", |
@@ -288,14 +286,14 @@ if (!is_nacl) { |
] |
if (is_chromeos) { |
# These were already removed on non-ChromeOS. |
- net_shared_sources -= [ |
+ net_sources -= [ |
"cert/nss_cert_database_chromeos.cc", |
"cert/nss_cert_database_chromeos.h", |
"cert/nss_profile_filter_chromeos.cc", |
"cert/nss_profile_filter_chromeos.h", |
] |
} |
- net_shared_sources -= [ |
+ net_sources -= [ |
"ssl/client_key_store.cc", |
"ssl/client_key_store.h", |
"ssl/ssl_platform_key_nss.cc", |
@@ -304,13 +302,13 @@ if (!is_nacl) { |
# client_cert_store_nss.c requires NSS_CmpCertChainWCANames from NSS's |
# libssl, but our bundled copy is not built in OpenSSL ports. Pull that file |
# in directly. |
- net_shared_sources += [ "third_party/nss/ssl/cmpcert.c" ] |
+ net_sources += [ "third_party/nss/ssl/cmpcert.c" ] |
} |
if (!use_nss_verifier) { |
# These files are part of the partial implementation of NSS for |
# cert verification, so keep them in that case. |
- net_shared_sources -= [ |
+ net_sources -= [ |
"cert/cert_verify_proc_nss.cc", |
"cert/cert_verify_proc_nss.h", |
"cert/test_root_certs_nss.cc", |
@@ -321,7 +319,7 @@ if (!is_nacl) { |
} |
if (is_ios && use_nss_verifier) { |
- net_shared_sources -= [ |
+ net_sources -= [ |
"cert/cert_verify_proc_ios.cc", |
"cert/cert_verify_proc_ios.h", |
"cert/x509_certificate_openssl_ios.cc", |
@@ -329,12 +327,12 @@ if (!is_nacl) { |
} |
if (is_chromecast && use_nss_certs) { |
- net_shared_sources += [ "ssl/ssl_platform_key_chromecast.cc" ] |
- net_shared_sources -= [ "ssl/ssl_platform_key_nss.cc" ] |
+ net_sources += [ "ssl/ssl_platform_key_chromecast.cc" ] |
+ net_sources -= [ "ssl/ssl_platform_key_nss.cc" ] |
} |
if (!enable_mdns) { |
- net_shared_sources -= [ |
+ net_sources -= [ |
"dns/mdns_cache.cc", |
"dns/mdns_cache.h", |
"dns/mdns_client.cc", |
@@ -349,9 +347,9 @@ if (!is_nacl) { |
} |
if (is_win) { |
- net_shared_sources -= [ "http/http_auth_handler_ntlm_portable.cc" ] |
+ net_sources -= [ "http/http_auth_handler_ntlm_portable.cc" ] |
} else { # !is_win |
- net_shared_sources -= [ |
+ net_sources -= [ |
"base/winsock_init.cc", |
"base/winsock_init.h", |
"base/winsock_util.cc", |
@@ -364,7 +362,7 @@ if (!is_nacl) { |
if (is_ios) { |
# Add back some sources that were otherwise filtered out. iOS needs some Mac |
# files. |
- net_shared_unfiltered_sources += [ |
+ net_unfiltered_sources += [ |
"base/mac/url_conversions.h", |
"base/mac/url_conversions.mm", |
"base/network_change_notifier_mac.cc", |
@@ -376,8 +374,8 @@ if (!is_nacl) { |
"proxy/proxy_server_mac.cc", |
] |
- net_shared_sources -= [ "disk_cache/blockfile/file_posix.cc" ] |
- net_shared_deps += [ |
+ net_sources -= [ "disk_cache/blockfile/file_posix.cc" ] |
+ net_deps += [ |
"//third_party/nss:nspr", |
"//third_party/nss", |
"//net/third_party/nss/ssl:libssl", |
@@ -385,19 +383,19 @@ if (!is_nacl) { |
} |
if (is_ios && !use_nss_verifier) { |
- net_shared_sources += [ "cert/test_root_certs_mac.cc" ] |
+ net_sources += [ "cert/test_root_certs_mac.cc" ] |
} |
if (is_ios || is_mac) { |
- net_shared_sources += gypi_values.net_base_mac_ios_sources |
+ net_sources += gypi_values.net_base_mac_ios_sources |
} |
if (is_android) { |
- net_shared_deps += [ ":net_jni_headers" ] |
+ net_deps += [ ":net_jni_headers" ] |
# Add some Linux sources that were excluded by the filter, but which |
# are needed. |
- net_shared_unfiltered_sources += [ |
+ net_unfiltered_sources += [ |
"base/address_tracker_linux.cc", |
"base/address_tracker_linux.h", |
"base/network_interfaces_linux.cc", |
@@ -406,23 +404,23 @@ if (!is_nacl) { |
] |
} |
} else { |
- net_shared_public_deps += [ "//native_client_sdk/src/libraries/nacl_io" ] |
+ net_public_deps += [ "//native_client_sdk/src/libraries/nacl_io" ] |
} |
component("net") { |
- sources = net_shared_sources |
+ sources = net_sources |
# Add back some sources that were otherwise filtered out. |
set_sources_assignment_filter([]) |
- sources += net_shared_unfiltered_sources |
+ sources += net_unfiltered_sources |
set_sources_assignment_filter(sources_assignment_filter) |
cflags = [] |
- configs += net_shared_configs |
+ configs += net_configs |
public_configs = [ ":net_config" ] |
- public_deps = net_shared_public_deps + [ "//url" ] |
- deps = net_shared_deps |
+ public_deps = net_public_deps + [ "//url" ] |
+ deps = net_deps |
if (is_mac) { |
libs = [ |
@@ -456,56 +454,43 @@ component("net") { |
sources += gypi_values.net_websockets_sources |
} |
- # ICU support. |
- deps += [ |
- "//base:i18n", |
- "//third_party/icu", |
- ] |
- sources += [ |
- "base/filename_util_icu.cc", |
- "base/net_string_util_icu.cc", |
- ] |
- |
- # Brotli support. |
- deps += [ "//third_party/brotli" ] |
- sources += [ "filter/brotli_filter.cc" ] |
- } |
-} |
- |
-if (is_android) { |
- # Same as net, but with brotli encoding, ICU, file, ftp, and websocket |
- # support stripped. |
- component("net_small") { |
- sources = net_shared_sources |
- |
- # Add back some sources that were otherwise filtered out. |
- set_sources_assignment_filter([]) |
- sources += net_shared_unfiltered_sources |
- set_sources_assignment_filter(sources_assignment_filter) |
- |
- cflags = [] |
- defines = [] |
- configs += net_shared_configs |
- public_configs = [ ":net_config" ] |
- |
- public_deps = net_shared_public_deps + |
- [ "//url:url_lib_use_icu_alternatives_on_android" ] |
- deps = net_shared_deps + [ ":net_jni_headers" ] |
- |
- defines += [ |
- "DISABLE_FILE_SUPPORT", |
- "DISABLE_FTP_SUPPORT", |
- "USE_ICU_ALTERNATIVES_ON_ANDROID=1", |
- ] |
- |
- # Use ICU alternative on Android. |
- sources += [ |
- "base/net_string_util_icu_alternatives_android.cc", |
- "base/net_string_util_icu_alternatives_android.h", |
- ] |
- |
- # Disable Brotli support. |
- sources += [ "filter/brotli_filter_disabled.cc" ] |
+ # ICU & Brotli support. |
+ if (is_android && use_platform_icu_alternatives) { |
+ # Use ICU alternative on Android & Disable Brotli support. |
+ sources += [ |
+ "base/net_string_util_icu_alternatives_android.cc", |
+ "base/net_string_util_icu_alternatives_android.h", |
+ "filter/brotli_filter_disabled.cc", |
+ ] |
+ defines = [ |
+ "DISABLE_FILE_SUPPORT", |
+ "DISABLE_FTP_SUPPORT", |
xunjieli
2016/04/01 14:16:43
These two defines should not be here?
kapishnikov
2016/04/01 18:55:01
Nice catch. These two defines come from "net_confi
|
+ "USE_PLATFORM_ICU_ALTERNATIVES=1", |
+ ] |
+ deps += [ ":net_jni_headers" ] |
+ } else if (is_ios && use_platform_icu_alternatives) { |
+ # Use ICU alternative on Android & Disable Brotli support. |
+ sources += [ |
+ "base/net_string_util_icu_alternatives_ios.mm", |
+ "filter/brotli_filter_disabled.cc", |
+ ] |
+ defines = [ |
+ "DISABLE_FILE_SUPPORT", |
+ "DISABLE_FTP_SUPPORT", |
xunjieli
2016/04/01 14:16:43
These two defines should not be here?
kapishnikov
2016/04/01 18:55:01
Removed.
|
+ "USE_PLATFORM_ICU_ALTERNATIVES=1", |
+ ] |
+ } else { # use third-party ICU implementation by default. |
+ deps += [ |
+ "//base:i18n", |
+ "//third_party/brotli", |
+ "//third_party/icu", |
+ ] |
+ sources += [ |
+ "base/filename_util_icu.cc", |
+ "base/net_string_util_icu.cc", |
+ "filter/brotli_filter.cc", |
+ ] |
+ } |
} |
} |
@@ -519,10 +504,7 @@ grit("net_resources") { |
} |
proto_library("net_quic_proto") { |
- visibility = [ |
- ":net", |
- ":net_small", |
- ] |
+ visibility = [ ":net" ] |
sources = [ |
"quic/proto/cached_network_parameters.proto", |
@@ -1380,7 +1362,7 @@ source_set("stale_while_revalidate_experiment_domains") { |
":stale_while_revalidate_experiment_domains_dafsa", |
"//base", |
] |
- configs += net_shared_configs |
+ configs += net_configs |
} |
if (!is_ios) { |
@@ -1431,7 +1413,7 @@ bundle_data("net_unittests_bundle_data") { |
test("net_unittests") { |
sources = gypi_values.net_test_sources |
- if (is_ios) { |
+ if (is_ios && enable_websockets) { |
sources -= [ |
"websockets/websocket_stream_cookie_test.cc", |
"websockets/websocket_stream_create_test_base.cc", |
@@ -1592,6 +1574,8 @@ test("net_unittests") { |
"websockets/websocket_handshake_challenge_test.cc", |
"websockets/websocket_handshake_stream_create_helper_test.cc", |
"websockets/websocket_inflater_test.cc", |
+ "websockets/websocket_stream_cookie_test.cc", |
+ "websockets/websocket_stream_create_test_base.cc", |
"websockets/websocket_stream_test.cc", |
"websockets/websocket_test_util.cc", |
"websockets/websocket_test_util.h", |
@@ -1703,6 +1687,39 @@ test("net_unittests") { |
] |
} |
+ # Unit tests that are not supported by the current ICU alternatives on Android. |
+ if (is_android && use_platform_icu_alternatives) { |
+ sources -= [ |
+ "base/filename_util_unittest.cc", |
+ "base/url_util_unittest.cc", |
+ "cert/x509_certificate_unittest.cc", |
+ "filter/brotli_filter_unittest.cc", |
+ "proxy/proxy_resolver_v8_unittest.cc", |
+ "url_request/url_request_job_unittest.cc", |
+ ] |
+ } |
+ |
+ # Unit tests that are not supported by the current ICU alternatives on iOS. |
+ if (is_ios && use_platform_icu_alternatives) { |
+ sources -= [ |
+ "base/filename_util_unittest.cc", |
+ "base/url_util_unittest.cc", |
+ "cert/x509_certificate_unittest.cc", |
+ "http/http_auth_handler_basic_unittest.cc", |
+ "http/http_auth_handler_digest_unittest.cc", |
+ "http/http_auth_handler_factory_unittest.cc", |
+ "http/http_auth_unittest.cc", |
+ "http/http_content_disposition_unittest.cc", |
+ "http/http_network_transaction_unittest.cc", |
+ "http/http_proxy_client_socket_pool_unittest.cc", |
+ "socket/ssl_client_socket_pool_unittest.cc", |
+ "spdy/spdy_network_transaction_unittest.cc", |
+ "spdy/spdy_proxy_client_socket_unittest.cc", |
+ "url_request/url_request_job_unittest.cc", |
+ "url_request/url_request_unittest.cc", |
+ ] |
+ } |
+ |
if (is_android) { |
deps += [ |
":net_test_jni_headers", |