blob: 47a5a033d5c00c827e60e35b21e78bea77bf47c3 [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
5import("//build/config/crypto.gni")
6import("//build/config/features.gni")
7import("//build/config/ui.gni")
rmcilroy5837d332014-12-17 14:30:588import("//build/module_args/v8.gni")
[email protected]8a3f8242014-06-05 18:05:129import("//url/config.gni")
qsrfb5251d12015-01-21 15:57:2210import("//testing/test.gni")
[email protected]4625ade2014-04-15 19:26:4411
[email protected]26046b52014-07-16 00:11:0312# TODO(cjhopman): //build/config/android/rules.gni also imports grit_rule.gni.
13# Currently, that file can't be imported multiple times. Make this always
14# imported when http://crbug.com/393704 is fixed.
15if (!is_android) {
16 import("//tools/grit/grit_rule.gni")
17}
18
[email protected]4625ade2014-04-15 19:26:4419if (is_android) {
20 import("//build/config/android/config.gni")
[email protected]ef0eb442014-05-15 09:32:1821 import("//build/config/android/rules.gni")
[email protected]4625ade2014-04-15 19:26:4422} else if (is_mac) {
23 import("//build/config/mac/mac_sdk.gni")
24}
25
26# The list of net files is kept in net.gypi. Read it.
scottmg34fb7e52014-12-03 23:27:2427gypi_values = exec_script("//build/gypi_to_gn.py",
28 [ rebase_path("net.gypi") ],
29 "scope",
30 [ "net.gypi" ])
[email protected]4625ade2014-04-15 19:26:4431
32# Disable Kerberos on ChromeOS, Android and iOS, at least for now. It needs
33# configuration (krb5.conf and so on).
34use_kerberos = !is_chromeos && !is_android && !is_ios
35
36# The way the cache uses mmap() is inefficient on some Android devices. If
37# this flag is set, we hackily avoid using mmap() in the disk cache. We are
38# pretty confident that mmap-ing the index would not hurt any existing x86
39# android devices, but we cannot be so sure about the variety of ARM devices.
40# So enable it for x86 only for now.
41posix_avoid_mmap = is_android && cpu_arch != "x86"
42
43# WebSockets and socket stream code are used everywhere except iOS.
44enable_websockets = !is_ios
[email protected]8a3f8242014-06-05 18:05:1245use_v8_in_net = !is_ios
[email protected]4625ade2014-04-15 19:26:4446enable_built_in_dns = !is_ios
[email protected]8a3f8242014-06-05 18:05:1247disable_ftp_support = is_ios
[email protected]4625ade2014-04-15 19:26:4448
[email protected]384dab92014-06-04 20:26:0849declare_args() {
50 # Disables support for file URLs. File URL support requires use of icu.
51 disable_file_support = false
52}
[email protected]02494ec2014-05-07 15:05:2953
[email protected]4625ade2014-04-15 19:26:4454config("net_config") {
55 defines = []
56 if (posix_avoid_mmap) {
57 defines += [ "POSIX_AVOID_MMAP" ]
58 }
[email protected]02494ec2014-05-07 15:05:2959 if (disable_file_support) {
60 defines += [ "DISABLE_FILE_SUPPORT" ]
61 }
[email protected]4625ade2014-04-15 19:26:4462}
63
[email protected]8603c5de2014-04-16 20:34:3164# Disables Windows warning about size to int truncations.
65# TODO(jschuh): crbug.com/167187 fix this and delete this config.
66config("net_win_size_truncation") {
67 if (is_win) {
[email protected]d980fd112014-04-22 04:42:1368 cflags = [ "/wd4267" ]
[email protected]8603c5de2014-04-16 20:34:3169 }
70}
71
[email protected]4625ade2014-04-15 19:26:4472component("net") {
73 sources =
scottmg34fb7e52014-12-03 23:27:2474 gypi_values.net_nacl_common_sources + gypi_values.net_non_nacl_sources
[email protected]4625ade2014-04-15 19:26:4475
76 cflags = []
[email protected]8603c5de2014-04-16 20:34:3177 defines = [
78 # TODO(GYP) Note that he GYP file supports linux_link_kerberos (defaults to
79 # 0) which implies that we run pkg_config on kerberos and link to that
80 # rather than setting this define which will dynamically open it. That
81 # doesn't seem to be set in the regular builds, so we're skipping this
82 # capability here.
83 "DLOPEN_KERBEROS",
scottmg34fb7e52014-12-03 23:27:2484 "NET_IMPLEMENTATION",
[email protected]8603c5de2014-04-16 20:34:3185 ]
86 configs += [ ":net_win_size_truncation" ]
Brett Wilsone53895272014-09-23 23:41:4687 public_configs = [ ":net_config" ]
[email protected]4625ade2014-04-15 19:26:4488 include_dirs = []
89
Brett Wilsone53895272014-09-23 23:41:4690 public_deps = [
91 "//crypto",
scottmg34fb7e52014-12-03 23:27:2492 "//crypto:platform",
Brett Wilsone53895272014-09-23 23:41:4693 ]
[email protected]4625ade2014-04-15 19:26:4494 deps = [
scottmg34fb7e52014-12-03 23:27:2495 ":net_resources",
[email protected]4625ade2014-04-15 19:26:4496 "//base",
97 "//base:i18n",
[email protected]ad66db12014-07-10 12:43:4798 "//base:prefs",
[email protected]4625ade2014-04-15 19:26:4499 "//base/third_party/dynamic_annotations",
[email protected]8a3f8242014-06-05 18:05:12100 "//net/base/registry_controlled_domains",
[email protected]4625ade2014-04-15 19:26:44101 "//sdch",
102 "//third_party/icu",
103 "//third_party/zlib",
104 "//url",
105 ]
106
107 if (use_kerberos) {
108 defines += [ "USE_KERBEROS" ]
109 if (is_android) {
110 include_dirs += [ "/usr/include/kerberosV" ]
111 }
112 } else {
113 sources -= [
114 "http/http_auth_gssapi_posix.cc",
115 "http/http_auth_gssapi_posix.h",
116 "http/http_auth_handler_negotiate.h",
117 "http/http_auth_handler_negotiate.cc",
118 ]
119 }
120
121 if (is_posix) {
122 if (posix_avoid_mmap) {
123 sources -= [ "disk_cache/blockfile/mapped_file_posix.cc" ]
124 } else {
125 sources -= [ "disk_cache/blockfile/mapped_file_avoid_mmap_posix.cc" ]
126 }
127 }
128
[email protected]02494ec2014-05-07 15:05:29129 if (disable_file_support) {
130 sources -= [
131 "base/directory_lister.cc",
132 "base/directory_lister.h",
133 "url_request/url_request_file_dir_job.cc",
134 "url_request/url_request_file_dir_job.h",
135 "url_request/url_request_file_job.cc",
136 "url_request/url_request_file_job.h",
137 "url_request/file_protocol_handler.cc",
138 "url_request/file_protocol_handler.h",
139 ]
140 }
141
[email protected]8a3f8242014-06-05 18:05:12142 if (disable_ftp_support) {
[email protected]4625ade2014-04-15 19:26:44143 sources -= [
144 "ftp/ftp_auth_cache.cc",
145 "ftp/ftp_auth_cache.h",
146 "ftp/ftp_ctrl_response_buffer.cc",
147 "ftp/ftp_ctrl_response_buffer.h",
148 "ftp/ftp_directory_listing_parser.cc",
149 "ftp/ftp_directory_listing_parser.h",
150 "ftp/ftp_directory_listing_parser_ls.cc",
151 "ftp/ftp_directory_listing_parser_ls.h",
152 "ftp/ftp_directory_listing_parser_netware.cc",
153 "ftp/ftp_directory_listing_parser_netware.h",
154 "ftp/ftp_directory_listing_parser_os2.cc",
155 "ftp/ftp_directory_listing_parser_os2.h",
156 "ftp/ftp_directory_listing_parser_vms.cc",
157 "ftp/ftp_directory_listing_parser_vms.h",
158 "ftp/ftp_directory_listing_parser_windows.cc",
159 "ftp/ftp_directory_listing_parser_windows.h",
160 "ftp/ftp_network_layer.cc",
161 "ftp/ftp_network_layer.h",
162 "ftp/ftp_network_session.cc",
163 "ftp/ftp_network_session.h",
164 "ftp/ftp_network_transaction.cc",
165 "ftp/ftp_network_transaction.h",
166 "ftp/ftp_request_info.h",
167 "ftp/ftp_response_info.cc",
168 "ftp/ftp_response_info.h",
169 "ftp/ftp_server_type_histograms.cc",
170 "ftp/ftp_server_type_histograms.h",
171 "ftp/ftp_transaction.h",
172 "ftp/ftp_transaction_factory.h",
173 "ftp/ftp_util.cc",
174 "ftp/ftp_util.h",
175 "url_request/ftp_protocol_handler.cc",
176 "url_request/ftp_protocol_handler.h",
177 "url_request/url_request_ftp_job.cc",
178 "url_request/url_request_ftp_job.h",
179 ]
180 }
181
182 if (enable_built_in_dns) {
183 defines += [ "ENABLE_BUILT_IN_DNS" ]
184 } else {
185 sources -= [
186 "dns/address_sorter_posix.cc",
187 "dns/address_sorter_posix.h",
188 "dns/dns_client.cc",
189 ]
190 }
191
192 if (use_openssl) {
193 sources -= [
[email protected]4625ade2014-04-15 19:26:44194 "base/nss_memio.c",
195 "base/nss_memio.h",
[email protected]4625ade2014-04-15 19:26:44196 "cert/ct_log_verifier_nss.cc",
197 "cert/ct_objects_extractor_nss.cc",
198 "cert/jwk_serializer_nss.cc",
[email protected]4625ade2014-04-15 19:26:44199 "cert/scoped_nss_types.h",
mukai77f8210a2014-10-07 16:35:14200 "cert/test_root_certs_nss.cc",
[email protected]4625ade2014-04-15 19:26:44201 "cert/x509_util_nss.cc",
202 "cert/x509_util_nss.h",
mukai77f8210a2014-10-07 16:35:14203 "ocsp/nss_ocsp.cc",
204 "ocsp/nss_ocsp.h",
[email protected]4625ade2014-04-15 19:26:44205 "quic/crypto/aead_base_decrypter_nss.cc",
206 "quic/crypto/aead_base_encrypter_nss.cc",
207 "quic/crypto/aes_128_gcm_12_decrypter_nss.cc",
208 "quic/crypto/aes_128_gcm_12_encrypter_nss.cc",
209 "quic/crypto/chacha20_poly1305_decrypter_nss.cc",
210 "quic/crypto/chacha20_poly1305_encrypter_nss.cc",
211 "quic/crypto/channel_id_nss.cc",
212 "quic/crypto/p256_key_exchange_nss.cc",
213 "socket/nss_ssl_util.cc",
214 "socket/nss_ssl_util.h",
215 "socket/ssl_client_socket_nss.cc",
216 "socket/ssl_client_socket_nss.h",
217 "socket/ssl_server_socket_nss.cc",
218 "socket/ssl_server_socket_nss.h",
[email protected]4625ade2014-04-15 19:26:44219 ]
[email protected]71d94dfce92014-04-30 16:47:24220 if (is_chromeos) {
221 sources -= [
222 "cert/nss_cert_database_chromeos.cc",
223 "cert/nss_cert_database_chromeos.h",
224 "cert/nss_profile_filter_chromeos.cc",
225 "cert/nss_profile_filter_chromeos.h",
226 ]
227 }
228 if (is_linux) {
229 # These are always removed for non-Linux cases below.
230 sources -= [
231 "base/crypto_module_nss.cc",
232 "base/keygen_handler_nss.cc",
233 "cert/cert_database_nss.cc",
234 "cert/nss_cert_database.cc",
235 "cert/nss_cert_database.h",
236 "cert/x509_certificate_nss.cc",
237 "third_party/mozilla_security_manager/nsKeygenHandler.cpp",
238 "third_party/mozilla_security_manager/nsKeygenHandler.h",
239 "third_party/mozilla_security_manager/nsNSSCertificateDB.cpp",
240 "third_party/mozilla_security_manager/nsNSSCertificateDB.h",
241 "third_party/mozilla_security_manager/nsPKCS12Blob.cpp",
242 "third_party/mozilla_security_manager/nsPKCS12Blob.h",
243 ]
244 }
245 if (is_ios) {
246 # Always removed for !ios below.
247 sources -= [
248 "cert/cert_verify_proc_nss.cc",
249 "cert/cert_verify_proc_nss.h",
[email protected]71d94dfce92014-04-30 16:47:24250 ]
251 }
davidbend5587412014-10-30 21:44:16252 if (is_win) {
scottmg34fb7e52014-12-03 23:27:24253 sources -= [ "cert/sha256_legacy_support_nss_win.cc" ]
davidbend5587412014-10-30 21:44:16254 }
[email protected]4625ade2014-04-15 19:26:44255 } else {
256 sources -= [
257 "base/crypto_module_openssl.cc",
[email protected]4625ade2014-04-15 19:26:44258 "cert/ct_log_verifier_openssl.cc",
259 "cert/ct_objects_extractor_openssl.cc",
260 "cert/jwk_serializer_openssl.cc",
261 "cert/x509_util_openssl.cc",
262 "cert/x509_util_openssl.h",
263 "quic/crypto/aead_base_decrypter_openssl.cc",
264 "quic/crypto/aead_base_encrypter_openssl.cc",
265 "quic/crypto/aes_128_gcm_12_decrypter_openssl.cc",
266 "quic/crypto/aes_128_gcm_12_encrypter_openssl.cc",
267 "quic/crypto/chacha20_poly1305_decrypter_openssl.cc",
268 "quic/crypto/chacha20_poly1305_encrypter_openssl.cc",
269 "quic/crypto/channel_id_openssl.cc",
270 "quic/crypto/p256_key_exchange_openssl.cc",
271 "quic/crypto/scoped_evp_aead_ctx.cc",
272 "quic/crypto/scoped_evp_aead_ctx.h",
273 "socket/ssl_client_socket_openssl.cc",
274 "socket/ssl_client_socket_openssl.h",
275 "socket/ssl_server_socket_openssl.cc",
[email protected]c8a80e92014-05-17 16:02:08276 "socket/ssl_server_socket_openssl.h",
[email protected]4625ade2014-04-15 19:26:44277 "socket/ssl_session_cache_openssl.cc",
278 "socket/ssl_session_cache_openssl.h",
[email protected]97a854f2014-07-29 07:51:36279 "ssl/openssl_platform_key.h",
280 "ssl/openssl_ssl_util.cc",
281 "ssl/openssl_ssl_util.h",
[email protected]4625ade2014-04-15 19:26:44282 ]
[email protected]97a854f2014-07-29 07:51:36283 if (is_mac) {
scottmg34fb7e52014-12-03 23:27:24284 sources -= [ "ssl/openssl_platform_key_mac.cc" ]
[email protected]97a854f2014-07-29 07:51:36285 }
286 if (is_win) {
287 sources -= [
John Abd-El-Malek494329e2014-11-05 19:06:30288 "cert/sha256_legacy_support_openssl_win.cc",
[email protected]97a854f2014-07-29 07:51:36289 "ssl/openssl_platform_key_win.cc",
290 ]
291 }
[email protected]4625ade2014-04-15 19:26:44292 }
293
294 if (!use_openssl_certs) {
295 sources -= [
isherman7e5de442014-09-25 23:00:18296 "base/keygen_handler_openssl.cc",
[email protected]4625ade2014-04-15 19:26:44297 "base/openssl_private_key_store.h",
298 "base/openssl_private_key_store_memory.cc",
299 "cert/cert_database_openssl.cc",
300 "cert/cert_verify_proc_openssl.cc",
301 "cert/cert_verify_proc_openssl.h",
302 "cert/test_root_certs_openssl.cc",
303 "cert/x509_certificate_openssl.cc",
304 "ssl/openssl_client_key_store.cc",
305 "ssl/openssl_client_key_store.h",
306 ]
307 if (is_android) {
scottmg34fb7e52014-12-03 23:27:24308 sources -= [ "base/openssl_private_key_store_android.cc" ]
[email protected]4625ade2014-04-15 19:26:44309 }
[email protected]1ea01752014-05-23 19:01:46310 } else if (is_android) {
311 # Android doesn't use these even when using OpenSSL.
312 sources -= [
313 "base/openssl_private_key_store_memory.cc",
314 "cert/cert_database_openssl.cc",
315 "cert/cert_verify_proc_openssl.cc",
316 "cert/test_root_certs_openssl.cc",
317 ]
[email protected]4625ade2014-04-15 19:26:44318 }
319
mukai77f8210a2014-10-07 16:35:14320 if (use_glib && !is_chromeos) {
[email protected]4625ade2014-04-15 19:26:44321 configs += [ "//build/config/linux:gconf" ]
322 deps += [ "//build/config/linux:gio" ]
323 }
324
325 if (is_linux) {
326 configs += [ "//build/config/linux:libresolv" ]
327 } else {
328 sources -= [
329 "base/crypto_module_nss.cc",
330 "base/keygen_handler_nss.cc",
331 "cert/cert_database_nss.cc",
332 "cert/nss_cert_database.cc",
333 "cert/nss_cert_database.h",
[email protected]4625ade2014-04-15 19:26:44334 "cert/x509_certificate_nss.cc",
[email protected]4625ade2014-04-15 19:26:44335 "third_party/mozilla_security_manager/nsKeygenHandler.cpp",
336 "third_party/mozilla_security_manager/nsKeygenHandler.h",
337 "third_party/mozilla_security_manager/nsNSSCertificateDB.cpp",
338 "third_party/mozilla_security_manager/nsNSSCertificateDB.h",
339 "third_party/mozilla_security_manager/nsPKCS12Blob.cpp",
340 "third_party/mozilla_security_manager/nsPKCS12Blob.h",
341 ]
[email protected]e8ab6912014-04-21 20:54:51342
mukai77f8210a2014-10-07 16:35:14343 if (!is_ios && !use_openssl) {
[email protected]e8ab6912014-04-21 20:54:51344 # These files are part of the partial implementation of NSS on iOS so
345 # keep them in that case.
346 sources -= [
347 "cert/test_root_certs_nss.cc",
348 "ocsp/nss_ocsp.cc",
349 "ocsp/nss_ocsp.h",
350 ]
351 }
[email protected]4625ade2014-04-15 19:26:44352 }
353
[email protected]e8ab6912014-04-21 20:54:51354 if (!use_nss_certs) {
[email protected]4625ade2014-04-15 19:26:44355 sources -= [
[email protected]4625ade2014-04-15 19:26:44356 "ssl/client_cert_store_nss.cc",
357 "ssl/client_cert_store_nss.h",
358 ]
[email protected]e8ab6912014-04-21 20:54:51359 if (!is_ios) {
360 # These files are part of the partial implementation of NSS on iOS so
361 # keep them in that case (even though use_nss_certs is not set).
362 sources -= [
363 "cert/cert_verify_proc_nss.cc",
364 "cert/cert_verify_proc_nss.h",
365 ]
366 }
[email protected]4625ade2014-04-15 19:26:44367 if (is_chromeos) {
368 # These were already removed on non-ChromeOS.
369 sources -= [
370 "ssl/client_cert_store_chromeos.cc",
371 "ssl/client_cert_store_chromeos.h",
372 ]
373 }
374 }
375
376 if (!enable_websockets) {
377 sources -= [
[email protected]4625ade2014-04-15 19:26:44378 "websockets/websocket_basic_handshake_stream.cc",
379 "websockets/websocket_basic_handshake_stream.h",
380 "websockets/websocket_basic_stream.cc",
381 "websockets/websocket_basic_stream.h",
382 "websockets/websocket_channel.cc",
383 "websockets/websocket_channel.h",
384 "websockets/websocket_deflate_predictor.h",
385 "websockets/websocket_deflate_predictor_impl.cc",
386 "websockets/websocket_deflate_predictor_impl.h",
387 "websockets/websocket_deflate_stream.cc",
388 "websockets/websocket_deflate_stream.h",
389 "websockets/websocket_deflater.cc",
390 "websockets/websocket_deflater.h",
391 "websockets/websocket_errors.cc",
392 "websockets/websocket_errors.h",
393 "websockets/websocket_extension.cc",
394 "websockets/websocket_extension.h",
395 "websockets/websocket_extension_parser.cc",
396 "websockets/websocket_extension_parser.h",
397 "websockets/websocket_frame.cc",
398 "websockets/websocket_frame.h",
399 "websockets/websocket_frame_parser.cc",
400 "websockets/websocket_frame_parser.h",
401 "websockets/websocket_handshake_constants.cc",
402 "websockets/websocket_handshake_constants.h",
ricea11bdcd02014-11-20 09:57:07403 "websockets/websocket_handshake_challenge.cc",
404 "websockets/websocket_handshake_challenge.h",
[email protected]4625ade2014-04-15 19:26:44405 "websockets/websocket_handshake_request_info.cc",
406 "websockets/websocket_handshake_request_info.h",
407 "websockets/websocket_handshake_response_info.cc",
408 "websockets/websocket_handshake_response_info.h",
409 "websockets/websocket_handshake_stream_base.h",
410 "websockets/websocket_handshake_stream_create_helper.cc",
411 "websockets/websocket_handshake_stream_create_helper.h",
412 "websockets/websocket_inflater.cc",
413 "websockets/websocket_inflater.h",
[email protected]4625ade2014-04-15 19:26:44414 "websockets/websocket_mux.h",
[email protected]4625ade2014-04-15 19:26:44415 "websockets/websocket_stream.cc",
416 "websockets/websocket_stream.h",
[email protected]4625ade2014-04-15 19:26:44417 ]
418 }
419
420 if (!enable_mdns) {
421 sources -= [
422 "dns/mdns_cache.cc",
423 "dns/mdns_cache.h",
424 "dns/mdns_client.cc",
425 "dns/mdns_client.h",
426 "dns/mdns_client_impl.cc",
427 "dns/mdns_client_impl.h",
428 "dns/record_parsed.cc",
429 "dns/record_parsed.h",
430 "dns/record_rdata.cc",
431 "dns/record_rdata.h",
432 ]
433 }
434
435 if (is_win) {
436 sources -= [
437 "http/http_auth_handler_ntlm_portable.cc",
[email protected]2ef2b0e2014-07-09 21:12:34438 "socket/socket_libevent.cc",
439 "socket/socket_libevent.h",
[email protected]4625ade2014-04-15 19:26:44440 "socket/tcp_socket_libevent.cc",
441 "socket/tcp_socket_libevent.h",
442 "udp/udp_socket_libevent.cc",
443 "udp/udp_socket_libevent.h",
444 ]
[email protected]4625ade2014-04-15 19:26:44445 } else { # !is_win
446 sources -= [
447 "base/winsock_init.cc",
448 "base/winsock_init.h",
449 "base/winsock_util.cc",
450 "base/winsock_util.h",
451 "proxy/proxy_resolver_winhttp.cc",
452 "proxy/proxy_resolver_winhttp.h",
453 ]
454 }
455
456 if (is_mac) {
[email protected]4625ade2014-04-15 19:26:44457 libs = [
[email protected]ab9ce6e2014-04-17 20:33:19458 "Foundation.framework",
459 "Security.framework",
460 "SystemConfiguration.framework",
461 "resolv",
[email protected]4625ade2014-04-15 19:26:44462 ]
463 }
464
465 if (is_ios) {
[email protected]b2b2bf52014-05-28 20:26:57466 # Add back some sources that were otherwise filtered out. iOS additionally
467 # doesn't set USE_NSS but needs some of the files.
468 set_sources_assignment_filter([])
469 sources += [
guoweis7eb7ab52014-11-14 17:42:56470 "base/net_util_mac.cc",
471 "base/net_util_mac.h",
[email protected]b2b2bf52014-05-28 20:26:57472 "base/network_change_notifier_mac.cc",
473 "base/network_config_watcher_mac.cc",
474 "base/platform_mime_util_mac.mm",
475 "cert/cert_verify_proc_nss.cc",
476 "cert/cert_verify_proc_nss.h",
477 "cert/test_root_certs_nss.cc",
478 "cert/x509_util_nss.cc",
479 "cert/x509_util_nss.h",
480 "proxy/proxy_resolver_mac.cc",
481 "proxy/proxy_server_mac.cc",
482 "ocsp/nss_ocsp.cc",
483 "ocsp/nss_ocsp.h",
484 ]
485 set_sources_assignment_filter(sources_assignment_filter)
486
[email protected]4625ade2014-04-15 19:26:44487 sources -= [ "disk_cache/blockfile/file_posix.cc" ]
[email protected]4625ade2014-04-15 19:26:44488 libs = [
[email protected]ab9ce6e2014-04-17 20:33:19489 "CFNetwork.framework",
490 "MobileCoreServices.framework",
491 "Security.framework",
492 "SystemConfiguration.framework",
493 "resolv",
[email protected]4625ade2014-04-15 19:26:44494 ]
495 }
496
erikchen006a7cf2014-12-03 22:27:11497 if (is_ios || is_mac) {
498 sources += gypi_values.net_base_mac_ios_sources
499 }
500
[email protected]4625ade2014-04-15 19:26:44501 if (is_android) {
[email protected]b2b2bf52014-05-28 20:26:57502 # Add some Linux sources that were excluded by the filter, but which
503 # are needed.
504 set_sources_assignment_filter([])
505 sources += [
506 "base/platform_mime_util_linux.cc",
507 "base/address_tracker_linux.cc",
508 "base/address_tracker_linux.h",
guoweis7eb7ab52014-11-14 17:42:56509 "base/net_util_linux.cc",
scottmg34fb7e52014-12-03 23:27:24510 "base/net_util_linux.h",
[email protected]b2b2bf52014-05-28 20:26:57511 ]
512 set_sources_assignment_filter(sources_assignment_filter)
513
[email protected]4625ade2014-04-15 19:26:44514 if (!is_android_webview_build) {
[email protected]4625ade2014-04-15 19:26:44515 deps += [ ":net_jni_headers" ]
[email protected]4625ade2014-04-15 19:26:44516 }
517 }
[email protected]ad66db12014-07-10 12:43:47518
[email protected]85191ed2014-05-15 00:41:49519 if (use_icu_alternatives_on_android) {
520 deps -= [
521 "//base:i18n",
522 "//third_party/icu",
523 ]
524 sources -= [
525 "base/filename_util_icu.cc",
526 "base/net_string_util_icu.cc",
527 "base/net_util_icu.cc",
528 ]
529 sources += [
530 "base/net_string_util_icu_alternatives_android.cc",
531 "base/net_string_util_icu_alternatives_android.h",
532 ]
533 }
[email protected]4625ade2014-04-15 19:26:44534}
535
536grit("net_resources") {
537 source = "base/net_resources.grd"
[email protected]7ae52902014-08-18 22:36:01538 use_qualified_include = true
[email protected]b89c53842014-07-23 16:32:32539 outputs = [
540 "grit/net_resources.h",
541 "net_resources.pak",
542 "net_resources.rc",
543 ]
[email protected]4625ade2014-04-15 19:26:44544}
545
Brett Wilson83fd4242014-09-02 19:45:33546static_library("extras") {
mef327a8e42014-08-29 17:10:03547 sources = gypi_values.net_extras_sources
548 configs += [ "//build/config/compiler:wexit_time_destructors" ]
549 deps = [
550 ":net",
551 "//sql:sql",
552 ]
553}
554
[email protected]8a3f8242014-06-05 18:05:12555static_library("http_server") {
[email protected]4625ade2014-04-15 19:26:44556 sources = [
557 "server/http_connection.cc",
558 "server/http_connection.h",
559 "server/http_server.cc",
560 "server/http_server.h",
561 "server/http_server_request_info.cc",
562 "server/http_server_request_info.h",
563 "server/http_server_response_info.cc",
564 "server/http_server_response_info.h",
565 "server/web_socket.cc",
566 "server/web_socket.h",
dgozmana6e70092014-12-12 14:46:21567 "server/web_socket_encoder.cc",
568 "server/web_socket_encoder.h",
[email protected]4625ade2014-04-15 19:26:44569 ]
jambc6cc8e2014-11-14 17:56:29570 configs += [
571 "//build/config/compiler:wexit_time_destructors",
scottmg34fb7e52014-12-03 23:27:24572 ":net_win_size_truncation",
jambc6cc8e2014-11-14 17:56:29573 ]
[email protected]4625ade2014-04-15 19:26:44574 deps = [
575 ":net",
576 "//base",
577 ]
578}
579
[email protected]8603c5de2014-04-16 20:34:31580executable("dump_cache") {
Brett Wilson8f80ad0b2014-09-08 19:50:24581 testonly = true
[email protected]8603c5de2014-04-16 20:34:31582 sources = [
583 "tools/dump_cache/cache_dumper.cc",
584 "tools/dump_cache/cache_dumper.h",
585 "tools/dump_cache/dump_cache.cc",
586 "tools/dump_cache/dump_files.cc",
587 "tools/dump_cache/dump_files.h",
588 "tools/dump_cache/simple_cache_dumper.cc",
589 "tools/dump_cache/simple_cache_dumper.h",
[email protected]8603c5de2014-04-16 20:34:31590 "tools/dump_cache/url_to_filename_encoder.cc",
591 "tools/dump_cache/url_to_filename_encoder.h",
592 "tools/dump_cache/url_utilities.h",
593 "tools/dump_cache/url_utilities.cc",
594 ]
[email protected]4625ade2014-04-15 19:26:44595
[email protected]8603c5de2014-04-16 20:34:31596 configs += [ ":net_win_size_truncation" ]
597
598 deps = [
599 "//base",
600 ":net",
[email protected]b2b2bf52014-05-28 20:26:57601 ":test_support",
[email protected]8603c5de2014-04-16 20:34:31602 ]
603}
604
[email protected]b2b2bf52014-05-28 20:26:57605source_set("test_support") {
Brett Wilson8f80ad0b2014-09-08 19:50:24606 testonly = true
[email protected]8603c5de2014-04-16 20:34:31607 sources = [
mmenke9e4ea8fe2014-11-19 23:12:30608 "base/captured_net_log_entry.cc",
609 "base/captured_net_log_entry.h",
[email protected]8603c5de2014-04-16 20:34:31610 "base/capturing_net_log.cc",
611 "base/capturing_net_log.h",
mmenke9e4ea8fe2014-11-19 23:12:30612 "base/capturing_net_log_observer.cc",
613 "base/capturing_net_log_observer.h",
[email protected]8603c5de2014-04-16 20:34:31614 "base/load_timing_info_test_util.cc",
615 "base/load_timing_info_test_util.h",
616 "base/mock_file_stream.cc",
617 "base/mock_file_stream.h",
618 "base/test_completion_callback.cc",
619 "base/test_completion_callback.h",
620 "base/test_data_directory.cc",
621 "base/test_data_directory.h",
622 "cert/mock_cert_verifier.cc",
623 "cert/mock_cert_verifier.h",
624 "cookies/cookie_monster_store_test.cc",
625 "cookies/cookie_monster_store_test.h",
626 "cookies/cookie_store_test_callbacks.cc",
627 "cookies/cookie_store_test_callbacks.h",
628 "cookies/cookie_store_test_helpers.cc",
629 "cookies/cookie_store_test_helpers.h",
630 "disk_cache/disk_cache_test_base.cc",
631 "disk_cache/disk_cache_test_base.h",
632 "disk_cache/disk_cache_test_util.cc",
633 "disk_cache/disk_cache_test_util.h",
634 "dns/dns_test_util.cc",
635 "dns/dns_test_util.h",
636 "dns/mock_host_resolver.cc",
637 "dns/mock_host_resolver.h",
638 "dns/mock_mdns_socket_factory.cc",
639 "dns/mock_mdns_socket_factory.h",
[email protected]8a3f8242014-06-05 18:05:12640 "http/http_transaction_test_util.cc",
641 "http/http_transaction_test_util.h",
[email protected]8603c5de2014-04-16 20:34:31642 "proxy/mock_proxy_resolver.cc",
643 "proxy/mock_proxy_resolver.h",
644 "proxy/mock_proxy_script_fetcher.cc",
645 "proxy/mock_proxy_script_fetcher.h",
646 "proxy/proxy_config_service_common_unittest.cc",
647 "proxy/proxy_config_service_common_unittest.h",
648 "socket/socket_test_util.cc",
649 "socket/socket_test_util.h",
650 "test/cert_test_util.cc",
651 "test/cert_test_util.h",
[email protected]83e1ae32014-07-18 10:57:07652 "test/cert_test_util_nss.cc",
[email protected]8603c5de2014-04-16 20:34:31653 "test/ct_test_util.cc",
654 "test/ct_test_util.h",
655 "test/embedded_test_server/embedded_test_server.cc",
656 "test/embedded_test_server/embedded_test_server.h",
657 "test/embedded_test_server/http_connection.cc",
658 "test/embedded_test_server/http_connection.h",
659 "test/embedded_test_server/http_request.cc",
660 "test/embedded_test_server/http_request.h",
661 "test/embedded_test_server/http_response.cc",
662 "test/embedded_test_server/http_response.h",
663 "test/net_test_suite.cc",
664 "test/net_test_suite.h",
665 "test/python_utils.cc",
666 "test/python_utils.h",
667 "test/spawned_test_server/base_test_server.cc",
668 "test/spawned_test_server/base_test_server.h",
669 "test/spawned_test_server/local_test_server_posix.cc",
670 "test/spawned_test_server/local_test_server_win.cc",
671 "test/spawned_test_server/local_test_server.cc",
672 "test/spawned_test_server/local_test_server.h",
673 "test/spawned_test_server/remote_test_server.cc",
674 "test/spawned_test_server/remote_test_server.h",
675 "test/spawned_test_server/spawned_test_server.h",
676 "test/spawned_test_server/spawner_communicator.cc",
677 "test/spawned_test_server/spawner_communicator.h",
Brett Wilson32ce17a2014-11-10 17:45:30678 "test/url_request/url_request_failed_job.cc",
679 "test/url_request/url_request_failed_job.h",
mef3e826cf2014-12-13 18:40:40680 "test/url_request/url_request_mock_data_job.cc",
681 "test/url_request/url_request_mock_data_job.h",
Brett Wilson32ce17a2014-11-10 17:45:30682 "test/url_request/url_request_mock_http_job.cc",
683 "test/url_request/url_request_mock_http_job.h",
jam8e45cd72015-01-20 16:33:44684 "test/url_request/url_request_slow_download_job.cc",
685 "test/url_request/url_request_slow_download_job.h",
[email protected]8603c5de2014-04-16 20:34:31686 "url_request/test_url_fetcher_factory.cc",
687 "url_request/test_url_fetcher_factory.h",
tommyclieaae5d92014-09-09 06:03:47688 "url_request/test_url_request_interceptor.cc",
689 "url_request/test_url_request_interceptor.h",
[email protected]8603c5de2014-04-16 20:34:31690 "url_request/url_request_test_util.cc",
691 "url_request/url_request_test_util.h",
692 ]
693
694 configs += [ ":net_win_size_truncation" ]
695
Brett Wilsone53895272014-09-23 23:41:46696 public_deps = [
[email protected]8603c5de2014-04-16 20:34:31697 "//base",
698 "//base/test:test_support",
[email protected]22fe91d2014-08-12 17:07:12699 "//crypto",
[email protected]59ff2d42014-04-22 22:25:23700 "//net",
[email protected]8603c5de2014-04-16 20:34:31701 "//net/tools/tld_cleanup",
702 "//testing/gmock",
703 "//testing/gtest",
704 "//url",
705 ]
706
davidben15d69d482014-09-29 18:24:08707 if (!use_openssl && (use_nss_certs || is_ios)) {
scottmg34fb7e52014-12-03 23:27:24708 public_deps += [ "//crypto:platform" ]
[email protected]8603c5de2014-04-16 20:34:31709 }
710
711 if (!is_android) {
712 sources -= [
713 "test/spawned_test_server/remote_test_server.cc",
714 "test/spawned_test_server/remote_test_server.h",
715 "test/spawned_test_server/spawner_communicator.cc",
716 "test/spawned_test_server/spawner_communicator.h",
717 ]
718 }
719
720 if (use_v8_in_net) {
Brett Wilsone53895272014-09-23 23:41:46721 public_deps += [ ":net_with_v8" ]
[email protected]8603c5de2014-04-16 20:34:31722 }
723
724 if (!enable_mdns) {
725 sources -= [
726 "dns/mock_mdns_socket_factory.cc",
727 "dns/mock_mdns_socket_factory.h",
728 ]
729 }
730
davidben15d69d482014-09-29 18:24:08731 if (!use_nss_certs) {
scottmg34fb7e52014-12-03 23:27:24732 sources -= [ "test/cert_test_util_nss.cc" ]
[email protected]83e1ae32014-07-18 10:57:07733 }
[email protected]8603c5de2014-04-16 20:34:31734}
735
[email protected]ceeaac792014-06-25 05:14:43736source_set("balsa") {
737 sources = [
738 "tools/balsa/balsa_enums.h",
739 "tools/balsa/balsa_frame.cc",
740 "tools/balsa/balsa_frame.h",
741 "tools/balsa/balsa_headers.cc",
742 "tools/balsa/balsa_headers.h",
743 "tools/balsa/balsa_headers_token_utils.cc",
744 "tools/balsa/balsa_headers_token_utils.h",
745 "tools/balsa/balsa_visitor_interface.h",
746 "tools/balsa/http_message_constants.cc",
747 "tools/balsa/http_message_constants.h",
748 "tools/balsa/noop_balsa_visitor.h",
749 "tools/balsa/simple_buffer.cc",
750 "tools/balsa/simple_buffer.h",
751 "tools/balsa/split.cc",
752 "tools/balsa/split.h",
753 "tools/balsa/string_piece_utils.h",
754 "tools/quic/spdy_utils.cc",
755 "tools/quic/spdy_utils.h",
756 ]
757 deps = [
758 ":net",
759 "//base",
[email protected]22fe91d2014-08-12 17:07:12760 "//url",
[email protected]ceeaac792014-06-25 05:14:43761 ]
762}
763
[email protected]8603c5de2014-04-16 20:34:31764if (use_v8_in_net) {
765 component("net_with_v8") {
766 sources = [
767 "proxy/proxy_resolver_v8.cc",
768 "proxy/proxy_resolver_v8.h",
769 "proxy/proxy_resolver_v8_tracing.cc",
770 "proxy/proxy_resolver_v8_tracing.h",
771 "proxy/proxy_service_v8.cc",
772 "proxy/proxy_service_v8.h",
773 ]
774
775 defines = [ "NET_IMPLEMENTATION" ]
776 configs += [
777 ":net_win_size_truncation",
778 "//build/config/compiler:wexit_time_destructors",
779 ]
780
Brett Wilsone53895272014-09-23 23:41:46781 public_deps = [
[email protected]8603c5de2014-04-16 20:34:31782 ":net",
Brett Wilsone53895272014-09-23 23:41:46783 ]
784 deps = [
[email protected]8603c5de2014-04-16 20:34:31785 "//base",
786 "//gin",
787 "//url",
788 "//v8",
789 ]
790 }
791}
792
amistry7e6ebfdc82015-02-13 04:19:11793if (use_v8_in_net && !is_android) {
794 source_set("net_browser_services") {
795 sources = [
796 "dns/mojo_host_resolver_impl.cc",
797 "dns/mojo_host_resolver_impl.h",
798 ]
799
800 public_deps = [
801 ":mojo_type_converters",
802 ":net",
803 "//net/interfaces",
804 "//third_party/mojo/src/mojo/public/cpp/bindings",
805 ]
806 }
807
808 source_set("mojo_type_converters") {
809 sources = [
810 "dns/mojo_type_converters.cc",
811 "dns/mojo_type_converters.h",
812 ]
813
814 public_deps = [
815 ":net",
816 "//net/interfaces",
817 "//third_party/mojo/src/mojo/public/cpp/bindings",
818 ]
819 }
820}
821
[email protected]8603c5de2014-04-16 20:34:31822if (!is_ios && !is_android) {
823 executable("crash_cache") {
Brett Wilson8f80ad0b2014-09-08 19:50:24824 testonly = true
scottmg34fb7e52014-12-03 23:27:24825 sources = [
826 "tools/crash_cache/crash_cache.cc",
827 ]
[email protected]8603c5de2014-04-16 20:34:31828 configs += [ ":net_win_size_truncation" ]
829 deps = [
830 ":net",
[email protected]b2b2bf52014-05-28 20:26:57831 ":test_support",
[email protected]8603c5de2014-04-16 20:34:31832 "//base",
833 ]
834 }
835
836 executable("crl_set_dump") {
Brett Wilson8f80ad0b2014-09-08 19:50:24837 testonly = true
scottmg34fb7e52014-12-03 23:27:24838 sources = [
839 "tools/crl_set_dump/crl_set_dump.cc",
840 ]
[email protected]8603c5de2014-04-16 20:34:31841 configs += [ ":net_win_size_truncation" ]
842 deps = [
843 ":net",
844 "//base",
845 ]
846 }
847
848 executable("dns_fuzz_stub") {
Brett Wilson8f80ad0b2014-09-08 19:50:24849 testonly = true
scottmg34fb7e52014-12-03 23:27:24850 sources = [
851 "tools/dns_fuzz_stub/dns_fuzz_stub.cc",
852 ]
[email protected]8603c5de2014-04-16 20:34:31853 configs += [ ":net_win_size_truncation" ]
854 deps = [
855 ":net",
856 "//base",
857 ]
858 }
859
860 executable("gdig") {
Brett Wilson8f80ad0b2014-09-08 19:50:24861 testonly = true
[email protected]8603c5de2014-04-16 20:34:31862 sources = [
863 "tools/gdig/file_net_log.cc",
864 "tools/gdig/gdig.cc",
865 ]
866 deps = [
867 ":net",
868 "//base",
869 ]
870 }
871
872 executable("get_server_time") {
Brett Wilson8f80ad0b2014-09-08 19:50:24873 testonly = true
scottmg34fb7e52014-12-03 23:27:24874 sources = [
875 "tools/get_server_time/get_server_time.cc",
876 ]
[email protected]8603c5de2014-04-16 20:34:31877 configs += [ ":net_win_size_truncation" ]
878 deps = [
879 ":net",
880 "//base",
881 "//base:i18n",
882 "//url",
883 ]
884 }
885
886 if (use_v8_in_net) {
887 executable("net_watcher") {
Brett Wilson8f80ad0b2014-09-08 19:50:24888 testonly = true
scottmg34fb7e52014-12-03 23:27:24889 sources = [
890 "tools/net_watcher/net_watcher.cc",
891 ]
[email protected]8603c5de2014-04-16 20:34:31892 deps = [
893 ":net",
894 ":net_with_v8",
895 "//base",
896 ]
897
mukai77f8210a2014-10-07 16:35:14898 if (is_desktop_linux) {
[email protected]22fe91d2014-08-12 17:07:12899 configs += [
900 "//build/config/linux:gconf",
901 "//build/config/linux:glib",
902 ]
[email protected]8603c5de2014-04-16 20:34:31903 deps += [ "//build/config/linux:gio" ]
904 }
905 }
906 }
907
908 executable("run_testserver") {
Brett Wilson8f80ad0b2014-09-08 19:50:24909 testonly = true
scottmg34fb7e52014-12-03 23:27:24910 sources = [
911 "tools/testserver/run_testserver.cc",
912 ]
[email protected]8603c5de2014-04-16 20:34:31913 deps = [
914 ":net", # TODO(brettw) bug 363749: this shouldn't be necessary. It's not
915 # in the GYP build, and can be removed when the bug is fixed.
[email protected]b2b2bf52014-05-28 20:26:57916 ":test_support",
[email protected]8603c5de2014-04-16 20:34:31917 "//base",
918 "//base/test:test_support",
919 "//testing/gtest",
920 ]
921 }
922
923 executable("stress_cache") {
Brett Wilson8f80ad0b2014-09-08 19:50:24924 testonly = true
scottmg34fb7e52014-12-03 23:27:24925 sources = [
926 "disk_cache/blockfile/stress_cache.cc",
927 ]
[email protected]8603c5de2014-04-16 20:34:31928 configs += [ ":net_win_size_truncation" ]
929 deps = [
930 ":net",
[email protected]b2b2bf52014-05-28 20:26:57931 ":test_support",
[email protected]8603c5de2014-04-16 20:34:31932 "//base",
933 ]
934 }
935
936 executable("tld_cleanup") {
scottmg34fb7e52014-12-03 23:27:24937 sources = [
938 "tools/tld_cleanup/tld_cleanup.cc",
939 ]
[email protected]8603c5de2014-04-16 20:34:31940 configs += [ ":net_win_size_truncation" ]
941 deps = [
942 "//base",
943 "//base:i18n",
944 "//net/tools/tld_cleanup",
945 ]
946 }
947}
948
949if (is_linux) {
[email protected]8a3f8242014-06-05 18:05:12950 static_library("epoll_server") {
[email protected]8603c5de2014-04-16 20:34:31951 sources = [
952 "tools/epoll_server/epoll_server.cc",
953 "tools/epoll_server/epoll_server.h",
954 ]
955 deps = [
956 ":net",
957 "//base",
958 ]
959 }
960
[email protected]8a3f8242014-06-05 18:05:12961 static_library("flip_in_mem_edsm_server_base") {
Brett Wilson8f80ad0b2014-09-08 19:50:24962 testonly = true
[email protected]8603c5de2014-04-16 20:34:31963 sources = [
964 "tools/dump_cache/url_to_filename_encoder.cc",
965 "tools/dump_cache/url_to_filename_encoder.h",
966 "tools/dump_cache/url_utilities.h",
967 "tools/dump_cache/url_utilities.cc",
968 "tools/flip_server/acceptor_thread.h",
969 "tools/flip_server/acceptor_thread.cc",
970 "tools/flip_server/create_listener.cc",
971 "tools/flip_server/create_listener.h",
972 "tools/flip_server/constants.h",
973 "tools/flip_server/flip_config.cc",
974 "tools/flip_server/flip_config.h",
975 "tools/flip_server/http_interface.cc",
976 "tools/flip_server/http_interface.h",
977 "tools/flip_server/loadtime_measurement.h",
978 "tools/flip_server/mem_cache.h",
979 "tools/flip_server/mem_cache.cc",
980 "tools/flip_server/output_ordering.cc",
981 "tools/flip_server/output_ordering.h",
982 "tools/flip_server/ring_buffer.cc",
983 "tools/flip_server/ring_buffer.h",
984 "tools/flip_server/sm_connection.cc",
985 "tools/flip_server/sm_connection.h",
986 "tools/flip_server/sm_interface.h",
987 "tools/flip_server/spdy_ssl.cc",
988 "tools/flip_server/spdy_ssl.h",
989 "tools/flip_server/spdy_interface.cc",
990 "tools/flip_server/spdy_interface.h",
991 "tools/flip_server/spdy_util.cc",
992 "tools/flip_server/spdy_util.h",
993 "tools/flip_server/streamer_interface.cc",
994 "tools/flip_server/streamer_interface.h",
995 ]
996 deps = [
997 ":balsa",
998 ":epoll_server",
999 ":net",
1000 "//base",
[email protected]edfd0f42014-07-22 18:20:371001 "//third_party/boringssl",
[email protected]8603c5de2014-04-16 20:34:311002 ]
1003 }
1004
1005 executable("flip_in_mem_edsm_server_unittests") {
Brett Wilson8f80ad0b2014-09-08 19:50:241006 testonly = true
[email protected]8603c5de2014-04-16 20:34:311007 sources = [
1008 "tools/flip_server/flip_test_utils.cc",
1009 "tools/flip_server/flip_test_utils.h",
1010 "tools/flip_server/http_interface_test.cc",
1011 "tools/flip_server/mem_cache_test.cc",
1012 "tools/flip_server/run_all_tests.cc",
1013 "tools/flip_server/spdy_interface_test.cc",
1014 ]
1015 deps = [
1016 ":flip_in_mem_edsm_server_base",
1017 ":net",
[email protected]b2b2bf52014-05-28 20:26:571018 ":test_support",
[email protected]8603c5de2014-04-16 20:34:311019 "//testing/gtest",
1020 "//testing/gmock",
[email protected]edfd0f42014-07-22 18:20:371021 "//third_party/boringssl",
[email protected]8603c5de2014-04-16 20:34:311022 ]
1023 }
1024
1025 executable("flip_in_mem_edsm_server") {
Brett Wilson8f80ad0b2014-09-08 19:50:241026 testonly = true
scottmg34fb7e52014-12-03 23:27:241027 sources = [
1028 "tools/flip_server/flip_in_mem_edsm_server.cc",
1029 ]
[email protected]8603c5de2014-04-16 20:34:311030 deps = [
1031 ":flip_in_mem_edsm_server_base",
1032 ":net",
1033 "//base",
1034 ]
1035 }
1036
1037 source_set("quic_base") {
1038 sources = [
1039 "tools/quic/quic_client.cc",
1040 "tools/quic/quic_client.h",
1041 "tools/quic/quic_client_session.cc",
1042 "tools/quic/quic_client_session.h",
1043 "tools/quic/quic_default_packet_writer.cc",
1044 "tools/quic/quic_default_packet_writer.h",
1045 "tools/quic/quic_dispatcher.h",
1046 "tools/quic/quic_dispatcher.cc",
1047 "tools/quic/quic_epoll_clock.cc",
1048 "tools/quic/quic_epoll_clock.h",
1049 "tools/quic/quic_epoll_connection_helper.cc",
1050 "tools/quic/quic_epoll_connection_helper.h",
1051 "tools/quic/quic_in_memory_cache.cc",
1052 "tools/quic/quic_in_memory_cache.h",
1053 "tools/quic/quic_packet_writer_wrapper.cc",
1054 "tools/quic/quic_packet_writer_wrapper.h",
[email protected]6d515822014-08-22 01:58:061055 "tools/quic/quic_per_connection_packet_writer.cc",
1056 "tools/quic/quic_per_connection_packet_writer.h",
[email protected]8603c5de2014-04-16 20:34:311057 "tools/quic/quic_server.cc",
1058 "tools/quic/quic_server.h",
1059 "tools/quic/quic_server_session.cc",
1060 "tools/quic/quic_server_session.h",
1061 "tools/quic/quic_socket_utils.cc",
1062 "tools/quic/quic_socket_utils.h",
1063 "tools/quic/quic_spdy_client_stream.cc",
1064 "tools/quic/quic_spdy_client_stream.h",
1065 "tools/quic/quic_spdy_server_stream.cc",
1066 "tools/quic/quic_spdy_server_stream.h",
1067 "tools/quic/quic_time_wait_list_manager.h",
1068 "tools/quic/quic_time_wait_list_manager.cc",
[email protected]8603c5de2014-04-16 20:34:311069 ]
1070 deps = [
1071 ":balsa",
1072 ":epoll_server",
1073 ":net",
1074 "//base",
1075 "//base/third_party/dynamic_annotations",
1076 "//crypto",
[email protected]edfd0f42014-07-22 18:20:371077 "//third_party/boringssl",
[email protected]8603c5de2014-04-16 20:34:311078 "//url",
1079 ]
1080 }
1081
1082 executable("quic_client") {
scottmg34fb7e52014-12-03 23:27:241083 sources = [
1084 "tools/quic/quic_client_bin.cc",
1085 ]
[email protected]8603c5de2014-04-16 20:34:311086 deps = [
1087 ":quic_base",
1088 ":net",
1089 "//base",
[email protected]edfd0f42014-07-22 18:20:371090 "//third_party/boringssl",
[email protected]8603c5de2014-04-16 20:34:311091 ]
1092 }
[email protected]8603c5de2014-04-16 20:34:311093}
1094
[email protected]ef0eb442014-05-15 09:32:181095if (is_android) {
1096 generate_jni("net_jni_headers") {
1097 sources = [
1098 "android/java/src/org/chromium/net/AndroidCertVerifyResult.java",
1099 "android/java/src/org/chromium/net/AndroidKeyStore.java",
1100 "android/java/src/org/chromium/net/AndroidNetworkLibrary.java",
1101 "android/java/src/org/chromium/net/AndroidPrivateKey.java",
1102 "android/java/src/org/chromium/net/GURLUtils.java",
1103 "android/java/src/org/chromium/net/NetworkChangeNotifier.java",
1104 "android/java/src/org/chromium/net/ProxyChangeListener.java",
1105 "android/java/src/org/chromium/net/X509Util.java",
1106 ]
1107 jni_package = "net"
1108 }
cjhopmandad5f4272014-09-05 01:00:551109 generate_jni("net_test_jni_headers") {
1110 sources = [
1111 "android/javatests/src/org/chromium/net/AndroidKeyStoreTestUtil.java",
1112 ]
1113 jni_package = "net"
1114 }
[email protected]ef0eb442014-05-15 09:32:181115}
[email protected]8603c5de2014-04-16 20:34:311116
1117if (is_android || is_linux) {
1118 executable("disk_cache_memory_test") {
Brett Wilson8f80ad0b2014-09-08 19:50:241119 testonly = true
scottmg34fb7e52014-12-03 23:27:241120 sources = [
1121 "tools/disk_cache_memory_test/disk_cache_memory_test.cc",
1122 ]
[email protected]8603c5de2014-04-16 20:34:311123 deps = [
1124 ":net",
1125 "//base",
1126 ]
1127 }
1128}
[email protected]8a3f8242014-06-05 18:05:121129
1130# TODO(GYP) make this compile on Android, we need some native test deps done.
[email protected]bd82a57d2014-07-31 16:52:341131# TODO(GYP) Also doesn't work on Windows; dependency on boringssl is wrong.
dprankecf8465db72014-11-10 23:51:221132# TODO(GYP) Also doesn't work on Mac, need to figure out why not.
1133if (!is_android && !is_win && !is_mac) {
scottmg34fb7e52014-12-03 23:27:241134 source_set("quic_tools") {
1135 sources = [
1136 "quic/quic_dispatcher.cc",
1137 "quic/quic_dispatcher.h",
1138 "quic/quic_in_memory_cache.cc",
1139 "quic/quic_in_memory_cache.h",
1140 "quic/quic_per_connection_packet_writer.cc",
1141 "quic/quic_per_connection_packet_writer.h",
1142 "quic/quic_server.cc",
1143 "quic/quic_server.h",
1144 "quic/quic_server_packet_writer.cc",
1145 "quic/quic_server_packet_writer.h",
1146 "quic/quic_server_session.cc",
1147 "quic/quic_server_session.h",
1148 "quic/quic_spdy_server_stream.cc",
1149 "quic/quic_spdy_server_stream.h",
1150 "quic/quic_time_wait_list_manager.cc",
1151 "quic/quic_time_wait_list_manager.h",
1152 ]
1153 deps = [
1154 ":net",
1155 "//base",
1156 "//base/third_party/dynamic_annotations",
1157 "//url",
[email protected]8a3f8242014-06-05 18:05:121158 ]
1159 }
1160
scottmg34fb7e52014-12-03 23:27:241161 test("net_unittests") {
1162 sources = gypi_values.net_test_sources
erikchen006a7cf2014-12-03 22:27:111163
scottmg34fb7e52014-12-03 23:27:241164 configs += [ ":net_win_size_truncation" ]
1165 defines = []
[email protected]8a3f8242014-06-05 18:05:121166
scottmg34fb7e52014-12-03 23:27:241167 deps = [
1168 ":extras",
1169 ":http_server",
1170 ":net",
1171 ":quic_tools",
1172 ":test_support",
1173 "//base",
1174 "//base:i18n",
1175 "//base:prefs_test_support",
1176 "//base/allocator",
1177 "//base/third_party/dynamic_annotations",
1178 "//crypto",
1179 "//crypto:platform",
1180 "//crypto:test_support",
1181 "//net/base/registry_controlled_domains",
1182 "//testing/gmock",
1183 "//testing/gtest",
1184 "//third_party/zlib",
1185 "//url",
[email protected]8a3f8242014-06-05 18:05:121186 ]
[email protected]8a3f8242014-06-05 18:05:121187
scottmg34fb7e52014-12-03 23:27:241188 if (is_linux) {
1189 sources += gypi_values.net_linux_test_sources
1190 deps += [
1191 ":balsa",
1192 ":epoll_server",
1193 ":flip_in_mem_edsm_server_base",
1194 ":quic_base",
[email protected]b2f44d12014-06-10 17:48:031195 ]
1196 }
[email protected]8a3f8242014-06-05 18:05:121197
scottmg34fb7e52014-12-03 23:27:241198 if (is_mac || is_ios) {
1199 sources += gypi_values.net_base_test_mac_ios_sources
1200 }
1201
brettwc859f18f2014-09-18 23:34:501202 if (is_chromeos) {
scottmg34fb7e52014-12-03 23:27:241203 sources -= [ "proxy/proxy_config_service_linux_unittest.cc" ]
1204 }
1205
1206 if (is_android) {
brettwc859f18f2014-09-18 23:34:501207 sources -= [
scottmg34fb7e52014-12-03 23:27:241208 # See bug http://crbug.com/344533.
1209 "disk_cache/blockfile/index_table_v3_unittest.cc",
1210
1211 # No res_ninit() et al on Android, so this doesn't make a lot of
1212 # sense.
1213 "dns/dns_config_service_posix_unittest.cc",
1214 ]
1215 deps += [
1216 ":net_javatests", # FIXME(brettw)
1217 ":net_test_jni_headers",
brettwc859f18f2014-09-18 23:34:501218 ]
1219 }
scottmg34fb7e52014-12-03 23:27:241220
rmcilroy5837d332014-12-17 14:30:581221 if (v8_use_external_startup_data) {
1222 deps += [ "//gin" ]
1223 }
1224
scottmg34fb7e52014-12-03 23:27:241225 if (!use_nss_certs) {
1226 sources -= [ "ssl/client_cert_store_nss_unittest.cc" ]
1227 if (is_chromeos) { # Already removed for all non-ChromeOS builds.
1228 sources -= [ "ssl/client_cert_store_chromeos_unittest.cc" ]
1229 }
1230 }
1231
1232 if (use_openssl) {
1233 # When building for OpenSSL, we need to exclude NSS specific tests
1234 # or functionality not supported by OpenSSL yet.
1235 # TODO(bulach): Add equivalent tests when the underlying
1236 # functionality is ported to OpenSSL.
1237 sources -= [
1238 "cert/nss_cert_database_unittest.cc",
1239 "cert/x509_util_nss_unittest.cc",
1240 "quic/test_tools/crypto_test_utils_nss.cc",
1241 ]
1242 if (is_chromeos) {
1243 # These were already removed in the non-ChromeOS case.
1244 sources -= [
1245 "cert/nss_cert_database_chromeos_unittest.cc",
1246 "cert/nss_profile_filter_chromeos_unittest.cc",
1247 ]
1248 }
1249 } else {
1250 sources -= [
1251 "cert/x509_util_openssl_unittest.cc",
1252 "quic/test_tools/crypto_test_utils_openssl.cc",
1253 "socket/ssl_client_socket_openssl_unittest.cc",
1254 "socket/ssl_session_cache_openssl_unittest.cc",
1255 ]
1256 if (!is_desktop_linux && !is_chromeos) {
1257 sources -= [ "cert/nss_cert_database_unittest.cc" ]
1258 }
1259 }
1260
1261 if (use_kerberos) {
1262 defines += [ "USE_KERBEROS" ]
1263 } else {
1264 sources -= [
1265 "http/http_auth_gssapi_posix_unittest.cc",
1266 "http/http_auth_handler_negotiate_unittest.cc",
1267 "http/mock_gssapi_library_posix.cc",
1268 "http/mock_gssapi_library_posix.h",
1269 ]
1270 }
1271
1272 if (use_openssl || (!is_desktop_linux && !is_chromeos && !is_ios)) {
1273 # Only include this test when on Posix and using NSS for
1274 # cert verification or on iOS (which also uses NSS for certs).
1275 sources -= [ "ocsp/nss_ocsp_unittest.cc" ]
1276 }
1277
1278 if (!use_openssl_certs) {
1279 sources -= [ "ssl/openssl_client_key_store_unittest.cc" ]
1280 }
1281
1282 if (!enable_websockets) {
1283 sources -= [
dgozmana6e70092014-12-12 14:46:211284 "server/http_connection_unittest.cc",
1285 "server/http_server_response_info_unittest.cc",
1286 "server/http_server_unittest.cc",
1287 "server/web_socket_encoder_unittest.cc",
scottmg34fb7e52014-12-03 23:27:241288 "websockets/websocket_basic_stream_test.cc",
1289 "websockets/websocket_channel_test.cc",
1290 "websockets/websocket_deflate_predictor_impl_test.cc",
1291 "websockets/websocket_deflate_stream_test.cc",
1292 "websockets/websocket_deflater_test.cc",
1293 "websockets/websocket_errors_test.cc",
ricea433bdab2015-01-26 07:25:371294 "websockets/websocket_end_to_end_test.cc",
scottmg34fb7e52014-12-03 23:27:241295 "websockets/websocket_extension_parser_test.cc",
1296 "websockets/websocket_frame_parser_test.cc",
1297 "websockets/websocket_frame_test.cc",
1298 "websockets/websocket_handshake_challenge_test.cc",
1299 "websockets/websocket_handshake_stream_create_helper_test.cc",
1300 "websockets/websocket_inflater_test.cc",
1301 "websockets/websocket_stream_test.cc",
1302 "websockets/websocket_test_util.cc",
1303 "websockets/websocket_test_util.h",
1304 ]
dgozmana6e70092014-12-12 14:46:211305 deps -= [ ":http_server" ]
scottmg34fb7e52014-12-03 23:27:241306 }
1307
1308 if (disable_file_support) {
1309 sources -= [
1310 "base/directory_lister_unittest.cc",
1311 "url_request/url_request_file_job_unittest.cc",
1312 ]
1313 }
1314
1315 if (disable_ftp_support) {
1316 sources -= [
1317 "ftp/ftp_auth_cache_unittest.cc",
1318 "ftp/ftp_ctrl_response_buffer_unittest.cc",
1319 "ftp/ftp_directory_listing_parser_ls_unittest.cc",
1320 "ftp/ftp_directory_listing_parser_netware_unittest.cc",
1321 "ftp/ftp_directory_listing_parser_os2_unittest.cc",
1322 "ftp/ftp_directory_listing_parser_unittest.cc",
1323 "ftp/ftp_directory_listing_parser_unittest.h",
1324 "ftp/ftp_directory_listing_parser_vms_unittest.cc",
1325 "ftp/ftp_directory_listing_parser_windows_unittest.cc",
1326 "ftp/ftp_network_transaction_unittest.cc",
1327 "ftp/ftp_util_unittest.cc",
1328 "url_request/url_request_ftp_job_unittest.cc",
1329 ]
1330 }
1331
1332 if (!enable_built_in_dns) {
1333 sources -= [
1334 "dns/address_sorter_posix_unittest.cc",
1335 "dns/address_sorter_unittest.cc",
1336 ]
1337 }
1338
1339 # Always need use_v8_in_net to be 1 to run on Android, so just remove
1340 # net_unittest's dependency on v8 when using icu alternatives instead of
1341 # setting use_v8_in_net to 0.
1342 if (use_v8_in_net && !use_icu_alternatives_on_android) {
1343 deps += [ ":net_with_v8" ]
1344 } else {
1345 sources -= [
1346 "proxy/proxy_resolver_v8_unittest.cc",
1347 "proxy/proxy_resolver_v8_tracing_unittest.cc",
1348 ]
1349 }
1350
amistry7e6ebfdc82015-02-13 04:19:111351 if (use_v8_in_net && !is_android) {
1352 deps += [
1353 ":net_browser_services",
1354 "//mojo/environment:chromium",
1355 "//third_party/mojo/src/mojo/edk/system",
1356 ]
1357 } else {
1358 sources -= [ "dns/mojo_host_resolver_impl_unittest.cc" ]
1359 }
1360
scottmg34fb7e52014-12-03 23:27:241361 if (!enable_mdns) {
1362 sources -= [
1363 "dns/mdns_cache_unittest.cc",
1364 "dns/mdns_client_unittest.cc",
1365 "dns/record_parsed_unittest.cc",
1366 "dns/record_rdata_unittest.cc",
1367 ]
1368 }
1369
1370 if (is_ios) {
1371 # TODO(GYP)
1372 # 'actions': [
1373 # {
1374 # 'action_name': 'copy_test_data',
1375 # 'variables': {
1376 # 'test_data_files': [
1377 # 'data/ssl/certificates/',
1378 # 'data/test.html',
1379 # 'data/url_request_unittest/',
1380 # ],
1381 # 'test_data_prefix': 'net',
1382 # },
1383 # 'includes': [ '../build/copy_test_data_ios.gypi' ],
1384 # },
1385 # ],
1386 sources -= [
1387 # TODO(droger): The following tests are disabled because the
1388 # implementation is missing or incomplete.
1389 # KeygenHandler::GenKeyAndSignChallenge() is not ported to iOS.
1390 "base/keygen_handler_unittest.cc",
1391 "disk_cache/backend_unittest.cc",
1392 "disk_cache/blockfile/block_files_unittest.cc",
1393
1394 # Need to read input data files.
1395 "filter/gzip_filter_unittest.cc",
1396 "socket/ssl_server_socket_unittest.cc",
1397 "spdy/fuzzing/hpack_fuzz_util_test.cc",
1398
1399 # Need TestServer.
1400 "proxy/proxy_script_fetcher_impl_unittest.cc",
1401 "socket/ssl_client_socket_unittest.cc",
1402 "url_request/url_fetcher_impl_unittest.cc",
1403 "url_request/url_request_context_builder_unittest.cc",
1404
1405 # Needs GetAppOutput().
1406 "test/python_utils_unittest.cc",
1407
1408 # The following tests are disabled because they don't apply to
1409 # iOS.
1410 # OS is not "linux" or "freebsd" or "openbsd".
1411 "socket/unix_domain_client_socket_posix_unittest.cc",
1412 "socket/unix_domain_listen_socket_posix_unittest.cc",
1413 "socket/unix_domain_server_socket_posix_unittest.cc",
1414
1415 # See bug http://crbug.com/344533.
1416 "disk_cache/blockfile/index_table_v3_unittest.cc",
1417 ]
1418 }
1419
1420 if (is_android) {
1421 sources -= [ "dns/dns_config_service_posix_unittest.cc" ]
1422
1423 # TODO(GYP)
1424 # # TODO(mmenke): This depends on test_support_base, which depends on
1425 # # icu. Figure out a way to remove that dependency.
1426 # 'dependencies': [
1427 # '../testing/android/native_test.gyp:native_test_native_code',
1428 # ]
1429
1430 set_sources_assignment_filter([])
1431 sources += [ "base/address_tracker_linux_unittest.cc" ]
1432 set_sources_assignment_filter(sources_assignment_filter)
1433 }
1434
1435 if (use_icu_alternatives_on_android) {
1436 sources -= [
1437 "base/filename_util_unittest.cc",
1438 "base/net_util_icu_unittest.cc",
1439 ]
1440 deps -= [ "//base:i18n" ]
[email protected]8a3f8242014-06-05 18:05:121441 }
1442 }
1443
scottmg34fb7e52014-12-03 23:27:241444 executable("quic_server") {
1445 sources = [
1446 "quic/quic_server_bin.cc",
1447 ]
1448 deps = [
1449 ":quic_tools",
1450 ":net",
1451 "//base",
1452 "//third_party/boringssl",
[email protected]8a3f8242014-06-05 18:05:121453 ]
1454 }
dprankecf8465db72014-11-10 23:51:221455} # !is_android && !is_win && !is_mac