blob: 618d6e4c2dceea45999883f6e605e081b6e4f121 [file] [log] [blame]
[email protected]4625ade2014-04-15 19:26:441# 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
mefff34b822016-01-11 15:28:085import("//build/buildflag_header.gni")
slan77bdc2e62015-09-21 17:56:266import("//build/config/chromecast_build.gni")
brettw4cab0f12015-09-14 21:40:017import("//build/config/compiler/compiler.gni")
[email protected]4625ade2014-04-15 19:26:448import("//build/config/crypto.gni")
9import("//build/config/features.gni")
10import("//build/config/ui.gni")
dpranked4da5ab42015-10-13 06:20:3311import("//build_overrides/v8.gni")
eromane6264fd2016-03-02 22:46:3012import("//testing/libfuzzer/fuzzer_test.gni")
qsrfb5251d12015-01-21 15:57:2213import("//testing/test.gni")
rockot9c67e5f2015-03-12 20:01:2114import("//third_party/icu/config.gni")
rtennetib6f1c0d2015-04-03 17:52:0615import("//third_party/protobuf/proto_library.gni")
tfarinae597851a2015-10-06 23:14:4116import("//tools/grit/grit_rule.gni")
[email protected]26046b52014-07-16 00:11:0317
[email protected]4625ade2014-04-15 19:26:4418if (is_android) {
19 import("//build/config/android/config.gni")
[email protected]ef0eb442014-05-15 09:32:1820 import("//build/config/android/rules.gni")
[email protected]4625ade2014-04-15 19:26:4421} else if (is_mac) {
22 import("//build/config/mac/mac_sdk.gni")
23}
24
25# The list of net files is kept in net.gypi. Read it.
scottmg34fb7e52014-12-03 23:27:2426gypi_values = exec_script("//build/gypi_to_gn.py",
27 [ rebase_path("net.gypi") ],
28 "scope",
29 [ "net.gypi" ])
[email protected]4625ade2014-04-15 19:26:4430
skyostila5574572015-11-11 16:24:2531# Disable Kerberos on ChromeOS, iOS, Chromecast and headless, at least for now.
slan77bdc2e62015-09-21 17:56:2632# It needs configuration (krb5.conf and so on).
skyostila5574572015-11-11 16:24:2533use_kerberos = !is_chromeos && !is_ios && !is_chromecast && !is_headless
[email protected]4625ade2014-04-15 19:26:4434
35# The way the cache uses mmap() is inefficient on some Android devices. If
36# this flag is set, we hackily avoid using mmap() in the disk cache. We are
37# pretty confident that mmap-ing the index would not hurt any existing x86
38# android devices, but we cannot be so sure about the variety of ARM devices.
39# So enable it for x86 only for now.
dpranke43276212015-02-20 02:55:1940posix_avoid_mmap = is_android && current_cpu != "x86"
[email protected]4625ade2014-04-15 19:26:4441
[email protected]8a3f8242014-06-05 18:05:1242use_v8_in_net = !is_ios
[email protected]4625ade2014-04-15 19:26:4443enable_built_in_dns = !is_ios
44
[email protected]384dab92014-06-04 20:26:0845declare_args() {
46 # Disables support for file URLs. File URL support requires use of icu.
47 disable_file_support = false
mefff34b822016-01-11 15:28:0848
49 # Enables BidirectionalStream; Used in cronet, disabled by default.
xunjieli11834f02015-12-22 04:27:0850 enable_bidirectional_stream = false
agrieve56240df2015-12-22 22:20:2151
52 # WebSockets and socket stream code are not used on iOS and are optional in
53 # cronet.
54 enable_websockets = !is_ios
55 disable_ftp_support = is_ios
[email protected]384dab92014-06-04 20:26:0856}
[email protected]02494ec2014-05-07 15:05:2957
[email protected]4625ade2014-04-15 19:26:4458config("net_config") {
59 defines = []
60 if (posix_avoid_mmap) {
61 defines += [ "POSIX_AVOID_MMAP" ]
62 }
[email protected]02494ec2014-05-07 15:05:2963 if (disable_file_support) {
64 defines += [ "DISABLE_FILE_SUPPORT" ]
65 }
tfarinae7c8c3c2015-11-04 15:09:5566 if (disable_ftp_support) {
67 defines += [ "DISABLE_FTP_SUPPORT=1" ]
68 }
[email protected]4625ade2014-04-15 19:26:4469}
70
xunjieli905496a2015-08-31 15:51:1771# net_internal_config is shared with net and net_small.
72config("net_internal_config") {
[email protected]8603c5de2014-04-16 20:34:3173 defines = [
ellyjonesc7a5c502015-06-26 18:55:2074 # TODO(GYP) Note that the GYP file supports linux_link_kerberos (defaults to
[email protected]8603c5de2014-04-16 20:34:3175 # 0) which implies that we run pkg_config on kerberos and link to that
76 # rather than setting this define which will dynamically open it. That
77 # doesn't seem to be set in the regular builds, so we're skipping this
78 # capability here.
79 "DLOPEN_KERBEROS",
scottmg34fb7e52014-12-03 23:27:2480 "NET_IMPLEMENTATION",
[email protected]8603c5de2014-04-16 20:34:3181 ]
dpranke43276212015-02-20 02:55:1982
[email protected]4625ade2014-04-15 19:26:4483 if (use_kerberos) {
84 defines += [ "USE_KERBEROS" ]
85 if (is_android) {
xunjieli905496a2015-08-31 15:51:1786 include_dirs = [ "/usr/include/kerberosV" ]
[email protected]4625ade2014-04-15 19:26:4487 }
[email protected]4625ade2014-04-15 19:26:4488 }
89
90 if (enable_built_in_dns) {
91 defines += [ "ENABLE_BUILT_IN_DNS" ]
xunjieli905496a2015-08-31 15:51:1792 }
93}
94
95# net_shared_* are settings shared between net and net_small
sergeyu99d83f92015-09-14 23:03:3396net_shared_sources = gypi_values.net_nacl_common_sources
xunjieli905496a2015-08-31 15:51:1797
98net_shared_unfiltered_sources = []
99
100net_shared_configs = [
101 ":net_internal_config",
102 "//build/config:precompiled_headers",
103
104 # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
105 "//build/config/compiler:no_size_t_to_int_warning",
106]
107
108net_shared_public_deps = [
mefff34b822016-01-11 15:28:08109 ":features",
xunjieli905496a2015-08-31 15:51:17110 ":net_quic_proto",
111 "//crypto",
112 "//crypto:platform",
113]
114
115net_shared_deps = [
116 ":net_resources",
117 "//base",
xunjieli905496a2015-08-31 15:51:17118 "//net/base/registry_controlled_domains",
xunjieli905496a2015-08-31 15:51:17119 "//third_party/protobuf:protobuf_lite",
xunjieli905496a2015-08-31 15:51:17120]
121
sergeyu99d83f92015-09-14 23:03:33122if (!is_nacl) {
123 net_shared_sources += gypi_values.net_non_nacl_sources
xunjieli905496a2015-08-31 15:51:17124
sergeyu99d83f92015-09-14 23:03:33125 net_shared_deps += [
sergeyu99d83f92015-09-14 23:03:33126 "//base/third_party/dynamic_annotations",
brettw9f7802a22016-01-30 06:40:17127 "//components/prefs",
sergeyu99d83f92015-09-14 23:03:33128 "//sdch",
129 "//third_party/zlib",
130 ]
131
132 if (!use_kerberos) {
133 net_shared_sources -= [
sergeyu99d83f92015-09-14 23:03:33134 "http/http_auth_handler_negotiate.cc",
135 "http/http_auth_handler_negotiate.h",
136 ]
137 }
138
139 if (is_posix) {
140 if (posix_avoid_mmap) {
141 net_shared_sources -= [ "disk_cache/blockfile/mapped_file_posix.cc" ]
142 } else {
143 net_shared_sources -=
144 [ "disk_cache/blockfile/mapped_file_avoid_mmap_posix.cc" ]
145 }
146 }
147
148 if (!enable_built_in_dns) {
149 net_shared_sources -= [
150 "dns/address_sorter_posix.cc",
151 "dns/address_sorter_posix.h",
152 "dns/dns_client.cc",
153 ]
154 }
155
156 if (use_openssl) {
157 net_shared_sources -= [
158 "base/nss_memio.c",
159 "base/nss_memio.h",
160 "cert/ct_log_verifier_nss.cc",
161 "cert/ct_objects_extractor_nss.cc",
162 "cert/jwk_serializer_nss.cc",
163 "cert/scoped_nss_types.h",
164 "cert/x509_util_nss.cc",
165 "quic/crypto/aead_base_decrypter_nss.cc",
166 "quic/crypto/aead_base_encrypter_nss.cc",
167 "quic/crypto/aes_128_gcm_12_decrypter_nss.cc",
168 "quic/crypto/aes_128_gcm_12_encrypter_nss.cc",
169 "quic/crypto/chacha20_poly1305_decrypter_nss.cc",
170 "quic/crypto/chacha20_poly1305_encrypter_nss.cc",
rch5ba79932015-12-22 19:21:13171 "quic/crypto/chacha20_poly1305_rfc7539_decrypter_nss.cc",
172 "quic/crypto/chacha20_poly1305_rfc7539_encrypter_nss.cc",
sergeyu99d83f92015-09-14 23:03:33173 "quic/crypto/channel_id_nss.cc",
174 "quic/crypto/p256_key_exchange_nss.cc",
175 "quic/crypto/proof_source_chromium_nss.cc",
176 "socket/nss_ssl_util.cc",
177 "socket/nss_ssl_util.h",
178 "socket/ssl_client_socket_nss.cc",
179 "socket/ssl_client_socket_nss.h",
180 "socket/ssl_server_socket_nss.cc",
181 "socket/ssl_server_socket_nss.h",
nharperb7441ef2016-01-25 23:54:14182 "ssl/token_binding_nss.cc",
sergeyu99d83f92015-09-14 23:03:33183 ]
184 if (is_ios) {
185 # Always removed for !ios below.
186 net_shared_sources -= [
187 "cert/cert_verify_proc_nss.cc",
188 "cert/cert_verify_proc_nss.h",
189 ]
190 }
sergeyu99d83f92015-09-14 23:03:33191 if (!use_nss_certs && !is_ios) {
192 net_shared_sources -= [ "cert/x509_util_nss.h" ]
193 }
[email protected]4625ade2014-04-15 19:26:44194 } else {
xunjieli905496a2015-08-31 15:51:17195 net_shared_sources -= [
sergeyu99d83f92015-09-14 23:03:33196 "cert/ct_log_verifier_openssl.cc",
197 "cert/ct_objects_extractor_openssl.cc",
198 "cert/jwk_serializer_openssl.cc",
199 "cert/x509_util_openssl.cc",
200 "cert/x509_util_openssl.h",
201 "quic/crypto/aead_base_decrypter_openssl.cc",
202 "quic/crypto/aead_base_encrypter_openssl.cc",
203 "quic/crypto/aes_128_gcm_12_decrypter_openssl.cc",
204 "quic/crypto/aes_128_gcm_12_encrypter_openssl.cc",
205 "quic/crypto/chacha20_poly1305_decrypter_openssl.cc",
206 "quic/crypto/chacha20_poly1305_encrypter_openssl.cc",
rch5ba79932015-12-22 19:21:13207 "quic/crypto/chacha20_poly1305_rfc7539_decrypter_openssl.cc",
208 "quic/crypto/chacha20_poly1305_rfc7539_encrypter_openssl.cc",
sergeyu99d83f92015-09-14 23:03:33209 "quic/crypto/channel_id_openssl.cc",
210 "quic/crypto/p256_key_exchange_openssl.cc",
211 "quic/crypto/proof_source_chromium_openssl.cc",
212 "quic/crypto/scoped_evp_aead_ctx.cc",
213 "quic/crypto/scoped_evp_aead_ctx.h",
214 "socket/ssl_client_socket_openssl.cc",
215 "socket/ssl_client_socket_openssl.h",
216 "socket/ssl_server_socket_openssl.cc",
217 "socket/ssl_server_socket_openssl.h",
218 "ssl/openssl_ssl_util.cc",
219 "ssl/openssl_ssl_util.h",
220 "ssl/ssl_client_session_cache_openssl.cc",
221 "ssl/ssl_client_session_cache_openssl.h",
davidben2a811e4e2015-12-01 10:49:34222 "ssl/ssl_key_logger.cc",
223 "ssl/ssl_key_logger.h",
sergeyu99d83f92015-09-14 23:03:33224 "ssl/ssl_platform_key.h",
svaldez7872fd02015-11-19 21:10:54225 "ssl/ssl_platform_key_task_runner.cc",
226 "ssl/ssl_platform_key_task_runner.h",
svaldez0e6a4c62016-01-29 21:17:11227 "ssl/test_ssl_private_key.cc",
228 "ssl/test_ssl_private_key.h",
sergeyu99d83f92015-09-14 23:03:33229 "ssl/threaded_ssl_private_key.cc",
230 "ssl/threaded_ssl_private_key.h",
nharperb7441ef2016-01-25 23:54:14231 "ssl/token_binding_openssl.cc",
[email protected]4625ade2014-04-15 19:26:44232 ]
233 }
sergeyu99d83f92015-09-14 23:03:33234
235 if (!use_openssl_certs) {
xunjieli905496a2015-08-31 15:51:17236 net_shared_sources -= [
sergeyu99d83f92015-09-14 23:03:33237 "base/crypto_module_openssl.cc",
238 "base/keygen_handler_openssl.cc",
239 "base/openssl_private_key_store.h",
240 "base/openssl_private_key_store_memory.cc",
241 "cert/cert_database_openssl.cc",
242 "cert/cert_verify_proc_openssl.cc",
243 "cert/cert_verify_proc_openssl.h",
244 "cert/test_root_certs_openssl.cc",
245 "cert/x509_certificate_openssl.cc",
246 "ssl/openssl_client_key_store.cc",
247 "ssl/openssl_client_key_store.h",
xunjieli06d93982015-08-27 17:13:02248 ]
sergeyu99d83f92015-09-14 23:03:33249 if (is_android) {
250 net_shared_sources -= [ "base/openssl_private_key_store_android.cc" ]
251 }
252 } else {
253 if (is_android) {
254 # Android doesn't use these even when using OpenSSL.
255 net_shared_sources -= [
256 "base/openssl_private_key_store_memory.cc",
257 "cert/cert_database_openssl.cc",
258 "cert/cert_verify_proc_openssl.cc",
259 "cert/test_root_certs_openssl.cc",
260 ]
261 }
[email protected]4625ade2014-04-15 19:26:44262 }
sergeyu99d83f92015-09-14 23:03:33263
slan074ec342016-01-29 23:52:26264 if (!use_kerberos || is_android) {
265 net_shared_sources -= [
266 "http/http_auth_gssapi_posix.cc",
267 "http/http_auth_gssapi_posix.h",
268 ]
269 }
270
mostynbbf5e6cc2015-10-21 07:53:31271 if (use_glib && use_gconf && !is_chromeos) {
sergeyu99d83f92015-09-14 23:03:33272 net_shared_configs += [ "//build/config/linux:gconf" ]
273 net_shared_deps += [ "//build/linux:gio" ]
274 }
275
276 if (is_linux) {
277 net_shared_configs += [ "//build/config/linux:libresolv" ]
278 }
279
280 if (!use_nss_certs) {
281 net_shared_sources -= [
282 "base/crypto_module_nss.cc",
283 "base/keygen_handler_nss.cc",
284 "cert/cert_database_nss.cc",
285 "cert/nss_cert_database.cc",
286 "cert/nss_cert_database.h",
287 "cert/x509_certificate_nss.cc",
288 "ssl/client_cert_store_nss.cc",
289 "ssl/client_cert_store_nss.h",
290 "third_party/mozilla_security_manager/nsKeygenHandler.cpp",
291 "third_party/mozilla_security_manager/nsKeygenHandler.h",
292 "third_party/mozilla_security_manager/nsNSSCertificateDB.cpp",
293 "third_party/mozilla_security_manager/nsNSSCertificateDB.h",
294 "third_party/mozilla_security_manager/nsPKCS12Blob.cpp",
295 "third_party/mozilla_security_manager/nsPKCS12Blob.h",
296 ]
297 if (!is_ios) {
298 # These files are part of the partial implementation of NSS on iOS so
299 # keep them in that case (even though use_nss_certs is not set).
300 net_shared_sources -= [
301 "cert/cert_verify_proc_nss.cc",
302 "cert/cert_verify_proc_nss.h",
303 "cert/test_root_certs_nss.cc",
304 "cert/x509_util_nss_certs.cc",
305 "cert_net/nss_ocsp.cc",
306 "cert_net/nss_ocsp.h",
307 ]
308 }
309 if (is_chromeos) {
310 # These were already removed on non-ChromeOS.
311 net_shared_sources -= [
312 "cert/nss_cert_database_chromeos.cc",
313 "cert/nss_cert_database_chromeos.h",
314 "cert/nss_profile_filter_chromeos.cc",
315 "cert/nss_profile_filter_chromeos.h",
316 ]
317 }
xunjieli905496a2015-08-31 15:51:17318 net_shared_sources -= [
pneubeckabe6e9d12015-08-26 08:47:11319 "ssl/client_key_store.cc",
320 "ssl/client_key_store.h",
321 "ssl/ssl_platform_key_nss.cc",
322 ]
sergeyu99d83f92015-09-14 23:03:33323 } else if (use_openssl) {
324 # client_cert_store_nss.c requires NSS_CmpCertChainWCANames from NSS's
325 # libssl, but our bundled copy is not built in OpenSSL ports. Pull that file
326 # in directly.
327 net_shared_sources += [ "third_party/nss/ssl/cmpcert.c" ]
[email protected]4625ade2014-04-15 19:26:44328 }
329
ryanchungcfe97202016-01-20 04:07:41330 if (is_chromecast && use_nss_certs) {
331 net_shared_sources += [ "ssl/ssl_platform_key_chromecast.cc" ]
332 net_shared_sources -= [ "ssl/ssl_platform_key_nss.cc" ]
333 }
334
sergeyu99d83f92015-09-14 23:03:33335 if (!enable_mdns) {
336 net_shared_sources -= [
337 "dns/mdns_cache.cc",
338 "dns/mdns_cache.h",
339 "dns/mdns_client.cc",
340 "dns/mdns_client.h",
341 "dns/mdns_client_impl.cc",
342 "dns/mdns_client_impl.h",
343 "dns/record_parsed.cc",
344 "dns/record_parsed.h",
345 "dns/record_rdata.cc",
346 "dns/record_rdata.h",
347 ]
348 }
349
350 if (is_win) {
351 net_shared_sources -= [ "http/http_auth_handler_ntlm_portable.cc" ]
352 } else { # !is_win
353 net_shared_sources -= [
354 "base/winsock_init.cc",
355 "base/winsock_init.h",
356 "base/winsock_util.cc",
357 "base/winsock_util.h",
358 "proxy/proxy_resolver_winhttp.cc",
359 "proxy/proxy_resolver_winhttp.h",
360 ]
361 }
362
363 if (is_ios) {
364 # Add back some sources that were otherwise filtered out. iOS needs some Mac
365 # files.
366 net_shared_unfiltered_sources += [
367 "base/mac/url_conversions.h",
368 "base/mac/url_conversions.mm",
369 "base/network_change_notifier_mac.cc",
370 "base/network_config_watcher_mac.cc",
371 "base/network_interfaces_mac.cc",
372 "base/network_interfaces_mac.h",
373 "base/platform_mime_util_mac.mm",
374 "proxy/proxy_resolver_mac.cc",
375 "proxy/proxy_server_mac.cc",
376 ]
377
378 net_shared_sources -= [ "disk_cache/blockfile/file_posix.cc" ]
379 net_shared_deps += [
380 "//third_party/nss:nspr",
381 "//third_party/nss",
382 "//net/third_party/nss/ssl:libssl",
383 ]
384 }
385
386 if (is_ios || is_mac) {
387 net_shared_sources += gypi_values.net_base_mac_ios_sources
388 }
389
xunjieli905496a2015-08-31 15:51:17390 if (is_android) {
sergeyu99d83f92015-09-14 23:03:33391 net_shared_deps += [ ":net_jni_headers" ]
392
393 # Add some Linux sources that were excluded by the filter, but which
394 # are needed.
395 net_shared_unfiltered_sources += [
396 "base/address_tracker_linux.cc",
397 "base/address_tracker_linux.h",
398 "base/network_interfaces_linux.cc",
399 "base/network_interfaces_linux.h",
400 "base/platform_mime_util_linux.cc",
401 ]
xunjieli905496a2015-08-31 15:51:17402 }
403} else {
sergeyu99d83f92015-09-14 23:03:33404 net_shared_public_deps += [ "//native_client_sdk/src/libraries/nacl_io" ]
xunjieli905496a2015-08-31 15:51:17405}
406
407component("net") {
408 sources = net_shared_sources
409
410 # Add back some sources that were otherwise filtered out.
411 set_sources_assignment_filter([])
412 sources += net_shared_unfiltered_sources
413 set_sources_assignment_filter(sources_assignment_filter)
414
415 cflags = []
416 configs += net_shared_configs
417 public_configs = [ ":net_config" ]
418
419 public_deps = net_shared_public_deps + [ "//url" ]
420 deps = net_shared_deps
[email protected]4625ade2014-04-15 19:26:44421
422 if (is_mac) {
[email protected]4625ade2014-04-15 19:26:44423 libs = [
[email protected]ab9ce6e2014-04-17 20:33:19424 "Foundation.framework",
425 "Security.framework",
426 "SystemConfiguration.framework",
427 "resolv",
[email protected]4625ade2014-04-15 19:26:44428 ]
429 }
430
431 if (is_ios) {
[email protected]4625ade2014-04-15 19:26:44432 libs = [
[email protected]ab9ce6e2014-04-17 20:33:19433 "CFNetwork.framework",
434 "MobileCoreServices.framework",
435 "Security.framework",
436 "SystemConfiguration.framework",
437 "resolv",
[email protected]4625ade2014-04-15 19:26:44438 ]
xunjieli06d93982015-08-27 17:13:02439 }
xunjieli4c8c6922015-08-27 16:02:40440
sergeyu99d83f92015-09-14 23:03:33441 if (!is_nacl) {
442 if (!disable_file_support) {
443 sources += gypi_values.net_file_support_sources
444 }
xunjieli06d93982015-08-27 17:13:02445
sergeyu99d83f92015-09-14 23:03:33446 if (!disable_ftp_support) {
447 sources += gypi_values.net_ftp_support_sources
448 }
xunjieli905496a2015-08-31 15:51:17449
xunjieli11834f02015-12-22 04:27:08450 if (enable_bidirectional_stream) {
451 sources += gypi_values.net_bidirectional_stream_sources
452 }
453
sergeyu99d83f92015-09-14 23:03:33454 if (enable_websockets) {
455 sources += gypi_values.net_websockets_sources
456 }
xunjieli905496a2015-08-31 15:51:17457
sergeyu99d83f92015-09-14 23:03:33458 # ICU support.
459 deps += [
460 "//base:i18n",
461 "//third_party/icu",
462 ]
463 sources += [
464 "base/filename_util_icu.cc",
465 "base/net_string_util_icu.cc",
sergeyu99d83f92015-09-14 23:03:33466 ]
eustasfbec9132015-12-30 14:56:51467
468 # Brotli support.
469 deps += [ "//third_party/brotli" ]
470 sources += [ "filter/brotli_filter.cc" ]
sergeyu99d83f92015-09-14 23:03:33471 }
xunjieli905496a2015-08-31 15:51:17472}
473
474if (is_android) {
eustasfbec9132015-12-30 14:56:51475 # Same as net, but with brotli encoding, ICU, file, ftp, and websocket
476 # support stripped.
xunjieli905496a2015-08-31 15:51:17477 component("net_small") {
478 sources = net_shared_sources
479
480 # Add back some sources that were otherwise filtered out.
xunjieli06d93982015-08-27 17:13:02481 set_sources_assignment_filter([])
xunjieli905496a2015-08-31 15:51:17482 sources += net_shared_unfiltered_sources
xunjieli06d93982015-08-27 17:13:02483 set_sources_assignment_filter(sources_assignment_filter)
xunjieli06d93982015-08-27 17:13:02484
xunjieli905496a2015-08-31 15:51:17485 cflags = []
486 defines = []
487 configs += net_shared_configs
488 public_configs = [ ":net_config" ]
489
490 public_deps = net_shared_public_deps +
491 [ "//url:url_lib_use_icu_alternatives_on_android" ]
492 deps = net_shared_deps + [ ":net_jni_headers" ]
493
494 defines += [
495 "DISABLE_FILE_SUPPORT",
496 "DISABLE_FTP_SUPPORT",
497 "USE_ICU_ALTERNATIVES_ON_ANDROID=1",
498 ]
499
500 # Use ICU alternative on Android.
[email protected]85191ed2014-05-15 00:41:49501 sources += [
502 "base/net_string_util_icu_alternatives_android.cc",
503 "base/net_string_util_icu_alternatives_android.h",
504 ]
eustasfbec9132015-12-30 14:56:51505
506 # Disable Brotli support.
507 sources += [ "filter/brotli_filter_disabled.cc" ]
mefff34b822016-01-11 15:28:08508
509 if (enable_bidirectional_stream) {
510 sources += gypi_values.net_bidirectional_stream_sources
511 }
[email protected]85191ed2014-05-15 00:41:49512 }
[email protected]4625ade2014-04-15 19:26:44513}
514
515grit("net_resources") {
516 source = "base/net_resources.grd"
[email protected]7ae52902014-08-18 22:36:01517 use_qualified_include = true
[email protected]b89c53842014-07-23 16:32:32518 outputs = [
519 "grit/net_resources.h",
520 "net_resources.pak",
[email protected]b89c53842014-07-23 16:32:32521 ]
[email protected]4625ade2014-04-15 19:26:44522}
523
rtennetib6f1c0d2015-04-03 17:52:06524proto_library("net_quic_proto") {
xunjieli905496a2015-08-31 15:51:17525 visibility = [
526 ":net",
527 ":net_small",
528 ]
brettw2e7db0a2015-04-24 22:59:17529
rtennetib6f1c0d2015-04-03 17:52:06530 sources = [
531 "quic/proto/cached_network_parameters.proto",
532 "quic/proto/source_address_token.proto",
533 ]
534 cc_generator_options = "dllexport_decl=NET_EXPORT_PRIVATE:"
535 cc_include = "net/base/net_export.h"
536
537 defines = [ "NET_IMPLEMENTATION" ]
538
539 extra_configs = [ "//build/config/compiler:wexit_time_destructors" ]
540}
541
Brett Wilson83fd4242014-09-02 19:45:33542static_library("extras") {
mef327a8e42014-08-29 17:10:03543 sources = gypi_values.net_extras_sources
544 configs += [ "//build/config/compiler:wexit_time_destructors" ]
545 deps = [
546 ":net",
brettwbc44c0a92015-02-20 22:30:39547 "//base",
mef327a8e42014-08-29 17:10:03548 "//sql:sql",
549 ]
550}
551
[email protected]8a3f8242014-06-05 18:05:12552static_library("http_server") {
[email protected]4625ade2014-04-15 19:26:44553 sources = [
554 "server/http_connection.cc",
555 "server/http_connection.h",
556 "server/http_server.cc",
557 "server/http_server.h",
558 "server/http_server_request_info.cc",
559 "server/http_server_request_info.h",
560 "server/http_server_response_info.cc",
561 "server/http_server_response_info.h",
562 "server/web_socket.cc",
563 "server/web_socket.h",
dgozmana6e70092014-12-12 14:46:21564 "server/web_socket_encoder.cc",
565 "server/web_socket_encoder.h",
[email protected]4625ade2014-04-15 19:26:44566 ]
jambc6cc8e2014-11-14 17:56:29567 configs += [
brettwd1c719a2015-02-19 23:17:04568 "//build/config/compiler:no_size_t_to_int_warning",
jambc6cc8e2014-11-14 17:56:29569 "//build/config/compiler:wexit_time_destructors",
jambc6cc8e2014-11-14 17:56:29570 ]
[email protected]4625ade2014-04-15 19:26:44571 deps = [
572 ":net",
573 "//base",
574 ]
575}
576
[email protected]8603c5de2014-04-16 20:34:31577executable("dump_cache") {
Brett Wilson8f80ad0b2014-09-08 19:50:24578 testonly = true
[email protected]8603c5de2014-04-16 20:34:31579 sources = [
[email protected]8603c5de2014-04-16 20:34:31580 "tools/dump_cache/dump_cache.cc",
581 "tools/dump_cache/dump_files.cc",
582 "tools/dump_cache/dump_files.h",
[email protected]8603c5de2014-04-16 20:34:31583 ]
[email protected]4625ade2014-04-15 19:26:44584
brettwd1c719a2015-02-19 23:17:04585 # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
586 configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
[email protected]8603c5de2014-04-16 20:34:31587
588 deps = [
[email protected]8603c5de2014-04-16 20:34:31589 ":net",
[email protected]b2b2bf52014-05-28 20:26:57590 ":test_support",
brettwba7a73d2015-08-31 22:17:39591 "//base",
592 "//build/config/sanitizers:deps",
[email protected]8603c5de2014-04-16 20:34:31593 ]
594}
595
[email protected]b2b2bf52014-05-28 20:26:57596source_set("test_support") {
Brett Wilson8f80ad0b2014-09-08 19:50:24597 testonly = true
[email protected]8603c5de2014-04-16 20:34:31598 sources = [
[email protected]8603c5de2014-04-16 20:34:31599 "base/load_timing_info_test_util.cc",
600 "base/load_timing_info_test_util.h",
601 "base/mock_file_stream.cc",
602 "base/mock_file_stream.h",
603 "base/test_completion_callback.cc",
604 "base/test_completion_callback.h",
605 "base/test_data_directory.cc",
606 "base/test_data_directory.h",
607 "cert/mock_cert_verifier.cc",
608 "cert/mock_cert_verifier.h",
ryanchung987b2ff2016-02-19 00:17:12609 "cert/mock_client_cert_verifier.cc",
610 "cert/mock_client_cert_verifier.h",
[email protected]8603c5de2014-04-16 20:34:31611 "cookies/cookie_monster_store_test.cc",
612 "cookies/cookie_monster_store_test.h",
613 "cookies/cookie_store_test_callbacks.cc",
614 "cookies/cookie_store_test_callbacks.h",
615 "cookies/cookie_store_test_helpers.cc",
616 "cookies/cookie_store_test_helpers.h",
drogerfd8b2772015-12-04 14:34:56617 "cookies/cookie_store_unittest.h",
[email protected]8603c5de2014-04-16 20:34:31618 "disk_cache/disk_cache_test_base.cc",
619 "disk_cache/disk_cache_test_base.h",
620 "disk_cache/disk_cache_test_util.cc",
621 "disk_cache/disk_cache_test_util.h",
622 "dns/dns_test_util.cc",
623 "dns/dns_test_util.h",
624 "dns/mock_host_resolver.cc",
625 "dns/mock_host_resolver.h",
626 "dns/mock_mdns_socket_factory.cc",
627 "dns/mock_mdns_socket_factory.h",
[email protected]8a3f8242014-06-05 18:05:12628 "http/http_transaction_test_util.cc",
629 "http/http_transaction_test_util.h",
vishal.b62985ca92015-04-17 08:45:51630 "log/test_net_log.cc",
631 "log/test_net_log.h",
mmenke43758e62015-05-04 21:09:46632 "log/test_net_log_entry.cc",
633 "log/test_net_log_entry.h",
mmenke0034c542015-05-05 22:34:59634 "log/test_net_log_util.cc",
mmenke43758e62015-05-04 21:09:46635 "log/test_net_log_util.h",
[email protected]8603c5de2014-04-16 20:34:31636 "proxy/mock_proxy_resolver.cc",
637 "proxy/mock_proxy_resolver.h",
638 "proxy/mock_proxy_script_fetcher.cc",
639 "proxy/mock_proxy_script_fetcher.h",
640 "proxy/proxy_config_service_common_unittest.cc",
641 "proxy/proxy_config_service_common_unittest.h",
642 "socket/socket_test_util.cc",
643 "socket/socket_test_util.h",
644 "test/cert_test_util.cc",
645 "test/cert_test_util.h",
[email protected]83e1ae32014-07-18 10:57:07646 "test/cert_test_util_nss.cc",
nharper2e171cf2015-06-01 20:29:23647 "test/channel_id_test_util.cc",
648 "test/channel_id_test_util.h",
[email protected]8603c5de2014-04-16 20:34:31649 "test/ct_test_util.cc",
650 "test/ct_test_util.h",
svaldez7d25c562015-10-30 19:09:45651 "test/embedded_test_server/default_handlers.cc",
652 "test/embedded_test_server/default_handlers.h",
[email protected]8603c5de2014-04-16 20:34:31653 "test/embedded_test_server/embedded_test_server.cc",
654 "test/embedded_test_server/embedded_test_server.h",
655 "test/embedded_test_server/http_connection.cc",
656 "test/embedded_test_server/http_connection.h",
657 "test/embedded_test_server/http_request.cc",
658 "test/embedded_test_server/http_request.h",
659 "test/embedded_test_server/http_response.cc",
660 "test/embedded_test_server/http_response.h",
svaldez6e7e82a22015-10-28 19:39:53661 "test/embedded_test_server/request_handler_util.cc",
662 "test/embedded_test_server/request_handler_util.h",
sammc6ac3fe52015-02-25 06:00:28663 "test/event_waiter.h",
[email protected]8603c5de2014-04-16 20:34:31664 "test/net_test_suite.cc",
665 "test/net_test_suite.h",
666 "test/python_utils.cc",
667 "test/python_utils.h",
brettw6315e032015-11-27 18:38:36668 "test/test_certificate_data.h",
sherouk51b4b098b2015-08-10 09:00:43669 "test/url_request/ssl_certificate_error_job.cc",
670 "test/url_request/ssl_certificate_error_job.h",
Brett Wilson32ce17a2014-11-10 17:45:30671 "test/url_request/url_request_failed_job.cc",
672 "test/url_request/url_request_failed_job.h",
mef3e826cf2014-12-13 18:40:40673 "test/url_request/url_request_mock_data_job.cc",
674 "test/url_request/url_request_mock_data_job.h",
jam8e45cd72015-01-20 16:33:44675 "test/url_request/url_request_slow_download_job.cc",
676 "test/url_request/url_request_slow_download_job.h",
[email protected]8603c5de2014-04-16 20:34:31677 "url_request/test_url_fetcher_factory.cc",
678 "url_request/test_url_fetcher_factory.h",
679 "url_request/url_request_test_util.cc",
680 "url_request/url_request_test_util.h",
681 ]
sherouk3eee4a82015-09-01 10:42:33682 if (!is_ios) {
683 sources += [
684 "test/spawned_test_server/base_test_server.cc",
685 "test/spawned_test_server/base_test_server.h",
686 "test/spawned_test_server/local_test_server.cc",
687 "test/spawned_test_server/local_test_server.h",
688 "test/spawned_test_server/local_test_server_posix.cc",
689 "test/spawned_test_server/local_test_server_win.cc",
690 "test/spawned_test_server/spawned_test_server.h",
691 ]
692 }
[email protected]8603c5de2014-04-16 20:34:31693
brettwbc8b2a22015-07-28 18:24:42694 configs += [
695 "//build/config:precompiled_headers",
696
697 # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
698 "//build/config/compiler:no_size_t_to_int_warning",
699 ]
[email protected]8603c5de2014-04-16 20:34:31700
Brett Wilsone53895272014-09-23 23:41:46701 public_deps = [
[email protected]8603c5de2014-04-16 20:34:31702 "//base",
703 "//base/test:test_support",
[email protected]22fe91d2014-08-12 17:07:12704 "//crypto",
[email protected]59ff2d42014-04-22 22:25:23705 "//net",
[email protected]8603c5de2014-04-16 20:34:31706 "//net/tools/tld_cleanup",
707 "//testing/gmock",
708 "//testing/gtest",
709 "//url",
710 ]
711
jamb533b7e2015-03-04 17:12:05712 if (!is_ios) {
713 public_deps += [ "//third_party/protobuf:py_proto" ]
714 }
715
davidben4a644b02015-07-01 19:34:55716 if (use_nss_certs || is_ios) {
scottmg34fb7e52014-12-03 23:27:24717 public_deps += [ "//crypto:platform" ]
[email protected]8603c5de2014-04-16 20:34:31718 }
719
sherouk3eee4a82015-09-01 10:42:33720 if (is_android) {
721 sources += [
[email protected]8603c5de2014-04-16 20:34:31722 "test/spawned_test_server/remote_test_server.cc",
723 "test/spawned_test_server/remote_test_server.h",
724 "test/spawned_test_server/spawner_communicator.cc",
725 "test/spawned_test_server/spawner_communicator.h",
726 ]
727 }
728
729 if (use_v8_in_net) {
Brett Wilsone53895272014-09-23 23:41:46730 public_deps += [ ":net_with_v8" ]
[email protected]8603c5de2014-04-16 20:34:31731 }
732
733 if (!enable_mdns) {
734 sources -= [
735 "dns/mock_mdns_socket_factory.cc",
736 "dns/mock_mdns_socket_factory.h",
737 ]
738 }
739
davidben15d69d482014-09-29 18:24:08740 if (!use_nss_certs) {
scottmg34fb7e52014-12-03 23:27:24741 sources -= [ "test/cert_test_util_nss.cc" ]
[email protected]83e1ae32014-07-18 10:57:07742 }
xunjielia6888202015-04-14 21:34:25743
744 if (!disable_file_support) {
745 sources += [
746 "test/url_request/url_request_mock_http_job.cc",
747 "test/url_request/url_request_mock_http_job.h",
748 "url_request/test_url_request_interceptor.cc",
749 "url_request/test_url_request_interceptor.h",
750 ]
751 }
[email protected]8603c5de2014-04-16 20:34:31752}
753
[email protected]ceeaac792014-06-25 05:14:43754source_set("balsa") {
755 sources = [
756 "tools/balsa/balsa_enums.h",
757 "tools/balsa/balsa_frame.cc",
758 "tools/balsa/balsa_frame.h",
759 "tools/balsa/balsa_headers.cc",
760 "tools/balsa/balsa_headers.h",
761 "tools/balsa/balsa_headers_token_utils.cc",
762 "tools/balsa/balsa_headers_token_utils.h",
763 "tools/balsa/balsa_visitor_interface.h",
764 "tools/balsa/http_message_constants.cc",
765 "tools/balsa/http_message_constants.h",
766 "tools/balsa/noop_balsa_visitor.h",
767 "tools/balsa/simple_buffer.cc",
768 "tools/balsa/simple_buffer.h",
[email protected]ceeaac792014-06-25 05:14:43769 "tools/balsa/string_piece_utils.h",
rtennetie0ee6eb2015-05-01 00:55:09770 "tools/quic/spdy_balsa_utils.cc",
771 "tools/quic/spdy_balsa_utils.h",
[email protected]ceeaac792014-06-25 05:14:43772 ]
773 deps = [
774 ":net",
775 "//base",
[email protected]22fe91d2014-08-12 17:07:12776 "//url",
[email protected]ceeaac792014-06-25 05:14:43777 ]
778}
779
[email protected]8603c5de2014-04-16 20:34:31780if (use_v8_in_net) {
781 component("net_with_v8") {
782 sources = [
783 "proxy/proxy_resolver_v8.cc",
784 "proxy/proxy_resolver_v8.h",
785 "proxy/proxy_resolver_v8_tracing.cc",
786 "proxy/proxy_resolver_v8_tracing.h",
sammcf2d1ea02015-06-29 02:58:47787 "proxy/proxy_resolver_v8_tracing_wrapper.cc",
788 "proxy/proxy_resolver_v8_tracing_wrapper.h",
[email protected]8603c5de2014-04-16 20:34:31789 "proxy/proxy_service_v8.cc",
790 "proxy/proxy_service_v8.h",
791 ]
792
793 defines = [ "NET_IMPLEMENTATION" ]
dprankea22b0732015-10-21 21:15:11794
[email protected]8603c5de2014-04-16 20:34:31795 configs += [
brettwd1c719a2015-02-19 23:17:04796 "//build/config/compiler:no_size_t_to_int_warning",
[email protected]8603c5de2014-04-16 20:34:31797 "//build/config/compiler:wexit_time_destructors",
dprankea22b0732015-10-21 21:15:11798 "//v8:external_startup_data",
[email protected]8603c5de2014-04-16 20:34:31799 ]
800
Brett Wilsone53895272014-09-23 23:41:46801 public_deps = [
[email protected]8603c5de2014-04-16 20:34:31802 ":net",
Brett Wilsone53895272014-09-23 23:41:46803 ]
804 deps = [
[email protected]8603c5de2014-04-16 20:34:31805 "//base",
806 "//gin",
807 "//url",
808 "//v8",
809 ]
810 }
811}
812
amistry7e6ebfdc82015-02-13 04:19:11813if (use_v8_in_net && !is_android) {
814 source_set("net_browser_services") {
815 sources = [
816 "dns/mojo_host_resolver_impl.cc",
817 "dns/mojo_host_resolver_impl.h",
amistry6e1ed1b2015-03-12 05:24:01818 "proxy/in_process_mojo_proxy_resolver_factory.cc",
819 "proxy/in_process_mojo_proxy_resolver_factory.h",
sammc1d5df4d2015-05-05 05:06:17820 "proxy/mojo_proxy_resolver_factory.h",
eromandcacef22015-06-01 19:36:35821 "proxy/proxy_resolver_factory_mojo.cc",
822 "proxy/proxy_resolver_factory_mojo.h",
amistry6e1ed1b2015-03-12 05:24:01823 "proxy/proxy_service_mojo.cc",
824 "proxy/proxy_service_mojo.h",
amistry7e6ebfdc82015-02-13 04:19:11825 ]
826
827 public_deps = [
828 ":mojo_type_converters",
tfarina8ac4d17f2015-12-16 02:11:11829 ":net_with_v8",
brettwbc44c0a92015-02-20 22:30:39830 "//base",
amistry07ff1402015-03-10 07:34:07831 "//mojo/common",
rockot85dce0862015-11-13 01:33:59832 "//mojo/public/cpp/bindings",
amistry7e6ebfdc82015-02-13 04:19:11833 "//net/interfaces",
amistry6e1ed1b2015-03-12 05:24:01834
835 # NOTE(amistry): As long as we support in-process Mojo v8 PAC, we need
836 # this dependency since in_process_mojo_proxy_resolver_factory creates
837 # the utility process side Mojo services in the browser process.
838 # Ultimately, this will go away when we only support out-of-process.
839 ":net_utility_services",
amistry7e6ebfdc82015-02-13 04:19:11840 ]
841 }
842
843 source_set("mojo_type_converters") {
844 sources = [
amistry7ec58112015-02-26 06:03:00845 "dns/mojo_host_type_converters.cc",
846 "dns/mojo_host_type_converters.h",
847 "proxy/mojo_proxy_type_converters.cc",
848 "proxy/mojo_proxy_type_converters.h",
amistry7e6ebfdc82015-02-13 04:19:11849 ]
850
851 public_deps = [
852 ":net",
tfarina8ac4d17f2015-12-16 02:11:11853 "//base",
rockot85dce0862015-11-13 01:33:59854 "//mojo/public/cpp/bindings",
amistry7e6ebfdc82015-02-13 04:19:11855 "//net/interfaces",
amistry7e6ebfdc82015-02-13 04:19:11856 ]
857 }
sammc5403aa1d2015-02-25 04:59:21858
859 source_set("net_utility_services") {
860 sources = [
sammc6ac3fe52015-02-25 06:00:28861 "dns/host_resolver_mojo.cc",
862 "dns/host_resolver_mojo.h",
sammc352f7492015-02-25 09:45:24863 "proxy/mojo_proxy_resolver_factory_impl.cc",
864 "proxy/mojo_proxy_resolver_factory_impl.h",
sammc5403aa1d2015-02-25 04:59:21865 "proxy/mojo_proxy_resolver_impl.cc",
866 "proxy/mojo_proxy_resolver_impl.h",
sammca3242c92015-07-10 02:38:51867 "proxy/mojo_proxy_resolver_v8_tracing_bindings.h",
sammc5403aa1d2015-02-25 04:59:21868 ]
869
rockot9509ec82015-04-14 02:50:56870 deps = [
871 ":net_with_v8",
tfarina8ac4d17f2015-12-16 02:11:11872 "//base",
rockot9509ec82015-04-14 02:50:56873 ]
874
sammc5403aa1d2015-02-25 04:59:21875 public_deps = [
876 ":mojo_type_converters",
877 ":net",
878 "//mojo/common",
rockot85dce0862015-11-13 01:33:59879 "//mojo/public/cpp/bindings",
sammc5403aa1d2015-02-25 04:59:21880 "//net/interfaces",
sammc5403aa1d2015-02-25 04:59:21881 ]
882 }
amistry7e6ebfdc82015-02-13 04:19:11883}
884
[email protected]8603c5de2014-04-16 20:34:31885if (!is_ios && !is_android) {
886 executable("crash_cache") {
Brett Wilson8f80ad0b2014-09-08 19:50:24887 testonly = true
scottmg34fb7e52014-12-03 23:27:24888 sources = [
889 "tools/crash_cache/crash_cache.cc",
890 ]
dpranke43276212015-02-20 02:55:19891
brettwd1c719a2015-02-19 23:17:04892 # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
893 configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
[email protected]8603c5de2014-04-16 20:34:31894 deps = [
895 ":net",
[email protected]b2b2bf52014-05-28 20:26:57896 ":test_support",
[email protected]8603c5de2014-04-16 20:34:31897 "//base",
brettwba7a73d2015-08-31 22:17:39898 "//build/config/sanitizers:deps",
[email protected]8603c5de2014-04-16 20:34:31899 ]
900 }
901
902 executable("crl_set_dump") {
Brett Wilson8f80ad0b2014-09-08 19:50:24903 testonly = true
scottmg34fb7e52014-12-03 23:27:24904 sources = [
905 "tools/crl_set_dump/crl_set_dump.cc",
906 ]
dpranke43276212015-02-20 02:55:19907
brettwd1c719a2015-02-19 23:17:04908 # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
909 configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
[email protected]8603c5de2014-04-16 20:34:31910 deps = [
911 ":net",
912 "//base",
brettwba7a73d2015-08-31 22:17:39913 "//build/config/sanitizers:deps",
[email protected]8603c5de2014-04-16 20:34:31914 ]
915 }
916
917 executable("dns_fuzz_stub") {
Brett Wilson8f80ad0b2014-09-08 19:50:24918 testonly = true
scottmg34fb7e52014-12-03 23:27:24919 sources = [
920 "tools/dns_fuzz_stub/dns_fuzz_stub.cc",
921 ]
dpranke43276212015-02-20 02:55:19922
brettwd1c719a2015-02-19 23:17:04923 # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
924 configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
[email protected]8603c5de2014-04-16 20:34:31925 deps = [
926 ":net",
927 "//base",
brettwba7a73d2015-08-31 22:17:39928 "//build/config/sanitizers:deps",
[email protected]8603c5de2014-04-16 20:34:31929 ]
930 }
931
932 executable("gdig") {
Brett Wilson8f80ad0b2014-09-08 19:50:24933 testonly = true
[email protected]8603c5de2014-04-16 20:34:31934 sources = [
935 "tools/gdig/file_net_log.cc",
936 "tools/gdig/gdig.cc",
937 ]
938 deps = [
939 ":net",
940 "//base",
brettwba7a73d2015-08-31 22:17:39941 "//build/config/sanitizers:deps",
[email protected]8603c5de2014-04-16 20:34:31942 ]
943 }
944
945 executable("get_server_time") {
Brett Wilson8f80ad0b2014-09-08 19:50:24946 testonly = true
scottmg34fb7e52014-12-03 23:27:24947 sources = [
948 "tools/get_server_time/get_server_time.cc",
949 ]
dpranke43276212015-02-20 02:55:19950
brettwd1c719a2015-02-19 23:17:04951 # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
952 configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
[email protected]8603c5de2014-04-16 20:34:31953 deps = [
954 ":net",
955 "//base",
956 "//base:i18n",
brettwba7a73d2015-08-31 22:17:39957 "//build/config/sanitizers:deps",
[email protected]8603c5de2014-04-16 20:34:31958 "//url",
959 ]
960 }
961
rockot9c67e5f2015-03-12 20:01:21962 executable("hpack_example_generator") {
963 testonly = true
964 sources = [
965 "spdy/fuzzing/hpack_example_generator.cc",
966 ]
967
968 # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
969 configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
970 deps = [
rockot9c67e5f2015-03-12 20:01:21971 ":net",
brettwba7a73d2015-08-31 22:17:39972 "//base",
973 "//build/config/sanitizers:deps",
rockot9c67e5f2015-03-12 20:01:21974 ]
975 }
976
977 executable("hpack_fuzz_mutator") {
978 testonly = true
979 sources = [
980 "spdy/fuzzing/hpack_fuzz_mutator.cc",
981 ]
982
983 # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
984 configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
985 deps = [
rockot9c67e5f2015-03-12 20:01:21986 ":net",
brettwba7a73d2015-08-31 22:17:39987 "//base",
988 "//build/config/sanitizers:deps",
rockot9c67e5f2015-03-12 20:01:21989 ]
990 }
991
992 executable("hpack_fuzz_wrapper") {
993 testonly = true
994 sources = [
995 "spdy/fuzzing/hpack_fuzz_wrapper.cc",
996 ]
997
998 # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
999 configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
1000 deps = [
rockot9c67e5f2015-03-12 20:01:211001 ":net",
brettwba7a73d2015-08-31 22:17:391002 "//base",
1003 "//build/config/sanitizers:deps",
rockot9c67e5f2015-03-12 20:01:211004 ]
1005 }
1006
[email protected]8603c5de2014-04-16 20:34:311007 if (use_v8_in_net) {
1008 executable("net_watcher") {
Brett Wilson8f80ad0b2014-09-08 19:50:241009 testonly = true
scottmg34fb7e52014-12-03 23:27:241010 sources = [
1011 "tools/net_watcher/net_watcher.cc",
1012 ]
[email protected]8603c5de2014-04-16 20:34:311013 deps = [
1014 ":net",
1015 ":net_with_v8",
1016 "//base",
brettwba7a73d2015-08-31 22:17:391017 "//build/config/sanitizers:deps",
[email protected]8603c5de2014-04-16 20:34:311018 ]
1019
mostynbbf5e6cc2015-10-21 07:53:311020 if (is_desktop_linux && use_gconf && use_glib) {
xunjieli905496a2015-08-31 15:51:171021 configs += [
1022 "//build/config/linux:gconf",
1023 "//build/config/linux:glib",
1024 ]
dprankead0c1f42015-08-28 21:48:041025 deps += [ "//build/linux:gio" ]
[email protected]8603c5de2014-04-16 20:34:311026 }
1027 }
1028 }
1029
1030 executable("run_testserver") {
Brett Wilson8f80ad0b2014-09-08 19:50:241031 testonly = true
scottmg34fb7e52014-12-03 23:27:241032 sources = [
1033 "tools/testserver/run_testserver.cc",
1034 ]
[email protected]8603c5de2014-04-16 20:34:311035 deps = [
[email protected]b2b2bf52014-05-28 20:26:571036 ":test_support",
[email protected]8603c5de2014-04-16 20:34:311037 "//base",
1038 "//base/test:test_support",
brettwba7a73d2015-08-31 22:17:391039 "//build/config/sanitizers:deps",
[email protected]8603c5de2014-04-16 20:34:311040 "//testing/gtest",
1041 ]
1042 }
1043
1044 executable("stress_cache") {
Brett Wilson8f80ad0b2014-09-08 19:50:241045 testonly = true
scottmg34fb7e52014-12-03 23:27:241046 sources = [
rvargase23fcf652015-03-04 19:59:221047 "tools/stress_cache/stress_cache.cc",
scottmg34fb7e52014-12-03 23:27:241048 ]
dpranke43276212015-02-20 02:55:191049
brettwd1c719a2015-02-19 23:17:041050 # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
1051 configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
[email protected]8603c5de2014-04-16 20:34:311052 deps = [
1053 ":net",
[email protected]b2b2bf52014-05-28 20:26:571054 ":test_support",
[email protected]8603c5de2014-04-16 20:34:311055 "//base",
brettwba7a73d2015-08-31 22:17:391056 "//build/config/sanitizers:deps",
[email protected]8603c5de2014-04-16 20:34:311057 ]
1058 }
1059
1060 executable("tld_cleanup") {
scottmg34fb7e52014-12-03 23:27:241061 sources = [
1062 "tools/tld_cleanup/tld_cleanup.cc",
1063 ]
dpranke43276212015-02-20 02:55:191064
brettwd1c719a2015-02-19 23:17:041065 # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
1066 configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
[email protected]8603c5de2014-04-16 20:34:311067 deps = [
1068 "//base",
1069 "//base:i18n",
brettwba7a73d2015-08-31 22:17:391070 "//build/config/sanitizers:deps",
[email protected]8603c5de2014-04-16 20:34:311071 "//net/tools/tld_cleanup",
1072 ]
1073 }
1074}
1075
rch6983a3f2015-03-30 03:47:281076if (is_linux) {
[email protected]8a3f8242014-06-05 18:05:121077 static_library("epoll_server") {
[email protected]8603c5de2014-04-16 20:34:311078 sources = [
1079 "tools/epoll_server/epoll_server.cc",
1080 "tools/epoll_server/epoll_server.h",
1081 ]
1082 deps = [
1083 ":net",
1084 "//base",
1085 ]
1086 }
1087
[email protected]8a3f8242014-06-05 18:05:121088 static_library("flip_in_mem_edsm_server_base") {
Brett Wilson8f80ad0b2014-09-08 19:50:241089 testonly = true
[email protected]8603c5de2014-04-16 20:34:311090 sources = [
[email protected]8603c5de2014-04-16 20:34:311091 "tools/flip_server/acceptor_thread.cc",
satorux933fc7a2015-02-13 07:09:101092 "tools/flip_server/acceptor_thread.h",
1093 "tools/flip_server/constants.h",
[email protected]8603c5de2014-04-16 20:34:311094 "tools/flip_server/flip_config.cc",
1095 "tools/flip_server/flip_config.h",
1096 "tools/flip_server/http_interface.cc",
1097 "tools/flip_server/http_interface.h",
[email protected]8603c5de2014-04-16 20:34:311098 "tools/flip_server/mem_cache.cc",
satorux933fc7a2015-02-13 07:09:101099 "tools/flip_server/mem_cache.h",
[email protected]8603c5de2014-04-16 20:34:311100 "tools/flip_server/output_ordering.cc",
1101 "tools/flip_server/output_ordering.h",
1102 "tools/flip_server/ring_buffer.cc",
1103 "tools/flip_server/ring_buffer.h",
1104 "tools/flip_server/sm_connection.cc",
1105 "tools/flip_server/sm_connection.h",
1106 "tools/flip_server/sm_interface.h",
[email protected]8603c5de2014-04-16 20:34:311107 "tools/flip_server/spdy_interface.cc",
1108 "tools/flip_server/spdy_interface.h",
satorux933fc7a2015-02-13 07:09:101109 "tools/flip_server/spdy_ssl.cc",
1110 "tools/flip_server/spdy_ssl.h",
[email protected]8603c5de2014-04-16 20:34:311111 "tools/flip_server/spdy_util.cc",
1112 "tools/flip_server/spdy_util.h",
1113 "tools/flip_server/streamer_interface.cc",
1114 "tools/flip_server/streamer_interface.h",
tfarinafb3c78c2016-02-09 22:13:521115 "tools/flip_server/tcp_socket_util.cc",
1116 "tools/flip_server/tcp_socket_util.h",
rvargas145310f2015-08-14 18:09:041117 "tools/flip_server/url_to_filename_encoder.cc",
1118 "tools/flip_server/url_to_filename_encoder.h",
1119 "tools/flip_server/url_utilities.cc",
1120 "tools/flip_server/url_utilities.h",
[email protected]8603c5de2014-04-16 20:34:311121 ]
1122 deps = [
1123 ":balsa",
1124 ":epoll_server",
1125 ":net",
1126 "//base",
[email protected]edfd0f42014-07-22 18:20:371127 "//third_party/boringssl",
[email protected]8603c5de2014-04-16 20:34:311128 ]
1129 }
1130
1131 executable("flip_in_mem_edsm_server_unittests") {
Brett Wilson8f80ad0b2014-09-08 19:50:241132 testonly = true
[email protected]8603c5de2014-04-16 20:34:311133 sources = [
1134 "tools/flip_server/flip_test_utils.cc",
1135 "tools/flip_server/flip_test_utils.h",
1136 "tools/flip_server/http_interface_test.cc",
1137 "tools/flip_server/mem_cache_test.cc",
1138 "tools/flip_server/run_all_tests.cc",
1139 "tools/flip_server/spdy_interface_test.cc",
rvargas145310f2015-08-14 18:09:041140 "tools/flip_server/url_to_filename_encoder_unittest.cc",
1141 "tools/flip_server/url_utilities_unittest.cc",
[email protected]8603c5de2014-04-16 20:34:311142 ]
1143 deps = [
brettwbc44c0a92015-02-20 22:30:391144 ":balsa",
[email protected]8603c5de2014-04-16 20:34:311145 ":flip_in_mem_edsm_server_base",
1146 ":net",
[email protected]b2b2bf52014-05-28 20:26:571147 ":test_support",
brettwba7a73d2015-08-31 22:17:391148 "//build/config/sanitizers:deps",
[email protected]8603c5de2014-04-16 20:34:311149 "//testing/gmock",
agrieved7a71c882015-11-20 19:53:281150 "//testing/gtest",
[email protected]edfd0f42014-07-22 18:20:371151 "//third_party/boringssl",
[email protected]8603c5de2014-04-16 20:34:311152 ]
1153 }
1154
1155 executable("flip_in_mem_edsm_server") {
Brett Wilson8f80ad0b2014-09-08 19:50:241156 testonly = true
scottmg34fb7e52014-12-03 23:27:241157 sources = [
1158 "tools/flip_server/flip_in_mem_edsm_server.cc",
1159 ]
[email protected]8603c5de2014-04-16 20:34:311160 deps = [
brettwbc44c0a92015-02-20 22:30:391161 ":balsa",
[email protected]8603c5de2014-04-16 20:34:311162 ":flip_in_mem_edsm_server_base",
1163 ":net",
1164 "//base",
brettwba7a73d2015-08-31 22:17:391165 "//build/config/sanitizers:deps",
[email protected]8603c5de2014-04-16 20:34:311166 ]
1167 }
1168
rch216445c2015-03-27 00:23:281169 source_set("epoll_quic_tools") {
[email protected]8603c5de2014-04-16 20:34:311170 sources = [
1171 "tools/quic/quic_client.cc",
1172 "tools/quic/quic_client.h",
[email protected]8603c5de2014-04-16 20:34:311173 "tools/quic/quic_default_packet_writer.cc",
1174 "tools/quic/quic_default_packet_writer.h",
[email protected]8603c5de2014-04-16 20:34:311175 "tools/quic/quic_epoll_clock.cc",
1176 "tools/quic/quic_epoll_clock.h",
1177 "tools/quic/quic_epoll_connection_helper.cc",
1178 "tools/quic/quic_epoll_connection_helper.h",
rtennetifb3fa6c2015-03-16 23:04:551179 "tools/quic/quic_packet_reader.cc",
1180 "tools/quic/quic_packet_reader.h",
[email protected]8603c5de2014-04-16 20:34:311181 "tools/quic/quic_packet_writer_wrapper.cc",
1182 "tools/quic/quic_packet_writer_wrapper.h",
rtennetid83f617172016-01-28 19:16:151183 "tools/quic/quic_process_packet_interface.h",
[email protected]8603c5de2014-04-16 20:34:311184 "tools/quic/quic_server.cc",
1185 "tools/quic/quic_server.h",
[email protected]8603c5de2014-04-16 20:34:311186 "tools/quic/quic_socket_utils.cc",
1187 "tools/quic/quic_socket_utils.h",
[email protected]8603c5de2014-04-16 20:34:311188 ]
1189 deps = [
1190 ":balsa",
1191 ":epoll_server",
1192 ":net",
tfarina8ac4d17f2015-12-16 02:11:111193 ":simple_quic_tools",
[email protected]8603c5de2014-04-16 20:34:311194 "//base",
1195 "//base/third_party/dynamic_annotations",
1196 "//crypto",
[email protected]edfd0f42014-07-22 18:20:371197 "//third_party/boringssl",
[email protected]8603c5de2014-04-16 20:34:311198 "//url",
1199 ]
1200 }
1201
rch216445c2015-03-27 00:23:281202 executable("epoll_quic_client") {
scottmg34fb7e52014-12-03 23:27:241203 sources = [
1204 "tools/quic/quic_client_bin.cc",
1205 ]
[email protected]8603c5de2014-04-16 20:34:311206 deps = [
brettwbc44c0a92015-02-20 22:30:391207 ":balsa",
rch216445c2015-03-27 00:23:281208 ":epoll_quic_tools",
agrieved7a71c882015-11-20 19:53:281209 ":epoll_server",
rch216445c2015-03-27 00:23:281210 ":net",
1211 ":simple_quic_tools",
1212 "//base",
brettwba7a73d2015-08-31 22:17:391213 "//build/config/sanitizers:deps",
rch216445c2015-03-27 00:23:281214 "//third_party/boringssl",
1215 ]
1216 }
1217
1218 executable("epoll_quic_server") {
1219 sources = [
1220 "tools/quic/quic_server_bin.cc",
1221 ]
1222 deps = [
1223 ":balsa",
rch216445c2015-03-27 00:23:281224 ":epoll_quic_tools",
agrieved7a71c882015-11-20 19:53:281225 ":epoll_server",
[email protected]8603c5de2014-04-16 20:34:311226 ":net",
rchda78df5a2015-03-22 05:16:371227 ":simple_quic_tools",
[email protected]8603c5de2014-04-16 20:34:311228 "//base",
brettwba7a73d2015-08-31 22:17:391229 "//build/config/sanitizers:deps",
[email protected]edfd0f42014-07-22 18:20:371230 "//third_party/boringssl",
[email protected]8603c5de2014-04-16 20:34:311231 ]
1232 }
[email protected]8603c5de2014-04-16 20:34:311233}
1234
[email protected]ef0eb442014-05-15 09:32:181235if (is_android) {
1236 generate_jni("net_jni_headers") {
1237 sources = [
1238 "android/java/src/org/chromium/net/AndroidCertVerifyResult.java",
1239 "android/java/src/org/chromium/net/AndroidKeyStore.java",
1240 "android/java/src/org/chromium/net/AndroidNetworkLibrary.java",
tbansal59a1ddc2015-09-14 17:35:011241 "android/java/src/org/chromium/net/AndroidTrafficStats.java",
[email protected]ef0eb442014-05-15 09:32:181242 "android/java/src/org/chromium/net/GURLUtils.java",
aberentec894a52015-07-09 14:45:531243 "android/java/src/org/chromium/net/HttpNegotiateAuthenticator.java",
xunjieli905496a2015-08-31 15:51:171244 "android/java/src/org/chromium/net/NetStringUtil.java",
[email protected]ef0eb442014-05-15 09:32:181245 "android/java/src/org/chromium/net/NetworkChangeNotifier.java",
1246 "android/java/src/org/chromium/net/ProxyChangeListener.java",
1247 "android/java/src/org/chromium/net/X509Util.java",
1248 ]
1249 jni_package = "net"
1250 }
cjhopmandad5f4272014-09-05 01:00:551251 generate_jni("net_test_jni_headers") {
1252 sources = [
1253 "android/javatests/src/org/chromium/net/AndroidKeyStoreTestUtil.java",
aberentec894a52015-07-09 14:45:531254 "test/android/javatests/src/org/chromium/net/test/DummySpnegoAuthenticator.java",
jbudorickccffb982015-12-22 01:21:351255 "test/android/javatests/src/org/chromium/net/test/EmbeddedTestServerImpl.java",
cjhopmandad5f4272014-09-05 01:00:551256 ]
brettwcdccaf02015-07-27 16:27:091257 jni_package = "net/test"
cjhopmandad5f4272014-09-05 01:00:551258 }
[email protected]ef0eb442014-05-15 09:32:181259}
[email protected]8603c5de2014-04-16 20:34:311260
1261if (is_android || is_linux) {
1262 executable("disk_cache_memory_test") {
Brett Wilson8f80ad0b2014-09-08 19:50:241263 testonly = true
scottmg34fb7e52014-12-03 23:27:241264 sources = [
1265 "tools/disk_cache_memory_test/disk_cache_memory_test.cc",
1266 ]
[email protected]8603c5de2014-04-16 20:34:311267 deps = [
1268 ":net",
1269 "//base",
brettwba7a73d2015-08-31 22:17:391270 "//build/config/sanitizers:deps",
[email protected]8603c5de2014-04-16 20:34:311271 ]
1272 }
1273}
[email protected]8a3f8242014-06-05 18:05:121274
rch47ad01f2015-03-20 21:17:231275source_set("simple_quic_tools") {
rcha9d12ce12015-03-19 23:06:491276 sources = [
rtennetid67b3a722015-08-18 05:15:311277 "tools/quic/quic_client_base.cc",
1278 "tools/quic/quic_client_base.h",
rched113b22015-03-26 04:54:051279 "tools/quic/quic_client_session.cc",
1280 "tools/quic/quic_client_session.h",
rchc99f380c2015-03-26 19:50:561281 "tools/quic/quic_dispatcher.cc",
1282 "tools/quic/quic_dispatcher.h",
rch0e945472015-03-26 15:19:211283 "tools/quic/quic_in_memory_cache.cc",
1284 "tools/quic/quic_in_memory_cache.h",
rchc99f380c2015-03-26 19:50:561285 "tools/quic/quic_per_connection_packet_writer.cc",
1286 "tools/quic/quic_per_connection_packet_writer.h",
jokulikc971baf92016-01-06 00:36:391287 "tools/quic/quic_server_session_base.cc",
1288 "tools/quic/quic_server_session_base.h",
rcha9d12ce12015-03-19 23:06:491289 "tools/quic/quic_simple_client.cc",
1290 "tools/quic/quic_simple_client.h",
rch216445c2015-03-27 00:23:281291 "tools/quic/quic_simple_per_connection_packet_writer.cc",
1292 "tools/quic/quic_simple_per_connection_packet_writer.h",
1293 "tools/quic/quic_simple_server.cc",
1294 "tools/quic/quic_simple_server.h",
1295 "tools/quic/quic_simple_server_packet_writer.cc",
1296 "tools/quic/quic_simple_server_packet_writer.h",
jokulikc971baf92016-01-06 00:36:391297 "tools/quic/quic_simple_server_session.cc",
1298 "tools/quic/quic_simple_server_session.h",
danzhb7551342015-12-18 02:06:401299 "tools/quic/quic_simple_server_stream.cc",
1300 "tools/quic/quic_simple_server_stream.h",
rched113b22015-03-26 04:54:051301 "tools/quic/quic_spdy_client_stream.cc",
1302 "tools/quic/quic_spdy_client_stream.h",
rch0e945472015-03-26 15:19:211303 "tools/quic/quic_time_wait_list_manager.cc",
1304 "tools/quic/quic_time_wait_list_manager.h",
rchda78df5a2015-03-22 05:16:371305 "tools/quic/synchronous_host_resolver.cc",
1306 "tools/quic/synchronous_host_resolver.h",
rcha9d12ce12015-03-19 23:06:491307 ]
1308 deps = [
tfarina8ac4d17f2015-12-16 02:11:111309 ":balsa",
rcha9d12ce12015-03-19 23:06:491310 ":net",
1311 "//base",
rch47ad01f2015-03-20 21:17:231312 "//base/third_party/dynamic_annotations",
1313 "//url",
1314 ]
1315}
1316
ricea7afa5232015-12-01 20:55:231317action_foreach("stale_while_revalidate_experiment_domains_dafsa") {
1318 script = "//net/tools/dafsa/make_dafsa.py"
1319 sources = [
1320 "base/stale_while_revalidate_experiment_domains.gperf",
1321 ]
1322 outputs = [
1323 "${target_gen_dir}/base/{{source_name_part}}-inc.cc",
1324 ]
1325 args = [
1326 "{{source}}",
1327 rebase_path("${target_gen_dir}/base/{{source_name_part}}-inc.cc",
1328 root_build_dir),
1329 ]
1330}
1331
1332source_set("stale_while_revalidate_experiment_domains") {
1333 sources = [
1334 "base/stale_while_revalidate_experiment_domains.cc",
1335 "base/stale_while_revalidate_experiment_domains.h",
1336 ]
1337 deps = [
1338 ":net",
1339 ":stale_while_revalidate_experiment_domains_dafsa",
1340 "//base",
1341 ]
1342 configs += net_shared_configs
1343}
1344
sherouk51b4b098b2015-08-10 09:00:431345if (!is_ios) {
1346 executable("quic_client") {
1347 sources = [
1348 "tools/quic/quic_simple_client_bin.cc",
1349 ]
1350 deps = [
1351 ":net",
1352 ":simple_quic_tools",
1353 "//base",
brettwba7a73d2015-08-31 22:17:391354 "//build/config/sanitizers:deps",
sherouk51b4b098b2015-08-10 09:00:431355 "//url",
1356 ]
1357 }
1358 executable("quic_server") {
1359 sources = [
1360 "tools/quic/quic_simple_server_bin.cc",
1361 ]
1362 deps = [
1363 ":net",
1364 ":simple_quic_tools",
1365 "//base",
brettwba7a73d2015-08-31 22:17:391366 "//build/config/sanitizers:deps",
sherouk51b4b098b2015-08-10 09:00:431367 "//third_party/boringssl",
1368 "//third_party/protobuf:protobuf_lite",
1369 ]
1370 }
rch216445c2015-03-27 00:23:281371}
1372
dpranke64df2832015-07-31 22:33:361373test("net_unittests") {
1374 sources = gypi_values.net_test_sources
1375
sherouk51b4b098b2015-08-10 09:00:431376 if (is_ios) {
1377 sources -= [
1378 "websockets/websocket_stream_cookie_test.cc",
1379 "websockets/websocket_stream_create_test_base.cc",
1380 "websockets/websocket_stream_create_test_base.h",
1381 ]
1382 }
1383
dpranke64df2832015-07-31 22:33:361384 configs += [
1385 "//build/config:precompiled_headers",
1386
1387 # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
1388 "//build/config/compiler:no_size_t_to_int_warning",
1389 ]
1390 defines = []
1391
1392 deps = [
1393 ":balsa",
1394 ":extras",
1395 ":http_server",
1396 ":net",
1397 ":simple_quic_tools",
ricea7afa5232015-12-01 20:55:231398 ":stale_while_revalidate_experiment_domains",
dpranke64df2832015-07-31 22:33:361399 ":test_support",
1400 "//base",
1401 "//base:i18n",
dpranke64df2832015-07-31 22:33:361402 "//base/third_party/dynamic_annotations",
1403 "//crypto",
1404 "//crypto:platform",
1405 "//crypto:test_support",
dpranke64df2832015-07-31 22:33:361406 "//net/base/registry_controlled_domains",
1407 "//sql",
1408 "//testing/gmock",
1409 "//testing/gtest",
1410 "//third_party/zlib",
1411 "//url",
1412 ]
1413
1414 data = [
1415 "data/",
1416 ]
mattm6586b432016-02-12 04:52:391417 data_deps = []
1418
1419 if (!is_ios) {
1420 data_deps += [ "third_party/nist-pkits/" ]
1421 }
dpranke64df2832015-07-31 22:33:361422
1423 if (is_linux || is_mac || is_win) {
1424 deps += [
1425 "//third_party/pyftpdlib/",
1426 "//third_party/pywebsocket/",
1427 "//third_party/tlslite/",
1428 ]
mattm6586b432016-02-12 04:52:391429 data_deps += [
dpranke64df2832015-07-31 22:33:361430 "//third_party/pyftpdlib/",
1431 "//third_party/pywebsocket/",
1432 "//third_party/tlslite/",
1433 ]
1434 data += [
1435 "tools/testserver/",
1436 "//third_party/pyftpdlib/",
1437 "//third_party/pywebsocket/",
1438 "//third_party/tlslite/",
1439 "$root_out_dir/pyproto/google/",
dprankef497c7962015-07-31 19:46:231440 ]
1441 }
1442
dpranke64df2832015-07-31 22:33:361443 if (is_desktop_linux) {
1444 deps += [ ":epoll_quic_tools" ]
1445 }
1446 if (is_linux) {
1447 sources += gypi_values.net_linux_test_sources
1448 deps += [
1449 ":epoll_quic_tools",
1450 ":epoll_server",
1451 ":flip_in_mem_edsm_server_base",
brettwbc8b2a22015-07-28 18:24:421452 ]
dpranke64df2832015-07-31 22:33:361453 }
[email protected]8a3f8242014-06-05 18:05:121454
dpranke64df2832015-07-31 22:33:361455 if (is_mac || is_ios) {
1456 sources += gypi_values.net_base_test_mac_ios_sources
1457 }
1458
1459 if (is_chromeos) {
1460 sources -= [ "proxy/proxy_config_service_linux_unittest.cc" ]
1461 }
1462
1463 if (v8_use_external_startup_data) {
1464 deps += [ "//gin" ]
1465 }
1466
1467 if (!use_nss_certs) {
1468 sources -= [
1469 "cert/nss_cert_database_unittest.cc",
1470 "ssl/client_cert_store_nss_unittest.cc",
[email protected]8a3f8242014-06-05 18:05:121471 ]
dpranke64df2832015-07-31 22:33:361472 if (is_chromeos) { # Already removed for all non-ChromeOS builds.
davidben2bcbc6b2015-04-22 02:36:411473 sources -= [
dpranke64df2832015-07-31 22:33:361474 "cert/nss_cert_database_chromeos_unittest.cc",
1475 "cert/nss_profile_filter_chromeos_unittest.cc",
davidben2bcbc6b2015-04-22 02:36:411476 ]
brettw43ae0e12015-07-14 22:12:361477 }
[email protected]8a3f8242014-06-05 18:05:121478 }
dpranke64df2832015-07-31 22:33:361479
1480 if (use_openssl) {
dpranke64df2832015-07-31 22:33:361481 sources -= [ "quic/test_tools/crypto_test_utils_nss.cc" ]
1482 } else {
1483 sources -= [
dpranke64df2832015-07-31 22:33:361484 "quic/test_tools/crypto_test_utils_openssl.cc",
dpranke64df2832015-07-31 22:33:361485 "ssl/ssl_client_session_cache_openssl_unittest.cc",
1486 ]
1487 }
1488
1489 if (use_kerberos) {
1490 defines += [ "USE_KERBEROS" ]
1491 }
1492
1493 # These are excluded on Android, because the actual Kerberos support, which
1494 # these test, is in a separate app on Android.
1495 if (!use_kerberos || is_android) {
1496 sources -= [
1497 "http/http_auth_gssapi_posix_unittest.cc",
1498 "http/mock_gssapi_library_posix.cc",
1499 "http/mock_gssapi_library_posix.h",
1500 ]
1501 }
1502 if (!use_kerberos) {
1503 sources -= [ "http/http_auth_handler_negotiate_unittest.cc" ]
1504 }
1505
davidbene1858d82015-12-09 02:18:401506 if (!use_nss_certs && !is_ios) {
dpranke64df2832015-07-31 22:33:361507 # Only include this test when on Posix and using NSS for
1508 # cert verification or on iOS (which also uses NSS for certs).
1509 sources -= [ "cert_net/nss_ocsp_unittest.cc" ]
1510 }
1511
1512 if (!use_openssl_certs) {
1513 sources -= [ "ssl/openssl_client_key_store_unittest.cc" ]
1514 }
1515
1516 if (!enable_websockets) {
1517 sources -= [
1518 "server/http_connection_unittest.cc",
1519 "server/http_server_response_info_unittest.cc",
1520 "server/http_server_unittest.cc",
1521 "server/web_socket_encoder_unittest.cc",
1522 "websockets/websocket_basic_stream_test.cc",
1523 "websockets/websocket_channel_test.cc",
dprankea8d2fb92015-10-28 22:25:231524 "websockets/websocket_deflate_parameters_test.cc",
dpranke64df2832015-07-31 22:33:361525 "websockets/websocket_deflate_predictor_impl_test.cc",
1526 "websockets/websocket_deflate_stream_test.cc",
1527 "websockets/websocket_deflater_test.cc",
1528 "websockets/websocket_end_to_end_test.cc",
1529 "websockets/websocket_errors_test.cc",
1530 "websockets/websocket_extension_parser_test.cc",
dprankea8d2fb92015-10-28 22:25:231531 "websockets/websocket_extension_test.cc",
dpranke64df2832015-07-31 22:33:361532 "websockets/websocket_frame_parser_test.cc",
1533 "websockets/websocket_frame_test.cc",
1534 "websockets/websocket_handshake_challenge_test.cc",
1535 "websockets/websocket_handshake_stream_create_helper_test.cc",
1536 "websockets/websocket_inflater_test.cc",
1537 "websockets/websocket_stream_test.cc",
1538 "websockets/websocket_test_util.cc",
1539 "websockets/websocket_test_util.h",
1540 ]
1541 deps -= [ ":http_server" ]
1542 }
1543
1544 if (disable_file_support) {
1545 sources -= [
1546 "base/directory_lister_unittest.cc",
Thiago Farinad673bb122016-01-06 23:18:161547 "base/directory_listing_unittest.cc",
shahriar.rostamia8c06daf2016-02-12 00:07:041548 "url_request/url_request_file_dir_job_unittest.cc",
dpranke64df2832015-07-31 22:33:361549 "url_request/url_request_file_job_unittest.cc",
1550 ]
1551 }
1552
1553 if (disable_ftp_support) {
1554 sources -= [
1555 "ftp/ftp_auth_cache_unittest.cc",
1556 "ftp/ftp_ctrl_response_buffer_unittest.cc",
1557 "ftp/ftp_directory_listing_parser_ls_unittest.cc",
dpranke64df2832015-07-31 22:33:361558 "ftp/ftp_directory_listing_parser_unittest.cc",
1559 "ftp/ftp_directory_listing_parser_unittest.h",
1560 "ftp/ftp_directory_listing_parser_vms_unittest.cc",
1561 "ftp/ftp_directory_listing_parser_windows_unittest.cc",
1562 "ftp/ftp_network_transaction_unittest.cc",
1563 "ftp/ftp_util_unittest.cc",
1564 "url_request/url_request_ftp_job_unittest.cc",
1565 ]
1566 }
1567
xunjieli11834f02015-12-22 04:27:081568 if (!enable_bidirectional_stream) {
1569 sources -= [ "http/bidirectional_stream_unittest.cc" ]
1570 }
dpranke64df2832015-07-31 22:33:361571 if (!enable_built_in_dns) {
1572 sources -= [
1573 "dns/address_sorter_posix_unittest.cc",
1574 "dns/address_sorter_unittest.cc",
1575 ]
1576 }
1577
xunjieli905496a2015-08-31 15:51:171578 if (use_v8_in_net) {
dpranke64df2832015-07-31 22:33:361579 deps += [ ":net_with_v8" ]
1580 } else {
1581 sources -= [
1582 "proxy/proxy_resolver_v8_tracing_unittest.cc",
1583 "proxy/proxy_resolver_v8_tracing_wrapper_unittest.cc",
1584 "proxy/proxy_resolver_v8_unittest.cc",
1585 ]
1586 }
1587
1588 if (use_v8_in_net && !is_android) {
1589 deps += [
1590 ":net_browser_services",
1591 ":net_utility_services",
rockotc637caf9b2016-02-10 09:57:081592 "//mojo/edk/system",
dpranke64df2832015-07-31 22:33:361593 "//mojo/environment:chromium",
dpranke64df2832015-07-31 22:33:361594 ]
1595 } else {
1596 sources -= [
1597 "dns/host_resolver_mojo_unittest.cc",
1598 "dns/mojo_host_resolver_impl_unittest.cc",
1599 "proxy/mojo_proxy_resolver_factory_impl_unittest.cc",
1600 "proxy/mojo_proxy_resolver_impl_unittest.cc",
1601 "proxy/mojo_proxy_resolver_v8_tracing_bindings_unittest.cc",
1602 "proxy/proxy_resolver_factory_mojo_unittest.cc",
1603 "proxy/proxy_service_mojo_unittest.cc",
1604 ]
1605 }
1606
1607 if (!enable_mdns) {
1608 sources -= [
1609 "dns/mdns_cache_unittest.cc",
1610 "dns/mdns_client_unittest.cc",
1611 "dns/record_parsed_unittest.cc",
1612 "dns/record_rdata_unittest.cc",
1613 ]
1614 }
1615
1616 if (is_ios) {
1617 # TODO(GYP)
1618 # 'actions': [
1619 # {
1620 # 'action_name': 'copy_test_data',
1621 # 'variables': {
1622 # 'test_data_files': [
mattm61c80732015-11-02 22:35:441623 # 'data/certificate_policies_unittest/',
mattm2c59d262015-10-29 05:33:211624 # 'data/name_constraints_unittest/',
eromanc1aac5a2015-12-18 02:23:061625 # 'data/parse_certificate_unittest/',
dpranke64df2832015-07-31 22:33:361626 # 'data/ssl/certificates/',
1627 # 'data/test.html',
1628 # 'data/url_request_unittest/',
eromanc1aac5a2015-12-18 02:23:061629 # 'data/verify_certificate_chain_unittest/',
mattm057b0152015-08-11 00:26:241630 # 'data/verify_name_match_unittest/names/',
dpranke64df2832015-07-31 22:33:361631 # ],
1632 # 'test_data_prefix': 'net',
1633 # },
1634 # 'includes': [ '../build/copy_test_data_ios.gypi' ],
1635 # },
1636 # ],
1637 sources -= [
1638 # TODO(droger): The following tests are disabled because the
1639 # implementation is missing or incomplete.
1640 # KeygenHandler::GenKeyAndSignChallenge() is not ported to iOS.
1641 "base/keygen_handler_unittest.cc",
1642 "disk_cache/backend_unittest.cc",
1643 "disk_cache/blockfile/block_files_unittest.cc",
1644
1645 # Need to read input data files.
eustasfbec9132015-12-30 14:56:511646 "filter/brotli_filter_unittest.cc",
dpranke64df2832015-07-31 22:33:361647 "filter/gzip_filter_unittest.cc",
1648 "socket/ssl_server_socket_unittest.cc",
1649 "spdy/fuzzing/hpack_fuzz_util_test.cc",
1650
1651 # Need TestServer.
1652 "cert_net/cert_net_fetcher_impl_unittest.cc",
1653 "proxy/proxy_script_fetcher_impl_unittest.cc",
1654 "socket/ssl_client_socket_unittest.cc",
1655 "url_request/url_fetcher_impl_unittest.cc",
1656 "url_request/url_request_context_builder_unittest.cc",
1657
1658 # Needs GetAppOutput().
1659 "test/python_utils_unittest.cc",
1660
1661 # The following tests are disabled because they don't apply to
1662 # iOS.
1663 # OS is not "linux" or "freebsd" or "openbsd".
1664 "socket/unix_domain_client_socket_posix_unittest.cc",
1665 "socket/unix_domain_server_socket_posix_unittest.cc",
1666
1667 # See bug http://crbug.com/344533.
1668 "disk_cache/blockfile/index_table_v3_unittest.cc",
1669 ]
1670 }
1671
1672 if (is_android) {
agrieve97176362015-12-01 16:36:191673 deps += [
1674 ":net_test_jni_headers",
agrievea5517aa2015-10-23 03:03:451675 "//base:base_java_unittest_support",
1676 "//net/android:net_java",
agrievea5517aa2015-10-23 03:03:451677 "//net/android:net_java_test_support",
agrieve97176362015-12-01 16:36:191678 "//net/android:net_javatests",
agrievea5517aa2015-10-23 03:03:451679 "//net/android:net_unittests_apk_resources",
agrieve97176362015-12-01 16:36:191680
1681 # TODO(mmenke): This depends on test_support_base, which depends on
1682 # icu. Figure out a way to remove that dependency.
1683 "//testing/android/native_test:native_test_native_code",
pkotwicz8c7027d2015-11-11 06:30:071684 "//v8:v8_external_startup_data_assets",
agrievea5517aa2015-10-23 03:03:451685 ]
1686 android_manifest = "//net/android/unittest_support/AndroidManifest.xml"
dpranke64df2832015-07-31 22:33:361687 sources -= [
1688 # See bug http://crbug.com/344533.
1689 "disk_cache/blockfile/index_table_v3_unittest.cc",
dpranke64df2832015-07-31 22:33:361690 ]
dpranke64df2832015-07-31 22:33:361691 set_sources_assignment_filter([])
1692 sources += [ "base/address_tracker_linux_unittest.cc" ]
1693 set_sources_assignment_filter(sources_assignment_filter)
1694 isolate_file = "net_unittests.isolate"
1695 }
1696
dpranke64df2832015-07-31 22:33:361697 # Symbols for crashes when running tests on swarming.
1698 if (symbol_level > 0) {
1699 if (is_win) {
1700 data += [ "$root_out_dir/net_unittests.exe.pdb" ]
1701 } else if (is_mac) {
1702 data += [ "$root_out_dir/net_unittests.dSYM/" ]
1703 }
1704 }
1705}
1706
1707# !is_android && !is_win && !is_mac
[email protected]8a3f8242014-06-05 18:05:121708
rockot9c67e5f2015-03-12 20:01:211709executable("net_perftests") {
1710 testonly = true
1711 sources = [
ricea10eb9f5e2015-05-19 18:51:571712 "base/mime_sniffer_perftest.cc",
rockot9c67e5f2015-03-12 20:01:211713 "cookies/cookie_monster_perftest.cc",
1714 "disk_cache/blockfile/disk_cache_perftest.cc",
rohitrao1860223c2015-05-16 01:07:141715 "extras/sqlite/sqlite_persistent_cookie_store_perftest.cc",
rockot9c67e5f2015-03-12 20:01:211716 "proxy/proxy_resolver_perftest.cc",
1717 "udp/udp_socket_perftest.cc",
1718 ]
1719
1720 # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
1721 configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
1722 deps = [
brettwcdccaf02015-07-27 16:27:091723 ":extras",
1724 ":net",
1725 ":test_support",
rockot9c67e5f2015-03-12 20:01:211726 "//base",
1727 "//base:i18n",
1728 "//base/test:test_support_perf",
brettwba7a73d2015-08-31 22:17:391729 "//build/config/sanitizers:deps",
rockot9c67e5f2015-03-12 20:01:211730 "//testing/gtest",
1731 "//url",
rockot9c67e5f2015-03-12 20:01:211732 ]
1733
1734 if (enable_websockets) {
1735 sources += [ "websockets/websocket_frame_perftest.cc" ]
1736 }
1737
1738 if (use_v8_in_net) {
1739 deps += [ ":net_with_v8" ]
1740 } else {
1741 sources -= [ "proxy/proxy_resolver_perftest.cc" ]
1742 }
rockot9c67e5f2015-03-12 20:01:211743}
mefff34b822016-01-11 15:28:081744
eromanfe8659e2016-03-02 23:47:021745# Fuzzers
1746
eromane6264fd2016-03-02 22:46:301747fuzzer_test("parse_proxy_list_pac_fuzzer") {
1748 sources = [
1749 "proxy/parse_proxy_list_pac_fuzzer.cc",
1750 ]
1751 deps = [
1752 "//net",
1753 ]
1754}
1755
1756fuzzer_test("parse_proxy_list_fuzzer") {
1757 sources = [
1758 "proxy/parse_proxy_list_fuzzer.cc",
1759 ]
1760 deps = [
1761 "//net",
1762 ]
1763}
1764
1765fuzzer_test("parse_proxy_bypass_rules_fuzzer") {
1766 sources = [
1767 "proxy/parse_proxy_bypass_rules_fuzzer.cc",
1768 ]
1769 deps = [
1770 "//net",
1771 ]
1772}
1773
1774fuzzer_test("parse_proxy_rules_fuzzer") {
1775 sources = [
1776 "proxy/parse_proxy_rules_fuzzer.cc",
1777 ]
1778 deps = [
1779 "//net",
1780 ]
1781}
1782
1783fuzzer_test("parse_data_url_fuzzer") {
1784 sources = [
1785 "base/parse_data_url_fuzzer.cc",
1786 ]
1787 deps = [
1788 "//base",
1789 "//net",
1790 ]
1791}
1792
1793fuzzer_test("sniff_mime_type_fuzzer") {
1794 sources = [
1795 "base/sniff_mime_type_fuzzer.cc",
1796 ]
1797 deps = [
1798 "//base",
1799 "//net",
1800 ]
1801}
1802
1803fuzzer_test("parse_ip_pattern_fuzzer") {
1804 sources = [
1805 "base/parse_ip_pattern_fuzzer.cc",
1806 ]
1807 deps = [
1808 "//net",
1809 ]
1810}
1811
1812fuzzer_test("get_domain_and_registry_fuzzer") {
1813 sources = [
1814 "base/registry_controlled_domains/get_domain_and_registry_fuzzer.cc",
1815 ]
1816 deps = [
1817 "//base",
1818 "//base:i18n",
1819 "//net",
1820 ]
1821}
1822
1823fuzzer_test("parse_cookie_line_fuzzer") {
1824 sources = [
1825 "cookies/parse_cookie_line_fuzzer.cc",
1826 ]
1827 deps = [
1828 "//net",
1829 ]
1830}
1831
eromanfe8659e2016-03-02 23:47:021832fuzzer_test("dns_record_fuzzer") {
1833 sources = [
1834 "dns/dns_record_fuzzer.cc",
1835 ]
1836 deps = [
1837 "//base",
1838 "//net",
1839 ]
1840}
1841
1842fuzzer_test("ftp_ctrl_response_fuzzer") {
1843 sources = [
1844 "ftp/ftp_ctrl_response_fuzzer.cc",
1845 ]
1846 deps = [
1847 "//base",
1848 "//net",
1849 ]
1850}
1851
1852fuzzer_test("ftp_directory_listing_fuzzer") {
1853 sources = [
1854 "ftp/ftp_directory_listing_fuzzer.cc",
1855 ]
1856 deps = [
1857 "//base",
1858 "//base:i18n",
1859 "//net",
1860 ]
1861}
1862
1863fuzzer_test("unescape_url_component_fuzzer") {
1864 sources = [
1865 "base/unescape_url_component_fuzzer.cc",
1866 ]
1867 deps = [
1868 "//base",
1869 "//net",
1870 ]
1871}
1872
1873fuzzer_test("websocket_frame_parser_fuzzer") {
1874 sources = [
1875 "websockets/websocket_frame_parser_fuzzer.cc",
1876 ]
1877 deps = [
1878 "//net",
1879 ]
1880}
1881
1882fuzzer_test("http_chunked_decoder_fuzzer") {
1883 sources = [
1884 "http/http_chunked_decoder_fuzzer.cc",
1885 ]
1886 deps = [
1887 "//net",
1888 ]
1889}
1890
1891fuzzer_test("quic_crypto_framer_parse_message_fuzzer") {
1892 sources = [
1893 "quic/quic_crypto_framer_parse_message_fuzzer.cc",
1894 ]
1895 deps = [
1896 "//base",
1897 "//net",
1898 ]
1899}
1900
mefff34b822016-01-11 15:28:081901buildflag_header("features") {
1902 header = "net_features.h"
1903
1904 flags = [ "ENABLE_BIDIRECTIONAL_STREAM=$enable_bidirectional_stream" ]
1905}