[email protected] | 4625ade | 2014-04-15 19:26:44 | [diff] [blame] | 1 | # Copyright (c) 2013 The Chromium Authors. All rights reserved. |
| 2 | # Use of this source code is governed by a BSD-style license that can be |
| 3 | # found in the LICENSE file. |
| 4 | |
| 5 | import("//build/config/crypto.gni") |
| 6 | import("//build/config/features.gni") |
| 7 | import("//build/config/ui.gni") |
| 8 | import("//tools/grit/grit_rule.gni") |
| 9 | |
| 10 | if (is_android) { |
| 11 | import("//build/config/android/config.gni") |
| 12 | } else if (is_mac) { |
| 13 | import("//build/config/mac/mac_sdk.gni") |
| 14 | } |
| 15 | |
| 16 | # The list of net files is kept in net.gypi. Read it. |
| 17 | gypi_values = exec_script( |
| 18 | "//build/gypi_to_gn.py", |
| 19 | [ rebase_path("net.gypi") ] |
| 20 | "scope", |
| 21 | [ "net.gypi" ]) |
| 22 | |
| 23 | # Disable Kerberos on ChromeOS, Android and iOS, at least for now. It needs |
| 24 | # configuration (krb5.conf and so on). |
| 25 | use_kerberos = !is_chromeos && !is_android && !is_ios |
| 26 | |
| 27 | # The way the cache uses mmap() is inefficient on some Android devices. If |
| 28 | # this flag is set, we hackily avoid using mmap() in the disk cache. We are |
| 29 | # pretty confident that mmap-ing the index would not hurt any existing x86 |
| 30 | # android devices, but we cannot be so sure about the variety of ARM devices. |
| 31 | # So enable it for x86 only for now. |
| 32 | posix_avoid_mmap = is_android && cpu_arch != "x86" |
| 33 | |
| 34 | # WebSockets and socket stream code are used everywhere except iOS. |
| 35 | enable_websockets = !is_ios |
[email protected] | 8603c5de | 2014-04-16 20:34:31 | [diff] [blame] | 36 | # TODO(brettw) put back to "!is_ios" when v8 is supported in GN build. |
| 37 | use_v8_in_net = false # TODO(brettw)!is_ios |
[email protected] | 4625ade | 2014-04-15 19:26:44 | [diff] [blame] | 38 | enable_built_in_dns = !is_ios |
| 39 | |
[email protected] | 8603c5de | 2014-04-16 20:34:31 | [diff] [blame] | 40 | enable_ftp_support = !is_ios |
[email protected] | 4625ade | 2014-04-15 19:26:44 | [diff] [blame] | 41 | |
[email protected] | 4625ade | 2014-04-15 19:26:44 | [diff] [blame] | 42 | config("net_config") { |
| 43 | defines = [] |
| 44 | if (posix_avoid_mmap) { |
| 45 | defines += [ "POSIX_AVOID_MMAP" ] |
| 46 | } |
| 47 | } |
| 48 | |
[email protected] | 8603c5de | 2014-04-16 20:34:31 | [diff] [blame] | 49 | # Disables Windows warning about size to int truncations. |
| 50 | # TODO(jschuh): crbug.com/167187 fix this and delete this config. |
| 51 | config("net_win_size_truncation") { |
| 52 | if (is_win) { |
[email protected] | d980fd11 | 2014-04-22 04:42:13 | [diff] [blame] | 53 | cflags = [ "/wd4267" ] |
[email protected] | 8603c5de | 2014-04-16 20:34:31 | [diff] [blame] | 54 | } |
| 55 | } |
| 56 | |
[email protected] | 4625ade | 2014-04-15 19:26:44 | [diff] [blame] | 57 | component("net") { |
| 58 | sources = |
| 59 | gypi_values.net_nacl_common_sources + |
| 60 | gypi_values.net_non_nacl_sources |
| 61 | |
| 62 | cflags = [] |
[email protected] | 8603c5de | 2014-04-16 20:34:31 | [diff] [blame] | 63 | defines = [ |
| 64 | # TODO(GYP) Note that he GYP file supports linux_link_kerberos (defaults to |
| 65 | # 0) which implies that we run pkg_config on kerberos and link to that |
| 66 | # rather than setting this define which will dynamically open it. That |
| 67 | # doesn't seem to be set in the regular builds, so we're skipping this |
| 68 | # capability here. |
| 69 | "DLOPEN_KERBEROS", |
| 70 | "NET_IMPLEMENTATION" |
| 71 | ] |
| 72 | configs += [ ":net_win_size_truncation" ] |
[email protected] | 4625ade | 2014-04-15 19:26:44 | [diff] [blame] | 73 | direct_dependent_configs = [ ":net_config" ] |
| 74 | include_dirs = [] |
| 75 | |
| 76 | deps = [ |
| 77 | ":net_resources", |
| 78 | "//base", |
| 79 | "//base:i18n", |
| 80 | "//base/third_party/dynamic_annotations", |
| 81 | "//crypto", |
| 82 | "//crypto:platform", |
| 83 | "//sdch", |
| 84 | "//third_party/icu", |
| 85 | "//third_party/zlib", |
| 86 | "//url", |
| 87 | ] |
| 88 | |
| 89 | if (use_kerberos) { |
| 90 | defines += [ "USE_KERBEROS" ] |
| 91 | if (is_android) { |
| 92 | include_dirs += [ "/usr/include/kerberosV" ] |
| 93 | } |
| 94 | } else { |
| 95 | sources -= [ |
| 96 | "http/http_auth_gssapi_posix.cc", |
| 97 | "http/http_auth_gssapi_posix.h", |
| 98 | "http/http_auth_handler_negotiate.h", |
| 99 | "http/http_auth_handler_negotiate.cc", |
| 100 | ] |
| 101 | } |
| 102 | |
| 103 | if (is_posix) { |
| 104 | if (posix_avoid_mmap) { |
| 105 | sources -= [ "disk_cache/blockfile/mapped_file_posix.cc" ] |
| 106 | } else { |
| 107 | sources -= [ "disk_cache/blockfile/mapped_file_avoid_mmap_posix.cc" ] |
| 108 | } |
| 109 | } |
| 110 | |
[email protected] | 8603c5de | 2014-04-16 20:34:31 | [diff] [blame] | 111 | if (!enable_ftp_support) { |
[email protected] | 4625ade | 2014-04-15 19:26:44 | [diff] [blame] | 112 | sources -= [ |
| 113 | "ftp/ftp_auth_cache.cc", |
| 114 | "ftp/ftp_auth_cache.h", |
| 115 | "ftp/ftp_ctrl_response_buffer.cc", |
| 116 | "ftp/ftp_ctrl_response_buffer.h", |
| 117 | "ftp/ftp_directory_listing_parser.cc", |
| 118 | "ftp/ftp_directory_listing_parser.h", |
| 119 | "ftp/ftp_directory_listing_parser_ls.cc", |
| 120 | "ftp/ftp_directory_listing_parser_ls.h", |
| 121 | "ftp/ftp_directory_listing_parser_netware.cc", |
| 122 | "ftp/ftp_directory_listing_parser_netware.h", |
| 123 | "ftp/ftp_directory_listing_parser_os2.cc", |
| 124 | "ftp/ftp_directory_listing_parser_os2.h", |
| 125 | "ftp/ftp_directory_listing_parser_vms.cc", |
| 126 | "ftp/ftp_directory_listing_parser_vms.h", |
| 127 | "ftp/ftp_directory_listing_parser_windows.cc", |
| 128 | "ftp/ftp_directory_listing_parser_windows.h", |
| 129 | "ftp/ftp_network_layer.cc", |
| 130 | "ftp/ftp_network_layer.h", |
| 131 | "ftp/ftp_network_session.cc", |
| 132 | "ftp/ftp_network_session.h", |
| 133 | "ftp/ftp_network_transaction.cc", |
| 134 | "ftp/ftp_network_transaction.h", |
| 135 | "ftp/ftp_request_info.h", |
| 136 | "ftp/ftp_response_info.cc", |
| 137 | "ftp/ftp_response_info.h", |
| 138 | "ftp/ftp_server_type_histograms.cc", |
| 139 | "ftp/ftp_server_type_histograms.h", |
| 140 | "ftp/ftp_transaction.h", |
| 141 | "ftp/ftp_transaction_factory.h", |
| 142 | "ftp/ftp_util.cc", |
| 143 | "ftp/ftp_util.h", |
| 144 | "url_request/ftp_protocol_handler.cc", |
| 145 | "url_request/ftp_protocol_handler.h", |
| 146 | "url_request/url_request_ftp_job.cc", |
| 147 | "url_request/url_request_ftp_job.h", |
| 148 | ] |
| 149 | } |
| 150 | |
| 151 | if (enable_built_in_dns) { |
| 152 | defines += [ "ENABLE_BUILT_IN_DNS" ] |
| 153 | } else { |
| 154 | sources -= [ |
| 155 | "dns/address_sorter_posix.cc", |
| 156 | "dns/address_sorter_posix.h", |
| 157 | "dns/dns_client.cc", |
| 158 | ] |
| 159 | } |
| 160 | |
| 161 | if (use_openssl) { |
| 162 | sources -= [ |
| 163 | "base/crypto_module_nss.cc", |
| 164 | "base/keygen_handler_nss.cc", |
| 165 | "base/nss_memio.c", |
| 166 | "base/nss_memio.h", |
| 167 | "cert/cert_database_nss.cc", |
| 168 | "cert/cert_verify_proc_nss.cc", |
| 169 | "cert/cert_verify_proc_nss.h", |
| 170 | "cert/ct_log_verifier_nss.cc", |
| 171 | "cert/ct_objects_extractor_nss.cc", |
| 172 | "cert/jwk_serializer_nss.cc", |
| 173 | "cert/nss_cert_database.cc", |
| 174 | "cert/nss_cert_database.h", |
| 175 | "cert/nss_cert_database_chromeos.cc", |
| 176 | "cert/nss_cert_database_chromeos.h", |
| 177 | "cert/nss_profile_filter_chromeos.cc", |
| 178 | "cert/nss_profile_filter_chromeos.h", |
| 179 | "cert/scoped_nss_types.h", |
| 180 | "cert/test_root_certs_nss.cc", |
| 181 | "cert/x509_certificate_nss.cc", |
| 182 | "cert/x509_util_nss.cc", |
| 183 | "cert/x509_util_nss.h", |
| 184 | "ocsp/nss_ocsp.cc", |
| 185 | "ocsp/nss_ocsp.h", |
| 186 | "quic/crypto/aead_base_decrypter_nss.cc", |
| 187 | "quic/crypto/aead_base_encrypter_nss.cc", |
| 188 | "quic/crypto/aes_128_gcm_12_decrypter_nss.cc", |
| 189 | "quic/crypto/aes_128_gcm_12_encrypter_nss.cc", |
| 190 | "quic/crypto/chacha20_poly1305_decrypter_nss.cc", |
| 191 | "quic/crypto/chacha20_poly1305_encrypter_nss.cc", |
| 192 | "quic/crypto/channel_id_nss.cc", |
| 193 | "quic/crypto/p256_key_exchange_nss.cc", |
| 194 | "socket/nss_ssl_util.cc", |
| 195 | "socket/nss_ssl_util.h", |
| 196 | "socket/ssl_client_socket_nss.cc", |
| 197 | "socket/ssl_client_socket_nss.h", |
| 198 | "socket/ssl_server_socket_nss.cc", |
| 199 | "socket/ssl_server_socket_nss.h", |
| 200 | "third_party/mozilla_security_manager/nsKeygenHandler.cpp", |
| 201 | "third_party/mozilla_security_manager/nsKeygenHandler.h", |
| 202 | "third_party/mozilla_security_manager/nsNSSCertificateDB.cpp", |
| 203 | "third_party/mozilla_security_manager/nsNSSCertificateDB.h", |
| 204 | "third_party/mozilla_security_manager/nsPKCS12Blob.cpp", |
| 205 | "third_party/mozilla_security_manager/nsPKCS12Blob.h", |
| 206 | ] |
| 207 | } else { |
| 208 | sources -= [ |
| 209 | "base/crypto_module_openssl.cc", |
| 210 | "base/keygen_handler_openssl.cc", |
| 211 | "cert/ct_log_verifier_openssl.cc", |
| 212 | "cert/ct_objects_extractor_openssl.cc", |
| 213 | "cert/jwk_serializer_openssl.cc", |
| 214 | "cert/x509_util_openssl.cc", |
| 215 | "cert/x509_util_openssl.h", |
| 216 | "quic/crypto/aead_base_decrypter_openssl.cc", |
| 217 | "quic/crypto/aead_base_encrypter_openssl.cc", |
| 218 | "quic/crypto/aes_128_gcm_12_decrypter_openssl.cc", |
| 219 | "quic/crypto/aes_128_gcm_12_encrypter_openssl.cc", |
| 220 | "quic/crypto/chacha20_poly1305_decrypter_openssl.cc", |
| 221 | "quic/crypto/chacha20_poly1305_encrypter_openssl.cc", |
| 222 | "quic/crypto/channel_id_openssl.cc", |
| 223 | "quic/crypto/p256_key_exchange_openssl.cc", |
| 224 | "quic/crypto/scoped_evp_aead_ctx.cc", |
| 225 | "quic/crypto/scoped_evp_aead_ctx.h", |
| 226 | "socket/ssl_client_socket_openssl.cc", |
| 227 | "socket/ssl_client_socket_openssl.h", |
| 228 | "socket/ssl_server_socket_openssl.cc", |
| 229 | "socket/ssl_session_cache_openssl.cc", |
| 230 | "socket/ssl_session_cache_openssl.h", |
| 231 | ] |
| 232 | } |
| 233 | |
| 234 | if (!use_openssl_certs) { |
| 235 | sources -= [ |
| 236 | "base/openssl_private_key_store.h", |
| 237 | "base/openssl_private_key_store_memory.cc", |
| 238 | "cert/cert_database_openssl.cc", |
| 239 | "cert/cert_verify_proc_openssl.cc", |
| 240 | "cert/cert_verify_proc_openssl.h", |
| 241 | "cert/test_root_certs_openssl.cc", |
| 242 | "cert/x509_certificate_openssl.cc", |
| 243 | "ssl/openssl_client_key_store.cc", |
| 244 | "ssl/openssl_client_key_store.h", |
| 245 | ] |
| 246 | if (is_android) { |
| 247 | sources -= [ |
| 248 | "base/openssl_private_key_store_android.cc", |
| 249 | ] |
| 250 | } |
| 251 | } |
| 252 | |
| 253 | if (use_glib) { |
| 254 | configs += [ "//build/config/linux:gconf" ] |
| 255 | deps += [ "//build/config/linux:gio" ] |
| 256 | } |
| 257 | |
| 258 | if (is_linux) { |
| 259 | configs += [ "//build/config/linux:libresolv" ] |
| 260 | } else { |
| 261 | sources -= [ |
| 262 | "base/crypto_module_nss.cc", |
| 263 | "base/keygen_handler_nss.cc", |
| 264 | "cert/cert_database_nss.cc", |
| 265 | "cert/nss_cert_database.cc", |
| 266 | "cert/nss_cert_database.h", |
[email protected] | 4625ade | 2014-04-15 19:26:44 | [diff] [blame] | 267 | "cert/x509_certificate_nss.cc", |
[email protected] | 4625ade | 2014-04-15 19:26:44 | [diff] [blame] | 268 | "third_party/mozilla_security_manager/nsKeygenHandler.cpp", |
| 269 | "third_party/mozilla_security_manager/nsKeygenHandler.h", |
| 270 | "third_party/mozilla_security_manager/nsNSSCertificateDB.cpp", |
| 271 | "third_party/mozilla_security_manager/nsNSSCertificateDB.h", |
| 272 | "third_party/mozilla_security_manager/nsPKCS12Blob.cpp", |
| 273 | "third_party/mozilla_security_manager/nsPKCS12Blob.h", |
| 274 | ] |
[email protected] | e8ab691 | 2014-04-21 20:54:51 | [diff] [blame] | 275 | |
| 276 | if (!is_ios) { |
| 277 | # These files are part of the partial implementation of NSS on iOS so |
| 278 | # keep them in that case. |
| 279 | sources -= [ |
| 280 | "cert/test_root_certs_nss.cc", |
| 281 | "ocsp/nss_ocsp.cc", |
| 282 | "ocsp/nss_ocsp.h", |
| 283 | ] |
| 284 | } |
[email protected] | 4625ade | 2014-04-15 19:26:44 | [diff] [blame] | 285 | } |
| 286 | |
[email protected] | e8ab691 | 2014-04-21 20:54:51 | [diff] [blame] | 287 | if (!use_nss_certs) { |
[email protected] | 4625ade | 2014-04-15 19:26:44 | [diff] [blame] | 288 | sources -= [ |
[email protected] | 4625ade | 2014-04-15 19:26:44 | [diff] [blame] | 289 | "ssl/client_cert_store_nss.cc", |
| 290 | "ssl/client_cert_store_nss.h", |
| 291 | ] |
[email protected] | e8ab691 | 2014-04-21 20:54:51 | [diff] [blame] | 292 | if (!is_ios) { |
| 293 | # These files are part of the partial implementation of NSS on iOS so |
| 294 | # keep them in that case (even though use_nss_certs is not set). |
| 295 | sources -= [ |
| 296 | "cert/cert_verify_proc_nss.cc", |
| 297 | "cert/cert_verify_proc_nss.h", |
| 298 | ] |
| 299 | } |
[email protected] | 4625ade | 2014-04-15 19:26:44 | [diff] [blame] | 300 | if (is_chromeos) { |
| 301 | # These were already removed on non-ChromeOS. |
| 302 | sources -= [ |
| 303 | "ssl/client_cert_store_chromeos.cc", |
| 304 | "ssl/client_cert_store_chromeos.h", |
| 305 | ] |
| 306 | } |
| 307 | } |
| 308 | |
| 309 | if (!enable_websockets) { |
| 310 | sources -= [ |
| 311 | "socket_stream/socket_stream.cc", |
| 312 | "socket_stream/socket_stream.h", |
| 313 | "socket_stream/socket_stream_job.cc", |
| 314 | "socket_stream/socket_stream_job.h", |
| 315 | "socket_stream/socket_stream_job_manager.cc", |
| 316 | "socket_stream/socket_stream_job_manager.h", |
| 317 | "socket_stream/socket_stream_metrics.cc", |
| 318 | "socket_stream/socket_stream_metrics.h", |
| 319 | "spdy/spdy_websocket_stream.cc", |
| 320 | "spdy/spdy_websocket_stream.h", |
| 321 | "websockets/websocket_basic_handshake_stream.cc", |
| 322 | "websockets/websocket_basic_handshake_stream.h", |
| 323 | "websockets/websocket_basic_stream.cc", |
| 324 | "websockets/websocket_basic_stream.h", |
| 325 | "websockets/websocket_channel.cc", |
| 326 | "websockets/websocket_channel.h", |
| 327 | "websockets/websocket_deflate_predictor.h", |
| 328 | "websockets/websocket_deflate_predictor_impl.cc", |
| 329 | "websockets/websocket_deflate_predictor_impl.h", |
| 330 | "websockets/websocket_deflate_stream.cc", |
| 331 | "websockets/websocket_deflate_stream.h", |
| 332 | "websockets/websocket_deflater.cc", |
| 333 | "websockets/websocket_deflater.h", |
| 334 | "websockets/websocket_errors.cc", |
| 335 | "websockets/websocket_errors.h", |
| 336 | "websockets/websocket_extension.cc", |
| 337 | "websockets/websocket_extension.h", |
| 338 | "websockets/websocket_extension_parser.cc", |
| 339 | "websockets/websocket_extension_parser.h", |
| 340 | "websockets/websocket_frame.cc", |
| 341 | "websockets/websocket_frame.h", |
| 342 | "websockets/websocket_frame_parser.cc", |
| 343 | "websockets/websocket_frame_parser.h", |
| 344 | "websockets/websocket_handshake_constants.cc", |
| 345 | "websockets/websocket_handshake_constants.h", |
| 346 | "websockets/websocket_handshake_handler.cc", |
| 347 | "websockets/websocket_handshake_handler.h", |
| 348 | "websockets/websocket_handshake_request_info.cc", |
| 349 | "websockets/websocket_handshake_request_info.h", |
| 350 | "websockets/websocket_handshake_response_info.cc", |
| 351 | "websockets/websocket_handshake_response_info.h", |
| 352 | "websockets/websocket_handshake_stream_base.h", |
| 353 | "websockets/websocket_handshake_stream_create_helper.cc", |
| 354 | "websockets/websocket_handshake_stream_create_helper.h", |
| 355 | "websockets/websocket_inflater.cc", |
| 356 | "websockets/websocket_inflater.h", |
| 357 | "websockets/websocket_job.cc", |
| 358 | "websockets/websocket_job.h", |
| 359 | "websockets/websocket_mux.h", |
| 360 | "websockets/websocket_net_log_params.cc", |
| 361 | "websockets/websocket_net_log_params.h", |
| 362 | "websockets/websocket_stream.cc", |
| 363 | "websockets/websocket_stream.h", |
| 364 | "websockets/websocket_throttle.cc", |
| 365 | "websockets/websocket_throttle.h", |
| 366 | ] |
| 367 | } |
| 368 | |
| 369 | if (!enable_mdns) { |
| 370 | sources -= [ |
| 371 | "dns/mdns_cache.cc", |
| 372 | "dns/mdns_cache.h", |
| 373 | "dns/mdns_client.cc", |
| 374 | "dns/mdns_client.h", |
| 375 | "dns/mdns_client_impl.cc", |
| 376 | "dns/mdns_client_impl.h", |
| 377 | "dns/record_parsed.cc", |
| 378 | "dns/record_parsed.h", |
| 379 | "dns/record_rdata.cc", |
| 380 | "dns/record_rdata.h", |
| 381 | ] |
| 382 | } |
| 383 | |
| 384 | if (is_win) { |
| 385 | sources -= [ |
| 386 | "http/http_auth_handler_ntlm_portable.cc", |
| 387 | "socket/tcp_socket_libevent.cc", |
| 388 | "socket/tcp_socket_libevent.h", |
| 389 | "udp/udp_socket_libevent.cc", |
| 390 | "udp/udp_socket_libevent.h", |
| 391 | ] |
| 392 | deps += [ |
[email protected] | 8603c5de | 2014-04-16 20:34:31 | [diff] [blame] | 393 | "//third_party/nss:nspr", |
| 394 | "//third_party/nss", |
[email protected] | 4625ade | 2014-04-15 19:26:44 | [diff] [blame] | 395 | ] |
[email protected] | 4625ade | 2014-04-15 19:26:44 | [diff] [blame] | 396 | } else { # !is_win |
| 397 | sources -= [ |
| 398 | "base/winsock_init.cc", |
| 399 | "base/winsock_init.h", |
| 400 | "base/winsock_util.cc", |
| 401 | "base/winsock_util.h", |
| 402 | "proxy/proxy_resolver_winhttp.cc", |
| 403 | "proxy/proxy_resolver_winhttp.h", |
| 404 | ] |
| 405 | } |
| 406 | |
| 407 | if (is_mac) { |
[email protected] | 4625ade | 2014-04-15 19:26:44 | [diff] [blame] | 408 | deps += [ |
[email protected] | 8603c5de | 2014-04-16 20:34:31 | [diff] [blame] | 409 | "//third_party/nss:nspr", |
| 410 | "//third_party/nss", |
[email protected] | 4625ade | 2014-04-15 19:26:44 | [diff] [blame] | 411 | ] |
| 412 | libs = [ |
[email protected] | ab9ce6e | 2014-04-17 20:33:19 | [diff] [blame] | 413 | "Foundation.framework", |
| 414 | "Security.framework", |
| 415 | "SystemConfiguration.framework", |
| 416 | "resolv", |
[email protected] | 4625ade | 2014-04-15 19:26:44 | [diff] [blame] | 417 | ] |
| 418 | } |
| 419 | |
| 420 | if (is_ios) { |
| 421 | sources -= [ "disk_cache/blockfile/file_posix.cc" ] |
| 422 | deps += [ |
| 423 | "//third_party/nss", |
| 424 | ] |
| 425 | libs = [ |
[email protected] | ab9ce6e | 2014-04-17 20:33:19 | [diff] [blame] | 426 | "CFNetwork.framework", |
| 427 | "MobileCoreServices.framework", |
| 428 | "Security.framework", |
| 429 | "SystemConfiguration.framework", |
| 430 | "resolv", |
[email protected] | 4625ade | 2014-04-15 19:26:44 | [diff] [blame] | 431 | ] |
| 432 | } |
| 433 | |
| 434 | if (is_android) { |
| 435 | if (!is_android_webview_build) { |
| 436 | sources -= [ |
| 437 | "base/openssl_private_key_store_memory.cc", |
| 438 | "cert/cert_database_openssl.cc", |
| 439 | "cert/cert_verify_proc_openssl.cc", |
| 440 | "cert/test_root_certs_openssl.cc", |
| 441 | ] |
| 442 | deps += [ ":net_jni_headers" ] |
| 443 | |
| 444 | # The net/android/keystore_openssl.cc source file needs to access an |
| 445 | # OpenSSL-internal header. |
| 446 | include_dirs = [ "//third_party/openssl" ] |
| 447 | } |
| 448 | } |
| 449 | } |
| 450 | |
| 451 | grit("net_resources") { |
| 452 | source = "base/net_resources.grd" |
| 453 | } |
| 454 | |
| 455 | source_set("http_server") { |
| 456 | sources = [ |
| 457 | "server/http_connection.cc", |
| 458 | "server/http_connection.h", |
| 459 | "server/http_server.cc", |
| 460 | "server/http_server.h", |
| 461 | "server/http_server_request_info.cc", |
| 462 | "server/http_server_request_info.h", |
| 463 | "server/http_server_response_info.cc", |
| 464 | "server/http_server_response_info.h", |
| 465 | "server/web_socket.cc", |
| 466 | "server/web_socket.h", |
| 467 | ] |
| 468 | configs += [ "//build/config/compiler:wexit_time_destructors" ] |
| 469 | deps = [ |
| 470 | ":net", |
| 471 | "//base", |
| 472 | ] |
| 473 | } |
| 474 | |
[email protected] | 8603c5de | 2014-04-16 20:34:31 | [diff] [blame] | 475 | executable("dump_cache") { |
| 476 | sources = [ |
| 477 | "tools/dump_cache/cache_dumper.cc", |
| 478 | "tools/dump_cache/cache_dumper.h", |
| 479 | "tools/dump_cache/dump_cache.cc", |
| 480 | "tools/dump_cache/dump_files.cc", |
| 481 | "tools/dump_cache/dump_files.h", |
| 482 | "tools/dump_cache/simple_cache_dumper.cc", |
| 483 | "tools/dump_cache/simple_cache_dumper.h", |
| 484 | "tools/dump_cache/upgrade_win.cc", |
| 485 | "tools/dump_cache/upgrade_win.h", |
| 486 | "tools/dump_cache/url_to_filename_encoder.cc", |
| 487 | "tools/dump_cache/url_to_filename_encoder.h", |
| 488 | "tools/dump_cache/url_utilities.h", |
| 489 | "tools/dump_cache/url_utilities.cc", |
| 490 | ] |
[email protected] | 4625ade | 2014-04-15 19:26:44 | [diff] [blame] | 491 | |
[email protected] | 8603c5de | 2014-04-16 20:34:31 | [diff] [blame] | 492 | configs += [ ":net_win_size_truncation" ] |
| 493 | |
| 494 | deps = [ |
| 495 | "//base", |
| 496 | ":net", |
| 497 | ":net_test_support", |
| 498 | ] |
| 499 | } |
| 500 | |
| 501 | source_set("net_test_support") { |
| 502 | sources = [ |
| 503 | "base/capturing_net_log.cc", |
| 504 | "base/capturing_net_log.h", |
| 505 | "base/load_timing_info_test_util.cc", |
| 506 | "base/load_timing_info_test_util.h", |
| 507 | "base/mock_file_stream.cc", |
| 508 | "base/mock_file_stream.h", |
| 509 | "base/test_completion_callback.cc", |
| 510 | "base/test_completion_callback.h", |
| 511 | "base/test_data_directory.cc", |
| 512 | "base/test_data_directory.h", |
| 513 | "cert/mock_cert_verifier.cc", |
| 514 | "cert/mock_cert_verifier.h", |
| 515 | "cookies/cookie_monster_store_test.cc", |
| 516 | "cookies/cookie_monster_store_test.h", |
| 517 | "cookies/cookie_store_test_callbacks.cc", |
| 518 | "cookies/cookie_store_test_callbacks.h", |
| 519 | "cookies/cookie_store_test_helpers.cc", |
| 520 | "cookies/cookie_store_test_helpers.h", |
| 521 | "disk_cache/disk_cache_test_base.cc", |
| 522 | "disk_cache/disk_cache_test_base.h", |
| 523 | "disk_cache/disk_cache_test_util.cc", |
| 524 | "disk_cache/disk_cache_test_util.h", |
| 525 | "dns/dns_test_util.cc", |
| 526 | "dns/dns_test_util.h", |
| 527 | "dns/mock_host_resolver.cc", |
| 528 | "dns/mock_host_resolver.h", |
| 529 | "dns/mock_mdns_socket_factory.cc", |
| 530 | "dns/mock_mdns_socket_factory.h", |
| 531 | "proxy/mock_proxy_resolver.cc", |
| 532 | "proxy/mock_proxy_resolver.h", |
| 533 | "proxy/mock_proxy_script_fetcher.cc", |
| 534 | "proxy/mock_proxy_script_fetcher.h", |
| 535 | "proxy/proxy_config_service_common_unittest.cc", |
| 536 | "proxy/proxy_config_service_common_unittest.h", |
| 537 | "socket/socket_test_util.cc", |
| 538 | "socket/socket_test_util.h", |
| 539 | "test/cert_test_util.cc", |
| 540 | "test/cert_test_util.h", |
| 541 | "test/ct_test_util.cc", |
| 542 | "test/ct_test_util.h", |
| 543 | "test/embedded_test_server/embedded_test_server.cc", |
| 544 | "test/embedded_test_server/embedded_test_server.h", |
| 545 | "test/embedded_test_server/http_connection.cc", |
| 546 | "test/embedded_test_server/http_connection.h", |
| 547 | "test/embedded_test_server/http_request.cc", |
| 548 | "test/embedded_test_server/http_request.h", |
| 549 | "test/embedded_test_server/http_response.cc", |
| 550 | "test/embedded_test_server/http_response.h", |
| 551 | "test/net_test_suite.cc", |
| 552 | "test/net_test_suite.h", |
| 553 | "test/python_utils.cc", |
| 554 | "test/python_utils.h", |
| 555 | "test/spawned_test_server/base_test_server.cc", |
| 556 | "test/spawned_test_server/base_test_server.h", |
| 557 | "test/spawned_test_server/local_test_server_posix.cc", |
| 558 | "test/spawned_test_server/local_test_server_win.cc", |
| 559 | "test/spawned_test_server/local_test_server.cc", |
| 560 | "test/spawned_test_server/local_test_server.h", |
| 561 | "test/spawned_test_server/remote_test_server.cc", |
| 562 | "test/spawned_test_server/remote_test_server.h", |
| 563 | "test/spawned_test_server/spawned_test_server.h", |
| 564 | "test/spawned_test_server/spawner_communicator.cc", |
| 565 | "test/spawned_test_server/spawner_communicator.h", |
| 566 | "url_request/test_url_fetcher_factory.cc", |
| 567 | "url_request/test_url_fetcher_factory.h", |
| 568 | "url_request/url_request_test_util.cc", |
| 569 | "url_request/url_request_test_util.h", |
| 570 | ] |
| 571 | |
| 572 | configs += [ ":net_win_size_truncation" ] |
| 573 | |
| 574 | deps = [ |
| 575 | "//base", |
| 576 | "//base/test:test_support", |
| 577 | "//crypto:platform", |
[email protected] | 59ff2d4 | 2014-04-22 22:25:23 | [diff] [blame^] | 578 | "//net", |
[email protected] | 8603c5de | 2014-04-16 20:34:31 | [diff] [blame] | 579 | "//net/tools/tld_cleanup", |
| 580 | "//testing/gmock", |
| 581 | "//testing/gtest", |
| 582 | "//url", |
| 583 | ] |
| 584 | |
| 585 | if (is_ios) { |
| 586 | deps += [ "//third_party/nss" ] |
| 587 | } |
| 588 | |
| 589 | if (!is_android) { |
| 590 | sources -= [ |
| 591 | "test/spawned_test_server/remote_test_server.cc", |
| 592 | "test/spawned_test_server/remote_test_server.h", |
| 593 | "test/spawned_test_server/spawner_communicator.cc", |
| 594 | "test/spawned_test_server/spawner_communicator.h", |
| 595 | ] |
| 596 | } |
| 597 | |
| 598 | if (use_v8_in_net) { |
| 599 | deps += [ ":net_with_v8" ] |
| 600 | } |
| 601 | |
| 602 | if (!enable_mdns) { |
| 603 | sources -= [ |
| 604 | "dns/mock_mdns_socket_factory.cc", |
| 605 | "dns/mock_mdns_socket_factory.h", |
| 606 | ] |
| 607 | } |
| 608 | |
| 609 | forward_dependent_configs_from = deps |
| 610 | } |
| 611 | |
| 612 | if (use_v8_in_net) { |
| 613 | component("net_with_v8") { |
| 614 | sources = [ |
| 615 | "proxy/proxy_resolver_v8.cc", |
| 616 | "proxy/proxy_resolver_v8.h", |
| 617 | "proxy/proxy_resolver_v8_tracing.cc", |
| 618 | "proxy/proxy_resolver_v8_tracing.h", |
| 619 | "proxy/proxy_service_v8.cc", |
| 620 | "proxy/proxy_service_v8.h", |
| 621 | ] |
| 622 | |
| 623 | defines = [ "NET_IMPLEMENTATION" ] |
| 624 | configs += [ |
| 625 | ":net_win_size_truncation", |
| 626 | "//build/config/compiler:wexit_time_destructors", |
| 627 | ] |
| 628 | |
| 629 | deps = [ |
| 630 | ":net", |
| 631 | "//base", |
| 632 | "//gin", |
| 633 | "//url", |
| 634 | "//v8", |
| 635 | ] |
| 636 | } |
| 637 | } |
| 638 | |
| 639 | if (!is_ios && !is_android) { |
| 640 | executable("crash_cache") { |
| 641 | sources = [ "tools/crash_cache/crash_cache.cc" ] |
| 642 | configs += [ ":net_win_size_truncation" ] |
| 643 | deps = [ |
| 644 | ":net", |
| 645 | ":net_test_support", |
| 646 | "//base", |
| 647 | ] |
| 648 | } |
| 649 | |
| 650 | executable("crl_set_dump") { |
| 651 | sources = [ "tools/crl_set_dump/crl_set_dump.cc" ] |
| 652 | configs += [ ":net_win_size_truncation" ] |
| 653 | deps = [ |
| 654 | ":net", |
| 655 | "//base", |
| 656 | ] |
| 657 | } |
| 658 | |
| 659 | executable("dns_fuzz_stub") { |
| 660 | sources = [ "tools/dns_fuzz_stub/dns_fuzz_stub.cc" ] |
| 661 | configs += [ ":net_win_size_truncation" ] |
| 662 | deps = [ |
| 663 | ":net", |
| 664 | "//base", |
| 665 | ] |
| 666 | } |
| 667 | |
| 668 | executable("gdig") { |
| 669 | sources = [ |
| 670 | "tools/gdig/file_net_log.cc", |
| 671 | "tools/gdig/gdig.cc", |
| 672 | ] |
| 673 | deps = [ |
| 674 | ":net", |
| 675 | "//base", |
| 676 | ] |
| 677 | } |
| 678 | |
| 679 | executable("get_server_time") { |
| 680 | sources = [ "tools/get_server_time/get_server_time.cc" ] |
| 681 | configs += [ ":net_win_size_truncation" ] |
| 682 | deps = [ |
| 683 | ":net", |
| 684 | "//base", |
| 685 | "//base:i18n", |
| 686 | "//url", |
| 687 | ] |
| 688 | } |
| 689 | |
| 690 | if (use_v8_in_net) { |
| 691 | executable("net_watcher") { |
| 692 | sources = [ "tools/net_watcher/net_watcher.cc" ] |
| 693 | deps = [ |
| 694 | ":net", |
| 695 | ":net_with_v8", |
| 696 | "//base", |
| 697 | ] |
| 698 | |
| 699 | if (is_linux) { |
| 700 | configs += [ "//build/config/linux:gconf" ] |
| 701 | deps += [ "//build/config/linux:gio" ] |
| 702 | } |
| 703 | } |
| 704 | } |
| 705 | |
| 706 | executable("run_testserver") { |
| 707 | sources = [ "tools/testserver/run_testserver.cc" ] |
| 708 | deps = [ |
| 709 | ":net", # TODO(brettw) bug 363749: this shouldn't be necessary. It's not |
| 710 | # in the GYP build, and can be removed when the bug is fixed. |
| 711 | ":net_test_support", |
| 712 | "//base", |
| 713 | "//base/test:test_support", |
| 714 | "//testing/gtest", |
| 715 | ] |
| 716 | } |
| 717 | |
| 718 | executable("stress_cache") { |
| 719 | sources = [ "disk_cache/blockfile/stress_cache.cc" ] |
| 720 | configs += [ ":net_win_size_truncation" ] |
| 721 | deps = [ |
| 722 | ":net", |
| 723 | ":net_test_support", |
| 724 | "//base", |
| 725 | ] |
| 726 | } |
| 727 | |
| 728 | executable("tld_cleanup") { |
| 729 | sources = [ "tools/tld_cleanup/tld_cleanup.cc" ] |
| 730 | configs += [ ":net_win_size_truncation" ] |
| 731 | deps = [ |
| 732 | "//base", |
| 733 | "//base:i18n", |
| 734 | "//net/tools/tld_cleanup", |
| 735 | ] |
| 736 | } |
| 737 | } |
| 738 | |
| 739 | if (is_linux) { |
| 740 | source_set("balsa") { |
| 741 | sources = [ |
| 742 | "tools/balsa/balsa_enums.h", |
| 743 | "tools/balsa/balsa_frame.cc", |
| 744 | "tools/balsa/balsa_frame.h", |
| 745 | "tools/balsa/balsa_headers.cc", |
| 746 | "tools/balsa/balsa_headers.h", |
| 747 | "tools/balsa/balsa_headers_token_utils.cc", |
| 748 | "tools/balsa/balsa_headers_token_utils.h", |
| 749 | "tools/balsa/balsa_visitor_interface.h", |
| 750 | "tools/balsa/http_message_constants.cc", |
| 751 | "tools/balsa/http_message_constants.h", |
| 752 | "tools/balsa/noop_balsa_visitor.h", |
| 753 | "tools/balsa/simple_buffer.cc", |
| 754 | "tools/balsa/simple_buffer.h", |
| 755 | "tools/balsa/split.cc", |
| 756 | "tools/balsa/split.h", |
| 757 | "tools/balsa/string_piece_utils.h", |
| 758 | ] |
| 759 | deps = [ |
| 760 | ":net", |
| 761 | "//base", |
| 762 | ] |
| 763 | } |
| 764 | |
| 765 | source_set("epoll_server") { |
| 766 | sources = [ |
| 767 | "tools/epoll_server/epoll_server.cc", |
| 768 | "tools/epoll_server/epoll_server.h", |
| 769 | ] |
| 770 | deps = [ |
| 771 | ":net", |
| 772 | "//base", |
| 773 | ] |
| 774 | } |
| 775 | |
| 776 | source_set("flip_in_mem_edsm_server_base") { |
| 777 | sources = [ |
| 778 | "tools/dump_cache/url_to_filename_encoder.cc", |
| 779 | "tools/dump_cache/url_to_filename_encoder.h", |
| 780 | "tools/dump_cache/url_utilities.h", |
| 781 | "tools/dump_cache/url_utilities.cc", |
| 782 | "tools/flip_server/acceptor_thread.h", |
| 783 | "tools/flip_server/acceptor_thread.cc", |
| 784 | "tools/flip_server/create_listener.cc", |
| 785 | "tools/flip_server/create_listener.h", |
| 786 | "tools/flip_server/constants.h", |
| 787 | "tools/flip_server/flip_config.cc", |
| 788 | "tools/flip_server/flip_config.h", |
| 789 | "tools/flip_server/http_interface.cc", |
| 790 | "tools/flip_server/http_interface.h", |
| 791 | "tools/flip_server/loadtime_measurement.h", |
| 792 | "tools/flip_server/mem_cache.h", |
| 793 | "tools/flip_server/mem_cache.cc", |
| 794 | "tools/flip_server/output_ordering.cc", |
| 795 | "tools/flip_server/output_ordering.h", |
| 796 | "tools/flip_server/ring_buffer.cc", |
| 797 | "tools/flip_server/ring_buffer.h", |
| 798 | "tools/flip_server/sm_connection.cc", |
| 799 | "tools/flip_server/sm_connection.h", |
| 800 | "tools/flip_server/sm_interface.h", |
| 801 | "tools/flip_server/spdy_ssl.cc", |
| 802 | "tools/flip_server/spdy_ssl.h", |
| 803 | "tools/flip_server/spdy_interface.cc", |
| 804 | "tools/flip_server/spdy_interface.h", |
| 805 | "tools/flip_server/spdy_util.cc", |
| 806 | "tools/flip_server/spdy_util.h", |
| 807 | "tools/flip_server/streamer_interface.cc", |
| 808 | "tools/flip_server/streamer_interface.h", |
| 809 | ] |
| 810 | deps = [ |
| 811 | ":balsa", |
| 812 | ":epoll_server", |
| 813 | ":net", |
| 814 | "//base", |
| 815 | "//third_party/openssl", |
| 816 | ] |
| 817 | } |
| 818 | |
| 819 | executable("flip_in_mem_edsm_server_unittests") { |
| 820 | sources = [ |
| 821 | "tools/flip_server/flip_test_utils.cc", |
| 822 | "tools/flip_server/flip_test_utils.h", |
| 823 | "tools/flip_server/http_interface_test.cc", |
| 824 | "tools/flip_server/mem_cache_test.cc", |
| 825 | "tools/flip_server/run_all_tests.cc", |
| 826 | "tools/flip_server/spdy_interface_test.cc", |
| 827 | ] |
| 828 | deps = [ |
| 829 | ":flip_in_mem_edsm_server_base", |
| 830 | ":net", |
| 831 | ":net_test_support", |
| 832 | "//testing/gtest", |
| 833 | "//testing/gmock", |
| 834 | "//third_party/openssl", |
| 835 | ] |
| 836 | } |
| 837 | |
| 838 | executable("flip_in_mem_edsm_server") { |
| 839 | sources = [ "tools/flip_server/flip_in_mem_edsm_server.cc" ] |
| 840 | deps = [ |
| 841 | ":flip_in_mem_edsm_server_base", |
| 842 | ":net", |
| 843 | "//base", |
| 844 | ] |
| 845 | } |
| 846 | |
| 847 | source_set("quic_base") { |
| 848 | sources = [ |
| 849 | "tools/quic/quic_client.cc", |
| 850 | "tools/quic/quic_client.h", |
| 851 | "tools/quic/quic_client_session.cc", |
| 852 | "tools/quic/quic_client_session.h", |
| 853 | "tools/quic/quic_default_packet_writer.cc", |
| 854 | "tools/quic/quic_default_packet_writer.h", |
| 855 | "tools/quic/quic_dispatcher.h", |
| 856 | "tools/quic/quic_dispatcher.cc", |
| 857 | "tools/quic/quic_epoll_clock.cc", |
| 858 | "tools/quic/quic_epoll_clock.h", |
| 859 | "tools/quic/quic_epoll_connection_helper.cc", |
| 860 | "tools/quic/quic_epoll_connection_helper.h", |
| 861 | "tools/quic/quic_in_memory_cache.cc", |
| 862 | "tools/quic/quic_in_memory_cache.h", |
| 863 | "tools/quic/quic_packet_writer_wrapper.cc", |
| 864 | "tools/quic/quic_packet_writer_wrapper.h", |
| 865 | "tools/quic/quic_server.cc", |
| 866 | "tools/quic/quic_server.h", |
| 867 | "tools/quic/quic_server_session.cc", |
| 868 | "tools/quic/quic_server_session.h", |
| 869 | "tools/quic/quic_socket_utils.cc", |
| 870 | "tools/quic/quic_socket_utils.h", |
| 871 | "tools/quic/quic_spdy_client_stream.cc", |
| 872 | "tools/quic/quic_spdy_client_stream.h", |
| 873 | "tools/quic/quic_spdy_server_stream.cc", |
| 874 | "tools/quic/quic_spdy_server_stream.h", |
| 875 | "tools/quic/quic_time_wait_list_manager.h", |
| 876 | "tools/quic/quic_time_wait_list_manager.cc", |
| 877 | "tools/quic/spdy_utils.cc", |
| 878 | "tools/quic/spdy_utils.h", |
| 879 | ] |
| 880 | deps = [ |
| 881 | ":balsa", |
| 882 | ":epoll_server", |
| 883 | ":net", |
| 884 | "//base", |
| 885 | "//base/third_party/dynamic_annotations", |
| 886 | "//crypto", |
| 887 | "//third_party/openssl", |
| 888 | "//url", |
| 889 | ] |
| 890 | } |
| 891 | |
| 892 | executable("quic_client") { |
| 893 | sources = [ "tools/quic/quic_client_bin.cc" ] |
| 894 | deps = [ |
| 895 | ":quic_base", |
| 896 | ":net", |
| 897 | "//base", |
| 898 | "//third_party/openssl", |
| 899 | ] |
| 900 | } |
| 901 | |
| 902 | executable("quic_server") { |
| 903 | sources = [ "tools/quic/quic_server_bin.cc" ] |
| 904 | deps = [ |
| 905 | ":quic_base", |
| 906 | ":net", |
| 907 | "//base", |
| 908 | "//third_party/openssl", |
| 909 | ] |
| 910 | } |
| 911 | } |
| 912 | |
| 913 | # TODO(GYP) Android net_jni_headers target and related. |
| 914 | |
| 915 | if (is_android || is_linux) { |
| 916 | executable("disk_cache_memory_test") { |
| 917 | sources = [ "tools/disk_cache_memory_test/disk_cache_memory_test.cc" ] |
| 918 | deps = [ |
| 919 | ":net", |
| 920 | "//base", |
| 921 | ] |
| 922 | } |
| 923 | } |