Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(231)

Unified Diff: net/BUILD.gn

Issue 1287893005: Reland: Make separate net and url GN targets with and without ICU (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix typo Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « .gn ('k') | net/net.gypi » ('j') | net/net.gypi » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/BUILD.gn
diff --git a/net/BUILD.gn b/net/BUILD.gn
index 5d9801b21ae33cbd2a2070c8821bd35a15a7bc40..9ef54e468749c24ba7fa3c2626527d17da39cd81 100644
--- a/net/BUILD.gn
+++ b/net/BUILD.gn
@@ -6,7 +6,6 @@ import("//build/config/crypto.gni")
import("//build/config/features.gni")
import("//build/config/ui.gni")
import("//build/module_args/v8.gni")
-import("//url/config.gni")
import("//testing/test.gni")
import("//third_party/icu/config.gni")
import("//third_party/protobuf/proto_library.gni")
@@ -63,382 +62,353 @@ config("net_config") {
}
}
brettw 2015/08/24 20:51:37 Here, can you add another config: config("net_in
xunjieli 2015/08/26 13:58:10 Done.
-component("net") {
- sources =
- gypi_values.net_nacl_common_sources + gypi_values.net_non_nacl_sources
+# _net_shared_* are settings shared between net and net_small
+_net_shared_sources =
brettw 2015/08/24 20:51:37 I'd delete the leading underscores. They don't act
xunjieli 2015/08/26 13:58:10 Done.
+ gypi_values.net_nacl_common_sources + gypi_values.net_non_nacl_sources
+_net_shared_include_dirs = []
+_net_shared_public_deps = [
brettw 2015/08/24 20:51:37 CAn you move this to right before the _deps?
xunjieli 2015/08/26 13:58:10 Done.
+ ":net_quic_proto",
+ "//crypto",
+ "//crypto:platform",
+]
+
+_net_shared_defines = [
+ # TODO(GYP) Note that the GYP file supports linux_link_kerberos (defaults to
+ # 0) which implies that we run pkg_config on kerberos and link to that
+ # rather than setting this define which will dynamically open it. That
+ # doesn't seem to be set in the regular builds, so we're skipping this
+ # capability here.
+ "DLOPEN_KERBEROS",
+ "NET_IMPLEMENTATION",
+]
+
+_net_shared_configs = [
+ "//build/config:precompiled_headers",
- cflags = []
- defines = [
- # TODO(GYP) Note that the GYP file supports linux_link_kerberos (defaults to
- # 0) which implies that we run pkg_config on kerberos and link to that
- # rather than setting this define which will dynamically open it. That
- # doesn't seem to be set in the regular builds, so we're skipping this
- # capability here.
- "DLOPEN_KERBEROS",
- "NET_IMPLEMENTATION",
+ # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
+ "//build/config/compiler:no_size_t_to_int_warning",
+]
+
+_net_shared_deps = [
+ ":net_resources",
+ "//base",
+ "//base:prefs",
+ "//base/third_party/dynamic_annotations",
+ "//net/base/registry_controlled_domains",
+ "//sdch",
+ "//third_party/protobuf:protobuf_lite",
+ "//third_party/zlib",
+]
+
+if (use_kerberos) {
+ _net_shared_defines += [ "USE_KERBEROS" ]
+ if (is_android) {
+ _net_shared_include_dirs += [ "/usr/include/kerberosV" ]
+ }
+} else {
+ _net_shared_sources -= [
+ "http/http_auth_gssapi_posix.cc",
+ "http/http_auth_gssapi_posix.h",
+ "http/http_auth_handler_negotiate.cc",
+ "http/http_auth_handler_negotiate.h",
]
+}
- configs += [
- "//build/config:precompiled_headers",
+if (is_posix) {
+ if (posix_avoid_mmap) {
+ _net_shared_sources -= [ "disk_cache/blockfile/mapped_file_posix.cc" ]
+ } else {
+ _net_shared_sources -=
+ [ "disk_cache/blockfile/mapped_file_avoid_mmap_posix.cc" ]
+ }
+}
- # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
- "//build/config/compiler:no_size_t_to_int_warning",
- ]
- public_configs = [ ":net_config" ]
- include_dirs = []
+if (disable_file_support) {
+ _net_shared_sources -= gypi_values.net_file_support_sources
+}
- public_deps = [
- ":net_quic_proto",
- "//crypto",
- "//crypto:platform",
- "//url",
- ]
- deps = [
- ":net_resources",
- "//base",
- "//base:prefs",
- "//base/third_party/dynamic_annotations",
- "//net/base/registry_controlled_domains",
- "//sdch",
- "//third_party/protobuf:protobuf_lite",
- "//third_party/zlib",
- "//url",
+if (disable_ftp_support) {
+ _net_shared_sources -= gypi_values.net_ftp_support_sources
+}
+
+if (enable_built_in_dns) {
+ _net_shared_defines += [ "ENABLE_BUILT_IN_DNS" ]
+} else {
+ _net_shared_sources -= [
+ "dns/address_sorter_posix.cc",
+ "dns/address_sorter_posix.h",
+ "dns/dns_client.cc",
]
+}
- if (use_kerberos) {
- defines += [ "USE_KERBEROS" ]
- if (is_android) {
- include_dirs += [ "/usr/include/kerberosV" ]
- }
- } else {
- sources -= [
- "http/http_auth_gssapi_posix.cc",
- "http/http_auth_gssapi_posix.h",
- "http/http_auth_handler_negotiate.cc",
- "http/http_auth_handler_negotiate.h",
+if (use_openssl) {
+ _net_shared_sources -= [
+ "base/nss_memio.c",
+ "base/nss_memio.h",
+ "cert/ct_log_verifier_nss.cc",
+ "cert/ct_objects_extractor_nss.cc",
+ "cert/jwk_serializer_nss.cc",
+ "cert/scoped_nss_types.h",
+ "cert/x509_util_nss.cc",
+ "quic/crypto/aead_base_decrypter_nss.cc",
+ "quic/crypto/aead_base_encrypter_nss.cc",
+ "quic/crypto/aes_128_gcm_12_decrypter_nss.cc",
+ "quic/crypto/aes_128_gcm_12_encrypter_nss.cc",
+ "quic/crypto/chacha20_poly1305_decrypter_nss.cc",
+ "quic/crypto/chacha20_poly1305_encrypter_nss.cc",
+ "quic/crypto/channel_id_nss.cc",
+ "quic/crypto/p256_key_exchange_nss.cc",
+ "socket/nss_ssl_util.cc",
+ "socket/nss_ssl_util.h",
+ "socket/ssl_client_socket_nss.cc",
+ "socket/ssl_client_socket_nss.h",
+ "socket/ssl_server_socket_nss.cc",
+ "socket/ssl_server_socket_nss.h",
+ ]
+ if (is_ios) {
+ # Always removed for !ios below.
+ _net_shared_sources -= [
+ "cert/cert_verify_proc_nss.cc",
+ "cert/cert_verify_proc_nss.h",
]
}
-
- if (is_posix) {
- if (posix_avoid_mmap) {
- sources -= [ "disk_cache/blockfile/mapped_file_posix.cc" ]
- } else {
- sources -= [ "disk_cache/blockfile/mapped_file_avoid_mmap_posix.cc" ]
- }
+ if (is_win) {
+ _net_shared_sources -= [ "cert/sha256_legacy_support_nss_win.cc" ]
+ }
+ if (!use_nss_certs && !is_ios) {
+ _net_shared_sources -= [ "cert/x509_util_nss.h" ]
+ }
+} else {
+ _net_shared_sources -= [
+ "cert/ct_log_verifier_openssl.cc",
+ "cert/ct_objects_extractor_openssl.cc",
+ "cert/jwk_serializer_openssl.cc",
+ "cert/x509_util_openssl.cc",
+ "cert/x509_util_openssl.h",
+ "quic/crypto/aead_base_decrypter_openssl.cc",
+ "quic/crypto/aead_base_encrypter_openssl.cc",
+ "quic/crypto/aes_128_gcm_12_decrypter_openssl.cc",
+ "quic/crypto/aes_128_gcm_12_encrypter_openssl.cc",
+ "quic/crypto/chacha20_poly1305_decrypter_openssl.cc",
+ "quic/crypto/chacha20_poly1305_encrypter_openssl.cc",
+ "quic/crypto/channel_id_openssl.cc",
+ "quic/crypto/p256_key_exchange_openssl.cc",
+ "quic/crypto/scoped_evp_aead_ctx.cc",
+ "quic/crypto/scoped_evp_aead_ctx.h",
+ "socket/ssl_client_socket_openssl.cc",
+ "socket/ssl_client_socket_openssl.h",
+ "socket/ssl_server_socket_openssl.cc",
+ "socket/ssl_server_socket_openssl.h",
+ "ssl/openssl_ssl_util.cc",
+ "ssl/openssl_ssl_util.h",
+ "ssl/ssl_client_session_cache_openssl.cc",
+ "ssl/ssl_client_session_cache_openssl.h",
+ "ssl/ssl_platform_key.h",
+ "ssl/threaded_ssl_private_key.cc",
+ "ssl/threaded_ssl_private_key.h",
+ ]
+ if (is_mac) {
+ _net_shared_sources -= [ "ssl/ssl_platform_key_mac.cc" ]
}
-
- if (disable_file_support) {
- sources -= [
- "base/directory_lister.cc",
- "base/directory_lister.h",
- "url_request/file_protocol_handler.cc",
- "url_request/file_protocol_handler.h",
- "url_request/url_request_file_dir_job.cc",
- "url_request/url_request_file_dir_job.h",
- "url_request/url_request_file_job.cc",
- "url_request/url_request_file_job.h",
+ if (is_win) {
+ _net_shared_sources -= [
+ "cert/sha256_legacy_support_openssl_win.cc",
+ "ssl/ssl_platform_key_win.cc",
]
}
-
- if (disable_ftp_support) {
- sources -= [
- "ftp/ftp_auth_cache.cc",
- "ftp/ftp_auth_cache.h",
- "ftp/ftp_ctrl_response_buffer.cc",
- "ftp/ftp_ctrl_response_buffer.h",
- "ftp/ftp_directory_listing_parser.cc",
- "ftp/ftp_directory_listing_parser.h",
- "ftp/ftp_directory_listing_parser_ls.cc",
- "ftp/ftp_directory_listing_parser_ls.h",
- "ftp/ftp_directory_listing_parser_netware.cc",
- "ftp/ftp_directory_listing_parser_netware.h",
- "ftp/ftp_directory_listing_parser_os2.cc",
- "ftp/ftp_directory_listing_parser_os2.h",
- "ftp/ftp_directory_listing_parser_vms.cc",
- "ftp/ftp_directory_listing_parser_vms.h",
- "ftp/ftp_directory_listing_parser_windows.cc",
- "ftp/ftp_directory_listing_parser_windows.h",
- "ftp/ftp_network_layer.cc",
- "ftp/ftp_network_layer.h",
- "ftp/ftp_network_session.cc",
- "ftp/ftp_network_session.h",
- "ftp/ftp_network_transaction.cc",
- "ftp/ftp_network_transaction.h",
- "ftp/ftp_request_info.h",
- "ftp/ftp_response_info.cc",
- "ftp/ftp_response_info.h",
- "ftp/ftp_server_type_histograms.cc",
- "ftp/ftp_server_type_histograms.h",
- "ftp/ftp_transaction.h",
- "ftp/ftp_transaction_factory.h",
- "ftp/ftp_util.cc",
- "ftp/ftp_util.h",
- "url_request/ftp_protocol_handler.cc",
- "url_request/ftp_protocol_handler.h",
- "url_request/url_request_ftp_job.cc",
- "url_request/url_request_ftp_job.h",
- ]
- }
-
- if (enable_built_in_dns) {
- defines += [ "ENABLE_BUILT_IN_DNS" ]
- } else {
- sources -= [
- "dns/address_sorter_posix.cc",
- "dns/address_sorter_posix.h",
- "dns/dns_client.cc",
- ]
+ if (use_nss_certs) {
+ _net_shared_sources -= [ "ssl/ssl_platform_key_nss.cc" ]
}
+}
- if (use_openssl) {
- sources -= [
- "base/nss_memio.c",
- "base/nss_memio.h",
- "cert/ct_log_verifier_nss.cc",
- "cert/ct_objects_extractor_nss.cc",
- "cert/jwk_serializer_nss.cc",
- "cert/scoped_nss_types.h",
- "cert/x509_util_nss.cc",
- "quic/crypto/aead_base_decrypter_nss.cc",
- "quic/crypto/aead_base_encrypter_nss.cc",
- "quic/crypto/aes_128_gcm_12_decrypter_nss.cc",
- "quic/crypto/aes_128_gcm_12_encrypter_nss.cc",
- "quic/crypto/chacha20_poly1305_decrypter_nss.cc",
- "quic/crypto/chacha20_poly1305_encrypter_nss.cc",
- "quic/crypto/channel_id_nss.cc",
- "quic/crypto/p256_key_exchange_nss.cc",
- "socket/nss_ssl_util.cc",
- "socket/nss_ssl_util.h",
- "socket/ssl_client_socket_nss.cc",
- "socket/ssl_client_socket_nss.h",
- "socket/ssl_server_socket_nss.cc",
- "socket/ssl_server_socket_nss.h",
- ]
- if (is_ios) {
- # Always removed for !ios below.
- sources -= [
- "cert/cert_verify_proc_nss.cc",
- "cert/cert_verify_proc_nss.h",
- ]
- }
- if (is_win) {
- sources -= [ "cert/sha256_legacy_support_nss_win.cc" ]
- }
- if (!use_nss_certs && !is_ios) {
- sources -= [ "cert/x509_util_nss.h" ]
- }
- } else {
- sources -= [
- "cert/ct_log_verifier_openssl.cc",
- "cert/ct_objects_extractor_openssl.cc",
- "cert/jwk_serializer_openssl.cc",
- "cert/x509_util_openssl.cc",
- "cert/x509_util_openssl.h",
- "quic/crypto/aead_base_decrypter_openssl.cc",
- "quic/crypto/aead_base_encrypter_openssl.cc",
- "quic/crypto/aes_128_gcm_12_decrypter_openssl.cc",
- "quic/crypto/aes_128_gcm_12_encrypter_openssl.cc",
- "quic/crypto/chacha20_poly1305_decrypter_openssl.cc",
- "quic/crypto/chacha20_poly1305_encrypter_openssl.cc",
- "quic/crypto/channel_id_openssl.cc",
- "quic/crypto/p256_key_exchange_openssl.cc",
- "quic/crypto/scoped_evp_aead_ctx.cc",
- "quic/crypto/scoped_evp_aead_ctx.h",
- "socket/ssl_client_socket_openssl.cc",
- "socket/ssl_client_socket_openssl.h",
- "socket/ssl_server_socket_openssl.cc",
- "socket/ssl_server_socket_openssl.h",
- "ssl/openssl_ssl_util.cc",
- "ssl/openssl_ssl_util.h",
- "ssl/ssl_client_session_cache_openssl.cc",
- "ssl/ssl_client_session_cache_openssl.h",
- "ssl/ssl_platform_key.h",
- "ssl/threaded_ssl_private_key.cc",
- "ssl/threaded_ssl_private_key.h",
- ]
- if (is_mac) {
- sources -= [ "ssl/ssl_platform_key_mac.cc" ]
- }
- if (is_win) {
- sources -= [
- "cert/sha256_legacy_support_openssl_win.cc",
- "ssl/ssl_platform_key_win.cc",
- ]
- }
- if (use_nss_certs) {
- sources -= [ "ssl/ssl_platform_key_nss.cc" ]
- }
+if (!use_openssl_certs) {
+ _net_shared_sources -= [
+ "base/crypto_module_openssl.cc",
+ "base/keygen_handler_openssl.cc",
+ "base/openssl_private_key_store.h",
+ "base/openssl_private_key_store_memory.cc",
+ "cert/cert_database_openssl.cc",
+ "cert/cert_verify_proc_openssl.cc",
+ "cert/cert_verify_proc_openssl.h",
+ "cert/test_root_certs_openssl.cc",
+ "cert/x509_certificate_openssl.cc",
+ "ssl/openssl_client_key_store.cc",
+ "ssl/openssl_client_key_store.h",
+ ]
+ if (is_android) {
+ _net_shared_sources -= [ "base/openssl_private_key_store_android.cc" ]
}
-
- if (!use_openssl_certs) {
- sources -= [
- "base/crypto_module_openssl.cc",
- "base/keygen_handler_openssl.cc",
- "base/openssl_private_key_store.h",
+} else {
+ if (is_android) {
+ # Android doesn't use these even when using OpenSSL.
+ _net_shared_sources -= [
"base/openssl_private_key_store_memory.cc",
"cert/cert_database_openssl.cc",
"cert/cert_verify_proc_openssl.cc",
- "cert/cert_verify_proc_openssl.h",
"cert/test_root_certs_openssl.cc",
- "cert/x509_certificate_openssl.cc",
- "ssl/openssl_client_key_store.cc",
- "ssl/openssl_client_key_store.h",
- ]
- if (is_android) {
- sources -= [ "base/openssl_private_key_store_android.cc" ]
- }
- } else {
- if (is_android) {
- # Android doesn't use these even when using OpenSSL.
- sources -= [
- "base/openssl_private_key_store_memory.cc",
- "cert/cert_database_openssl.cc",
- "cert/cert_verify_proc_openssl.cc",
- "cert/test_root_certs_openssl.cc",
- ]
- }
-
- # TODO(davidben): Remove these exclusions when use_openssl_certs builds also
- # use the SSLPrivateKey machinery.
- sources -= [
- "ssl/threaded_ssl_private_key.cc",
- "ssl/threaded_ssl_private_key.h",
]
}
- if (use_glib && !is_chromeos) {
- configs += [ "//build/config/linux:gconf" ]
- deps += [ "//build/config/linux:gio" ]
- }
+ # TODO(davidben): Remove these exclusions when use_openssl_certs builds also
+ # use the SSLPrivateKey machinery.
+ _net_shared_sources -= [
+ "ssl/threaded_ssl_private_key.cc",
+ "ssl/threaded_ssl_private_key.h",
+ ]
+}
- if (is_linux) {
- configs += [ "//build/config/linux:libresolv" ]
- }
+if (use_glib && !is_chromeos) {
+ _net_shared_configs += [ "//build/config/linux:gconf" ]
+ _net_shared_deps += [ "//build/config/linux:gio" ]
+}
- if (!use_nss_certs) {
- sources -= [
- "base/crypto_module_nss.cc",
- "base/keygen_handler_nss.cc",
- "cert/cert_database_nss.cc",
- "cert/nss_cert_database.cc",
- "cert/nss_cert_database.h",
- "cert/x509_certificate_nss.cc",
- "ssl/client_cert_store_nss.cc",
- "ssl/client_cert_store_nss.h",
- "third_party/mozilla_security_manager/nsKeygenHandler.cpp",
- "third_party/mozilla_security_manager/nsKeygenHandler.h",
- "third_party/mozilla_security_manager/nsNSSCertificateDB.cpp",
- "third_party/mozilla_security_manager/nsNSSCertificateDB.h",
- "third_party/mozilla_security_manager/nsPKCS12Blob.cpp",
- "third_party/mozilla_security_manager/nsPKCS12Blob.h",
- ]
- if (!is_ios) {
- # These files are part of the partial implementation of NSS on iOS so
- # keep them in that case (even though use_nss_certs is not set).
- sources -= [
- "cert/cert_verify_proc_nss.cc",
- "cert/cert_verify_proc_nss.h",
- "cert/test_root_certs_nss.cc",
- "cert/x509_util_nss_certs.cc",
- "cert_net/nss_ocsp.cc",
- "cert_net/nss_ocsp.h",
- ]
- }
- if (is_chromeos) {
- # These were already removed on non-ChromeOS.
- 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",
- ]
- }
- sources -= [ "ssl/ssl_platform_key_nss.cc" ]
- } else if (use_openssl) {
- # 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.
- sources += [ "third_party/nss/ssl/cmpcert.c" ]
- }
+if (is_linux) {
+ _net_shared_configs += [ "//build/config/linux:libresolv" ]
+}
- if (!enable_websockets) {
- sources -= [
- "websockets/websocket_basic_handshake_stream.cc",
- "websockets/websocket_basic_handshake_stream.h",
- "websockets/websocket_basic_stream.cc",
- "websockets/websocket_basic_stream.h",
- "websockets/websocket_channel.cc",
- "websockets/websocket_channel.h",
- "websockets/websocket_deflate_predictor.h",
- "websockets/websocket_deflate_predictor_impl.cc",
- "websockets/websocket_deflate_predictor_impl.h",
- "websockets/websocket_deflate_stream.cc",
- "websockets/websocket_deflate_stream.h",
- "websockets/websocket_deflater.cc",
- "websockets/websocket_deflater.h",
- "websockets/websocket_errors.cc",
- "websockets/websocket_errors.h",
- "websockets/websocket_extension.cc",
- "websockets/websocket_extension.h",
- "websockets/websocket_extension_parser.cc",
- "websockets/websocket_extension_parser.h",
- "websockets/websocket_frame.cc",
- "websockets/websocket_frame.h",
- "websockets/websocket_frame_parser.cc",
- "websockets/websocket_frame_parser.h",
- "websockets/websocket_handshake_challenge.cc",
- "websockets/websocket_handshake_challenge.h",
- "websockets/websocket_handshake_constants.cc",
- "websockets/websocket_handshake_constants.h",
- "websockets/websocket_handshake_request_info.cc",
- "websockets/websocket_handshake_request_info.h",
- "websockets/websocket_handshake_response_info.cc",
- "websockets/websocket_handshake_response_info.h",
- "websockets/websocket_handshake_stream_base.h",
- "websockets/websocket_handshake_stream_create_helper.cc",
- "websockets/websocket_handshake_stream_create_helper.h",
- "websockets/websocket_inflater.cc",
- "websockets/websocket_inflater.h",
- "websockets/websocket_mux.h",
- "websockets/websocket_stream.cc",
- "websockets/websocket_stream.h",
+if (!use_nss_certs) {
+ _net_shared_sources -= [
+ "base/crypto_module_nss.cc",
+ "base/keygen_handler_nss.cc",
+ "cert/cert_database_nss.cc",
+ "cert/nss_cert_database.cc",
+ "cert/nss_cert_database.h",
+ "cert/x509_certificate_nss.cc",
+ "ssl/client_cert_store_nss.cc",
+ "ssl/client_cert_store_nss.h",
+ "third_party/mozilla_security_manager/nsKeygenHandler.cpp",
+ "third_party/mozilla_security_manager/nsKeygenHandler.h",
+ "third_party/mozilla_security_manager/nsNSSCertificateDB.cpp",
+ "third_party/mozilla_security_manager/nsNSSCertificateDB.h",
+ "third_party/mozilla_security_manager/nsPKCS12Blob.cpp",
+ "third_party/mozilla_security_manager/nsPKCS12Blob.h",
+ ]
+ if (!is_ios) {
+ # These files are part of the partial implementation of NSS on iOS so
+ # keep them in that case (even though use_nss_certs is not set).
+ _net_shared_sources -= [
+ "cert/cert_verify_proc_nss.cc",
+ "cert/cert_verify_proc_nss.h",
+ "cert/test_root_certs_nss.cc",
+ "cert/x509_util_nss_certs.cc",
+ "cert_net/nss_ocsp.cc",
+ "cert_net/nss_ocsp.h",
]
}
+ if (is_chromeos) {
+ # These were already removed on non-ChromeOS.
+ _net_shared_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 -= [ "ssl/ssl_platform_key_nss.cc" ]
+} else if (use_openssl) {
+ # 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" ]
+}
- if (!enable_mdns) {
- sources -= [
- "dns/mdns_cache.cc",
- "dns/mdns_cache.h",
- "dns/mdns_client.cc",
- "dns/mdns_client.h",
- "dns/mdns_client_impl.cc",
- "dns/mdns_client_impl.h",
- "dns/record_parsed.cc",
- "dns/record_parsed.h",
- "dns/record_rdata.cc",
- "dns/record_rdata.h",
- ]
- }
+if (!enable_websockets) {
+ _net_shared_sources -= gypi_values.net_websockets_sources
+}
- if (is_win) {
- sources -= [
- "http/http_auth_handler_ntlm_portable.cc",
- "socket/socket_libevent.cc",
- "socket/socket_libevent.h",
- "socket/tcp_socket_libevent.cc",
- "socket/tcp_socket_libevent.h",
- "udp/udp_socket_libevent.cc",
- "udp/udp_socket_libevent.h",
- ]
- } else { # !is_win
- sources -= [
- "base/winsock_init.cc",
- "base/winsock_init.h",
- "base/winsock_util.cc",
- "base/winsock_util.h",
- "proxy/proxy_resolver_winhttp.cc",
- "proxy/proxy_resolver_winhttp.h",
+if (!enable_mdns) {
+ _net_shared_sources -= [
+ "dns/mdns_cache.cc",
+ "dns/mdns_cache.h",
+ "dns/mdns_client.cc",
+ "dns/mdns_client.h",
+ "dns/mdns_client_impl.cc",
+ "dns/mdns_client_impl.h",
+ "dns/record_parsed.cc",
+ "dns/record_parsed.h",
+ "dns/record_rdata.cc",
+ "dns/record_rdata.h",
+ ]
+}
+
+if (is_win) {
+ _net_shared_sources -= [
+ "http/http_auth_handler_ntlm_portable.cc",
+ "socket/socket_libevent.cc",
+ "socket/socket_libevent.h",
+ "socket/tcp_socket_libevent.cc",
+ "socket/tcp_socket_libevent.h",
+ "udp/udp_socket_libevent.cc",
+ "udp/udp_socket_libevent.h",
+ ]
+} else { # !is_win
+ _net_shared_sources -= [
+ "base/winsock_init.cc",
+ "base/winsock_init.h",
+ "base/winsock_util.cc",
+ "base/winsock_util.h",
+ "proxy/proxy_resolver_winhttp.cc",
+ "proxy/proxy_resolver_winhttp.h",
+ ]
+}
+
+if (is_ios) {
+ # Add back some sources that were otherwise filtered out. iOS needs some Mac
+ # files.
+ set_sources_assignment_filter([])
+ _net_shared_sources += [
+ "base/mac/url_conversions.h",
+ "base/mac/url_conversions.mm",
+ "base/network_change_notifier_mac.cc",
+ "base/network_config_watcher_mac.cc",
+ "base/network_interfaces_mac.cc",
+ "base/network_interfaces_mac.h",
+ "base/platform_mime_util_mac.mm",
+ "proxy/proxy_resolver_mac.cc",
+ "proxy/proxy_server_mac.cc",
+ ]
+ set_sources_assignment_filter(sources_assignment_filter)
+
+ _net_shared_sources -= [ "disk_cache/blockfile/file_posix.cc" ]
+ _net_shared_deps += [
+ "//third_party/nss:nspr",
+ "//third_party/nss",
+ "//net/third_party/nss/ssl:libssl",
+ ]
+}
+
+if (is_ios || is_mac) {
+ _net_shared_sources += gypi_values.net_base_mac_ios_sources
+}
+
+if (is_android) {
+ _net_shared_deps += [ ":net_jni_headers" ]
+}
+
+component("net") {
+ sources = _net_shared_sources
+ cflags = []
+ defines = _net_shared_defines
+ configs += _net_shared_configs
+ public_configs = [ ":net_config" ]
+
+ include_dirs = _net_shared_include_dirs
+ public_deps = _net_shared_public_deps + [ "//url:url" ]
+
+ deps = _net_shared_deps
+
+ if (is_android) {
+ # Add some Linux sources that were excluded by the filter, but which
+ # are needed.
+ set_sources_assignment_filter([])
+ sources += [
+ "base/address_tracker_linux.cc",
+ "base/address_tracker_linux.h",
+ "base/network_interfaces_linux.cc",
+ "base/network_interfaces_linux.h",
+ "base/platform_mime_util_linux.cc",
]
+ set_sources_assignment_filter(sources_assignment_filter)
}
if (is_mac) {
@@ -467,7 +437,6 @@ component("net") {
]
set_sources_assignment_filter(sources_assignment_filter)
- sources -= [ "disk_cache/blockfile/file_posix.cc" ]
libs = [
"CFNetwork.framework",
"MobileCoreServices.framework",
@@ -475,19 +444,34 @@ component("net") {
"SystemConfiguration.framework",
"resolv",
]
-
- deps += [
- "//third_party/nss:nspr",
- "//third_party/nss",
- "//net/third_party/nss/ssl:libssl",
- ]
}
- if (is_ios || is_mac) {
- sources += gypi_values.net_base_mac_ios_sources
- }
+ # ICU support.
+ deps += [
+ "//base:i18n",
+ "//third_party/icu",
+ ]
+ sources += [
+ "base/filename_util_icu.cc",
+ "base/net_string_util_icu.cc",
+ "base/net_util_icu.cc",
+ ]
+}
+
+if (is_android) {
+ # Same as net, but with ICU, file, ftp, and websocket support stripped.
+ component("net_small") {
+ sources = _net_shared_sources
+ cflags = []
+ defines = _net_shared_defines
+ configs += _net_shared_configs
+ public_configs = [ ":net_config" ]
+
+ include_dirs = _net_shared_include_dirs
+ public_deps = _net_shared_public_deps +
+ [ "//url:url_lib_use_icu_alternatives_on_android" ]
+ deps = _net_shared_deps
- if (is_android) {
# Add some Linux sources that were excluded by the filter, but which
# are needed.
set_sources_assignment_filter([])
@@ -499,24 +483,31 @@ component("net") {
"base/platform_mime_util_linux.cc",
]
set_sources_assignment_filter(sources_assignment_filter)
- deps += [ ":net_jni_headers" ]
- }
- if (use_icu_alternatives_on_android) {
+ # Strip file support.
+ if (!disable_file_support) {
+ sources -= gypi_values.net_file_support_sources
+ defines += [ "DISABLE_FILE_SUPPORT" ]
+ }
+
+ # Strip ftp support.
+ if (!disable_file_support) {
+ sources -= gypi_values.net_ftp_support_sources
+ defines += [ "DISABLE_FTP_SUPPORT" ]
+ }
+
+ # Strip websocket support.
+ if (enable_websockets) {
+ sources -= gypi_values.net_websockets_sources
+ }
+
+ # Use ICU alternative on Android.
+ defines += [ "USE_ICU_ALTERNATIVES_ON_ANDROID=1" ]
+ deps += [ ":net_jni_headers" ]
sources += [
"base/net_string_util_icu_alternatives_android.cc",
"base/net_string_util_icu_alternatives_android.h",
]
- } else {
- deps += [
- "//base:i18n",
- "//third_party/icu",
- ]
- sources += [
- "base/filename_util_icu.cc",
- "base/net_string_util_icu.cc",
- "base/net_util_icu.cc",
- ]
}
}
@@ -530,7 +521,10 @@ grit("net_resources") {
}
proto_library("net_quic_proto") {
- visibility = [ "//net" ] # Part of the net component.
+ visibility = [
+ ":net",
+ ":net_small",
+ ]
sources = [
"quic/proto/cached_network_parameters.proto",
@@ -1222,6 +1216,7 @@ if (is_android) {
"android/java/src/org/chromium/net/AndroidPrivateKey.java",
"android/java/src/org/chromium/net/GURLUtils.java",
"android/java/src/org/chromium/net/HttpNegotiateAuthenticator.java",
+ "android/java/src/org/chromium/net/NetStringUtil.java",
"android/java/src/org/chromium/net/NetworkChangeNotifier.java",
"android/java/src/org/chromium/net/ProxyChangeListener.java",
"android/java/src/org/chromium/net/X509Util.java",
@@ -1527,10 +1522,7 @@ test("net_unittests") {
]
}
- # Always need use_v8_in_net to be 1 to run on Android, so just remove
- # net_unittest's dependency on v8 when using icu alternatives instead of
- # setting use_v8_in_net to 0.
- if (use_v8_in_net && !use_icu_alternatives_on_android) {
+ if (use_v8_in_net) {
deps += [ ":net_with_v8" ]
} else {
sources -= [
@@ -1639,14 +1631,6 @@ test("net_unittests") {
isolate_file = "net_unittests.isolate"
}
- if (use_icu_alternatives_on_android) {
- sources -= [
- "base/filename_util_unittest.cc",
- "base/net_util_icu_unittest.cc",
- ]
- deps -= [ "//base:i18n" ]
- }
-
# Symbols for crashes when running tests on swarming.
if (symbol_level > 0) {
if (is_win) {
« no previous file with comments | « .gn ('k') | net/net.gypi » ('j') | net/net.gypi » ('J')

Powered by Google App Engine
This is Rietveld 408576698