blob: 53c1ed990a0dae8f7a989325fda61dcb6b781439 [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")
[email protected]8a3f8242014-06-05 18:05:128import("//url/config.gni")
[email protected]4625ade2014-04-15 19:26:449
[email protected]26046b52014-07-16 00:11:0310# TODO(cjhopman): //build/config/android/rules.gni also imports grit_rule.gni.
11# Currently, that file can't be imported multiple times. Make this always
12# imported when http://crbug.com/393704 is fixed.
13if (!is_android) {
14 import("//tools/grit/grit_rule.gni")
15}
16
[email protected]4625ade2014-04-15 19:26:4417if (is_android) {
18 import("//build/config/android/config.gni")
[email protected]ef0eb442014-05-15 09:32:1819 import("//build/config/android/rules.gni")
[email protected]4625ade2014-04-15 19:26:4420} else if (is_mac) {
21 import("//build/config/mac/mac_sdk.gni")
22}
23
24# The list of net files is kept in net.gypi. Read it.
25gypi_values = exec_script(
26 "//build/gypi_to_gn.py",
[email protected]c7d9b352014-04-29 22:18:0427 [ rebase_path("net.gypi") ],
[email protected]4625ade2014-04-15 19:26:4428 "scope",
29 [ "net.gypi" ])
30
31# Disable Kerberos on ChromeOS, Android and iOS, at least for now. It needs
32# configuration (krb5.conf and so on).
33use_kerberos = !is_chromeos && !is_android && !is_ios
34
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.
40posix_avoid_mmap = is_android && cpu_arch != "x86"
41
42# WebSockets and socket stream code are used everywhere except iOS.
43enable_websockets = !is_ios
[email protected]8a3f8242014-06-05 18:05:1244use_v8_in_net = !is_ios
[email protected]4625ade2014-04-15 19:26:4445enable_built_in_dns = !is_ios
[email protected]8a3f8242014-06-05 18:05:1246disable_ftp_support = is_ios
[email protected]4625ade2014-04-15 19:26:4447
[email protected]384dab92014-06-04 20:26:0848declare_args() {
49 # Disables support for file URLs. File URL support requires use of icu.
50 disable_file_support = false
51}
[email protected]02494ec2014-05-07 15:05:2952
[email protected]4625ade2014-04-15 19:26:4453config("net_config") {
54 defines = []
55 if (posix_avoid_mmap) {
56 defines += [ "POSIX_AVOID_MMAP" ]
57 }
[email protected]02494ec2014-05-07 15:05:2958 if (disable_file_support) {
59 defines += [ "DISABLE_FILE_SUPPORT" ]
60 }
[email protected]4625ade2014-04-15 19:26:4461}
62
[email protected]8603c5de2014-04-16 20:34:3163# Disables Windows warning about size to int truncations.
64# TODO(jschuh): crbug.com/167187 fix this and delete this config.
65config("net_win_size_truncation") {
66 if (is_win) {
[email protected]d980fd112014-04-22 04:42:1367 cflags = [ "/wd4267" ]
[email protected]8603c5de2014-04-16 20:34:3168 }
69}
70
[email protected]4625ade2014-04-15 19:26:4471component("net") {
72 sources =
73 gypi_values.net_nacl_common_sources +
74 gypi_values.net_non_nacl_sources
75
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",
84 "NET_IMPLEMENTATION"
85 ]
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",
92 "//crypto:platform"
93 ]
[email protected]4625ade2014-04-15 19:26:4494 deps = [
[email protected]d7f04492014-05-13 07:01:3495 ":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) {
253 sources -= [
254 "cert/cert/sha256_legacy_support_nss_win.cc",
255 ]
256 }
[email protected]4625ade2014-04-15 19:26:44257 } else {
258 sources -= [
259 "base/crypto_module_openssl.cc",
[email protected]4625ade2014-04-15 19:26:44260 "cert/ct_log_verifier_openssl.cc",
261 "cert/ct_objects_extractor_openssl.cc",
262 "cert/jwk_serializer_openssl.cc",
263 "cert/x509_util_openssl.cc",
264 "cert/x509_util_openssl.h",
265 "quic/crypto/aead_base_decrypter_openssl.cc",
266 "quic/crypto/aead_base_encrypter_openssl.cc",
267 "quic/crypto/aes_128_gcm_12_decrypter_openssl.cc",
268 "quic/crypto/aes_128_gcm_12_encrypter_openssl.cc",
269 "quic/crypto/chacha20_poly1305_decrypter_openssl.cc",
270 "quic/crypto/chacha20_poly1305_encrypter_openssl.cc",
271 "quic/crypto/channel_id_openssl.cc",
272 "quic/crypto/p256_key_exchange_openssl.cc",
273 "quic/crypto/scoped_evp_aead_ctx.cc",
274 "quic/crypto/scoped_evp_aead_ctx.h",
275 "socket/ssl_client_socket_openssl.cc",
276 "socket/ssl_client_socket_openssl.h",
277 "socket/ssl_server_socket_openssl.cc",
[email protected]c8a80e92014-05-17 16:02:08278 "socket/ssl_server_socket_openssl.h",
[email protected]4625ade2014-04-15 19:26:44279 "socket/ssl_session_cache_openssl.cc",
280 "socket/ssl_session_cache_openssl.h",
[email protected]97a854f2014-07-29 07:51:36281 "ssl/openssl_platform_key.h",
282 "ssl/openssl_ssl_util.cc",
283 "ssl/openssl_ssl_util.h",
[email protected]4625ade2014-04-15 19:26:44284 ]
[email protected]97a854f2014-07-29 07:51:36285 if (is_mac) {
286 sources -= [
287 "ssl/openssl_platform_key_mac.cc",
288 ]
289 }
290 if (is_win) {
291 sources -= [
John Abd-El-Malek494329e2014-11-05 19:06:30292 "cert/sha256_legacy_support_openssl_win.cc",
[email protected]97a854f2014-07-29 07:51:36293 "ssl/openssl_platform_key_win.cc",
294 ]
295 }
[email protected]4625ade2014-04-15 19:26:44296 }
297
298 if (!use_openssl_certs) {
299 sources -= [
isherman7e5de442014-09-25 23:00:18300 "base/keygen_handler_openssl.cc",
[email protected]4625ade2014-04-15 19:26:44301 "base/openssl_private_key_store.h",
302 "base/openssl_private_key_store_memory.cc",
303 "cert/cert_database_openssl.cc",
304 "cert/cert_verify_proc_openssl.cc",
305 "cert/cert_verify_proc_openssl.h",
306 "cert/test_root_certs_openssl.cc",
307 "cert/x509_certificate_openssl.cc",
308 "ssl/openssl_client_key_store.cc",
309 "ssl/openssl_client_key_store.h",
310 ]
311 if (is_android) {
312 sources -= [
313 "base/openssl_private_key_store_android.cc",
314 ]
315 }
[email protected]1ea01752014-05-23 19:01:46316 } else if (is_android) {
317 # Android doesn't use these even when using OpenSSL.
318 sources -= [
319 "base/openssl_private_key_store_memory.cc",
320 "cert/cert_database_openssl.cc",
321 "cert/cert_verify_proc_openssl.cc",
322 "cert/test_root_certs_openssl.cc",
323 ]
[email protected]4625ade2014-04-15 19:26:44324 }
325
mukai77f8210a2014-10-07 16:35:14326 if (use_glib && !is_chromeos) {
[email protected]4625ade2014-04-15 19:26:44327 configs += [ "//build/config/linux:gconf" ]
328 deps += [ "//build/config/linux:gio" ]
329 }
330
331 if (is_linux) {
332 configs += [ "//build/config/linux:libresolv" ]
333 } else {
334 sources -= [
335 "base/crypto_module_nss.cc",
336 "base/keygen_handler_nss.cc",
337 "cert/cert_database_nss.cc",
338 "cert/nss_cert_database.cc",
339 "cert/nss_cert_database.h",
[email protected]4625ade2014-04-15 19:26:44340 "cert/x509_certificate_nss.cc",
[email protected]4625ade2014-04-15 19:26:44341 "third_party/mozilla_security_manager/nsKeygenHandler.cpp",
342 "third_party/mozilla_security_manager/nsKeygenHandler.h",
343 "third_party/mozilla_security_manager/nsNSSCertificateDB.cpp",
344 "third_party/mozilla_security_manager/nsNSSCertificateDB.h",
345 "third_party/mozilla_security_manager/nsPKCS12Blob.cpp",
346 "third_party/mozilla_security_manager/nsPKCS12Blob.h",
347 ]
[email protected]e8ab6912014-04-21 20:54:51348
mukai77f8210a2014-10-07 16:35:14349 if (!is_ios && !use_openssl) {
[email protected]e8ab6912014-04-21 20:54:51350 # These files are part of the partial implementation of NSS on iOS so
351 # keep them in that case.
352 sources -= [
353 "cert/test_root_certs_nss.cc",
354 "ocsp/nss_ocsp.cc",
355 "ocsp/nss_ocsp.h",
356 ]
357 }
[email protected]4625ade2014-04-15 19:26:44358 }
359
[email protected]e8ab6912014-04-21 20:54:51360 if (!use_nss_certs) {
[email protected]4625ade2014-04-15 19:26:44361 sources -= [
[email protected]4625ade2014-04-15 19:26:44362 "ssl/client_cert_store_nss.cc",
363 "ssl/client_cert_store_nss.h",
364 ]
[email protected]e8ab6912014-04-21 20:54:51365 if (!is_ios) {
366 # These files are part of the partial implementation of NSS on iOS so
367 # keep them in that case (even though use_nss_certs is not set).
368 sources -= [
369 "cert/cert_verify_proc_nss.cc",
370 "cert/cert_verify_proc_nss.h",
371 ]
372 }
[email protected]4625ade2014-04-15 19:26:44373 if (is_chromeos) {
374 # These were already removed on non-ChromeOS.
375 sources -= [
376 "ssl/client_cert_store_chromeos.cc",
377 "ssl/client_cert_store_chromeos.h",
378 ]
379 }
380 }
381
382 if (!enable_websockets) {
383 sources -= [
[email protected]4625ade2014-04-15 19:26:44384 "websockets/websocket_basic_handshake_stream.cc",
385 "websockets/websocket_basic_handshake_stream.h",
386 "websockets/websocket_basic_stream.cc",
387 "websockets/websocket_basic_stream.h",
388 "websockets/websocket_channel.cc",
389 "websockets/websocket_channel.h",
390 "websockets/websocket_deflate_predictor.h",
391 "websockets/websocket_deflate_predictor_impl.cc",
392 "websockets/websocket_deflate_predictor_impl.h",
393 "websockets/websocket_deflate_stream.cc",
394 "websockets/websocket_deflate_stream.h",
395 "websockets/websocket_deflater.cc",
396 "websockets/websocket_deflater.h",
397 "websockets/websocket_errors.cc",
398 "websockets/websocket_errors.h",
399 "websockets/websocket_extension.cc",
400 "websockets/websocket_extension.h",
401 "websockets/websocket_extension_parser.cc",
402 "websockets/websocket_extension_parser.h",
403 "websockets/websocket_frame.cc",
404 "websockets/websocket_frame.h",
405 "websockets/websocket_frame_parser.cc",
406 "websockets/websocket_frame_parser.h",
407 "websockets/websocket_handshake_constants.cc",
408 "websockets/websocket_handshake_constants.h",
409 "websockets/websocket_handshake_handler.cc",
410 "websockets/websocket_handshake_handler.h",
411 "websockets/websocket_handshake_request_info.cc",
412 "websockets/websocket_handshake_request_info.h",
413 "websockets/websocket_handshake_response_info.cc",
414 "websockets/websocket_handshake_response_info.h",
415 "websockets/websocket_handshake_stream_base.h",
416 "websockets/websocket_handshake_stream_create_helper.cc",
417 "websockets/websocket_handshake_stream_create_helper.h",
418 "websockets/websocket_inflater.cc",
419 "websockets/websocket_inflater.h",
[email protected]4625ade2014-04-15 19:26:44420 "websockets/websocket_mux.h",
[email protected]4625ade2014-04-15 19:26:44421 "websockets/websocket_stream.cc",
422 "websockets/websocket_stream.h",
[email protected]4625ade2014-04-15 19:26:44423 ]
424 }
425
426 if (!enable_mdns) {
427 sources -= [
428 "dns/mdns_cache.cc",
429 "dns/mdns_cache.h",
430 "dns/mdns_client.cc",
431 "dns/mdns_client.h",
432 "dns/mdns_client_impl.cc",
433 "dns/mdns_client_impl.h",
434 "dns/record_parsed.cc",
435 "dns/record_parsed.h",
436 "dns/record_rdata.cc",
437 "dns/record_rdata.h",
438 ]
439 }
440
441 if (is_win) {
442 sources -= [
443 "http/http_auth_handler_ntlm_portable.cc",
[email protected]2ef2b0e2014-07-09 21:12:34444 "socket/socket_libevent.cc",
445 "socket/socket_libevent.h",
[email protected]4625ade2014-04-15 19:26:44446 "socket/tcp_socket_libevent.cc",
447 "socket/tcp_socket_libevent.h",
448 "udp/udp_socket_libevent.cc",
449 "udp/udp_socket_libevent.h",
450 ]
[email protected]4625ade2014-04-15 19:26:44451 } else { # !is_win
452 sources -= [
453 "base/winsock_init.cc",
454 "base/winsock_init.h",
455 "base/winsock_util.cc",
456 "base/winsock_util.h",
457 "proxy/proxy_resolver_winhttp.cc",
458 "proxy/proxy_resolver_winhttp.h",
459 ]
460 }
461
462 if (is_mac) {
[email protected]4625ade2014-04-15 19:26:44463 libs = [
[email protected]ab9ce6e2014-04-17 20:33:19464 "Foundation.framework",
465 "Security.framework",
466 "SystemConfiguration.framework",
467 "resolv",
[email protected]4625ade2014-04-15 19:26:44468 ]
469 }
470
471 if (is_ios) {
[email protected]b2b2bf52014-05-28 20:26:57472 # Add back some sources that were otherwise filtered out. iOS additionally
473 # doesn't set USE_NSS but needs some of the files.
474 set_sources_assignment_filter([])
475 sources += [
guoweis7eb7ab52014-11-14 17:42:56476 "base/net_util_mac.cc",
477 "base/net_util_mac.h",
[email protected]b2b2bf52014-05-28 20:26:57478 "base/network_change_notifier_mac.cc",
479 "base/network_config_watcher_mac.cc",
480 "base/platform_mime_util_mac.mm",
481 "cert/cert_verify_proc_nss.cc",
482 "cert/cert_verify_proc_nss.h",
483 "cert/test_root_certs_nss.cc",
484 "cert/x509_util_nss.cc",
485 "cert/x509_util_nss.h",
486 "proxy/proxy_resolver_mac.cc",
487 "proxy/proxy_server_mac.cc",
488 "ocsp/nss_ocsp.cc",
489 "ocsp/nss_ocsp.h",
490 ]
491 set_sources_assignment_filter(sources_assignment_filter)
492
[email protected]4625ade2014-04-15 19:26:44493 sources -= [ "disk_cache/blockfile/file_posix.cc" ]
[email protected]4625ade2014-04-15 19:26:44494 libs = [
[email protected]ab9ce6e2014-04-17 20:33:19495 "CFNetwork.framework",
496 "MobileCoreServices.framework",
497 "Security.framework",
498 "SystemConfiguration.framework",
499 "resolv",
[email protected]4625ade2014-04-15 19:26:44500 ]
501 }
502
503 if (is_android) {
[email protected]b2b2bf52014-05-28 20:26:57504 # Add some Linux sources that were excluded by the filter, but which
505 # are needed.
506 set_sources_assignment_filter([])
507 sources += [
508 "base/platform_mime_util_linux.cc",
509 "base/address_tracker_linux.cc",
510 "base/address_tracker_linux.h",
guoweis7eb7ab52014-11-14 17:42:56511 "base/net_util_linux.cc",
512 "base/net_util_linux.h"
[email protected]b2b2bf52014-05-28 20:26:57513 ]
514 set_sources_assignment_filter(sources_assignment_filter)
515
[email protected]4625ade2014-04-15 19:26:44516 if (!is_android_webview_build) {
[email protected]4625ade2014-04-15 19:26:44517 deps += [ ":net_jni_headers" ]
[email protected]4625ade2014-04-15 19:26:44518 }
519 }
[email protected]ad66db12014-07-10 12:43:47520
[email protected]85191ed2014-05-15 00:41:49521 if (use_icu_alternatives_on_android) {
522 deps -= [
523 "//base:i18n",
524 "//third_party/icu",
525 ]
526 sources -= [
527 "base/filename_util_icu.cc",
528 "base/net_string_util_icu.cc",
529 "base/net_util_icu.cc",
530 ]
531 sources += [
532 "base/net_string_util_icu_alternatives_android.cc",
533 "base/net_string_util_icu_alternatives_android.h",
534 ]
535 }
[email protected]4625ade2014-04-15 19:26:44536}
537
538grit("net_resources") {
539 source = "base/net_resources.grd"
[email protected]7ae52902014-08-18 22:36:01540 use_qualified_include = true
[email protected]b89c53842014-07-23 16:32:32541 outputs = [
542 "grit/net_resources.h",
543 "net_resources.pak",
544 "net_resources.rc",
545 ]
[email protected]4625ade2014-04-15 19:26:44546}
547
Brett Wilson83fd4242014-09-02 19:45:33548static_library("extras") {
mef327a8e42014-08-29 17:10:03549 sources = gypi_values.net_extras_sources
550 configs += [ "//build/config/compiler:wexit_time_destructors" ]
551 deps = [
552 ":net",
553 "//sql:sql",
554 ]
555}
556
[email protected]8a3f8242014-06-05 18:05:12557static_library("http_server") {
[email protected]4625ade2014-04-15 19:26:44558 sources = [
559 "server/http_connection.cc",
560 "server/http_connection.h",
561 "server/http_server.cc",
562 "server/http_server.h",
563 "server/http_server_request_info.cc",
564 "server/http_server_request_info.h",
565 "server/http_server_response_info.cc",
566 "server/http_server_response_info.h",
567 "server/web_socket.cc",
568 "server/web_socket.h",
569 ]
570 configs += [ "//build/config/compiler:wexit_time_destructors" ]
571 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 = [
580 "tools/dump_cache/cache_dumper.cc",
581 "tools/dump_cache/cache_dumper.h",
582 "tools/dump_cache/dump_cache.cc",
583 "tools/dump_cache/dump_files.cc",
584 "tools/dump_cache/dump_files.h",
585 "tools/dump_cache/simple_cache_dumper.cc",
586 "tools/dump_cache/simple_cache_dumper.h",
[email protected]8603c5de2014-04-16 20:34:31587 "tools/dump_cache/url_to_filename_encoder.cc",
588 "tools/dump_cache/url_to_filename_encoder.h",
589 "tools/dump_cache/url_utilities.h",
590 "tools/dump_cache/url_utilities.cc",
591 ]
[email protected]4625ade2014-04-15 19:26:44592
[email protected]8603c5de2014-04-16 20:34:31593 configs += [ ":net_win_size_truncation" ]
594
595 deps = [
596 "//base",
597 ":net",
[email protected]b2b2bf52014-05-28 20:26:57598 ":test_support",
[email protected]8603c5de2014-04-16 20:34:31599 ]
600}
601
[email protected]b2b2bf52014-05-28 20:26:57602source_set("test_support") {
Brett Wilson8f80ad0b2014-09-08 19:50:24603 testonly = true
[email protected]8603c5de2014-04-16 20:34:31604 sources = [
605 "base/capturing_net_log.cc",
606 "base/capturing_net_log.h",
607 "base/load_timing_info_test_util.cc",
608 "base/load_timing_info_test_util.h",
609 "base/mock_file_stream.cc",
610 "base/mock_file_stream.h",
611 "base/test_completion_callback.cc",
612 "base/test_completion_callback.h",
613 "base/test_data_directory.cc",
614 "base/test_data_directory.h",
615 "cert/mock_cert_verifier.cc",
616 "cert/mock_cert_verifier.h",
617 "cookies/cookie_monster_store_test.cc",
618 "cookies/cookie_monster_store_test.h",
619 "cookies/cookie_store_test_callbacks.cc",
620 "cookies/cookie_store_test_callbacks.h",
621 "cookies/cookie_store_test_helpers.cc",
622 "cookies/cookie_store_test_helpers.h",
623 "disk_cache/disk_cache_test_base.cc",
624 "disk_cache/disk_cache_test_base.h",
625 "disk_cache/disk_cache_test_util.cc",
626 "disk_cache/disk_cache_test_util.h",
627 "dns/dns_test_util.cc",
628 "dns/dns_test_util.h",
629 "dns/mock_host_resolver.cc",
630 "dns/mock_host_resolver.h",
631 "dns/mock_mdns_socket_factory.cc",
632 "dns/mock_mdns_socket_factory.h",
[email protected]8a3f8242014-06-05 18:05:12633 "http/http_transaction_test_util.cc",
634 "http/http_transaction_test_util.h",
[email protected]8603c5de2014-04-16 20:34:31635 "proxy/mock_proxy_resolver.cc",
636 "proxy/mock_proxy_resolver.h",
637 "proxy/mock_proxy_script_fetcher.cc",
638 "proxy/mock_proxy_script_fetcher.h",
639 "proxy/proxy_config_service_common_unittest.cc",
640 "proxy/proxy_config_service_common_unittest.h",
641 "socket/socket_test_util.cc",
642 "socket/socket_test_util.h",
643 "test/cert_test_util.cc",
644 "test/cert_test_util.h",
[email protected]83e1ae32014-07-18 10:57:07645 "test/cert_test_util_nss.cc",
[email protected]8603c5de2014-04-16 20:34:31646 "test/ct_test_util.cc",
647 "test/ct_test_util.h",
648 "test/embedded_test_server/embedded_test_server.cc",
649 "test/embedded_test_server/embedded_test_server.h",
650 "test/embedded_test_server/http_connection.cc",
651 "test/embedded_test_server/http_connection.h",
652 "test/embedded_test_server/http_request.cc",
653 "test/embedded_test_server/http_request.h",
654 "test/embedded_test_server/http_response.cc",
655 "test/embedded_test_server/http_response.h",
656 "test/net_test_suite.cc",
657 "test/net_test_suite.h",
658 "test/python_utils.cc",
659 "test/python_utils.h",
660 "test/spawned_test_server/base_test_server.cc",
661 "test/spawned_test_server/base_test_server.h",
662 "test/spawned_test_server/local_test_server_posix.cc",
663 "test/spawned_test_server/local_test_server_win.cc",
664 "test/spawned_test_server/local_test_server.cc",
665 "test/spawned_test_server/local_test_server.h",
666 "test/spawned_test_server/remote_test_server.cc",
667 "test/spawned_test_server/remote_test_server.h",
668 "test/spawned_test_server/spawned_test_server.h",
669 "test/spawned_test_server/spawner_communicator.cc",
670 "test/spawned_test_server/spawner_communicator.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",
673 "test/url_request/url_request_mock_http_job.cc",
674 "test/url_request/url_request_mock_http_job.h",
[email protected]8603c5de2014-04-16 20:34:31675 "url_request/test_url_fetcher_factory.cc",
676 "url_request/test_url_fetcher_factory.h",
tommyclieaae5d92014-09-09 06:03:47677 "url_request/test_url_request_interceptor.cc",
678 "url_request/test_url_request_interceptor.h",
[email protected]8603c5de2014-04-16 20:34:31679 "url_request/url_request_test_util.cc",
680 "url_request/url_request_test_util.h",
681 ]
682
683 configs += [ ":net_win_size_truncation" ]
684
Brett Wilsone53895272014-09-23 23:41:46685 public_deps = [
[email protected]8603c5de2014-04-16 20:34:31686 "//base",
687 "//base/test:test_support",
[email protected]22fe91d2014-08-12 17:07:12688 "//crypto",
[email protected]59ff2d42014-04-22 22:25:23689 "//net",
[email protected]8603c5de2014-04-16 20:34:31690 "//net/tools/tld_cleanup",
691 "//testing/gmock",
692 "//testing/gtest",
693 "//url",
694 ]
695
davidben15d69d482014-09-29 18:24:08696 if (!use_openssl && (use_nss_certs || is_ios)) {
697 public_deps += ["//crypto:platform" ]
[email protected]8603c5de2014-04-16 20:34:31698 }
699
700 if (!is_android) {
701 sources -= [
702 "test/spawned_test_server/remote_test_server.cc",
703 "test/spawned_test_server/remote_test_server.h",
704 "test/spawned_test_server/spawner_communicator.cc",
705 "test/spawned_test_server/spawner_communicator.h",
706 ]
707 }
708
709 if (use_v8_in_net) {
Brett Wilsone53895272014-09-23 23:41:46710 public_deps += [ ":net_with_v8" ]
[email protected]8603c5de2014-04-16 20:34:31711 }
712
713 if (!enable_mdns) {
714 sources -= [
715 "dns/mock_mdns_socket_factory.cc",
716 "dns/mock_mdns_socket_factory.h",
717 ]
718 }
719
davidben15d69d482014-09-29 18:24:08720 if (!use_nss_certs) {
[email protected]83e1ae32014-07-18 10:57:07721 sources -= [
722 "test/cert_test_util_nss.cc",
723 ]
724 }
[email protected]8603c5de2014-04-16 20:34:31725}
726
[email protected]ceeaac792014-06-25 05:14:43727source_set("balsa") {
728 sources = [
729 "tools/balsa/balsa_enums.h",
730 "tools/balsa/balsa_frame.cc",
731 "tools/balsa/balsa_frame.h",
732 "tools/balsa/balsa_headers.cc",
733 "tools/balsa/balsa_headers.h",
734 "tools/balsa/balsa_headers_token_utils.cc",
735 "tools/balsa/balsa_headers_token_utils.h",
736 "tools/balsa/balsa_visitor_interface.h",
737 "tools/balsa/http_message_constants.cc",
738 "tools/balsa/http_message_constants.h",
739 "tools/balsa/noop_balsa_visitor.h",
740 "tools/balsa/simple_buffer.cc",
741 "tools/balsa/simple_buffer.h",
742 "tools/balsa/split.cc",
743 "tools/balsa/split.h",
744 "tools/balsa/string_piece_utils.h",
745 "tools/quic/spdy_utils.cc",
746 "tools/quic/spdy_utils.h",
747 ]
748 deps = [
749 ":net",
750 "//base",
[email protected]22fe91d2014-08-12 17:07:12751 "//url",
[email protected]ceeaac792014-06-25 05:14:43752 ]
753}
754
[email protected]8603c5de2014-04-16 20:34:31755if (use_v8_in_net) {
756 component("net_with_v8") {
757 sources = [
758 "proxy/proxy_resolver_v8.cc",
759 "proxy/proxy_resolver_v8.h",
760 "proxy/proxy_resolver_v8_tracing.cc",
761 "proxy/proxy_resolver_v8_tracing.h",
762 "proxy/proxy_service_v8.cc",
763 "proxy/proxy_service_v8.h",
764 ]
765
766 defines = [ "NET_IMPLEMENTATION" ]
767 configs += [
768 ":net_win_size_truncation",
769 "//build/config/compiler:wexit_time_destructors",
770 ]
771
Brett Wilsone53895272014-09-23 23:41:46772 public_deps = [
[email protected]8603c5de2014-04-16 20:34:31773 ":net",
Brett Wilsone53895272014-09-23 23:41:46774 ]
775 deps = [
[email protected]8603c5de2014-04-16 20:34:31776 "//base",
777 "//gin",
778 "//url",
779 "//v8",
780 ]
781 }
782}
783
784if (!is_ios && !is_android) {
785 executable("crash_cache") {
Brett Wilson8f80ad0b2014-09-08 19:50:24786 testonly = true
[email protected]8603c5de2014-04-16 20:34:31787 sources = [ "tools/crash_cache/crash_cache.cc" ]
788 configs += [ ":net_win_size_truncation" ]
789 deps = [
790 ":net",
[email protected]b2b2bf52014-05-28 20:26:57791 ":test_support",
[email protected]8603c5de2014-04-16 20:34:31792 "//base",
793 ]
794 }
795
796 executable("crl_set_dump") {
Brett Wilson8f80ad0b2014-09-08 19:50:24797 testonly = true
[email protected]8603c5de2014-04-16 20:34:31798 sources = [ "tools/crl_set_dump/crl_set_dump.cc" ]
799 configs += [ ":net_win_size_truncation" ]
800 deps = [
801 ":net",
802 "//base",
803 ]
804 }
805
806 executable("dns_fuzz_stub") {
Brett Wilson8f80ad0b2014-09-08 19:50:24807 testonly = true
[email protected]8603c5de2014-04-16 20:34:31808 sources = [ "tools/dns_fuzz_stub/dns_fuzz_stub.cc" ]
809 configs += [ ":net_win_size_truncation" ]
810 deps = [
811 ":net",
812 "//base",
813 ]
814 }
815
816 executable("gdig") {
Brett Wilson8f80ad0b2014-09-08 19:50:24817 testonly = true
[email protected]8603c5de2014-04-16 20:34:31818 sources = [
819 "tools/gdig/file_net_log.cc",
820 "tools/gdig/gdig.cc",
821 ]
822 deps = [
823 ":net",
824 "//base",
825 ]
826 }
827
828 executable("get_server_time") {
Brett Wilson8f80ad0b2014-09-08 19:50:24829 testonly = true
[email protected]8603c5de2014-04-16 20:34:31830 sources = [ "tools/get_server_time/get_server_time.cc" ]
831 configs += [ ":net_win_size_truncation" ]
832 deps = [
833 ":net",
834 "//base",
835 "//base:i18n",
836 "//url",
837 ]
838 }
839
840 if (use_v8_in_net) {
841 executable("net_watcher") {
Brett Wilson8f80ad0b2014-09-08 19:50:24842 testonly = true
[email protected]8603c5de2014-04-16 20:34:31843 sources = [ "tools/net_watcher/net_watcher.cc" ]
844 deps = [
845 ":net",
846 ":net_with_v8",
847 "//base",
848 ]
849
mukai77f8210a2014-10-07 16:35:14850 if (is_desktop_linux) {
[email protected]22fe91d2014-08-12 17:07:12851 configs += [
852 "//build/config/linux:gconf",
853 "//build/config/linux:glib",
854 ]
[email protected]8603c5de2014-04-16 20:34:31855 deps += [ "//build/config/linux:gio" ]
856 }
857 }
858 }
859
860 executable("run_testserver") {
Brett Wilson8f80ad0b2014-09-08 19:50:24861 testonly = true
[email protected]8603c5de2014-04-16 20:34:31862 sources = [ "tools/testserver/run_testserver.cc" ]
863 deps = [
864 ":net", # TODO(brettw) bug 363749: this shouldn't be necessary. It's not
865 # in the GYP build, and can be removed when the bug is fixed.
[email protected]b2b2bf52014-05-28 20:26:57866 ":test_support",
[email protected]8603c5de2014-04-16 20:34:31867 "//base",
868 "//base/test:test_support",
869 "//testing/gtest",
870 ]
871 }
872
873 executable("stress_cache") {
Brett Wilson8f80ad0b2014-09-08 19:50:24874 testonly = true
[email protected]8603c5de2014-04-16 20:34:31875 sources = [ "disk_cache/blockfile/stress_cache.cc" ]
876 configs += [ ":net_win_size_truncation" ]
877 deps = [
878 ":net",
[email protected]b2b2bf52014-05-28 20:26:57879 ":test_support",
[email protected]8603c5de2014-04-16 20:34:31880 "//base",
881 ]
882 }
883
884 executable("tld_cleanup") {
885 sources = [ "tools/tld_cleanup/tld_cleanup.cc" ]
886 configs += [ ":net_win_size_truncation" ]
887 deps = [
888 "//base",
889 "//base:i18n",
890 "//net/tools/tld_cleanup",
891 ]
892 }
893}
894
895if (is_linux) {
[email protected]8a3f8242014-06-05 18:05:12896 static_library("epoll_server") {
[email protected]8603c5de2014-04-16 20:34:31897 sources = [
898 "tools/epoll_server/epoll_server.cc",
899 "tools/epoll_server/epoll_server.h",
900 ]
901 deps = [
902 ":net",
903 "//base",
904 ]
905 }
906
[email protected]8a3f8242014-06-05 18:05:12907 static_library("flip_in_mem_edsm_server_base") {
Brett Wilson8f80ad0b2014-09-08 19:50:24908 testonly = true
[email protected]8603c5de2014-04-16 20:34:31909 sources = [
910 "tools/dump_cache/url_to_filename_encoder.cc",
911 "tools/dump_cache/url_to_filename_encoder.h",
912 "tools/dump_cache/url_utilities.h",
913 "tools/dump_cache/url_utilities.cc",
914 "tools/flip_server/acceptor_thread.h",
915 "tools/flip_server/acceptor_thread.cc",
916 "tools/flip_server/create_listener.cc",
917 "tools/flip_server/create_listener.h",
918 "tools/flip_server/constants.h",
919 "tools/flip_server/flip_config.cc",
920 "tools/flip_server/flip_config.h",
921 "tools/flip_server/http_interface.cc",
922 "tools/flip_server/http_interface.h",
923 "tools/flip_server/loadtime_measurement.h",
924 "tools/flip_server/mem_cache.h",
925 "tools/flip_server/mem_cache.cc",
926 "tools/flip_server/output_ordering.cc",
927 "tools/flip_server/output_ordering.h",
928 "tools/flip_server/ring_buffer.cc",
929 "tools/flip_server/ring_buffer.h",
930 "tools/flip_server/sm_connection.cc",
931 "tools/flip_server/sm_connection.h",
932 "tools/flip_server/sm_interface.h",
933 "tools/flip_server/spdy_ssl.cc",
934 "tools/flip_server/spdy_ssl.h",
935 "tools/flip_server/spdy_interface.cc",
936 "tools/flip_server/spdy_interface.h",
937 "tools/flip_server/spdy_util.cc",
938 "tools/flip_server/spdy_util.h",
939 "tools/flip_server/streamer_interface.cc",
940 "tools/flip_server/streamer_interface.h",
941 ]
942 deps = [
943 ":balsa",
944 ":epoll_server",
945 ":net",
946 "//base",
[email protected]edfd0f42014-07-22 18:20:37947 "//third_party/boringssl",
[email protected]8603c5de2014-04-16 20:34:31948 ]
949 }
950
951 executable("flip_in_mem_edsm_server_unittests") {
Brett Wilson8f80ad0b2014-09-08 19:50:24952 testonly = true
[email protected]8603c5de2014-04-16 20:34:31953 sources = [
954 "tools/flip_server/flip_test_utils.cc",
955 "tools/flip_server/flip_test_utils.h",
956 "tools/flip_server/http_interface_test.cc",
957 "tools/flip_server/mem_cache_test.cc",
958 "tools/flip_server/run_all_tests.cc",
959 "tools/flip_server/spdy_interface_test.cc",
960 ]
961 deps = [
962 ":flip_in_mem_edsm_server_base",
963 ":net",
[email protected]b2b2bf52014-05-28 20:26:57964 ":test_support",
[email protected]8603c5de2014-04-16 20:34:31965 "//testing/gtest",
966 "//testing/gmock",
[email protected]edfd0f42014-07-22 18:20:37967 "//third_party/boringssl",
[email protected]8603c5de2014-04-16 20:34:31968 ]
969 }
970
971 executable("flip_in_mem_edsm_server") {
Brett Wilson8f80ad0b2014-09-08 19:50:24972 testonly = true
[email protected]8603c5de2014-04-16 20:34:31973 sources = [ "tools/flip_server/flip_in_mem_edsm_server.cc" ]
974 deps = [
975 ":flip_in_mem_edsm_server_base",
976 ":net",
977 "//base",
978 ]
979 }
980
981 source_set("quic_base") {
982 sources = [
983 "tools/quic/quic_client.cc",
984 "tools/quic/quic_client.h",
985 "tools/quic/quic_client_session.cc",
986 "tools/quic/quic_client_session.h",
987 "tools/quic/quic_default_packet_writer.cc",
988 "tools/quic/quic_default_packet_writer.h",
989 "tools/quic/quic_dispatcher.h",
990 "tools/quic/quic_dispatcher.cc",
991 "tools/quic/quic_epoll_clock.cc",
992 "tools/quic/quic_epoll_clock.h",
993 "tools/quic/quic_epoll_connection_helper.cc",
994 "tools/quic/quic_epoll_connection_helper.h",
995 "tools/quic/quic_in_memory_cache.cc",
996 "tools/quic/quic_in_memory_cache.h",
997 "tools/quic/quic_packet_writer_wrapper.cc",
998 "tools/quic/quic_packet_writer_wrapper.h",
[email protected]6d515822014-08-22 01:58:06999 "tools/quic/quic_per_connection_packet_writer.cc",
1000 "tools/quic/quic_per_connection_packet_writer.h",
[email protected]8603c5de2014-04-16 20:34:311001 "tools/quic/quic_server.cc",
1002 "tools/quic/quic_server.h",
1003 "tools/quic/quic_server_session.cc",
1004 "tools/quic/quic_server_session.h",
1005 "tools/quic/quic_socket_utils.cc",
1006 "tools/quic/quic_socket_utils.h",
1007 "tools/quic/quic_spdy_client_stream.cc",
1008 "tools/quic/quic_spdy_client_stream.h",
1009 "tools/quic/quic_spdy_server_stream.cc",
1010 "tools/quic/quic_spdy_server_stream.h",
1011 "tools/quic/quic_time_wait_list_manager.h",
1012 "tools/quic/quic_time_wait_list_manager.cc",
[email protected]8603c5de2014-04-16 20:34:311013 ]
1014 deps = [
1015 ":balsa",
1016 ":epoll_server",
1017 ":net",
1018 "//base",
1019 "//base/third_party/dynamic_annotations",
1020 "//crypto",
[email protected]edfd0f42014-07-22 18:20:371021 "//third_party/boringssl",
[email protected]8603c5de2014-04-16 20:34:311022 "//url",
1023 ]
1024 }
1025
1026 executable("quic_client") {
1027 sources = [ "tools/quic/quic_client_bin.cc" ]
1028 deps = [
1029 ":quic_base",
1030 ":net",
1031 "//base",
[email protected]edfd0f42014-07-22 18:20:371032 "//third_party/boringssl",
[email protected]8603c5de2014-04-16 20:34:311033 ]
1034 }
[email protected]8603c5de2014-04-16 20:34:311035}
1036
[email protected]ef0eb442014-05-15 09:32:181037if (is_android) {
1038 generate_jni("net_jni_headers") {
1039 sources = [
1040 "android/java/src/org/chromium/net/AndroidCertVerifyResult.java",
1041 "android/java/src/org/chromium/net/AndroidKeyStore.java",
1042 "android/java/src/org/chromium/net/AndroidNetworkLibrary.java",
1043 "android/java/src/org/chromium/net/AndroidPrivateKey.java",
1044 "android/java/src/org/chromium/net/GURLUtils.java",
1045 "android/java/src/org/chromium/net/NetworkChangeNotifier.java",
1046 "android/java/src/org/chromium/net/ProxyChangeListener.java",
1047 "android/java/src/org/chromium/net/X509Util.java",
1048 ]
1049 jni_package = "net"
1050 }
cjhopmandad5f4272014-09-05 01:00:551051 generate_jni("net_test_jni_headers") {
1052 sources = [
1053 "android/javatests/src/org/chromium/net/AndroidKeyStoreTestUtil.java",
1054 ]
1055 jni_package = "net"
1056 }
[email protected]ef0eb442014-05-15 09:32:181057}
[email protected]8603c5de2014-04-16 20:34:311058
1059if (is_android || is_linux) {
1060 executable("disk_cache_memory_test") {
Brett Wilson8f80ad0b2014-09-08 19:50:241061 testonly = true
[email protected]8603c5de2014-04-16 20:34:311062 sources = [ "tools/disk_cache_memory_test/disk_cache_memory_test.cc" ]
1063 deps = [
1064 ":net",
1065 "//base",
1066 ]
1067 }
1068}
[email protected]8a3f8242014-06-05 18:05:121069
1070# TODO(GYP) make this compile on Android, we need some native test deps done.
[email protected]bd82a57d2014-07-31 16:52:341071# TODO(GYP) Also doesn't work on Windows; dependency on boringssl is wrong.
dprankecf8465db72014-11-10 23:51:221072# TODO(GYP) Also doesn't work on Mac, need to figure out why not.
1073if (!is_android && !is_win && !is_mac) {
[email protected]8a3f8242014-06-05 18:05:121074
[email protected]ceeaac792014-06-25 05:14:431075source_set("quic_tools") {
1076 sources = [
1077 "quic/quic_dispatcher.cc",
1078 "quic/quic_dispatcher.h",
1079 "quic/quic_in_memory_cache.cc",
1080 "quic/quic_in_memory_cache.h",
1081 "quic/quic_per_connection_packet_writer.cc",
1082 "quic/quic_per_connection_packet_writer.h",
1083 "quic/quic_server.cc",
1084 "quic/quic_server.h",
1085 "quic/quic_server_packet_writer.cc",
1086 "quic/quic_server_packet_writer.h",
1087 "quic/quic_server_session.cc",
1088 "quic/quic_server_session.h",
1089 "quic/quic_spdy_server_stream.cc",
1090 "quic/quic_spdy_server_stream.h",
1091 "quic/quic_time_wait_list_manager.cc",
1092 "quic/quic_time_wait_list_manager.h",
1093 ]
1094 deps = [
[email protected]ceeaac792014-06-25 05:14:431095 ":net",
1096 "//base",
1097 "//base/third_party/dynamic_annotations",
1098 "//url",
1099 ]
1100}
1101
[email protected]8a3f8242014-06-05 18:05:121102test("net_unittests") {
1103 sources = gypi_values.net_test_sources
1104
1105 configs += [ ":net_win_size_truncation" ]
1106 defines = []
1107
1108 deps = [
Brett Wilson83fd4242014-09-02 19:45:331109 ":extras",
[email protected]8a3f8242014-06-05 18:05:121110 ":http_server",
1111 ":net",
[email protected]ceeaac792014-06-25 05:14:431112 ":quic_tools",
[email protected]8a3f8242014-06-05 18:05:121113 ":test_support",
1114 "//base",
1115 "//base:i18n",
[email protected]ad66db12014-07-10 12:43:471116 "//base:prefs_test_support",
[email protected]8a3f8242014-06-05 18:05:121117 "//base/allocator",
1118 "//base/third_party/dynamic_annotations",
1119 "//crypto",
1120 "//crypto:platform",
[email protected]190933f2014-07-28 09:56:511121 "//crypto:test_support",
[email protected]8a3f8242014-06-05 18:05:121122 "//net/base/registry_controlled_domains",
1123 "//testing/gmock",
1124 "//testing/gtest",
1125 "//third_party/zlib",
1126 "//url",
1127 ]
1128
1129 if (is_linux) {
1130 sources += gypi_values.net_linux_test_sources
1131 deps += [
1132 ":balsa",
1133 ":epoll_server",
1134 ":flip_in_mem_edsm_server_base",
1135 ":quic_base",
1136 ]
1137 }
1138
1139 if (is_chromeos) {
1140 sources -= [
[email protected]8a3f8242014-06-05 18:05:121141 "proxy/proxy_config_service_linux_unittest.cc",
1142 ]
1143 }
1144
1145 if (is_android) {
1146 sources -= [
1147 # See bug http://crbug.com/344533.
1148 "disk_cache/blockfile/index_table_v3_unittest.cc",
1149 # No res_ninit() et al on Android, so this doesn't make a lot of
1150 # sense.
1151 "dns/dns_config_service_posix_unittest.cc",
1152 ]
1153 deps += [
1154 ":net_javatests", # FIXME(brettw)
1155 ":net_test_jni_headers",
1156 ]
1157 }
1158
1159 if (!use_nss_certs) {
[email protected]852f7182014-06-09 16:59:481160 sources -= [
1161 "ssl/client_cert_store_nss_unittest.cc",
[email protected]852f7182014-06-09 16:59:481162 ]
[email protected]b2f44d12014-06-10 17:48:031163 if (is_chromeos) { # Already removed for all non-ChromeOS builds.
1164 sources -= [
1165 "ssl/client_cert_store_chromeos_unittest.cc",
1166 ]
1167 }
[email protected]8a3f8242014-06-05 18:05:121168 }
1169
1170 if (use_openssl) {
1171 # When building for OpenSSL, we need to exclude NSS specific tests
1172 # or functionality not supported by OpenSSL yet.
1173 # TODO(bulach): Add equivalent tests when the underlying
1174 # functionality is ported to OpenSSL.
1175 sources -= [
[email protected]8a3f8242014-06-05 18:05:121176 "cert/nss_cert_database_unittest.cc",
[email protected]8a3f8242014-06-05 18:05:121177 "cert/x509_util_nss_unittest.cc",
1178 "quic/test_tools/crypto_test_utils_nss.cc",
1179 ]
brettwc859f18f2014-09-18 23:34:501180 if (is_chromeos) {
1181 # These were already removed in the non-ChromeOS case.
1182 sources -= [
1183 "cert/nss_cert_database_chromeos_unittest.cc",
1184 "cert/nss_profile_filter_chromeos_unittest.cc",
1185 ]
1186 }
[email protected]8a3f8242014-06-05 18:05:121187 } else {
1188 sources -= [
1189 "cert/x509_util_openssl_unittest.cc",
1190 "quic/test_tools/crypto_test_utils_openssl.cc",
1191 "socket/ssl_client_socket_openssl_unittest.cc",
1192 "socket/ssl_session_cache_openssl_unittest.cc",
1193 ]
1194 if (!is_desktop_linux && !is_chromeos) {
1195 sources -= [ "cert/nss_cert_database_unittest.cc" ]
1196 }
1197 }
1198
1199 if (use_kerberos) {
1200 defines += [ "USE_KERBEROS" ]
1201 } else {
1202 sources -= [
1203 "http/http_auth_gssapi_posix_unittest.cc",
1204 "http/http_auth_handler_negotiate_unittest.cc",
1205 "http/mock_gssapi_library_posix.cc",
1206 "http/mock_gssapi_library_posix.h",
1207 ]
1208 }
1209
1210 if (use_openssl || (!is_desktop_linux && !is_chromeos && !is_ios)) {
1211 # Only include this test when on Posix and using NSS for
1212 # cert verification or on iOS (which also uses NSS for certs).
1213 sources -= [ "ocsp/nss_ocsp_unittest.cc" ]
1214 }
1215
1216 if (!use_openssl_certs) {
1217 sources -= [ "ssl/openssl_client_key_store_unittest.cc" ]
1218 }
1219
1220 if (!enable_websockets) {
1221 sources -= [
[email protected]8a3f8242014-06-05 18:05:121222 "websockets/websocket_basic_stream_test.cc",
1223 "websockets/websocket_channel_test.cc",
1224 "websockets/websocket_deflate_predictor_impl_test.cc",
1225 "websockets/websocket_deflate_stream_test.cc",
1226 "websockets/websocket_deflater_test.cc",
1227 "websockets/websocket_errors_test.cc",
1228 "websockets/websocket_extension_parser_test.cc",
1229 "websockets/websocket_frame_parser_test.cc",
1230 "websockets/websocket_frame_test.cc",
1231 "websockets/websocket_handshake_handler_spdy_test.cc",
1232 "websockets/websocket_handshake_handler_test.cc",
1233 "websockets/websocket_handshake_stream_create_helper_test.cc",
1234 "websockets/websocket_inflater_test.cc",
[email protected]8a3f8242014-06-05 18:05:121235 "websockets/websocket_stream_test.cc",
1236 "websockets/websocket_test_util.cc",
1237 "websockets/websocket_test_util.h",
[email protected]8a3f8242014-06-05 18:05:121238 ]
1239 }
1240
1241 if (disable_file_support) {
1242 sources -= [
1243 "base/directory_lister_unittest.cc",
1244 "url_request/url_request_file_job_unittest.cc",
1245 ]
1246 }
1247
1248 if (disable_ftp_support) {
1249 sources -= [
1250 "ftp/ftp_auth_cache_unittest.cc",
1251 "ftp/ftp_ctrl_response_buffer_unittest.cc",
1252 "ftp/ftp_directory_listing_parser_ls_unittest.cc",
1253 "ftp/ftp_directory_listing_parser_netware_unittest.cc",
1254 "ftp/ftp_directory_listing_parser_os2_unittest.cc",
1255 "ftp/ftp_directory_listing_parser_unittest.cc",
1256 "ftp/ftp_directory_listing_parser_unittest.h",
1257 "ftp/ftp_directory_listing_parser_vms_unittest.cc",
1258 "ftp/ftp_directory_listing_parser_windows_unittest.cc",
1259 "ftp/ftp_network_transaction_unittest.cc",
1260 "ftp/ftp_util_unittest.cc",
1261 "url_request/url_request_ftp_job_unittest.cc",
1262 ]
1263 }
1264
1265 if (!enable_built_in_dns) {
1266 sources -= [
1267 "dns/address_sorter_posix_unittest.cc",
1268 "dns/address_sorter_unittest.cc",
1269 ]
1270 }
1271
1272 # Always need use_v8_in_net to be 1 to run on Android, so just remove
1273 # net_unittest's dependency on v8 when using icu alternatives instead of
1274 # setting use_v8_in_net to 0.
1275 if (use_v8_in_net && !use_icu_alternatives_on_android) {
1276 deps += [ ":net_with_v8" ]
1277 } else {
1278 sources -= [
1279 "proxy/proxy_resolver_v8_unittest.cc",
1280 "proxy/proxy_resolver_v8_tracing_unittest.cc",
1281 ]
1282 }
1283
1284 if (!enable_mdns) {
1285 sources -= [
1286 "dns/mdns_cache_unittest.cc",
1287 "dns/mdns_client_unittest.cc",
[email protected]8a3f8242014-06-05 18:05:121288 "dns/record_parsed_unittest.cc",
1289 "dns/record_rdata_unittest.cc",
1290 ]
1291 }
1292
1293 if (is_ios) {
1294 # TODO(GYP)
1295 # 'actions': [
1296 # {
1297 # 'action_name': 'copy_test_data',
1298 # 'variables': {
1299 # 'test_data_files': [
1300 # 'data/ssl/certificates/',
1301 # 'data/test.html',
1302 # 'data/url_request_unittest/',
1303 # ],
1304 # 'test_data_prefix': 'net',
1305 # },
1306 # 'includes': [ '../build/copy_test_data_ios.gypi' ],
1307 # },
1308 # ],
1309 sources -= [
1310 # TODO(droger): The following tests are disabled because the
1311 # implementation is missing or incomplete.
1312 # KeygenHandler::GenKeyAndSignChallenge() is not ported to iOS.
1313 "base/keygen_handler_unittest.cc",
1314 "disk_cache/backend_unittest.cc",
1315 "disk_cache/blockfile/block_files_unittest.cc",
1316 # Need to read input data files.
1317 "filter/gzip_filter_unittest.cc",
1318 "socket/ssl_server_socket_unittest.cc",
1319 "spdy/fuzzing/hpack_fuzz_util_test.cc",
1320 # Need TestServer.
1321 "proxy/proxy_script_fetcher_impl_unittest.cc",
1322 "socket/ssl_client_socket_unittest.cc",
1323 "url_request/url_fetcher_impl_unittest.cc",
1324 "url_request/url_request_context_builder_unittest.cc",
1325 # Needs GetAppOutput().
1326 "test/python_utils_unittest.cc",
1327
1328 # The following tests are disabled because they don't apply to
1329 # iOS.
1330 # OS is not "linux" or "freebsd" or "openbsd".
[email protected]518c63a2014-07-24 03:51:231331 "socket/unix_domain_client_socket_posix_unittest.cc",
1332 "socket/unix_domain_listen_socket_posix_unittest.cc",
1333 "socket/unix_domain_server_socket_posix_unittest.cc",
[email protected]8a3f8242014-06-05 18:05:121334
1335 # See bug http://crbug.com/344533.
1336 "disk_cache/blockfile/index_table_v3_unittest.cc",
1337 ]
1338 }
1339
1340 if (is_android) {
1341 sources -= [
1342 "dns/dns_config_service_posix_unittest.cc",
1343 ]
1344 # TODO(GYP)
1345 # # TODO(mmenke): This depends on test_support_base, which depends on
1346 # # icu. Figure out a way to remove that dependency.
1347 # 'dependencies': [
1348 # '../testing/android/native_test.gyp:native_test_native_code',
1349 # ]
1350
1351 set_sources_assignment_filter([])
1352 sources += [ "base/address_tracker_linux_unittest.cc" ]
1353 set_sources_assignment_filter(sources_assignment_filter)
1354 }
1355
1356 if (use_icu_alternatives_on_android) {
1357 sources -= [
1358 "base/filename_util_unittest.cc",
1359 "base/net_util_icu_unittest.cc",
1360 ]
1361 deps -= [ "//base:i18n" ]
1362 }
1363}
1364
[email protected]ceeaac792014-06-25 05:14:431365executable("quic_server") {
1366 sources = [ "quic/quic_server_bin.cc" ]
1367 deps = [
1368 ":quic_tools",
1369 ":net",
1370 "//base",
[email protected]edfd0f42014-07-22 18:20:371371 "//third_party/boringssl",
[email protected]ceeaac792014-06-25 05:14:431372 ]
1373}
1374
dprankecf8465db72014-11-10 23:51:221375} # !is_android && !is_win && !is_mac