summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--BUILD.gn2
-rw-r--r--base/BUILD.gn6
-rw-r--r--build/config/BUILDCONFIG.gn11
-rw-r--r--build/config/linux/BUILD.gn50
-rw-r--r--crypto/BUILD.gn10
-rw-r--r--net/BUILD.gn572
-rw-r--r--net/net.gypi3
-rw-r--r--net/third_party/nss/ssl/BUILD.gn6
-rw-r--r--net/tools/tld_cleanup/BUILD.gn14
-rw-r--r--tools/gn/ninja_helper.cc23
-rw-r--r--tools/gn/secondary/tools/grit/grit_rule.gni19
11 files changed, 683 insertions, 33 deletions
diff --git a/BUILD.gn b/BUILD.gn
index 9c1446b..e484275 100644
--- a/BUILD.gn
+++ b/BUILD.gn
@@ -27,7 +27,7 @@ group("root") {
"//crypto",
"//device/usb",
"//ipc",
- #"//net",
+ "//net",
#"//sdch",
"//skia",
#"//third_party/WebKit/Source/platform",
diff --git a/base/BUILD.gn b/base/BUILD.gn
index 0ee30dc..43b02f0 100644
--- a/base/BUILD.gn
+++ b/base/BUILD.gn
@@ -731,12 +731,6 @@ component("base") {
"//third_party/modp_b64",
]
- if (!is_chromeos) {
- sources -= [
- "sys_info_chromeos.cc",
- ]
- }
-
if (is_nacl) {
# These things would otherwise be built on a Posix build but aren't
# supported on NaCl.
diff --git a/build/config/BUILDCONFIG.gn b/build/config/BUILDCONFIG.gn
index 2172df9..18d1140 100644
--- a/build/config/BUILDCONFIG.gn
+++ b/build/config/BUILDCONFIG.gn
@@ -207,6 +207,7 @@ windows_sources_filters = [
"*_win.h",
"*_win_unittest.cc",
"*\bwin/*",
+ "*.rc",
]
mac_sources_filters = [
"*_mac.h",
@@ -257,6 +258,13 @@ posix_sources_filters = [
"*_posix_unittest.cc",
"*\bposix/*",
]
+chromeos_sources_filters = [
+ "*_chromeos.h",
+ "*_chromeos.cc",
+ "*_chromeos_unittest.h",
+ "*_chromeos_unittest.cc",
+ "*\bchromeos/*",
+]
# DO NOT ADD MORE PATTERNS TO THIS LIST, see set_sources_assignment_filter call
# below.
@@ -282,6 +290,9 @@ if (!is_linux) {
if (!is_android) {
sources_assignment_filter += android_sources_filters
}
+if (!is_chromeos) {
+ sources_assignment_filter += chromeos_sources_filters
+}
# Actually save this list.
#
diff --git a/build/config/linux/BUILD.gn b/build/config/linux/BUILD.gn
index 51616c0..7358ca5 100644
--- a/build/config/linux/BUILD.gn
+++ b/build/config/linux/BUILD.gn
@@ -75,3 +75,53 @@ config("x11") {
"Xtst",
]
}
+
+config("libresolv") {
+ libs = [ "libresolv" ]
+}
+
+pkg_config("gconf") {
+ packages = [ "gconf-2.0" ]
+ defines = [ "USE_GCONF" ]
+}
+
+pkg_config("gio_config") {
+ packages = [ "gio-2.0" ]
+ defines = [ "USE_GIO" ]
+}
+
+gio_output_h = "$root_gen_dir/library_loaders/libgio.h"
+gio_output_cc = "$root_gen_dir/library_loaders/libgio_loader.cc"
+
+action("make_gio_headers") {
+ visibility = ":gio"
+
+ script = "//tools/generate_library_loader/generate_library_loader.py"
+
+ outputs = [ gio_output_h, gio_output_cc ]
+
+ args = [
+ "--name", "LibGioLoader",
+ "--output-h", rebase_path(gio_output_h),
+ "--output-cc", rebase_path(gio_output_cc),
+ # TODO(brettw) convert ti "<gio/gio.h>" once GN doesn't mangle <>.
+ "--header", "\"gio/gio.h\"",
+ # Note GYP build exposes a variable linux_link_gsettings to control this,
+ # which, if manually set to true, will disable dlopen() for this. Its not
+ # clear this is needed, so here we just leave off.
+ "--link-directly=0",
+ "g_settings_new",
+ "g_settings_get_child",
+ "g_settings_get_string",
+ "g_settings_get_boolean",
+ "g_settings_get_int",
+ "g_settings_get_strv",
+ "g_settings_list_schemas",
+ ]
+}
+
+source_set("gio") {
+ direct_dependent_configs = [ ":gio_config" ]
+ sources = [ gio_output_h, gio_output_cc ]
+ deps = [ ":make_gio_headers" ]
+}
diff --git a/crypto/BUILD.gn b/crypto/BUILD.gn
index 110868d..455169c 100644
--- a/crypto/BUILD.gn
+++ b/crypto/BUILD.gn
@@ -264,8 +264,16 @@ group("platform") {
if (is_linux) {
# On Linux, we use the system NSS (excepting SSL where we always use our
# own).
+ #
+ # We always need our SSL header search path to come before the system one
+ # so our versions are used. The libssl target will add the search path we
+ # want, but according to GN's ordering rules, direct_dependent_configs'
+ # search path will get applied before ones inherited from our
+ # dependencies. Therefore, we need to explicitly list our custom libssl's
+ # config here before the system one.
direct_dependent_configs = [
- "//third_party/nss:system_nss_no_ssl_config"
+ "//net/third_party/nss/ssl:ssl_config",
+ "//third_party/nss:system_nss_no_ssl_config",
]
} else {
# Non-Linux platforms use the hermetic NSS from the tree.
diff --git a/net/BUILD.gn b/net/BUILD.gn
new file mode 100644
index 0000000..4fa0fa2
--- /dev/null
+++ b/net/BUILD.gn
@@ -0,0 +1,572 @@
+# Copyright (c) 2013 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.
+
+import("//build/config/crypto.gni")
+import("//build/config/features.gni")
+import("//build/config/ui.gni")
+import("//tools/grit/grit_rule.gni")
+
+if (is_android) {
+ import("//build/config/android/config.gni")
+} else if (is_mac) {
+ import("//build/config/mac/mac_sdk.gni")
+}
+
+# The list of net files is kept in net.gypi. Read it.
+gypi_values = exec_script(
+ "//build/gypi_to_gn.py",
+ [ rebase_path("net.gypi") ]
+ "scope",
+ [ "net.gypi" ])
+
+# Disable Kerberos on ChromeOS, Android and iOS, at least for now. It needs
+# configuration (krb5.conf and so on).
+use_kerberos = !is_chromeos && !is_android && !is_ios
+
+# The way the cache uses mmap() is inefficient on some Android devices. If
+# this flag is set, we hackily avoid using mmap() in the disk cache. We are
+# pretty confident that mmap-ing the index would not hurt any existing x86
+# android devices, but we cannot be so sure about the variety of ARM devices.
+# So enable it for x86 only for now.
+posix_avoid_mmap = is_android && cpu_arch != "x86"
+
+# WebSockets and socket stream code are used everywhere except iOS.
+enable_websockets = !is_ios
+use_v8_in_net = !is_ios
+enable_built_in_dns = !is_ios
+
+disable_ftp_support = !is_ios
+
+# When OpenSSL is used for SSL and crypto on Unix-like systems, use OpenSSL"s
+# certificate definition.
+use_openssl_certs = (is_linux || is_android) && use_openssl
+
+config("net_config") {
+ defines = []
+ if (posix_avoid_mmap) {
+ defines += [ "POSIX_AVOID_MMAP" ]
+ }
+}
+
+component("net") {
+ sources =
+ gypi_values.net_nacl_common_sources +
+ gypi_values.net_non_nacl_sources
+
+ cflags = []
+ defines = [ "NET_IMPLEMENTATION" ]
+ direct_dependent_configs = [ ":net_config" ]
+ include_dirs = []
+
+ deps = [
+ ":net_resources",
+ "//base",
+ "//base:i18n",
+ "//base/third_party/dynamic_annotations",
+ "//crypto",
+ "//crypto:platform",
+ "//sdch",
+ "//third_party/icu",
+ "//third_party/zlib",
+ "//url",
+ ]
+
+ 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.h",
+ "http/http_auth_handler_negotiate.cc",
+ ]
+ }
+
+ 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 (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_openssl) {
+ sources -= [
+ "base/crypto_module_nss.cc",
+ "base/keygen_handler_nss.cc",
+ "base/nss_memio.c",
+ "base/nss_memio.h",
+ "cert/cert_database_nss.cc",
+ "cert/cert_verify_proc_nss.cc",
+ "cert/cert_verify_proc_nss.h",
+ "cert/ct_log_verifier_nss.cc",
+ "cert/ct_objects_extractor_nss.cc",
+ "cert/jwk_serializer_nss.cc",
+ "cert/nss_cert_database.cc",
+ "cert/nss_cert_database.h",
+ "cert/nss_cert_database_chromeos.cc",
+ "cert/nss_cert_database_chromeos.h",
+ "cert/nss_profile_filter_chromeos.cc",
+ "cert/nss_profile_filter_chromeos.h",
+ "cert/scoped_nss_types.h",
+ "cert/test_root_certs_nss.cc",
+ "cert/x509_certificate_nss.cc",
+ "cert/x509_util_nss.cc",
+ "cert/x509_util_nss.h",
+ "ocsp/nss_ocsp.cc",
+ "ocsp/nss_ocsp.h",
+ "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",
+ "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",
+ ]
+ } else {
+ sources -= [
+ "base/crypto_module_openssl.cc",
+ "base/keygen_handler_openssl.cc",
+ "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_session_cache_openssl.cc",
+ "socket/ssl_session_cache_openssl.h",
+ ]
+ }
+
+ if (!use_openssl_certs) {
+ sources -= [
+ "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) {
+ sources -= [
+ "base/openssl_private_key_store_android.cc",
+ ]
+ }
+ }
+
+ if (use_glib) {
+ configs += [ "//build/config/linux:gconf" ]
+ deps += [ "//build/config/linux:gio" ]
+ }
+
+ if (is_linux) {
+ configs += [ "//build/config/linux:libresolv" ]
+ } else {
+ 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/test_root_certs_nss.cc",
+ "cert/x509_certificate_nss.cc",
+ "ocsp/nss_ocsp.cc",
+ "ocsp/nss_ocsp.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 (!use_nss) {
+ sources -= [
+ "cert/cert_verify_proc_nss.cc",
+ "cert/cert_verify_proc_nss.h",
+ "ssl/client_cert_store_nss.cc",
+ "ssl/client_cert_store_nss.h",
+ ]
+ if (is_chromeos) {
+ # These were already removed on non-ChromeOS.
+ sources -= [
+ "ssl/client_cert_store_chromeos.cc",
+ "ssl/client_cert_store_chromeos.h",
+ ]
+ }
+ }
+
+ if (!enable_websockets) {
+ sources -= [
+ "socket_stream/socket_stream.cc",
+ "socket_stream/socket_stream.h",
+ "socket_stream/socket_stream_job.cc",
+ "socket_stream/socket_stream_job.h",
+ "socket_stream/socket_stream_job_manager.cc",
+ "socket_stream/socket_stream_job_manager.h",
+ "socket_stream/socket_stream_metrics.cc",
+ "socket_stream/socket_stream_metrics.h",
+ "spdy/spdy_websocket_stream.cc",
+ "spdy/spdy_websocket_stream.h",
+ "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_constants.cc",
+ "websockets/websocket_handshake_constants.h",
+ "websockets/websocket_handshake_handler.cc",
+ "websockets/websocket_handshake_handler.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_job.cc",
+ "websockets/websocket_job.h",
+ "websockets/websocket_mux.h",
+ "websockets/websocket_net_log_params.cc",
+ "websockets/websocket_net_log_params.h",
+ "websockets/websocket_stream.cc",
+ "websockets/websocket_stream.h",
+ "websockets/websocket_throttle.cc",
+ "websockets/websocket_throttle.h",
+ ]
+ }
+
+ 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 (is_win) {
+ sources -= [
+ "http/http_auth_handler_ntlm_portable.cc",
+ "socket/tcp_socket_libevent.cc",
+ "socket/tcp_socket_libevent.h",
+ "udp/udp_socket_libevent.cc",
+ "udp/udp_socket_libevent.h",
+ ]
+ deps += [
+ #"//third_party/nss:nspr", # TODO(brettw)
+ #"//third_party/nss",
+ ]
+
+ # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
+ cflags += [ "/wd4267" ]
+ } 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 (is_mac) {
+ sources -= [
+ "ssl/client_cert_store_nss.cc",
+ "ssl/client_cert_store_nss.h",
+ ]
+ deps += [
+ # TODO(brettw)
+ #"//third_party/nss:nspr",
+ #"//third_party/nss",
+ ]
+ libs = [
+ "$SDKROOT/System/Library/Frameworks/Foundation.framework",
+ "$SDKROOT/System/Library/Frameworks/Security.framework",
+ "$SDKROOT/System/Library/Frameworks/SystemConfiguration.framework",
+ "$SDKROOT/usr/lib/libresolv.dylib",
+ ]
+ }
+
+ if (is_ios) {
+ sources -= [ "disk_cache/blockfile/file_posix.cc" ]
+ deps += [
+ "//third_party/nss",
+ ]
+ libs = [
+ "$SDKROOT/System/Library/Frameworks/CFNetwork.framework",
+ "$SDKROOT/System/Library/Frameworks/MobileCoreServices.framework",
+ "$SDKROOT/System/Library/Frameworks/Security.framework",
+ "$SDKROOT/System/Library/Frameworks/SystemConfiguration.framework",
+ "$SDKROOT/usr/lib/libresolv.dylib",
+ ]
+ }
+
+ if (is_android) {
+ if (!is_android_webview_build) {
+ 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",
+ ]
+ deps += [ ":net_jni_headers" ]
+
+ # The net/android/keystore_openssl.cc source file needs to access an
+ # OpenSSL-internal header.
+ include_dirs = [ "//third_party/openssl" ]
+ }
+ }
+}
+
+grit("net_resources") {
+ source = "base/net_resources.grd"
+}
+
+source_set("http_server") {
+ sources = [
+ "server/http_connection.cc",
+ "server/http_connection.h",
+ "server/http_server.cc",
+ "server/http_server.h",
+ "server/http_server_request_info.cc",
+ "server/http_server_request_info.h",
+ "server/http_server_response_info.cc",
+ "server/http_server_response_info.h",
+ "server/web_socket.cc",
+ "server/web_socket.h",
+ ]
+ configs += [ "//build/config/compiler:wexit_time_destructors" ]
+ deps = [
+ ":net",
+ "//base",
+ ]
+}
+
+#TODO(brettw) enable this wben we've done all deps required by this target.
+#executable("dump_cache") {
+# sources = [
+# 'tools/dump_cache/cache_dumper.cc',
+# 'tools/dump_cache/cache_dumper.h',
+# 'tools/dump_cache/dump_cache.cc',
+# 'tools/dump_cache/dump_files.cc',
+# 'tools/dump_cache/dump_files.h',
+# 'tools/dump_cache/simple_cache_dumper.cc',
+# 'tools/dump_cache/simple_cache_dumper.h',
+# 'tools/dump_cache/upgrade_win.cc',
+# 'tools/dump_cache/upgrade_win.h',
+# 'tools/dump_cache/url_to_filename_encoder.cc',
+# 'tools/dump_cache/url_to_filename_encoder.h',
+# 'tools/dump_cache/url_utilities.h',
+# 'tools/dump_cache/url_utilities.cc',
+# ]
+#
+# deps = [
+# "//base",
+# ":net",
+# ":net_test_support",
+# ]
+#
+# if (is_win) {
+# # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
+# cflags += [ "/wd4267" ]
+# }
+#}
+#
+#source_set("net_test_support") {
+# sources = [
+# 'base/capturing_net_log.cc',
+# 'base/capturing_net_log.h',
+# 'base/load_timing_info_test_util.cc',
+# 'base/load_timing_info_test_util.h',
+# 'base/mock_file_stream.cc',
+# 'base/mock_file_stream.h',
+# 'base/test_completion_callback.cc',
+# 'base/test_completion_callback.h',
+# 'base/test_data_directory.cc',
+# 'base/test_data_directory.h',
+# 'cert/mock_cert_verifier.cc',
+# 'cert/mock_cert_verifier.h',
+# 'cookies/cookie_monster_store_test.cc',
+# 'cookies/cookie_monster_store_test.h',
+# 'cookies/cookie_store_test_callbacks.cc',
+# 'cookies/cookie_store_test_callbacks.h',
+# 'cookies/cookie_store_test_helpers.cc',
+# 'cookies/cookie_store_test_helpers.h',
+# 'disk_cache/disk_cache_test_base.cc',
+# 'disk_cache/disk_cache_test_base.h',
+# 'disk_cache/disk_cache_test_util.cc',
+# 'disk_cache/disk_cache_test_util.h',
+# 'dns/dns_test_util.cc',
+# 'dns/dns_test_util.h',
+# 'dns/mock_host_resolver.cc',
+# 'dns/mock_host_resolver.h',
+# 'dns/mock_mdns_socket_factory.cc',
+# 'dns/mock_mdns_socket_factory.h',
+# 'proxy/mock_proxy_resolver.cc',
+# 'proxy/mock_proxy_resolver.h',
+# 'proxy/mock_proxy_script_fetcher.cc',
+# 'proxy/mock_proxy_script_fetcher.h',
+# 'proxy/proxy_config_service_common_unittest.cc',
+# 'proxy/proxy_config_service_common_unittest.h',
+# 'socket/socket_test_util.cc',
+# 'socket/socket_test_util.h',
+# 'test/cert_test_util.cc',
+# 'test/cert_test_util.h',
+# 'test/ct_test_util.cc',
+# 'test/ct_test_util.h',
+# 'test/embedded_test_server/embedded_test_server.cc',
+# 'test/embedded_test_server/embedded_test_server.h',
+# 'test/embedded_test_server/http_connection.cc',
+# 'test/embedded_test_server/http_connection.h',
+# 'test/embedded_test_server/http_request.cc',
+# 'test/embedded_test_server/http_request.h',
+# 'test/embedded_test_server/http_response.cc',
+# 'test/embedded_test_server/http_response.h',
+# 'test/net_test_suite.cc',
+# 'test/net_test_suite.h',
+# 'test/python_utils.cc',
+# 'test/python_utils.h',
+# 'test/spawned_test_server/base_test_server.cc',
+# 'test/spawned_test_server/base_test_server.h',
+# 'test/spawned_test_server/local_test_server_posix.cc',
+# 'test/spawned_test_server/local_test_server_win.cc',
+# 'test/spawned_test_server/local_test_server.cc',
+# 'test/spawned_test_server/local_test_server.h',
+# 'test/spawned_test_server/remote_test_server.cc',
+# 'test/spawned_test_server/remote_test_server.h',
+# 'test/spawned_test_server/spawned_test_server.h',
+# 'test/spawned_test_server/spawner_communicator.cc',
+# 'test/spawned_test_server/spawner_communicator.h',
+# 'url_request/test_url_fetcher_factory.cc',
+# 'url_request/test_url_fetcher_factory.h',
+# 'url_request/url_request_test_util.cc',
+# 'url_request/url_request_test_util.h',
+# ]
+#
+# deps = [
+# "//base",
+# "//base/test:test_support",
+# "//crypto:platform",
+# "//net/tools/tld_cleanup",
+# "//testing/gmock",
+# "//testing/gtest",
+# "//url",
+# ]
+#
+# # TODO(brettw) conditions from GYP
+#
+# forward_dependent_configs_from = deps
+#}
+
+# TODO(brettw) remaining targets from GYP file.
diff --git a/net/net.gypi b/net/net.gypi
index 795236c..aff4af5 100644
--- a/net/net.gypi
+++ b/net/net.gypi
@@ -2,6 +2,9 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
+# This file is shared between the regular GYP build, the NaCl GYP build, and
+# the GN build. For GN support, it must have no conditionals or anything like
+# that beyond the simple one-level-deep dictionary of values.
{
'variables': {
# Subset of net source files that are compiled for NaCl (net_nacl target).
diff --git a/net/third_party/nss/ssl/BUILD.gn b/net/third_party/nss/ssl/BUILD.gn
index 03385f6..cf52e47 100644
--- a/net/third_party/nss/ssl/BUILD.gn
+++ b/net/third_party/nss/ssl/BUILD.gn
@@ -57,7 +57,7 @@ component("libssl") {
"bodge/secitem_array.c",
]
- direct_dependent_settings = [ ":ssl_config" ]
+ direct_dependent_configs = [ ":ssl_config" ]
cflags = []
defines = [
@@ -83,7 +83,9 @@ component("libssl") {
include_dirs = [ "bodge" ]
- direct_dependent_configs = [
+ # Must be after ssl_config since we want our SSL headers to take
+ # precedence.
+ direct_dependent_configs += [
"//third_party/nss:system_nss_no_ssl_config"
]
} else if (is_mac) {
diff --git a/net/tools/tld_cleanup/BUILD.gn b/net/tools/tld_cleanup/BUILD.gn
new file mode 100644
index 0000000..bf89c00
--- /dev/null
+++ b/net/tools/tld_cleanup/BUILD.gn
@@ -0,0 +1,14 @@
+# 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.
+
+source_set("tld_cleanup") {
+ sources = [
+ "tld_cleanup_util.cc",
+ "tld_cleanup_util.h",
+ ]
+ deps = [
+ "//base",
+ "//url",
+ ]
+}
diff --git a/tools/gn/ninja_helper.cc b/tools/gn/ninja_helper.cc
index f84d2b1..e5d1ff8 100644
--- a/tools/gn/ninja_helper.cc
+++ b/tools/gn/ninja_helper.cc
@@ -212,23 +212,16 @@ std::string NinjaHelper::GetRuleForSourceType(const Settings* settings,
return prefix + "cc";
if (type == SOURCE_CC)
return prefix + "cxx";
+ if (type == SOURCE_M)
+ return prefix + "objc";
+ if (type == SOURCE_MM)
+ return prefix + "objcxx";
+ if (type == SOURCE_RC)
+ return prefix + "rc";
+ if (type == SOURCE_S)
+ return prefix + "cc"; // Assembly files just get compiled by CC.
// TODO(brettw) asm files.
- if (settings->IsMac()) {
- if (type == SOURCE_M)
- return prefix + "objc";
- if (type == SOURCE_MM)
- return prefix + "objcxx";
- }
-
- if (settings->IsWin()) {
- if (type == SOURCE_RC)
- return prefix + "rc";
- } else {
- if (type == SOURCE_S)
- return prefix + "cc"; // Assembly files just get compiled by CC.
- }
-
return std::string();
}
diff --git a/tools/gn/secondary/tools/grit/grit_rule.gni b/tools/gn/secondary/tools/grit/grit_rule.gni
index f14a175..8b28b24 100644
--- a/tools/gn/secondary/tools/grit/grit_rule.gni
+++ b/tools/gn/secondary/tools/grit/grit_rule.gni
@@ -44,9 +44,15 @@ template("grit") {
[ "--outputs", "$output_dir", source_path, "-f", resource_ids ] +
grit_flags,
"list lines")
+
# The inputs are relative to the current (build) directory, rebase to
# the current one.
- grit_outputs = rebase_path(grit_outputs_build_rel, root_build_dir)
+ grit_outputs = rebase_path(grit_outputs_build_rel, ".", root_build_dir)
+
+ # The config and the action below get this visibility son only the generated
+ # source set can depend on them. The variable "target_name" will get
+ # overwritten inside the innter classes so we need to compute it here.
+ target_visibility = ":$target_name"
# The current grit setup makes an file in $target_gen_dir/grit/foo.h that
# the source code expects to include via "grit/foo.h". It would be nice to
@@ -55,14 +61,13 @@ template("grit") {
grit_config = target_name + "_grit_config"
config(grit_config) {
include_dirs = [ target_gen_dir ]
-
- # Only our generated static library can depend on this.
- visibility = ":" + target_name
+ visibility = target_visibility
}
grit_custom_target = target_name + "_grit"
action(grit_custom_target) {
script = "//tools/grit/grit.py"
+ hard_dep = true
source_prereqs = grit_inputs
outputs = grit_outputs
@@ -73,13 +78,12 @@ template("grit") {
"-o", output_dir,
] + grit_flags
- # Only our generated static library can depend on this.
- visibility = ":" + target_name
+ visibility = target_visibility
}
# This is the thing that people actually link with, it must be named the
# same as the argument the template was invoked with.
- static_library(target_name) {
+ source_set(target_name) {
# Since we generate a file, we need to be run before the targets that
# depend on us.
hard_dep = true
@@ -87,7 +91,6 @@ template("grit") {
# Deps set on the template invocation will go on the grit script running
# target rather than this library.
- deps = []
deps = [ ":$grit_custom_target" ]
direct_dependent_configs = [ ":$grit_config" ]