blob: 76a5cf80ddd19abd68816d1b26439d28c93ee06a [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.
dpranke43276212015-02-20 02:55:1941posix_avoid_mmap = is_android && current_cpu != "x86"
[email protected]4625ade2014-04-15 19:26:4442
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
64component("net") {
65 sources =
scottmg34fb7e52014-12-03 23:27:2466 gypi_values.net_nacl_common_sources + gypi_values.net_non_nacl_sources
[email protected]4625ade2014-04-15 19:26:4467
68 cflags = []
[email protected]8603c5de2014-04-16 20:34:3169 defines = [
70 # TODO(GYP) Note that he GYP file supports linux_link_kerberos (defaults to
71 # 0) which implies that we run pkg_config on kerberos and link to that
72 # rather than setting this define which will dynamically open it. That
73 # doesn't seem to be set in the regular builds, so we're skipping this
74 # capability here.
75 "DLOPEN_KERBEROS",
scottmg34fb7e52014-12-03 23:27:2476 "NET_IMPLEMENTATION",
[email protected]8603c5de2014-04-16 20:34:3177 ]
dpranke43276212015-02-20 02:55:1978
brettwd1c719a2015-02-19 23:17:0479 # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
80 configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
Brett Wilsone53895272014-09-23 23:41:4681 public_configs = [ ":net_config" ]
[email protected]4625ade2014-04-15 19:26:4482 include_dirs = []
83
Brett Wilsone53895272014-09-23 23:41:4684 public_deps = [
85 "//crypto",
scottmg34fb7e52014-12-03 23:27:2486 "//crypto:platform",
brettwbc44c0a92015-02-20 22:30:3987 "//url",
Brett Wilsone53895272014-09-23 23:41:4688 ]
[email protected]4625ade2014-04-15 19:26:4489 deps = [
scottmg34fb7e52014-12-03 23:27:2490 ":net_resources",
[email protected]4625ade2014-04-15 19:26:4491 "//base",
92 "//base:i18n",
[email protected]ad66db12014-07-10 12:43:4793 "//base:prefs",
[email protected]4625ade2014-04-15 19:26:4494 "//base/third_party/dynamic_annotations",
[email protected]8a3f8242014-06-05 18:05:1295 "//net/base/registry_controlled_domains",
[email protected]4625ade2014-04-15 19:26:4496 "//sdch",
97 "//third_party/icu",
98 "//third_party/zlib",
99 "//url",
100 ]
101
102 if (use_kerberos) {
103 defines += [ "USE_KERBEROS" ]
104 if (is_android) {
105 include_dirs += [ "/usr/include/kerberosV" ]
106 }
107 } else {
108 sources -= [
109 "http/http_auth_gssapi_posix.cc",
110 "http/http_auth_gssapi_posix.h",
[email protected]4625ade2014-04-15 19:26:44111 "http/http_auth_handler_negotiate.cc",
satorux933fc7a2015-02-13 07:09:10112 "http/http_auth_handler_negotiate.h",
[email protected]4625ade2014-04-15 19:26:44113 ]
114 }
115
116 if (is_posix) {
117 if (posix_avoid_mmap) {
118 sources -= [ "disk_cache/blockfile/mapped_file_posix.cc" ]
119 } else {
120 sources -= [ "disk_cache/blockfile/mapped_file_avoid_mmap_posix.cc" ]
121 }
122 }
123
[email protected]02494ec2014-05-07 15:05:29124 if (disable_file_support) {
125 sources -= [
126 "base/directory_lister.cc",
127 "base/directory_lister.h",
satorux933fc7a2015-02-13 07:09:10128 "url_request/file_protocol_handler.cc",
129 "url_request/file_protocol_handler.h",
[email protected]02494ec2014-05-07 15:05:29130 "url_request/url_request_file_dir_job.cc",
131 "url_request/url_request_file_dir_job.h",
132 "url_request/url_request_file_job.cc",
133 "url_request/url_request_file_job.h",
[email protected]02494ec2014-05-07 15:05:29134 ]
135 }
136
[email protected]8a3f8242014-06-05 18:05:12137 if (disable_ftp_support) {
[email protected]4625ade2014-04-15 19:26:44138 sources -= [
139 "ftp/ftp_auth_cache.cc",
140 "ftp/ftp_auth_cache.h",
141 "ftp/ftp_ctrl_response_buffer.cc",
142 "ftp/ftp_ctrl_response_buffer.h",
143 "ftp/ftp_directory_listing_parser.cc",
144 "ftp/ftp_directory_listing_parser.h",
145 "ftp/ftp_directory_listing_parser_ls.cc",
146 "ftp/ftp_directory_listing_parser_ls.h",
147 "ftp/ftp_directory_listing_parser_netware.cc",
148 "ftp/ftp_directory_listing_parser_netware.h",
149 "ftp/ftp_directory_listing_parser_os2.cc",
150 "ftp/ftp_directory_listing_parser_os2.h",
151 "ftp/ftp_directory_listing_parser_vms.cc",
152 "ftp/ftp_directory_listing_parser_vms.h",
153 "ftp/ftp_directory_listing_parser_windows.cc",
154 "ftp/ftp_directory_listing_parser_windows.h",
155 "ftp/ftp_network_layer.cc",
156 "ftp/ftp_network_layer.h",
157 "ftp/ftp_network_session.cc",
158 "ftp/ftp_network_session.h",
159 "ftp/ftp_network_transaction.cc",
160 "ftp/ftp_network_transaction.h",
161 "ftp/ftp_request_info.h",
162 "ftp/ftp_response_info.cc",
163 "ftp/ftp_response_info.h",
164 "ftp/ftp_server_type_histograms.cc",
165 "ftp/ftp_server_type_histograms.h",
166 "ftp/ftp_transaction.h",
167 "ftp/ftp_transaction_factory.h",
168 "ftp/ftp_util.cc",
169 "ftp/ftp_util.h",
170 "url_request/ftp_protocol_handler.cc",
171 "url_request/ftp_protocol_handler.h",
172 "url_request/url_request_ftp_job.cc",
173 "url_request/url_request_ftp_job.h",
174 ]
175 }
176
177 if (enable_built_in_dns) {
178 defines += [ "ENABLE_BUILT_IN_DNS" ]
179 } else {
180 sources -= [
181 "dns/address_sorter_posix.cc",
182 "dns/address_sorter_posix.h",
183 "dns/dns_client.cc",
184 ]
185 }
186
187 if (use_openssl) {
188 sources -= [
[email protected]4625ade2014-04-15 19:26:44189 "base/nss_memio.c",
190 "base/nss_memio.h",
[email protected]4625ade2014-04-15 19:26:44191 "cert/ct_log_verifier_nss.cc",
192 "cert/ct_objects_extractor_nss.cc",
193 "cert/jwk_serializer_nss.cc",
[email protected]4625ade2014-04-15 19:26:44194 "cert/scoped_nss_types.h",
mukai77f8210a2014-10-07 16:35:14195 "cert/test_root_certs_nss.cc",
[email protected]4625ade2014-04-15 19:26:44196 "cert/x509_util_nss.cc",
197 "cert/x509_util_nss.h",
mukai77f8210a2014-10-07 16:35:14198 "ocsp/nss_ocsp.cc",
199 "ocsp/nss_ocsp.h",
[email protected]4625ade2014-04-15 19:26:44200 "quic/crypto/aead_base_decrypter_nss.cc",
201 "quic/crypto/aead_base_encrypter_nss.cc",
202 "quic/crypto/aes_128_gcm_12_decrypter_nss.cc",
203 "quic/crypto/aes_128_gcm_12_encrypter_nss.cc",
204 "quic/crypto/chacha20_poly1305_decrypter_nss.cc",
205 "quic/crypto/chacha20_poly1305_encrypter_nss.cc",
206 "quic/crypto/channel_id_nss.cc",
207 "quic/crypto/p256_key_exchange_nss.cc",
208 "socket/nss_ssl_util.cc",
209 "socket/nss_ssl_util.h",
210 "socket/ssl_client_socket_nss.cc",
211 "socket/ssl_client_socket_nss.h",
212 "socket/ssl_server_socket_nss.cc",
213 "socket/ssl_server_socket_nss.h",
[email protected]4625ade2014-04-15 19:26:44214 ]
[email protected]71d94dfce92014-04-30 16:47:24215 if (is_chromeos) {
216 sources -= [
217 "cert/nss_cert_database_chromeos.cc",
218 "cert/nss_cert_database_chromeos.h",
219 "cert/nss_profile_filter_chromeos.cc",
220 "cert/nss_profile_filter_chromeos.h",
221 ]
222 }
223 if (is_linux) {
224 # These are always removed for non-Linux cases below.
225 sources -= [
226 "base/crypto_module_nss.cc",
227 "base/keygen_handler_nss.cc",
228 "cert/cert_database_nss.cc",
229 "cert/nss_cert_database.cc",
230 "cert/nss_cert_database.h",
231 "cert/x509_certificate_nss.cc",
232 "third_party/mozilla_security_manager/nsKeygenHandler.cpp",
233 "third_party/mozilla_security_manager/nsKeygenHandler.h",
234 "third_party/mozilla_security_manager/nsNSSCertificateDB.cpp",
235 "third_party/mozilla_security_manager/nsNSSCertificateDB.h",
236 "third_party/mozilla_security_manager/nsPKCS12Blob.cpp",
237 "third_party/mozilla_security_manager/nsPKCS12Blob.h",
238 ]
239 }
240 if (is_ios) {
241 # Always removed for !ios below.
242 sources -= [
243 "cert/cert_verify_proc_nss.cc",
244 "cert/cert_verify_proc_nss.h",
[email protected]71d94dfce92014-04-30 16:47:24245 ]
246 }
davidbend5587412014-10-30 21:44:16247 if (is_win) {
scottmg34fb7e52014-12-03 23:27:24248 sources -= [ "cert/sha256_legacy_support_nss_win.cc" ]
davidbend5587412014-10-30 21:44:16249 }
[email protected]4625ade2014-04-15 19:26:44250 } else {
251 sources -= [
252 "base/crypto_module_openssl.cc",
[email protected]4625ade2014-04-15 19:26:44253 "cert/ct_log_verifier_openssl.cc",
254 "cert/ct_objects_extractor_openssl.cc",
255 "cert/jwk_serializer_openssl.cc",
256 "cert/x509_util_openssl.cc",
257 "cert/x509_util_openssl.h",
258 "quic/crypto/aead_base_decrypter_openssl.cc",
259 "quic/crypto/aead_base_encrypter_openssl.cc",
260 "quic/crypto/aes_128_gcm_12_decrypter_openssl.cc",
261 "quic/crypto/aes_128_gcm_12_encrypter_openssl.cc",
262 "quic/crypto/chacha20_poly1305_decrypter_openssl.cc",
263 "quic/crypto/chacha20_poly1305_encrypter_openssl.cc",
264 "quic/crypto/channel_id_openssl.cc",
265 "quic/crypto/p256_key_exchange_openssl.cc",
266 "quic/crypto/scoped_evp_aead_ctx.cc",
267 "quic/crypto/scoped_evp_aead_ctx.h",
268 "socket/ssl_client_socket_openssl.cc",
269 "socket/ssl_client_socket_openssl.h",
270 "socket/ssl_server_socket_openssl.cc",
[email protected]c8a80e92014-05-17 16:02:08271 "socket/ssl_server_socket_openssl.h",
[email protected]4625ade2014-04-15 19:26:44272 "socket/ssl_session_cache_openssl.cc",
273 "socket/ssl_session_cache_openssl.h",
[email protected]97a854f2014-07-29 07:51:36274 "ssl/openssl_platform_key.h",
275 "ssl/openssl_ssl_util.cc",
276 "ssl/openssl_ssl_util.h",
[email protected]4625ade2014-04-15 19:26:44277 ]
[email protected]97a854f2014-07-29 07:51:36278 if (is_mac) {
scottmg34fb7e52014-12-03 23:27:24279 sources -= [ "ssl/openssl_platform_key_mac.cc" ]
[email protected]97a854f2014-07-29 07:51:36280 }
281 if (is_win) {
282 sources -= [
John Abd-El-Malek494329e2014-11-05 19:06:30283 "cert/sha256_legacy_support_openssl_win.cc",
[email protected]97a854f2014-07-29 07:51:36284 "ssl/openssl_platform_key_win.cc",
285 ]
286 }
[email protected]4625ade2014-04-15 19:26:44287 }
288
289 if (!use_openssl_certs) {
290 sources -= [
isherman7e5de442014-09-25 23:00:18291 "base/keygen_handler_openssl.cc",
[email protected]4625ade2014-04-15 19:26:44292 "base/openssl_private_key_store.h",
293 "base/openssl_private_key_store_memory.cc",
294 "cert/cert_database_openssl.cc",
295 "cert/cert_verify_proc_openssl.cc",
296 "cert/cert_verify_proc_openssl.h",
297 "cert/test_root_certs_openssl.cc",
298 "cert/x509_certificate_openssl.cc",
299 "ssl/openssl_client_key_store.cc",
300 "ssl/openssl_client_key_store.h",
301 ]
302 if (is_android) {
scottmg34fb7e52014-12-03 23:27:24303 sources -= [ "base/openssl_private_key_store_android.cc" ]
[email protected]4625ade2014-04-15 19:26:44304 }
[email protected]1ea01752014-05-23 19:01:46305 } else if (is_android) {
306 # Android doesn't use these even when using OpenSSL.
307 sources -= [
308 "base/openssl_private_key_store_memory.cc",
309 "cert/cert_database_openssl.cc",
310 "cert/cert_verify_proc_openssl.cc",
311 "cert/test_root_certs_openssl.cc",
312 ]
[email protected]4625ade2014-04-15 19:26:44313 }
314
mukai77f8210a2014-10-07 16:35:14315 if (use_glib && !is_chromeos) {
[email protected]4625ade2014-04-15 19:26:44316 configs += [ "//build/config/linux:gconf" ]
317 deps += [ "//build/config/linux:gio" ]
318 }
319
320 if (is_linux) {
321 configs += [ "//build/config/linux:libresolv" ]
322 } else {
323 sources -= [
324 "base/crypto_module_nss.cc",
325 "base/keygen_handler_nss.cc",
326 "cert/cert_database_nss.cc",
327 "cert/nss_cert_database.cc",
328 "cert/nss_cert_database.h",
[email protected]4625ade2014-04-15 19:26:44329 "cert/x509_certificate_nss.cc",
[email protected]4625ade2014-04-15 19:26:44330 "third_party/mozilla_security_manager/nsKeygenHandler.cpp",
331 "third_party/mozilla_security_manager/nsKeygenHandler.h",
332 "third_party/mozilla_security_manager/nsNSSCertificateDB.cpp",
333 "third_party/mozilla_security_manager/nsNSSCertificateDB.h",
334 "third_party/mozilla_security_manager/nsPKCS12Blob.cpp",
335 "third_party/mozilla_security_manager/nsPKCS12Blob.h",
336 ]
[email protected]e8ab6912014-04-21 20:54:51337
mukai77f8210a2014-10-07 16:35:14338 if (!is_ios && !use_openssl) {
[email protected]e8ab6912014-04-21 20:54:51339 # These files are part of the partial implementation of NSS on iOS so
340 # keep them in that case.
341 sources -= [
342 "cert/test_root_certs_nss.cc",
343 "ocsp/nss_ocsp.cc",
344 "ocsp/nss_ocsp.h",
345 ]
346 }
[email protected]4625ade2014-04-15 19:26:44347 }
348
[email protected]e8ab6912014-04-21 20:54:51349 if (!use_nss_certs) {
[email protected]4625ade2014-04-15 19:26:44350 sources -= [
[email protected]4625ade2014-04-15 19:26:44351 "ssl/client_cert_store_nss.cc",
352 "ssl/client_cert_store_nss.h",
353 ]
[email protected]e8ab6912014-04-21 20:54:51354 if (!is_ios) {
355 # These files are part of the partial implementation of NSS on iOS so
356 # keep them in that case (even though use_nss_certs is not set).
357 sources -= [
358 "cert/cert_verify_proc_nss.cc",
359 "cert/cert_verify_proc_nss.h",
360 ]
361 }
[email protected]4625ade2014-04-15 19:26:44362 if (is_chromeos) {
363 # These were already removed on non-ChromeOS.
364 sources -= [
365 "ssl/client_cert_store_chromeos.cc",
366 "ssl/client_cert_store_chromeos.h",
367 ]
368 }
369 }
370
371 if (!enable_websockets) {
372 sources -= [
[email protected]4625ade2014-04-15 19:26:44373 "websockets/websocket_basic_handshake_stream.cc",
374 "websockets/websocket_basic_handshake_stream.h",
375 "websockets/websocket_basic_stream.cc",
376 "websockets/websocket_basic_stream.h",
377 "websockets/websocket_channel.cc",
378 "websockets/websocket_channel.h",
379 "websockets/websocket_deflate_predictor.h",
380 "websockets/websocket_deflate_predictor_impl.cc",
381 "websockets/websocket_deflate_predictor_impl.h",
382 "websockets/websocket_deflate_stream.cc",
383 "websockets/websocket_deflate_stream.h",
384 "websockets/websocket_deflater.cc",
385 "websockets/websocket_deflater.h",
386 "websockets/websocket_errors.cc",
387 "websockets/websocket_errors.h",
388 "websockets/websocket_extension.cc",
389 "websockets/websocket_extension.h",
390 "websockets/websocket_extension_parser.cc",
391 "websockets/websocket_extension_parser.h",
392 "websockets/websocket_frame.cc",
393 "websockets/websocket_frame.h",
394 "websockets/websocket_frame_parser.cc",
395 "websockets/websocket_frame_parser.h",
ricea11bdcd02014-11-20 09:57:07396 "websockets/websocket_handshake_challenge.cc",
397 "websockets/websocket_handshake_challenge.h",
satorux933fc7a2015-02-13 07:09:10398 "websockets/websocket_handshake_constants.cc",
399 "websockets/websocket_handshake_constants.h",
[email protected]4625ade2014-04-15 19:26:44400 "websockets/websocket_handshake_request_info.cc",
401 "websockets/websocket_handshake_request_info.h",
402 "websockets/websocket_handshake_response_info.cc",
403 "websockets/websocket_handshake_response_info.h",
404 "websockets/websocket_handshake_stream_base.h",
405 "websockets/websocket_handshake_stream_create_helper.cc",
406 "websockets/websocket_handshake_stream_create_helper.h",
407 "websockets/websocket_inflater.cc",
408 "websockets/websocket_inflater.h",
[email protected]4625ade2014-04-15 19:26:44409 "websockets/websocket_mux.h",
[email protected]4625ade2014-04-15 19:26:44410 "websockets/websocket_stream.cc",
411 "websockets/websocket_stream.h",
[email protected]4625ade2014-04-15 19:26:44412 ]
413 }
414
415 if (!enable_mdns) {
416 sources -= [
417 "dns/mdns_cache.cc",
418 "dns/mdns_cache.h",
419 "dns/mdns_client.cc",
420 "dns/mdns_client.h",
421 "dns/mdns_client_impl.cc",
422 "dns/mdns_client_impl.h",
423 "dns/record_parsed.cc",
424 "dns/record_parsed.h",
425 "dns/record_rdata.cc",
426 "dns/record_rdata.h",
427 ]
428 }
429
430 if (is_win) {
431 sources -= [
432 "http/http_auth_handler_ntlm_portable.cc",
[email protected]2ef2b0e2014-07-09 21:12:34433 "socket/socket_libevent.cc",
434 "socket/socket_libevent.h",
[email protected]4625ade2014-04-15 19:26:44435 "socket/tcp_socket_libevent.cc",
436 "socket/tcp_socket_libevent.h",
437 "udp/udp_socket_libevent.cc",
438 "udp/udp_socket_libevent.h",
439 ]
[email protected]4625ade2014-04-15 19:26:44440 } else { # !is_win
441 sources -= [
442 "base/winsock_init.cc",
443 "base/winsock_init.h",
444 "base/winsock_util.cc",
445 "base/winsock_util.h",
446 "proxy/proxy_resolver_winhttp.cc",
447 "proxy/proxy_resolver_winhttp.h",
448 ]
449 }
450
451 if (is_mac) {
[email protected]4625ade2014-04-15 19:26:44452 libs = [
[email protected]ab9ce6e2014-04-17 20:33:19453 "Foundation.framework",
454 "Security.framework",
455 "SystemConfiguration.framework",
456 "resolv",
[email protected]4625ade2014-04-15 19:26:44457 ]
458 }
459
460 if (is_ios) {
[email protected]b2b2bf52014-05-28 20:26:57461 # Add back some sources that were otherwise filtered out. iOS additionally
462 # doesn't set USE_NSS but needs some of the files.
463 set_sources_assignment_filter([])
464 sources += [
guoweis7eb7ab52014-11-14 17:42:56465 "base/net_util_mac.cc",
466 "base/net_util_mac.h",
[email protected]b2b2bf52014-05-28 20:26:57467 "base/network_change_notifier_mac.cc",
468 "base/network_config_watcher_mac.cc",
469 "base/platform_mime_util_mac.mm",
470 "cert/cert_verify_proc_nss.cc",
471 "cert/cert_verify_proc_nss.h",
472 "cert/test_root_certs_nss.cc",
473 "cert/x509_util_nss.cc",
474 "cert/x509_util_nss.h",
[email protected]b2b2bf52014-05-28 20:26:57475 "ocsp/nss_ocsp.cc",
476 "ocsp/nss_ocsp.h",
satorux933fc7a2015-02-13 07:09:10477 "proxy/proxy_resolver_mac.cc",
478 "proxy/proxy_server_mac.cc",
[email protected]b2b2bf52014-05-28 20:26:57479 ]
480 set_sources_assignment_filter(sources_assignment_filter)
481
[email protected]4625ade2014-04-15 19:26:44482 sources -= [ "disk_cache/blockfile/file_posix.cc" ]
[email protected]4625ade2014-04-15 19:26:44483 libs = [
[email protected]ab9ce6e2014-04-17 20:33:19484 "CFNetwork.framework",
485 "MobileCoreServices.framework",
486 "Security.framework",
487 "SystemConfiguration.framework",
488 "resolv",
[email protected]4625ade2014-04-15 19:26:44489 ]
490 }
491
erikchen006a7cf2014-12-03 22:27:11492 if (is_ios || is_mac) {
493 sources += gypi_values.net_base_mac_ios_sources
494 }
495
[email protected]4625ade2014-04-15 19:26:44496 if (is_android) {
[email protected]b2b2bf52014-05-28 20:26:57497 # Add some Linux sources that were excluded by the filter, but which
498 # are needed.
499 set_sources_assignment_filter([])
500 sources += [
[email protected]b2b2bf52014-05-28 20:26:57501 "base/address_tracker_linux.cc",
502 "base/address_tracker_linux.h",
guoweis7eb7ab52014-11-14 17:42:56503 "base/net_util_linux.cc",
scottmg34fb7e52014-12-03 23:27:24504 "base/net_util_linux.h",
satorux933fc7a2015-02-13 07:09:10505 "base/platform_mime_util_linux.cc",
[email protected]b2b2bf52014-05-28 20:26:57506 ]
507 set_sources_assignment_filter(sources_assignment_filter)
508
[email protected]4625ade2014-04-15 19:26:44509 if (!is_android_webview_build) {
[email protected]4625ade2014-04-15 19:26:44510 deps += [ ":net_jni_headers" ]
[email protected]4625ade2014-04-15 19:26:44511 }
512 }
[email protected]ad66db12014-07-10 12:43:47513
[email protected]85191ed2014-05-15 00:41:49514 if (use_icu_alternatives_on_android) {
515 deps -= [
516 "//base:i18n",
517 "//third_party/icu",
518 ]
519 sources -= [
520 "base/filename_util_icu.cc",
521 "base/net_string_util_icu.cc",
522 "base/net_util_icu.cc",
523 ]
524 sources += [
525 "base/net_string_util_icu_alternatives_android.cc",
526 "base/net_string_util_icu_alternatives_android.h",
527 ]
528 }
[email protected]4625ade2014-04-15 19:26:44529}
530
531grit("net_resources") {
532 source = "base/net_resources.grd"
[email protected]7ae52902014-08-18 22:36:01533 use_qualified_include = true
[email protected]b89c53842014-07-23 16:32:32534 outputs = [
535 "grit/net_resources.h",
536 "net_resources.pak",
537 "net_resources.rc",
538 ]
[email protected]4625ade2014-04-15 19:26:44539}
540
Brett Wilson83fd4242014-09-02 19:45:33541static_library("extras") {
mef327a8e42014-08-29 17:10:03542 sources = gypi_values.net_extras_sources
543 configs += [ "//build/config/compiler:wexit_time_destructors" ]
544 deps = [
545 ":net",
brettwbc44c0a92015-02-20 22:30:39546 "//base",
mef327a8e42014-08-29 17:10:03547 "//sql:sql",
548 ]
549}
550
[email protected]8a3f8242014-06-05 18:05:12551static_library("http_server") {
[email protected]4625ade2014-04-15 19:26:44552 sources = [
553 "server/http_connection.cc",
554 "server/http_connection.h",
555 "server/http_server.cc",
556 "server/http_server.h",
557 "server/http_server_request_info.cc",
558 "server/http_server_request_info.h",
559 "server/http_server_response_info.cc",
560 "server/http_server_response_info.h",
561 "server/web_socket.cc",
562 "server/web_socket.h",
dgozmana6e70092014-12-12 14:46:21563 "server/web_socket_encoder.cc",
564 "server/web_socket_encoder.h",
[email protected]4625ade2014-04-15 19:26:44565 ]
jambc6cc8e2014-11-14 17:56:29566 configs += [
brettwd1c719a2015-02-19 23:17:04567 "//build/config/compiler:no_size_t_to_int_warning",
jambc6cc8e2014-11-14 17:56:29568 "//build/config/compiler:wexit_time_destructors",
jambc6cc8e2014-11-14 17:56:29569 ]
[email protected]4625ade2014-04-15 19:26:44570 deps = [
571 ":net",
572 "//base",
573 ]
574}
575
[email protected]8603c5de2014-04-16 20:34:31576executable("dump_cache") {
Brett Wilson8f80ad0b2014-09-08 19:50:24577 testonly = true
[email protected]8603c5de2014-04-16 20:34:31578 sources = [
579 "tools/dump_cache/cache_dumper.cc",
580 "tools/dump_cache/cache_dumper.h",
581 "tools/dump_cache/dump_cache.cc",
582 "tools/dump_cache/dump_files.cc",
583 "tools/dump_cache/dump_files.h",
584 "tools/dump_cache/simple_cache_dumper.cc",
585 "tools/dump_cache/simple_cache_dumper.h",
[email protected]8603c5de2014-04-16 20:34:31586 "tools/dump_cache/url_to_filename_encoder.cc",
587 "tools/dump_cache/url_to_filename_encoder.h",
[email protected]8603c5de2014-04-16 20:34:31588 "tools/dump_cache/url_utilities.cc",
satorux933fc7a2015-02-13 07:09:10589 "tools/dump_cache/url_utilities.h",
[email protected]8603c5de2014-04-16 20:34:31590 ]
[email protected]4625ade2014-04-15 19:26:44591
brettwd1c719a2015-02-19 23:17:04592 # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
593 configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
[email protected]8603c5de2014-04-16 20:34:31594
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 = [
mmenke9e4ea8fe2014-11-19 23:12:30605 "base/captured_net_log_entry.cc",
606 "base/captured_net_log_entry.h",
[email protected]8603c5de2014-04-16 20:34:31607 "base/capturing_net_log.cc",
608 "base/capturing_net_log.h",
mmenke9e4ea8fe2014-11-19 23:12:30609 "base/capturing_net_log_observer.cc",
610 "base/capturing_net_log_observer.h",
[email protected]8603c5de2014-04-16 20:34:31611 "base/load_timing_info_test_util.cc",
612 "base/load_timing_info_test_util.h",
613 "base/mock_file_stream.cc",
614 "base/mock_file_stream.h",
615 "base/test_completion_callback.cc",
616 "base/test_completion_callback.h",
617 "base/test_data_directory.cc",
618 "base/test_data_directory.h",
619 "cert/mock_cert_verifier.cc",
620 "cert/mock_cert_verifier.h",
621 "cookies/cookie_monster_store_test.cc",
622 "cookies/cookie_monster_store_test.h",
623 "cookies/cookie_store_test_callbacks.cc",
624 "cookies/cookie_store_test_callbacks.h",
625 "cookies/cookie_store_test_helpers.cc",
626 "cookies/cookie_store_test_helpers.h",
627 "disk_cache/disk_cache_test_base.cc",
628 "disk_cache/disk_cache_test_base.h",
629 "disk_cache/disk_cache_test_util.cc",
630 "disk_cache/disk_cache_test_util.h",
631 "dns/dns_test_util.cc",
632 "dns/dns_test_util.h",
633 "dns/mock_host_resolver.cc",
634 "dns/mock_host_resolver.h",
635 "dns/mock_mdns_socket_factory.cc",
636 "dns/mock_mdns_socket_factory.h",
[email protected]8a3f8242014-06-05 18:05:12637 "http/http_transaction_test_util.cc",
638 "http/http_transaction_test_util.h",
[email protected]8603c5de2014-04-16 20:34:31639 "proxy/mock_proxy_resolver.cc",
640 "proxy/mock_proxy_resolver.h",
641 "proxy/mock_proxy_script_fetcher.cc",
642 "proxy/mock_proxy_script_fetcher.h",
643 "proxy/proxy_config_service_common_unittest.cc",
644 "proxy/proxy_config_service_common_unittest.h",
645 "socket/socket_test_util.cc",
646 "socket/socket_test_util.h",
647 "test/cert_test_util.cc",
648 "test/cert_test_util.h",
[email protected]83e1ae32014-07-18 10:57:07649 "test/cert_test_util_nss.cc",
[email protected]8603c5de2014-04-16 20:34:31650 "test/ct_test_util.cc",
651 "test/ct_test_util.h",
652 "test/embedded_test_server/embedded_test_server.cc",
653 "test/embedded_test_server/embedded_test_server.h",
654 "test/embedded_test_server/http_connection.cc",
655 "test/embedded_test_server/http_connection.h",
656 "test/embedded_test_server/http_request.cc",
657 "test/embedded_test_server/http_request.h",
658 "test/embedded_test_server/http_response.cc",
659 "test/embedded_test_server/http_response.h",
660 "test/net_test_suite.cc",
661 "test/net_test_suite.h",
662 "test/python_utils.cc",
663 "test/python_utils.h",
664 "test/spawned_test_server/base_test_server.cc",
665 "test/spawned_test_server/base_test_server.h",
[email protected]8603c5de2014-04-16 20:34:31666 "test/spawned_test_server/local_test_server.cc",
667 "test/spawned_test_server/local_test_server.h",
satorux933fc7a2015-02-13 07:09:10668 "test/spawned_test_server/local_test_server_posix.cc",
669 "test/spawned_test_server/local_test_server_win.cc",
[email protected]8603c5de2014-04-16 20:34:31670 "test/spawned_test_server/remote_test_server.cc",
671 "test/spawned_test_server/remote_test_server.h",
672 "test/spawned_test_server/spawned_test_server.h",
673 "test/spawned_test_server/spawner_communicator.cc",
674 "test/spawned_test_server/spawner_communicator.h",
Brett Wilson32ce17a2014-11-10 17:45:30675 "test/url_request/url_request_failed_job.cc",
676 "test/url_request/url_request_failed_job.h",
mef3e826cf2014-12-13 18:40:40677 "test/url_request/url_request_mock_data_job.cc",
678 "test/url_request/url_request_mock_data_job.h",
Brett Wilson32ce17a2014-11-10 17:45:30679 "test/url_request/url_request_mock_http_job.cc",
680 "test/url_request/url_request_mock_http_job.h",
jam8e45cd72015-01-20 16:33:44681 "test/url_request/url_request_slow_download_job.cc",
682 "test/url_request/url_request_slow_download_job.h",
[email protected]8603c5de2014-04-16 20:34:31683 "url_request/test_url_fetcher_factory.cc",
684 "url_request/test_url_fetcher_factory.h",
tommyclieaae5d92014-09-09 06:03:47685 "url_request/test_url_request_interceptor.cc",
686 "url_request/test_url_request_interceptor.h",
[email protected]8603c5de2014-04-16 20:34:31687 "url_request/url_request_test_util.cc",
688 "url_request/url_request_test_util.h",
689 ]
690
brettwd1c719a2015-02-19 23:17:04691 # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
692 configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
[email protected]8603c5de2014-04-16 20:34:31693
Brett Wilsone53895272014-09-23 23:41:46694 public_deps = [
[email protected]8603c5de2014-04-16 20:34:31695 "//base",
696 "//base/test:test_support",
[email protected]22fe91d2014-08-12 17:07:12697 "//crypto",
[email protected]59ff2d42014-04-22 22:25:23698 "//net",
[email protected]8603c5de2014-04-16 20:34:31699 "//net/tools/tld_cleanup",
700 "//testing/gmock",
701 "//testing/gtest",
702 "//url",
703 ]
704
davidben15d69d482014-09-29 18:24:08705 if (!use_openssl && (use_nss_certs || is_ios)) {
scottmg34fb7e52014-12-03 23:27:24706 public_deps += [ "//crypto:platform" ]
[email protected]8603c5de2014-04-16 20:34:31707 }
708
709 if (!is_android) {
710 sources -= [
711 "test/spawned_test_server/remote_test_server.cc",
712 "test/spawned_test_server/remote_test_server.h",
713 "test/spawned_test_server/spawner_communicator.cc",
714 "test/spawned_test_server/spawner_communicator.h",
715 ]
716 }
717
718 if (use_v8_in_net) {
Brett Wilsone53895272014-09-23 23:41:46719 public_deps += [ ":net_with_v8" ]
[email protected]8603c5de2014-04-16 20:34:31720 }
721
722 if (!enable_mdns) {
723 sources -= [
724 "dns/mock_mdns_socket_factory.cc",
725 "dns/mock_mdns_socket_factory.h",
726 ]
727 }
728
davidben15d69d482014-09-29 18:24:08729 if (!use_nss_certs) {
scottmg34fb7e52014-12-03 23:27:24730 sources -= [ "test/cert_test_util_nss.cc" ]
[email protected]83e1ae32014-07-18 10:57:07731 }
[email protected]8603c5de2014-04-16 20:34:31732}
733
[email protected]ceeaac792014-06-25 05:14:43734source_set("balsa") {
735 sources = [
736 "tools/balsa/balsa_enums.h",
737 "tools/balsa/balsa_frame.cc",
738 "tools/balsa/balsa_frame.h",
739 "tools/balsa/balsa_headers.cc",
740 "tools/balsa/balsa_headers.h",
741 "tools/balsa/balsa_headers_token_utils.cc",
742 "tools/balsa/balsa_headers_token_utils.h",
743 "tools/balsa/balsa_visitor_interface.h",
744 "tools/balsa/http_message_constants.cc",
745 "tools/balsa/http_message_constants.h",
746 "tools/balsa/noop_balsa_visitor.h",
747 "tools/balsa/simple_buffer.cc",
748 "tools/balsa/simple_buffer.h",
749 "tools/balsa/split.cc",
750 "tools/balsa/split.h",
751 "tools/balsa/string_piece_utils.h",
752 "tools/quic/spdy_utils.cc",
753 "tools/quic/spdy_utils.h",
754 ]
755 deps = [
756 ":net",
757 "//base",
[email protected]22fe91d2014-08-12 17:07:12758 "//url",
[email protected]ceeaac792014-06-25 05:14:43759 ]
760}
761
[email protected]8603c5de2014-04-16 20:34:31762if (use_v8_in_net) {
763 component("net_with_v8") {
764 sources = [
765 "proxy/proxy_resolver_v8.cc",
766 "proxy/proxy_resolver_v8.h",
767 "proxy/proxy_resolver_v8_tracing.cc",
768 "proxy/proxy_resolver_v8_tracing.h",
769 "proxy/proxy_service_v8.cc",
770 "proxy/proxy_service_v8.h",
771 ]
772
773 defines = [ "NET_IMPLEMENTATION" ]
774 configs += [
brettwd1c719a2015-02-19 23:17:04775 "//build/config/compiler:no_size_t_to_int_warning",
[email protected]8603c5de2014-04-16 20:34:31776 "//build/config/compiler:wexit_time_destructors",
777 ]
778
Brett Wilsone53895272014-09-23 23:41:46779 public_deps = [
[email protected]8603c5de2014-04-16 20:34:31780 ":net",
Brett Wilsone53895272014-09-23 23:41:46781 ]
782 deps = [
[email protected]8603c5de2014-04-16 20:34:31783 "//base",
784 "//gin",
785 "//url",
786 "//v8",
787 ]
788 }
789}
790
amistry7e6ebfdc82015-02-13 04:19:11791if (use_v8_in_net && !is_android) {
792 source_set("net_browser_services") {
793 sources = [
794 "dns/mojo_host_resolver_impl.cc",
795 "dns/mojo_host_resolver_impl.h",
796 ]
797
798 public_deps = [
799 ":mojo_type_converters",
800 ":net",
brettwbc44c0a92015-02-20 22:30:39801 "//base",
amistry7e6ebfdc82015-02-13 04:19:11802 "//net/interfaces",
803 "//third_party/mojo/src/mojo/public/cpp/bindings",
804 ]
805 }
806
807 source_set("mojo_type_converters") {
808 sources = [
809 "dns/mojo_type_converters.cc",
810 "dns/mojo_type_converters.h",
811 ]
812
813 public_deps = [
814 ":net",
815 "//net/interfaces",
816 "//third_party/mojo/src/mojo/public/cpp/bindings",
817 ]
818 }
819}
820
[email protected]8603c5de2014-04-16 20:34:31821if (!is_ios && !is_android) {
822 executable("crash_cache") {
Brett Wilson8f80ad0b2014-09-08 19:50:24823 testonly = true
scottmg34fb7e52014-12-03 23:27:24824 sources = [
825 "tools/crash_cache/crash_cache.cc",
826 ]
dpranke43276212015-02-20 02:55:19827
brettwd1c719a2015-02-19 23:17:04828 # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
829 configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
[email protected]8603c5de2014-04-16 20:34:31830 deps = [
831 ":net",
[email protected]b2b2bf52014-05-28 20:26:57832 ":test_support",
[email protected]8603c5de2014-04-16 20:34:31833 "//base",
834 ]
835 }
836
837 executable("crl_set_dump") {
Brett Wilson8f80ad0b2014-09-08 19:50:24838 testonly = true
scottmg34fb7e52014-12-03 23:27:24839 sources = [
840 "tools/crl_set_dump/crl_set_dump.cc",
841 ]
dpranke43276212015-02-20 02:55:19842
brettwd1c719a2015-02-19 23:17:04843 # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
844 configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
[email protected]8603c5de2014-04-16 20:34:31845 deps = [
846 ":net",
847 "//base",
848 ]
849 }
850
851 executable("dns_fuzz_stub") {
Brett Wilson8f80ad0b2014-09-08 19:50:24852 testonly = true
scottmg34fb7e52014-12-03 23:27:24853 sources = [
854 "tools/dns_fuzz_stub/dns_fuzz_stub.cc",
855 ]
dpranke43276212015-02-20 02:55:19856
brettwd1c719a2015-02-19 23:17:04857 # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
858 configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
[email protected]8603c5de2014-04-16 20:34:31859 deps = [
860 ":net",
861 "//base",
862 ]
863 }
864
865 executable("gdig") {
Brett Wilson8f80ad0b2014-09-08 19:50:24866 testonly = true
[email protected]8603c5de2014-04-16 20:34:31867 sources = [
868 "tools/gdig/file_net_log.cc",
869 "tools/gdig/gdig.cc",
870 ]
871 deps = [
872 ":net",
873 "//base",
874 ]
875 }
876
877 executable("get_server_time") {
Brett Wilson8f80ad0b2014-09-08 19:50:24878 testonly = true
scottmg34fb7e52014-12-03 23:27:24879 sources = [
880 "tools/get_server_time/get_server_time.cc",
881 ]
dpranke43276212015-02-20 02:55:19882
brettwd1c719a2015-02-19 23:17:04883 # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
884 configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
[email protected]8603c5de2014-04-16 20:34:31885 deps = [
886 ":net",
887 "//base",
888 "//base:i18n",
889 "//url",
890 ]
891 }
892
893 if (use_v8_in_net) {
894 executable("net_watcher") {
Brett Wilson8f80ad0b2014-09-08 19:50:24895 testonly = true
scottmg34fb7e52014-12-03 23:27:24896 sources = [
897 "tools/net_watcher/net_watcher.cc",
898 ]
[email protected]8603c5de2014-04-16 20:34:31899 deps = [
900 ":net",
901 ":net_with_v8",
902 "//base",
903 ]
904
mukai77f8210a2014-10-07 16:35:14905 if (is_desktop_linux) {
[email protected]22fe91d2014-08-12 17:07:12906 configs += [
907 "//build/config/linux:gconf",
908 "//build/config/linux:glib",
909 ]
[email protected]8603c5de2014-04-16 20:34:31910 deps += [ "//build/config/linux:gio" ]
911 }
912 }
913 }
914
915 executable("run_testserver") {
Brett Wilson8f80ad0b2014-09-08 19:50:24916 testonly = true
scottmg34fb7e52014-12-03 23:27:24917 sources = [
918 "tools/testserver/run_testserver.cc",
919 ]
[email protected]8603c5de2014-04-16 20:34:31920 deps = [
921 ":net", # TODO(brettw) bug 363749: this shouldn't be necessary. It's not
922 # in the GYP build, and can be removed when the bug is fixed.
[email protected]b2b2bf52014-05-28 20:26:57923 ":test_support",
[email protected]8603c5de2014-04-16 20:34:31924 "//base",
925 "//base/test:test_support",
926 "//testing/gtest",
927 ]
928 }
929
930 executable("stress_cache") {
Brett Wilson8f80ad0b2014-09-08 19:50:24931 testonly = true
scottmg34fb7e52014-12-03 23:27:24932 sources = [
933 "disk_cache/blockfile/stress_cache.cc",
934 ]
dpranke43276212015-02-20 02:55:19935
brettwd1c719a2015-02-19 23:17:04936 # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
937 configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
[email protected]8603c5de2014-04-16 20:34:31938 deps = [
939 ":net",
[email protected]b2b2bf52014-05-28 20:26:57940 ":test_support",
[email protected]8603c5de2014-04-16 20:34:31941 "//base",
942 ]
943 }
944
945 executable("tld_cleanup") {
scottmg34fb7e52014-12-03 23:27:24946 sources = [
947 "tools/tld_cleanup/tld_cleanup.cc",
948 ]
dpranke43276212015-02-20 02:55:19949
brettwd1c719a2015-02-19 23:17:04950 # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
951 configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
[email protected]8603c5de2014-04-16 20:34:31952 deps = [
953 "//base",
954 "//base:i18n",
955 "//net/tools/tld_cleanup",
956 ]
957 }
958}
959
960if (is_linux) {
[email protected]8a3f8242014-06-05 18:05:12961 static_library("epoll_server") {
[email protected]8603c5de2014-04-16 20:34:31962 sources = [
963 "tools/epoll_server/epoll_server.cc",
964 "tools/epoll_server/epoll_server.h",
965 ]
966 deps = [
967 ":net",
968 "//base",
969 ]
970 }
971
[email protected]8a3f8242014-06-05 18:05:12972 static_library("flip_in_mem_edsm_server_base") {
Brett Wilson8f80ad0b2014-09-08 19:50:24973 testonly = true
[email protected]8603c5de2014-04-16 20:34:31974 sources = [
975 "tools/dump_cache/url_to_filename_encoder.cc",
976 "tools/dump_cache/url_to_filename_encoder.h",
[email protected]8603c5de2014-04-16 20:34:31977 "tools/dump_cache/url_utilities.cc",
satorux933fc7a2015-02-13 07:09:10978 "tools/dump_cache/url_utilities.h",
[email protected]8603c5de2014-04-16 20:34:31979 "tools/flip_server/acceptor_thread.cc",
satorux933fc7a2015-02-13 07:09:10980 "tools/flip_server/acceptor_thread.h",
981 "tools/flip_server/constants.h",
[email protected]8603c5de2014-04-16 20:34:31982 "tools/flip_server/create_listener.cc",
983 "tools/flip_server/create_listener.h",
[email protected]8603c5de2014-04-16 20:34:31984 "tools/flip_server/flip_config.cc",
985 "tools/flip_server/flip_config.h",
986 "tools/flip_server/http_interface.cc",
987 "tools/flip_server/http_interface.h",
988 "tools/flip_server/loadtime_measurement.h",
[email protected]8603c5de2014-04-16 20:34:31989 "tools/flip_server/mem_cache.cc",
satorux933fc7a2015-02-13 07:09:10990 "tools/flip_server/mem_cache.h",
[email protected]8603c5de2014-04-16 20:34:31991 "tools/flip_server/output_ordering.cc",
992 "tools/flip_server/output_ordering.h",
993 "tools/flip_server/ring_buffer.cc",
994 "tools/flip_server/ring_buffer.h",
995 "tools/flip_server/sm_connection.cc",
996 "tools/flip_server/sm_connection.h",
997 "tools/flip_server/sm_interface.h",
[email protected]8603c5de2014-04-16 20:34:31998 "tools/flip_server/spdy_interface.cc",
999 "tools/flip_server/spdy_interface.h",
satorux933fc7a2015-02-13 07:09:101000 "tools/flip_server/spdy_ssl.cc",
1001 "tools/flip_server/spdy_ssl.h",
[email protected]8603c5de2014-04-16 20:34:311002 "tools/flip_server/spdy_util.cc",
1003 "tools/flip_server/spdy_util.h",
1004 "tools/flip_server/streamer_interface.cc",
1005 "tools/flip_server/streamer_interface.h",
1006 ]
1007 deps = [
1008 ":balsa",
1009 ":epoll_server",
1010 ":net",
1011 "//base",
[email protected]edfd0f42014-07-22 18:20:371012 "//third_party/boringssl",
[email protected]8603c5de2014-04-16 20:34:311013 ]
1014 }
1015
1016 executable("flip_in_mem_edsm_server_unittests") {
Brett Wilson8f80ad0b2014-09-08 19:50:241017 testonly = true
[email protected]8603c5de2014-04-16 20:34:311018 sources = [
1019 "tools/flip_server/flip_test_utils.cc",
1020 "tools/flip_server/flip_test_utils.h",
1021 "tools/flip_server/http_interface_test.cc",
1022 "tools/flip_server/mem_cache_test.cc",
1023 "tools/flip_server/run_all_tests.cc",
1024 "tools/flip_server/spdy_interface_test.cc",
1025 ]
1026 deps = [
brettwbc44c0a92015-02-20 22:30:391027 ":balsa",
[email protected]8603c5de2014-04-16 20:34:311028 ":flip_in_mem_edsm_server_base",
1029 ":net",
[email protected]b2b2bf52014-05-28 20:26:571030 ":test_support",
[email protected]8603c5de2014-04-16 20:34:311031 "//testing/gtest",
1032 "//testing/gmock",
[email protected]edfd0f42014-07-22 18:20:371033 "//third_party/boringssl",
[email protected]8603c5de2014-04-16 20:34:311034 ]
1035 }
1036
1037 executable("flip_in_mem_edsm_server") {
Brett Wilson8f80ad0b2014-09-08 19:50:241038 testonly = true
scottmg34fb7e52014-12-03 23:27:241039 sources = [
1040 "tools/flip_server/flip_in_mem_edsm_server.cc",
1041 ]
[email protected]8603c5de2014-04-16 20:34:311042 deps = [
brettwbc44c0a92015-02-20 22:30:391043 ":balsa",
[email protected]8603c5de2014-04-16 20:34:311044 ":flip_in_mem_edsm_server_base",
1045 ":net",
1046 "//base",
1047 ]
1048 }
1049
1050 source_set("quic_base") {
1051 sources = [
1052 "tools/quic/quic_client.cc",
1053 "tools/quic/quic_client.h",
1054 "tools/quic/quic_client_session.cc",
1055 "tools/quic/quic_client_session.h",
1056 "tools/quic/quic_default_packet_writer.cc",
1057 "tools/quic/quic_default_packet_writer.h",
[email protected]8603c5de2014-04-16 20:34:311058 "tools/quic/quic_dispatcher.cc",
satorux933fc7a2015-02-13 07:09:101059 "tools/quic/quic_dispatcher.h",
[email protected]8603c5de2014-04-16 20:34:311060 "tools/quic/quic_epoll_clock.cc",
1061 "tools/quic/quic_epoll_clock.h",
1062 "tools/quic/quic_epoll_connection_helper.cc",
1063 "tools/quic/quic_epoll_connection_helper.h",
1064 "tools/quic/quic_in_memory_cache.cc",
1065 "tools/quic/quic_in_memory_cache.h",
1066 "tools/quic/quic_packet_writer_wrapper.cc",
1067 "tools/quic/quic_packet_writer_wrapper.h",
[email protected]6d515822014-08-22 01:58:061068 "tools/quic/quic_per_connection_packet_writer.cc",
1069 "tools/quic/quic_per_connection_packet_writer.h",
[email protected]8603c5de2014-04-16 20:34:311070 "tools/quic/quic_server.cc",
1071 "tools/quic/quic_server.h",
1072 "tools/quic/quic_server_session.cc",
1073 "tools/quic/quic_server_session.h",
1074 "tools/quic/quic_socket_utils.cc",
1075 "tools/quic/quic_socket_utils.h",
1076 "tools/quic/quic_spdy_client_stream.cc",
1077 "tools/quic/quic_spdy_client_stream.h",
1078 "tools/quic/quic_spdy_server_stream.cc",
1079 "tools/quic/quic_spdy_server_stream.h",
[email protected]8603c5de2014-04-16 20:34:311080 "tools/quic/quic_time_wait_list_manager.cc",
satorux933fc7a2015-02-13 07:09:101081 "tools/quic/quic_time_wait_list_manager.h",
[email protected]8603c5de2014-04-16 20:34:311082 ]
1083 deps = [
1084 ":balsa",
1085 ":epoll_server",
1086 ":net",
1087 "//base",
1088 "//base/third_party/dynamic_annotations",
1089 "//crypto",
[email protected]edfd0f42014-07-22 18:20:371090 "//third_party/boringssl",
[email protected]8603c5de2014-04-16 20:34:311091 "//url",
1092 ]
1093 }
1094
1095 executable("quic_client") {
scottmg34fb7e52014-12-03 23:27:241096 sources = [
1097 "tools/quic/quic_client_bin.cc",
1098 ]
[email protected]8603c5de2014-04-16 20:34:311099 deps = [
brettwbc44c0a92015-02-20 22:30:391100 ":balsa",
1101 ":epoll_server",
[email protected]8603c5de2014-04-16 20:34:311102 ":quic_base",
1103 ":net",
1104 "//base",
[email protected]edfd0f42014-07-22 18:20:371105 "//third_party/boringssl",
[email protected]8603c5de2014-04-16 20:34:311106 ]
1107 }
[email protected]8603c5de2014-04-16 20:34:311108}
1109
[email protected]ef0eb442014-05-15 09:32:181110if (is_android) {
1111 generate_jni("net_jni_headers") {
1112 sources = [
1113 "android/java/src/org/chromium/net/AndroidCertVerifyResult.java",
1114 "android/java/src/org/chromium/net/AndroidKeyStore.java",
1115 "android/java/src/org/chromium/net/AndroidNetworkLibrary.java",
1116 "android/java/src/org/chromium/net/AndroidPrivateKey.java",
1117 "android/java/src/org/chromium/net/GURLUtils.java",
1118 "android/java/src/org/chromium/net/NetworkChangeNotifier.java",
1119 "android/java/src/org/chromium/net/ProxyChangeListener.java",
1120 "android/java/src/org/chromium/net/X509Util.java",
1121 ]
1122 jni_package = "net"
1123 }
cjhopmandad5f4272014-09-05 01:00:551124 generate_jni("net_test_jni_headers") {
1125 sources = [
1126 "android/javatests/src/org/chromium/net/AndroidKeyStoreTestUtil.java",
1127 ]
1128 jni_package = "net"
1129 }
[email protected]ef0eb442014-05-15 09:32:181130}
[email protected]8603c5de2014-04-16 20:34:311131
1132if (is_android || is_linux) {
1133 executable("disk_cache_memory_test") {
Brett Wilson8f80ad0b2014-09-08 19:50:241134 testonly = true
scottmg34fb7e52014-12-03 23:27:241135 sources = [
1136 "tools/disk_cache_memory_test/disk_cache_memory_test.cc",
1137 ]
[email protected]8603c5de2014-04-16 20:34:311138 deps = [
1139 ":net",
1140 "//base",
1141 ]
1142 }
1143}
[email protected]8a3f8242014-06-05 18:05:121144
1145# TODO(GYP) make this compile on Android, we need some native test deps done.
[email protected]bd82a57d2014-07-31 16:52:341146# TODO(GYP) Also doesn't work on Windows; dependency on boringssl is wrong.
dprankecf8465db72014-11-10 23:51:221147# TODO(GYP) Also doesn't work on Mac, need to figure out why not.
1148if (!is_android && !is_win && !is_mac) {
scottmg34fb7e52014-12-03 23:27:241149 source_set("quic_tools") {
1150 sources = [
1151 "quic/quic_dispatcher.cc",
1152 "quic/quic_dispatcher.h",
1153 "quic/quic_in_memory_cache.cc",
1154 "quic/quic_in_memory_cache.h",
1155 "quic/quic_per_connection_packet_writer.cc",
1156 "quic/quic_per_connection_packet_writer.h",
1157 "quic/quic_server.cc",
1158 "quic/quic_server.h",
1159 "quic/quic_server_packet_writer.cc",
1160 "quic/quic_server_packet_writer.h",
1161 "quic/quic_server_session.cc",
1162 "quic/quic_server_session.h",
1163 "quic/quic_spdy_server_stream.cc",
1164 "quic/quic_spdy_server_stream.h",
1165 "quic/quic_time_wait_list_manager.cc",
1166 "quic/quic_time_wait_list_manager.h",
1167 ]
1168 deps = [
1169 ":net",
1170 "//base",
1171 "//base/third_party/dynamic_annotations",
1172 "//url",
[email protected]8a3f8242014-06-05 18:05:121173 ]
1174 }
1175
scottmg34fb7e52014-12-03 23:27:241176 test("net_unittests") {
1177 sources = gypi_values.net_test_sources
erikchen006a7cf2014-12-03 22:27:111178
brettwd1c719a2015-02-19 23:17:041179 # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
1180 configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
scottmg34fb7e52014-12-03 23:27:241181 defines = []
[email protected]8a3f8242014-06-05 18:05:121182
scottmg34fb7e52014-12-03 23:27:241183 deps = [
1184 ":extras",
1185 ":http_server",
1186 ":net",
1187 ":quic_tools",
1188 ":test_support",
1189 "//base",
1190 "//base:i18n",
1191 "//base:prefs_test_support",
1192 "//base/allocator",
1193 "//base/third_party/dynamic_annotations",
1194 "//crypto",
1195 "//crypto:platform",
1196 "//crypto:test_support",
brettwbc44c0a92015-02-20 22:30:391197 "//gin",
scottmg34fb7e52014-12-03 23:27:241198 "//net/base/registry_controlled_domains",
brettwbc44c0a92015-02-20 22:30:391199 "//sql",
scottmg34fb7e52014-12-03 23:27:241200 "//testing/gmock",
1201 "//testing/gtest",
1202 "//third_party/zlib",
1203 "//url",
[email protected]8a3f8242014-06-05 18:05:121204 ]
[email protected]8a3f8242014-06-05 18:05:121205
scottmg34fb7e52014-12-03 23:27:241206 if (is_linux) {
1207 sources += gypi_values.net_linux_test_sources
1208 deps += [
1209 ":balsa",
1210 ":epoll_server",
1211 ":flip_in_mem_edsm_server_base",
1212 ":quic_base",
[email protected]b2f44d12014-06-10 17:48:031213 ]
1214 }
[email protected]8a3f8242014-06-05 18:05:121215
scottmg34fb7e52014-12-03 23:27:241216 if (is_mac || is_ios) {
1217 sources += gypi_values.net_base_test_mac_ios_sources
1218 }
1219
brettwc859f18f2014-09-18 23:34:501220 if (is_chromeos) {
scottmg34fb7e52014-12-03 23:27:241221 sources -= [ "proxy/proxy_config_service_linux_unittest.cc" ]
1222 }
1223
1224 if (is_android) {
brettwc859f18f2014-09-18 23:34:501225 sources -= [
scottmg34fb7e52014-12-03 23:27:241226 # See bug http://crbug.com/344533.
1227 "disk_cache/blockfile/index_table_v3_unittest.cc",
1228
1229 # No res_ninit() et al on Android, so this doesn't make a lot of
1230 # sense.
1231 "dns/dns_config_service_posix_unittest.cc",
1232 ]
1233 deps += [
1234 ":net_javatests", # FIXME(brettw)
1235 ":net_test_jni_headers",
brettwc859f18f2014-09-18 23:34:501236 ]
1237 }
scottmg34fb7e52014-12-03 23:27:241238
rmcilroy5837d332014-12-17 14:30:581239 if (v8_use_external_startup_data) {
1240 deps += [ "//gin" ]
1241 }
1242
scottmg34fb7e52014-12-03 23:27:241243 if (!use_nss_certs) {
1244 sources -= [ "ssl/client_cert_store_nss_unittest.cc" ]
1245 if (is_chromeos) { # Already removed for all non-ChromeOS builds.
1246 sources -= [ "ssl/client_cert_store_chromeos_unittest.cc" ]
1247 }
1248 }
1249
1250 if (use_openssl) {
1251 # When building for OpenSSL, we need to exclude NSS specific tests
1252 # or functionality not supported by OpenSSL yet.
1253 # TODO(bulach): Add equivalent tests when the underlying
1254 # functionality is ported to OpenSSL.
1255 sources -= [
1256 "cert/nss_cert_database_unittest.cc",
1257 "cert/x509_util_nss_unittest.cc",
1258 "quic/test_tools/crypto_test_utils_nss.cc",
1259 ]
1260 if (is_chromeos) {
1261 # These were already removed in the non-ChromeOS case.
1262 sources -= [
1263 "cert/nss_cert_database_chromeos_unittest.cc",
1264 "cert/nss_profile_filter_chromeos_unittest.cc",
1265 ]
1266 }
1267 } else {
1268 sources -= [
1269 "cert/x509_util_openssl_unittest.cc",
1270 "quic/test_tools/crypto_test_utils_openssl.cc",
1271 "socket/ssl_client_socket_openssl_unittest.cc",
1272 "socket/ssl_session_cache_openssl_unittest.cc",
1273 ]
1274 if (!is_desktop_linux && !is_chromeos) {
1275 sources -= [ "cert/nss_cert_database_unittest.cc" ]
1276 }
1277 }
1278
1279 if (use_kerberos) {
1280 defines += [ "USE_KERBEROS" ]
1281 } else {
1282 sources -= [
1283 "http/http_auth_gssapi_posix_unittest.cc",
1284 "http/http_auth_handler_negotiate_unittest.cc",
1285 "http/mock_gssapi_library_posix.cc",
1286 "http/mock_gssapi_library_posix.h",
1287 ]
1288 }
1289
1290 if (use_openssl || (!is_desktop_linux && !is_chromeos && !is_ios)) {
1291 # Only include this test when on Posix and using NSS for
1292 # cert verification or on iOS (which also uses NSS for certs).
1293 sources -= [ "ocsp/nss_ocsp_unittest.cc" ]
1294 }
1295
1296 if (!use_openssl_certs) {
1297 sources -= [ "ssl/openssl_client_key_store_unittest.cc" ]
1298 }
1299
1300 if (!enable_websockets) {
1301 sources -= [
dgozmana6e70092014-12-12 14:46:211302 "server/http_connection_unittest.cc",
1303 "server/http_server_response_info_unittest.cc",
1304 "server/http_server_unittest.cc",
1305 "server/web_socket_encoder_unittest.cc",
scottmg34fb7e52014-12-03 23:27:241306 "websockets/websocket_basic_stream_test.cc",
1307 "websockets/websocket_channel_test.cc",
1308 "websockets/websocket_deflate_predictor_impl_test.cc",
1309 "websockets/websocket_deflate_stream_test.cc",
1310 "websockets/websocket_deflater_test.cc",
ricea433bdab2015-01-26 07:25:371311 "websockets/websocket_end_to_end_test.cc",
satorux933fc7a2015-02-13 07:09:101312 "websockets/websocket_errors_test.cc",
scottmg34fb7e52014-12-03 23:27:241313 "websockets/websocket_extension_parser_test.cc",
1314 "websockets/websocket_frame_parser_test.cc",
1315 "websockets/websocket_frame_test.cc",
1316 "websockets/websocket_handshake_challenge_test.cc",
1317 "websockets/websocket_handshake_stream_create_helper_test.cc",
1318 "websockets/websocket_inflater_test.cc",
1319 "websockets/websocket_stream_test.cc",
1320 "websockets/websocket_test_util.cc",
1321 "websockets/websocket_test_util.h",
1322 ]
dgozmana6e70092014-12-12 14:46:211323 deps -= [ ":http_server" ]
scottmg34fb7e52014-12-03 23:27:241324 }
1325
1326 if (disable_file_support) {
1327 sources -= [
1328 "base/directory_lister_unittest.cc",
1329 "url_request/url_request_file_job_unittest.cc",
1330 ]
1331 }
1332
1333 if (disable_ftp_support) {
1334 sources -= [
1335 "ftp/ftp_auth_cache_unittest.cc",
1336 "ftp/ftp_ctrl_response_buffer_unittest.cc",
1337 "ftp/ftp_directory_listing_parser_ls_unittest.cc",
1338 "ftp/ftp_directory_listing_parser_netware_unittest.cc",
1339 "ftp/ftp_directory_listing_parser_os2_unittest.cc",
1340 "ftp/ftp_directory_listing_parser_unittest.cc",
1341 "ftp/ftp_directory_listing_parser_unittest.h",
1342 "ftp/ftp_directory_listing_parser_vms_unittest.cc",
1343 "ftp/ftp_directory_listing_parser_windows_unittest.cc",
1344 "ftp/ftp_network_transaction_unittest.cc",
1345 "ftp/ftp_util_unittest.cc",
1346 "url_request/url_request_ftp_job_unittest.cc",
1347 ]
1348 }
1349
1350 if (!enable_built_in_dns) {
1351 sources -= [
1352 "dns/address_sorter_posix_unittest.cc",
1353 "dns/address_sorter_unittest.cc",
1354 ]
1355 }
1356
1357 # Always need use_v8_in_net to be 1 to run on Android, so just remove
1358 # net_unittest's dependency on v8 when using icu alternatives instead of
1359 # setting use_v8_in_net to 0.
1360 if (use_v8_in_net && !use_icu_alternatives_on_android) {
1361 deps += [ ":net_with_v8" ]
1362 } else {
1363 sources -= [
scottmg34fb7e52014-12-03 23:27:241364 "proxy/proxy_resolver_v8_tracing_unittest.cc",
satorux933fc7a2015-02-13 07:09:101365 "proxy/proxy_resolver_v8_unittest.cc",
scottmg34fb7e52014-12-03 23:27:241366 ]
1367 }
1368
amistry7e6ebfdc82015-02-13 04:19:111369 if (use_v8_in_net && !is_android) {
1370 deps += [
1371 ":net_browser_services",
1372 "//mojo/environment:chromium",
1373 "//third_party/mojo/src/mojo/edk/system",
1374 ]
1375 } else {
1376 sources -= [ "dns/mojo_host_resolver_impl_unittest.cc" ]
1377 }
1378
scottmg34fb7e52014-12-03 23:27:241379 if (!enable_mdns) {
1380 sources -= [
1381 "dns/mdns_cache_unittest.cc",
1382 "dns/mdns_client_unittest.cc",
1383 "dns/record_parsed_unittest.cc",
1384 "dns/record_rdata_unittest.cc",
1385 ]
1386 }
1387
1388 if (is_ios) {
1389 # TODO(GYP)
1390 # 'actions': [
1391 # {
1392 # 'action_name': 'copy_test_data',
1393 # 'variables': {
1394 # 'test_data_files': [
1395 # 'data/ssl/certificates/',
1396 # 'data/test.html',
1397 # 'data/url_request_unittest/',
1398 # ],
1399 # 'test_data_prefix': 'net',
1400 # },
1401 # 'includes': [ '../build/copy_test_data_ios.gypi' ],
1402 # },
1403 # ],
1404 sources -= [
1405 # TODO(droger): The following tests are disabled because the
1406 # implementation is missing or incomplete.
1407 # KeygenHandler::GenKeyAndSignChallenge() is not ported to iOS.
1408 "base/keygen_handler_unittest.cc",
1409 "disk_cache/backend_unittest.cc",
1410 "disk_cache/blockfile/block_files_unittest.cc",
1411
1412 # Need to read input data files.
1413 "filter/gzip_filter_unittest.cc",
1414 "socket/ssl_server_socket_unittest.cc",
1415 "spdy/fuzzing/hpack_fuzz_util_test.cc",
1416
1417 # Need TestServer.
1418 "proxy/proxy_script_fetcher_impl_unittest.cc",
1419 "socket/ssl_client_socket_unittest.cc",
1420 "url_request/url_fetcher_impl_unittest.cc",
1421 "url_request/url_request_context_builder_unittest.cc",
1422
1423 # Needs GetAppOutput().
1424 "test/python_utils_unittest.cc",
1425
1426 # The following tests are disabled because they don't apply to
1427 # iOS.
1428 # OS is not "linux" or "freebsd" or "openbsd".
1429 "socket/unix_domain_client_socket_posix_unittest.cc",
1430 "socket/unix_domain_listen_socket_posix_unittest.cc",
1431 "socket/unix_domain_server_socket_posix_unittest.cc",
1432
1433 # See bug http://crbug.com/344533.
1434 "disk_cache/blockfile/index_table_v3_unittest.cc",
1435 ]
1436 }
1437
1438 if (is_android) {
1439 sources -= [ "dns/dns_config_service_posix_unittest.cc" ]
1440
1441 # TODO(GYP)
1442 # # TODO(mmenke): This depends on test_support_base, which depends on
1443 # # icu. Figure out a way to remove that dependency.
1444 # 'dependencies': [
1445 # '../testing/android/native_test.gyp:native_test_native_code',
1446 # ]
1447
1448 set_sources_assignment_filter([])
1449 sources += [ "base/address_tracker_linux_unittest.cc" ]
1450 set_sources_assignment_filter(sources_assignment_filter)
1451 }
1452
1453 if (use_icu_alternatives_on_android) {
1454 sources -= [
1455 "base/filename_util_unittest.cc",
1456 "base/net_util_icu_unittest.cc",
1457 ]
1458 deps -= [ "//base:i18n" ]
[email protected]8a3f8242014-06-05 18:05:121459 }
1460 }
1461
scottmg34fb7e52014-12-03 23:27:241462 executable("quic_server") {
1463 sources = [
1464 "quic/quic_server_bin.cc",
1465 ]
1466 deps = [
1467 ":quic_tools",
1468 ":net",
1469 "//base",
1470 "//third_party/boringssl",
[email protected]8a3f8242014-06-05 18:05:121471 ]
1472 }
dprankecf8465db72014-11-10 23:51:221473} # !is_android && !is_win && !is_mac