Index: net/BUILD.gn |
diff --git a/net/BUILD.gn b/net/BUILD.gn |
index 0b34549434267b6b147020b258e8b968a28d53e1..5521227758bbd07f7eb8f319999ea73201c57bfb 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") |
@@ -51,6 +52,9 @@ declare_args() { |
# Chromecast, at least for now. This feature needs configuration (krb5.conf |
# and so on). |
use_kerberos = !is_chromeos && !is_ios && !is_chromecast |
+ |
+ # Do not disable brotli filter by default. |
+ disable_brotli_filter = false |
} |
config("net_config") { |
@@ -66,7 +70,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 |
@@ -90,12 +93,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", |
@@ -103,13 +105,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", |
@@ -117,9 +119,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", |
@@ -127,7 +129,7 @@ if (!is_nacl) { |
] |
if (!use_kerberos) { |
- net_shared_sources -= [ |
+ net_sources -= [ |
"http/http_auth_handler_negotiate.cc", |
"http/http_auth_handler_negotiate.h", |
] |
@@ -135,15 +137,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", |
@@ -151,7 +152,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", |
@@ -179,13 +180,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", |
@@ -226,7 +227,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", |
@@ -240,12 +241,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", |
@@ -255,23 +256,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", |
@@ -289,14 +290,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", |
@@ -305,13 +306,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", |
@@ -322,7 +323,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", |
@@ -330,12 +331,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", |
@@ -350,9 +351,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", |
@@ -365,7 +366,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", |
@@ -377,8 +378,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", |
@@ -386,19 +387,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", |
@@ -407,23 +408,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 = [ |
@@ -458,55 +459,36 @@ component("net") { |
} |
# ICU support. |
- deps += [ |
- "//base:i18n", |
- "//third_party/icu", |
- ] |
- sources += [ |
- "base/filename_util_icu.cc", |
- "base/net_string_util_icu.cc", |
- ] |
+ if (is_android && use_platform_icu_alternatives) { |
mef
2016/04/01 20:42:50
are nested ifs allowed in gn?
If so, maybe do
i
kapishnikov
2016/04/04 20:17:26
Done with failing the build if use_platform_icu_al
|
+ # Use ICU alternative on Android. |
+ sources += [ |
+ "base/net_string_util_icu_alternatives_android.cc", |
+ "base/net_string_util_icu_alternatives_android.h", |
+ ] |
+ defines = [ "USE_PLATFORM_ICU_ALTERNATIVES=1" ] |
+ deps += [ ":net_jni_headers" ] |
mef
2016/04/01 20:42:50
Is it needed? I'd think that net_jni_headers is ad
kapishnikov
2016/04/04 20:17:27
net_jni_headers are added automatically only if "i
|
+ } else if (is_ios && use_platform_icu_alternatives) { |
+ # Use ICU alternative on Android. |
+ sources += [ "base/net_string_util_icu_alternatives_ios.mm" ] |
+ defines = [ "USE_PLATFORM_ICU_ALTERNATIVES=1" ] |
+ } else { # use third-party ICU implementation by default. |
+ 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" ] |
+ if (!disable_brotli_filter) { |
+ sources += [ "filter/brotli_filter.cc" ] |
+ deps += [ "//third_party/brotli" ] |
+ } else { |
+ sources += [ "filter/brotli_filter_disabled.cc" ] |
+ } |
} |
} |
@@ -520,10 +502,7 @@ grit("net_resources") { |
} |
proto_library("net_quic_proto") { |
- visibility = [ |
- ":net", |
- ":net_small", |
- ] |
+ visibility = [ ":net" ] |
sources = [ |
"quic/proto/cached_network_parameters.proto", |
@@ -1381,7 +1360,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) { |
@@ -1646,7 +1625,6 @@ test("net_unittests") { |
"disk_cache/blockfile/block_files_unittest.cc", |
# Need to read input data files. |
- "filter/brotli_filter_unittest.cc", |
"filter/gzip_filter_unittest.cc", |
"socket/ssl_server_socket_unittest.cc", |
"spdy/fuzzing/hpack_fuzz_util_test.cc", |
@@ -1672,6 +1650,44 @@ 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", |
+ "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", |
+ ] |
+ } |
+ |
+ # Exclude brotli test if the support for brotli is disabled. |
+ # Also, exclude the test from iOS for now (needs to read input data files). |
+ if (disable_brotli_filter || is_ios) { |
+ sources -= [ "filter/brotli_filter_unittest.cc" ] |
+ } |
+ |
if (is_android) { |
deps += [ |
":net_test_jni_headers", |