| Index: net/BUILD.gn
|
| diff --git a/net/BUILD.gn b/net/BUILD.gn
|
| index fdfe0b690788fc7fd8e6c528594a0a632609fa3a..fea8c2aee0a76b52871acd236b000c7424364905 100644
|
| --- a/net/BUILD.gn
|
| +++ b/net/BUILD.gn
|
| @@ -14,6 +14,12 @@ 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")
|
| +
|
| +buildflag_header("features") {
|
| + header = "features.h"
|
| + flags = [ "USE_PLATFORM_ICU_ALTERNATIVES=$use_platform_icu_alternatives" ]
|
| +}
|
|
|
| if (is_android) {
|
| import("//build/config/android/config.gni")
|
| @@ -51,6 +57,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 +75,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 +98,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 +110,14 @@ 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 = [
|
| + ":features",
|
| ":net_resources",
|
| "//base",
|
| "//net/base/registry_controlled_domains",
|
| @@ -117,9 +125,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 +135,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 +143,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 +158,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",
|
| @@ -177,13 +184,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",
|
| @@ -222,7 +229,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",
|
| @@ -236,12 +243,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",
|
| @@ -251,23 +258,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",
|
| @@ -285,14 +292,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",
|
| @@ -301,13 +308,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",
|
| @@ -318,7 +325,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",
|
| @@ -326,12 +333,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",
|
| @@ -346,9 +353,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",
|
| @@ -361,7 +368,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",
|
| @@ -373,8 +380,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",
|
| @@ -382,19 +389,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",
|
| @@ -403,23 +410,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 = [
|
| @@ -466,55 +473,40 @@ component("net") {
|
| }
|
|
|
| # ICU support.
|
| - deps += [
|
| - "//base:i18n",
|
| - "//third_party/icu",
|
| - ]
|
| - sources += [
|
| - "base/filename_util_icu.cc",
|
| - "base/net_string_util_icu.cc",
|
| - ]
|
| + if (use_platform_icu_alternatives) {
|
| + if (is_android) {
|
| + # Use ICU alternative on Android.
|
| + sources += [
|
| + "base/net_string_util_icu_alternatives_android.cc",
|
| + "base/net_string_util_icu_alternatives_android.h",
|
| + ]
|
| + deps += [ ":net_jni_headers" ]
|
| + } else if (is_ios) {
|
| + # Use ICU alternative on iOS.
|
| + sources += [ "base/net_string_util_icu_alternatives_ios.mm" ]
|
| + } else {
|
| + assert(false,
|
| + "ICU alternative is not implemented for platform: " + target_os)
|
| + }
|
| + } else {
|
| + # Use ICU.
|
| + 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" ]
|
| + }
|
| }
|
| }
|
|
|
| @@ -528,10 +520,7 @@ grit("net_resources") {
|
| }
|
|
|
| proto_library("net_quic_proto") {
|
| - visibility = [
|
| - ":net",
|
| - ":net_small",
|
| - ]
|
| + visibility = [ ":net" ]
|
|
|
| sources = [
|
| "quic/proto/cached_network_parameters.proto",
|
| @@ -1389,7 +1378,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) {
|
| @@ -1452,6 +1441,7 @@ test("net_unittests") {
|
| deps = [
|
| ":balsa",
|
| ":extras",
|
| + ":features",
|
| ":net",
|
| ":net_unittests_bundle_data",
|
| ":simple_quic_tools",
|
| @@ -1655,7 +1645,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",
|
| @@ -1681,6 +1670,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",
|
|
|