relnote: refactoring spdy/quic utils, adding SpdyHeadersToBalsaHeaders
[chromium-blink-merge.git] / base / BUILD.gn
blob23cc60f08424a16bca266808706e8b3f8582d7ae
1 # Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file.
5 import("//build/config/ui.gni")
6 import("//testing/test.gni")
8 if (is_android) {
9   import("//build/config/android/rules.gni")
12 config("base_implementation") {
13   defines = [ "BASE_IMPLEMENTATION" ]
16 if (is_win) {
17   # This is in a separate config so the flags can be applied to dependents.
18   # ldflags in GN aren't automatically inherited.
19   config("base_win_linker_flags") {
20     ldflags = [
21       "/DELAYLOAD:cfgmgr32.dll",
22       "/DELAYLOAD:powrprof.dll",
23       "/DELAYLOAD:setupapi.dll",
24     ]
25   }
28 source_set("base_paths") {
29   sources = [
30     "base_paths.cc",
31     "base_paths.h",
32     "base_paths_android.cc",
33     "base_paths_android.h",
34     "base_paths_mac.h",
35     "base_paths_mac.mm",
36     "base_paths_posix.cc",
37     "base_paths_posix.h",
38     "base_paths_win.cc",
39     "base_paths_win.h",
40   ]
42   if (is_android || is_mac || is_ios) {
43     sources -= [ "base_paths_posix.cc" ]
44   }
46   if (is_nacl) {
47     sources -= [
48       "base_paths.cc",
49       "base_paths_posix.cc",
50     ]
51   }
53   configs += [ ":base_implementation" ]
55   deps = [
56     "//base/memory",
57     "//base/process",
58   ]
60   visibility = [ ":base" ]
63 component("base") {
64   sources = [
65     "allocator/allocator_extension.cc",
66     "allocator/allocator_extension.h",
67     "allocator/type_profiler_control.cc",
68     "allocator/type_profiler_control.h",
69     "android/animation_frame_time_histogram.cc",
70     "android/animation_frame_time_histogram.h",
71     "android/apk_assets.cc",
72     "android/apk_assets.h",
73     "android/application_status_listener.cc",
74     "android/application_status_listener.h",
75     "android/base_jni_onload.cc",
76     "android/base_jni_onload.h",
77     "android/base_jni_registrar.cc",
78     "android/base_jni_registrar.h",
79     "android/build_info.cc",
80     "android/build_info.h",
81     "android/command_line_android.cc",
82     "android/command_line_android.h",
83     "android/content_uri_utils.cc",
84     "android/content_uri_utils.h",
85     "android/cpu_features.cc",
86     "android/cxa_demangle_stub.cc",
87     "android/event_log.cc",
88     "android/event_log.h",
89     "android/field_trial_list.cc",
90     "android/field_trial_list.h",
91     "android/fifo_utils.cc",
92     "android/fifo_utils.h",
93     "android/important_file_writer_android.cc",
94     "android/important_file_writer_android.h",
95     "android/java_handler_thread.cc",
96     "android/java_handler_thread.h",
97     "android/java_runtime.cc",
98     "android/java_runtime.h",
99     "android/jni_android.cc",
100     "android/jni_android.h",
101     "android/jni_array.cc",
102     "android/jni_array.h",
103     "android/jni_registrar.cc",
104     "android/jni_registrar.h",
105     "android/jni_string.cc",
106     "android/jni_string.h",
107     "android/jni_utils.cc",
108     "android/jni_utils.h",
109     "android/jni_weak_ref.cc",
110     "android/jni_weak_ref.h",
111     "android/library_loader/library_load_from_apk_status_codes.h",
112     "android/library_loader/library_loader_hooks.cc",
113     "android/library_loader/library_loader_hooks.h",
114     "android/library_loader/library_prefetcher.cc",
115     "android/library_loader/library_prefetcher.h",
116     "android/locale_utils.cc",
117     "android/locale_utils.h",
118     "android/memory_pressure_listener_android.cc",
119     "android/memory_pressure_listener_android.h",
120     "android/path_service_android.cc",
121     "android/path_service_android.h",
122     "android/path_utils.cc",
123     "android/path_utils.h",
124     "android/record_histogram.cc",
125     "android/record_histogram.h",
126     "android/record_user_action.cc",
127     "android/record_user_action.h",
128     "android/scoped_java_ref.cc",
129     "android/scoped_java_ref.h",
130     "android/sys_utils.cc",
131     "android/sys_utils.h",
132     "android/thread_utils.h",
133     "android/trace_event_binding.cc",
134     "android/trace_event_binding.h",
135     "async_socket_io_handler.h",
136     "async_socket_io_handler_posix.cc",
137     "async_socket_io_handler_win.cc",
138     "at_exit.cc",
139     "at_exit.h",
140     "atomic_ref_count.h",
141     "atomic_sequence_num.h",
142     "atomicops.h",
143     "atomicops_internals_mac.h",
144     "atomicops_internals_portable.h",
145     "atomicops_internals_x86_msvc.h",
146     "auto_reset.h",
147     "barrier_closure.cc",
148     "barrier_closure.h",
149     "base64.cc",
150     "base64.h",
151     "base_export.h",
152     "base_switches.h",
153     "basictypes.h",
154     "big_endian.cc",
155     "big_endian.h",
156     "bind.h",
157     "bind_helpers.cc",
158     "bind_helpers.h",
159     "bind_internal.h",
160     "bind_internal_win.h",
161     "bits.h",
162     "build_time.cc",
163     "build_time.h",
164     "callback.h",
165     "callback_helpers.cc",
166     "callback_helpers.h",
167     "callback_internal.cc",
168     "callback_internal.h",
169     "cancelable_callback.h",
170     "command_line.cc",
171     "command_line.h",
172     "compiler_specific.h",
173     "containers/adapters.h",
174     "containers/hash_tables.h",
175     "containers/linked_list.h",
176     "containers/mru_cache.h",
177     "containers/scoped_ptr_hash_map.h",
178     "containers/scoped_ptr_map.h",
179     "containers/small_map.h",
180     "containers/stack_container.h",
181     "cpu.cc",
182     "cpu.h",
183     "critical_closure.h",
184     "critical_closure_internal_ios.mm",
185     "deferred_sequenced_task_runner.cc",
186     "deferred_sequenced_task_runner.h",
187     "environment.cc",
188     "environment.h",
189     "file_descriptor_posix.h",
190     "file_version_info.h",
191     "file_version_info_mac.h",
192     "file_version_info_mac.mm",
193     "file_version_info_win.cc",
194     "file_version_info_win.h",
195     "files/dir_reader_fallback.h",
196     "files/dir_reader_linux.h",
197     "files/dir_reader_posix.h",
198     "files/file.cc",
199     "files/file_enumerator.cc",
200     "files/file_enumerator.h",
201     "files/file_enumerator_posix.cc",
202     "files/file_enumerator_win.cc",
203     "files/file_path.cc",
204     "files/file_path.h",
205     "files/file_path_constants.cc",
206     "files/file_path_watcher.cc",
207     "files/file_path_watcher.h",
208     "files/file_path_watcher_fsevents.cc",
209     "files/file_path_watcher_fsevents.h",
210     "files/file_path_watcher_kqueue.cc",
211     "files/file_path_watcher_kqueue.h",
212     "files/file_path_watcher_linux.cc",
213     "files/file_path_watcher_mac.cc",
214     "files/file_path_watcher_win.cc",
215     "files/file_posix.cc",
216     "files/file_proxy.cc",
217     "files/file_proxy.h",
218     "files/file_tracing.cc",
219     "files/file_tracing.h",
220     "files/file_util.cc",
221     "files/file_util.h",
222     "files/file_util_android.cc",
223     "files/file_util_linux.cc",
224     "files/file_util_mac.mm",
225     "files/file_util_posix.cc",
226     "files/file_util_proxy.cc",
227     "files/file_util_proxy.h",
228     "files/file_util_win.cc",
229     "files/file_win.cc",
230     "files/important_file_writer.cc",
231     "files/important_file_writer.h",
232     "files/memory_mapped_file.cc",
233     "files/memory_mapped_file.h",
234     "files/memory_mapped_file_posix.cc",
235     "files/memory_mapped_file_win.cc",
236     "files/scoped_file.cc",
237     "files/scoped_file.h",
238     "files/scoped_temp_dir.cc",
239     "files/scoped_temp_dir.h",
240     "format_macros.h",
241     "gtest_prod_util.h",
242     "guid.cc",
243     "guid.h",
244     "guid_posix.cc",
245     "guid_win.cc",
246     "hash.cc",
247     "hash.h",
248     "id_map.h",
249     "ios/device_util.h",
250     "ios/device_util.mm",
251     "ios/ios_util.h",
252     "ios/ios_util.mm",
253     "ios/scoped_critical_action.h",
254     "ios/scoped_critical_action.mm",
255     "ios/weak_nsobject.h",
256     "ios/weak_nsobject.mm",
257     "lazy_instance.cc",
258     "lazy_instance.h",
259     "linux_util.cc",
260     "linux_util.h",
261     "location.cc",
262     "location.h",
263     "logging.cc",
264     "logging.h",
265     "logging_win.cc",
266     "logging_win.h",
267     "mac/authorization_util.h",
268     "mac/authorization_util.mm",
269     "mac/bind_objc_block.h",
270     "mac/bundle_locations.h",
271     "mac/bundle_locations.mm",
272     "mac/call_with_eh_frame.cc",
273     "mac/call_with_eh_frame.h",
274     "mac/call_with_eh_frame_asm.S",
275     "mac/cocoa_protocols.h",
276     "mac/dispatch_source_mach.cc",
277     "mac/dispatch_source_mach.h",
278     "mac/foundation_util.h",
279     "mac/foundation_util.mm",
280     "mac/launch_services_util.cc",
281     "mac/launch_services_util.h",
282     "mac/launchd.cc",
283     "mac/launchd.h",
284     "mac/libdispatch_task_runner.cc",
285     "mac/libdispatch_task_runner.h",
286     "mac/mac_logging.cc",
287     "mac/mac_logging.h",
288     "mac/mac_util.h",
289     "mac/mac_util.mm",
290     "mac/mach_logging.cc",
291     "mac/mach_logging.h",
292     "mac/objc_property_releaser.h",
293     "mac/objc_property_releaser.mm",
294     "mac/os_crash_dumps.cc",
295     "mac/os_crash_dumps.h",
296     "mac/scoped_aedesc.h",
297     "mac/scoped_authorizationref.h",
298     "mac/scoped_block.h",
299     "mac/scoped_cftyperef.h",
300     "mac/scoped_ioobject.h",
301     "mac/scoped_ioplugininterface.h",
302     "mac/scoped_launch_data.h",
303     "mac/scoped_mach_port.cc",
304     "mac/scoped_mach_port.h",
305     "mac/scoped_mach_vm.cc",
306     "mac/scoped_mach_vm.h",
307     "mac/scoped_nsautorelease_pool.h",
308     "mac/scoped_nsautorelease_pool.mm",
309     "mac/scoped_nsobject.h",
310     "mac/scoped_objc_class_swizzler.h",
311     "mac/scoped_objc_class_swizzler.mm",
312     "mac/scoped_sending_event.h",
313     "mac/scoped_sending_event.mm",
314     "mac/sdk_forward_declarations.h",
315     "mac/sdk_forward_declarations.mm",
316     "macros.h",
317     "md5.cc",
318     "md5.h",
319     "message_loop/incoming_task_queue.cc",
320     "message_loop/incoming_task_queue.h",
321     "message_loop/message_loop.cc",
322     "message_loop/message_loop.h",
323     "message_loop/message_loop_task_runner.cc",
324     "message_loop/message_loop_task_runner.h",
325     "message_loop/message_pump.cc",
326     "message_loop/message_pump.h",
327     "message_loop/message_pump_android.cc",
328     "message_loop/message_pump_android.h",
329     "message_loop/message_pump_default.cc",
330     "message_loop/message_pump_default.h",
331     "message_loop/message_pump_glib.cc",
332     "message_loop/message_pump_glib.h",
333     "message_loop/message_pump_io_ios.cc",
334     "message_loop/message_pump_io_ios.h",
335     "message_loop/message_pump_libevent.cc",
336     "message_loop/message_pump_libevent.h",
337     "message_loop/message_pump_mac.h",
338     "message_loop/message_pump_mac.mm",
339     "message_loop/message_pump_win.cc",
340     "message_loop/message_pump_win.h",
341     "move.h",
342     "native_library.h",
343     "native_library_ios.mm",
344     "native_library_mac.mm",
345     "native_library_posix.cc",
346     "native_library_win.cc",
347     "nix/mime_util_xdg.cc",
348     "nix/mime_util_xdg.h",
349     "nix/xdg_util.cc",
350     "nix/xdg_util.h",
351     "numerics/safe_conversions.h",
352     "numerics/safe_conversions_impl.h",
353     "numerics/safe_math.h",
354     "numerics/safe_math_impl.h",
355     "observer_list.h",
356     "observer_list_threadsafe.h",
357     "os_compat_android.cc",
358     "os_compat_android.h",
359     "os_compat_nacl.cc",
360     "os_compat_nacl.h",
361     "path_service.cc",
362     "path_service.h",
363     "pending_task.cc",
364     "pending_task.h",
365     "pickle.cc",
366     "pickle.h",
367     "posix/eintr_wrapper.h",
368     "posix/file_descriptor_shuffle.cc",
369     "posix/global_descriptors.cc",
370     "posix/global_descriptors.h",
371     "posix/safe_strerror.cc",
372     "posix/safe_strerror.h",
373     "posix/unix_domain_socket_linux.cc",
374     "posix/unix_domain_socket_linux.h",
375     "power_monitor/power_monitor.cc",
376     "power_monitor/power_monitor.h",
377     "power_monitor/power_monitor_device_source.cc",
378     "power_monitor/power_monitor_device_source.h",
379     "power_monitor/power_monitor_device_source_android.cc",
380     "power_monitor/power_monitor_device_source_android.h",
381     "power_monitor/power_monitor_device_source_chromeos.cc",
382     "power_monitor/power_monitor_device_source_ios.mm",
383     "power_monitor/power_monitor_device_source_mac.mm",
384     "power_monitor/power_monitor_device_source_posix.cc",
385     "power_monitor/power_monitor_device_source_win.cc",
386     "power_monitor/power_monitor_source.cc",
387     "power_monitor/power_monitor_source.h",
388     "power_monitor/power_observer.h",
389     "profiler/alternate_timer.cc",
390     "profiler/alternate_timer.h",
391     "profiler/native_stack_sampler.cc",
392     "profiler/native_stack_sampler.h",
393     "profiler/scoped_profile.cc",
394     "profiler/scoped_profile.h",
395     "profiler/scoped_tracker.cc",
396     "profiler/scoped_tracker.h",
397     "profiler/stack_sampling_profiler.cc",
398     "profiler/stack_sampling_profiler.h",
399     "profiler/stack_sampling_profiler_posix.cc",
400     "profiler/stack_sampling_profiler_win.cc",
401     "profiler/tracked_time.cc",
402     "profiler/tracked_time.h",
403     "rand_util.cc",
404     "rand_util.h",
405     "rand_util_nacl.cc",
406     "rand_util_posix.cc",
407     "rand_util_win.cc",
408     "run_loop.cc",
409     "run_loop.h",
410     "scoped_generic.h",
411     "scoped_native_library.cc",
412     "scoped_native_library.h",
413     "scoped_observer.h",
414     "sequence_checker.h",
415     "sequence_checker_impl.cc",
416     "sequence_checker_impl.h",
417     "sequenced_task_runner.cc",
418     "sequenced_task_runner.h",
419     "sequenced_task_runner_helpers.h",
420     "sha1.h",
421     "sha1_portable.cc",
422     "sha1_win.cc",
423     "single_thread_task_runner.h",
424     "stl_util.h",
425     "strings/latin1_string_conversions.cc",
426     "strings/latin1_string_conversions.h",
427     "strings/nullable_string16.cc",
428     "strings/nullable_string16.h",
429     "strings/pattern.cc",
430     "strings/pattern.h",
431     "strings/safe_sprintf.cc",
432     "strings/safe_sprintf.h",
433     "strings/string16.cc",
434     "strings/string16.h",
435     "strings/string_number_conversions.cc",
436     "strings/string_number_conversions.h",
437     "strings/string_piece.cc",
438     "strings/string_piece.h",
439     "strings/string_split.cc",
440     "strings/string_split.h",
441     "strings/string_tokenizer.h",
442     "strings/string_util.cc",
443     "strings/string_util.h",
444     "strings/string_util_constants.cc",
445     "strings/string_util_posix.h",
446     "strings/string_util_win.h",
447     "strings/stringize_macros.h",
448     "strings/stringprintf.cc",
449     "strings/stringprintf.h",
450     "strings/sys_string_conversions.h",
451     "strings/sys_string_conversions_mac.mm",
452     "strings/sys_string_conversions_posix.cc",
453     "strings/sys_string_conversions_win.cc",
454     "strings/utf_offset_string_conversions.cc",
455     "strings/utf_offset_string_conversions.h",
456     "strings/utf_string_conversion_utils.cc",
457     "strings/utf_string_conversion_utils.h",
458     "strings/utf_string_conversions.cc",
459     "strings/utf_string_conversions.h",
460     "supports_user_data.cc",
461     "supports_user_data.h",
462     "sync_socket.h",
463     "sync_socket_posix.cc",
464     "sync_socket_win.cc",
465     "synchronization/cancellation_flag.cc",
466     "synchronization/cancellation_flag.h",
467     "synchronization/condition_variable.h",
468     "synchronization/condition_variable_posix.cc",
469     "synchronization/condition_variable_win.cc",
470     "synchronization/lock.cc",
471     "synchronization/lock.h",
472     "synchronization/lock_impl.h",
473     "synchronization/lock_impl_posix.cc",
474     "synchronization/lock_impl_win.cc",
475     "synchronization/spin_wait.h",
476     "synchronization/waitable_event.h",
477     "synchronization/waitable_event_posix.cc",
478     "synchronization/waitable_event_watcher.h",
479     "synchronization/waitable_event_watcher_posix.cc",
480     "synchronization/waitable_event_watcher_win.cc",
481     "synchronization/waitable_event_win.cc",
482     "sys_byteorder.h",
483     "sys_info.cc",
484     "sys_info.h",
485     "sys_info_android.cc",
486     "sys_info_chromeos.cc",
487     "sys_info_freebsd.cc",
488     "sys_info_ios.mm",
489     "sys_info_linux.cc",
490     "sys_info_mac.cc",
491     "sys_info_openbsd.cc",
492     "sys_info_posix.cc",
493     "sys_info_win.cc",
494     "system_monitor/system_monitor.cc",
495     "system_monitor/system_monitor.h",
496     "task/cancelable_task_tracker.cc",
497     "task/cancelable_task_tracker.h",
498     "task_runner.cc",
499     "task_runner.h",
500     "task_runner_util.h",
501     "template_util.h",
502     "third_party/dmg_fp/dmg_fp.h",
503     "third_party/dmg_fp/dtoa_wrapper.cc",
504     "third_party/dmg_fp/g_fmt.cc",
505     "third_party/icu/icu_utf.cc",
506     "third_party/icu/icu_utf.h",
507     "third_party/nspr/prtime.cc",
508     "third_party/nspr/prtime.h",
509     "third_party/superfasthash/superfasthash.c",
510     "thread_task_runner_handle.cc",
511     "thread_task_runner_handle.h",
512     "threading/non_thread_safe.h",
513     "threading/non_thread_safe_impl.cc",
514     "threading/non_thread_safe_impl.h",
515     "threading/platform_thread.h",
516     "threading/platform_thread_android.cc",
517     "threading/platform_thread_internal_posix.cc",
518     "threading/platform_thread_internal_posix.h",
519     "threading/platform_thread_linux.cc",
520     "threading/platform_thread_mac.mm",
521     "threading/platform_thread_posix.cc",
522     "threading/platform_thread_win.cc",
523     "threading/post_task_and_reply_impl.cc",
524     "threading/post_task_and_reply_impl.h",
525     "threading/sequenced_worker_pool.cc",
526     "threading/sequenced_worker_pool.h",
527     "threading/simple_thread.cc",
528     "threading/simple_thread.h",
529     "threading/thread.cc",
530     "threading/thread.h",
531     "threading/thread_checker.h",
532     "threading/thread_checker_impl.cc",
533     "threading/thread_checker_impl.h",
534     "threading/thread_collision_warner.cc",
535     "threading/thread_collision_warner.h",
536     "threading/thread_id_name_manager.cc",
537     "threading/thread_id_name_manager.h",
538     "threading/thread_local.h",
539     "threading/thread_local_android.cc",
540     "threading/thread_local_posix.cc",
541     "threading/thread_local_storage.cc",
542     "threading/thread_local_storage.h",
543     "threading/thread_local_storage_posix.cc",
544     "threading/thread_local_storage_win.cc",
545     "threading/thread_local_win.cc",
546     "threading/thread_restrictions.cc",
547     "threading/thread_restrictions.h",
548     "threading/watchdog.cc",
549     "threading/watchdog.h",
550     "threading/worker_pool.cc",
551     "threading/worker_pool.h",
552     "threading/worker_pool_posix.cc",
553     "threading/worker_pool_posix.h",
554     "threading/worker_pool_win.cc",
555     "time/clock.cc",
556     "time/clock.h",
557     "time/default_clock.cc",
558     "time/default_clock.h",
559     "time/default_tick_clock.cc",
560     "time/default_tick_clock.h",
561     "time/tick_clock.cc",
562     "time/tick_clock.h",
563     "time/time.cc",
564     "time/time.h",
565     "time/time_mac.cc",
566     "time/time_posix.cc",
567     "time/time_win.cc",
568     "timer/elapsed_timer.cc",
569     "timer/elapsed_timer.h",
570     "timer/hi_res_timer_manager.h",
571     "timer/hi_res_timer_manager_posix.cc",
572     "timer/hi_res_timer_manager_win.cc",
573     "timer/mock_timer.cc",
574     "timer/mock_timer.h",
575     "timer/timer.cc",
576     "timer/timer.h",
577     "tracked_objects.cc",
578     "tracked_objects.h",
579     "tracking_info.cc",
580     "tracking_info.h",
581     "tuple.h",
582     "value_conversions.cc",
583     "value_conversions.h",
584     "values.cc",
585     "values.h",
586     "version.cc",
587     "version.h",
588     "vlog.cc",
589     "vlog.h",
590     "win/enum_variant.cc",
591     "win/enum_variant.h",
592     "win/event_trace_consumer.h",
593     "win/event_trace_controller.cc",
594     "win/event_trace_controller.h",
595     "win/event_trace_provider.cc",
596     "win/event_trace_provider.h",
597     "win/i18n.cc",
598     "win/i18n.h",
599     "win/iat_patch_function.cc",
600     "win/iat_patch_function.h",
601     "win/iunknown_impl.cc",
602     "win/iunknown_impl.h",
603     "win/message_window.cc",
604     "win/message_window.h",
605     "win/metro.cc",
606     "win/metro.h",
607     "win/object_watcher.cc",
608     "win/object_watcher.h",
609     "win/registry.cc",
610     "win/registry.h",
611     "win/resource_util.cc",
612     "win/resource_util.h",
613     "win/scoped_bstr.cc",
614     "win/scoped_bstr.h",
615     "win/scoped_co_mem.h",
616     "win/scoped_com_initializer.h",
617     "win/scoped_comptr.h",
618     "win/scoped_gdi_object.h",
619     "win/scoped_handle.cc",
620     "win/scoped_handle.h",
621     "win/scoped_hdc.h",
622     "win/scoped_hglobal.h",
623     "win/scoped_process_information.cc",
624     "win/scoped_process_information.h",
625     "win/scoped_propvariant.h",
626     "win/scoped_select_object.h",
627     "win/scoped_variant.cc",
628     "win/scoped_variant.h",
629     "win/shortcut.cc",
630     "win/shortcut.h",
631     "win/startup_information.cc",
632     "win/startup_information.h",
633     "win/win_util.cc",
634     "win/win_util.h",
635     "win/windows_version.cc",
636     "win/windows_version.h",
637     "win/wrapped_window_proc.cc",
638     "win/wrapped_window_proc.h",
639   ]
641   sources -= [
642     "sys_info_freebsd.cc",
643     "sys_info_openbsd.cc",
644   ]
646   data = []
648   configs += [ ":base_implementation" ]
650   deps = [
651     ":base_static",
652     "//base/allocator:allocator_extension_thunks",
653     "//base/third_party/dynamic_annotations",
654     "//third_party/modp_b64",
655   ]
657   public_deps = [
658     ":base_paths",
659     "//base/debug",
660     "//base/json",
661     "//base/memory",
662     "//base/metrics",
663     "//base/process",
664     "//base/trace_event",
665   ]
667   # Allow more direct string conversions on platforms with native utf8
668   # strings
669   if (is_mac || is_ios || is_chromeos) {
670     defines = [ "SYSTEM_NATIVE_UTF8" ]
671   }
673   if (is_android) {
674     sources -= [ "power_monitor/power_monitor_device_source_posix.cc" ]
676     # Android uses some Linux sources, put those back.
677     set_sources_assignment_filter([])
678     sources += [
679       "files/file_path_watcher_linux.cc",
680       "posix/unix_domain_socket_linux.cc",
681       "sys_info_linux.cc",
682     ]
683     set_sources_assignment_filter(sources_assignment_filter)
685     deps += [
686       ":base_jni_headers",
687       "//third_party/ashmem",
688       "//third_party/android_tools:cpu_features",
689     ]
691     # logging.cc uses the Android logging library.
692     libs = [ "log" ]
693   }
695   if (is_chromeos) {
696     sources -= [ "power_monitor/power_monitor_device_source_posix.cc" ]
697   }
699   if (is_nacl) {
700     # We reset sources_assignment_filter in order to explicitly include
701     # the linux file (which would otherwise be filtered out).
702     set_sources_assignment_filter([])
703     sources += [
704       "files/file_path_watcher_stub.cc",
705       "sync_socket_nacl.cc",
706       "threading/platform_thread_linux.cc",
707     ]
708     set_sources_assignment_filter(sources_assignment_filter)
710     sources -= [
711       "allocator/type_profiler_control.cc",
712       "allocator/type_profiler_control.h",
713       "async_socket_io_handler_posix.cc",
714       "cpu.cc",
715       "files/file_enumerator_posix.cc",
716       "files/file_proxy.cc",
717       "files/file_util.cc",
718       "files/file_util_posix.cc",
719       "files/file_util_proxy.cc",
720       "files/important_file_writer.cc",
721       "files/important_file_writer.h",
722       "files/scoped_temp_dir.cc",
723       "message_loop/message_pump_libevent.cc",
724       "native_library_posix.cc",
725       "path_service.cc",
726       "rand_util_posix.cc",
727       "scoped_native_library.cc",
728       "sync_socket_posix.cc",
729       "sys_info.cc",
730       "sys_info_posix.cc",
731     ]
732   } else {
733     # Remove NaCl stuff.
734     sources -= [
735       "os_compat_nacl.cc",
736       "os_compat_nacl.h",
737       "rand_util_nacl.cc",
738     ]
739   }
741   # Windows.
742   if (is_win) {
743     sources -= [
744       "message_loop/message_pump_libevent.cc",
745       "strings/string16.cc",
747       # Not using sha1_win.cc because it may have caused a
748       # regression to page cycler moz.
749       "sha1_win.cc",
750     ]
752     # Required for base/stack_trace_win.cc to symbolize correctly.
753     data += [ "$root_build_dir/dbghelp.dll" ]
755     if (is_component_build) {
756       # Copy the VS runtime DLLs into the isolate so that they don't have to be
757       # preinstalled on the target machine. The debug runtimes have a "d" at
758       # the end.
759       if (is_debug) {
760         vcrt_suffix = "d"
761       } else {
762         vcrt_suffix = ""
763       }
765       # These runtime files are copied to the output directory by the
766       # vs_toolchain script that runs as part of toolchain configuration.
767       data += [
768         "$root_out_dir/msvcp120${vcrt_suffix}.dll",
769         "$root_out_dir/msvcr120${vcrt_suffix}.dll",
770       ]
771       if (is_asan) {
772         data += [ "//third_party/llvm-build/Release+Asserts/lib/clang/3.8.0/lib/windows/clang_rt.asan_dynamic-i386.dll" ]
773       }
774     }
776     # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
777     configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
779     libs = [
780       "cfgmgr32.lib",
781       "netapi32.lib",
782       "powrprof.lib",
783       "setupapi.lib",
784     ]
785     all_dependent_configs = [ ":base_win_linker_flags" ]
786   } else if (!is_nacl) {
787     # Non-Windows.
788     deps += [ "//third_party/libevent" ]
789   }
791   # Mac.
792   if (is_mac || is_ios) {
793     # Common Desktop / iOS excludes
794     sources -= [
795       "native_library_posix.cc",
796       "strings/sys_string_conversions_posix.cc",
797       "threading/platform_thread_internal_posix.cc",
798     ]
800     if (is_asan) {
801       # TODO(GYP) hook up asan on Mac. GYP has this extra dylib:
802       #data += [ "$root_out_dir/libclang_rt.asan_osx_dynamic.dylib" ]
803     }
805     if (is_ios) {
806       sources -= [
807         "files/file_path_watcher_fsevents.cc",
808         "files/file_path_watcher_fsevents.h",
809       ]
810     }
811   } else {
812     # Non-Mac.
813     sources -= [
814       "files/file_path_watcher_fsevents.cc",
815       "files/file_path_watcher_fsevents.h",
816       "files/file_path_watcher_kqueue.cc",
817       "files/file_path_watcher_kqueue.h",
818     ]
819   }
821   # Linux.
822   if (is_linux) {
823     if (is_asan || is_lsan || is_msan || is_tsan) {
824       # For llvm-sanitizer.
825       data += [ "//third_party/llvm-build/Release+Asserts/lib/libstdc++.so.6" ]
826     }
828     # TODO(brettw) this will need to be parameterized at some point.
829     linux_configs = []
830     if (use_glib) {
831       linux_configs += [ "//build/config/linux:glib" ]
832     }
834     configs += linux_configs
835     all_dependent_configs = linux_configs
837     # These dependencies are not required on Android, and in the case
838     # of xdg_mime must be excluded due to licensing restrictions.
839     deps += [
840       "//base/third_party/xdg_mime",
841       "//base/third_party/xdg_user_dirs",
842     ]
843   } else {
844     # Non-Linux.
845     sources -= [
846       "nix/mime_util_xdg.cc",
847       "nix/mime_util_xdg.h",
848       "nix/xdg_util.cc",
849       "nix/xdg_util.h",
850     ]
852     if (!is_android) {
853       sources -= [
854         "linux_util.cc",
855         "linux_util.h",
856       ]
857     }
858   }
860   # iOS
861   if (is_ios) {
862     set_sources_assignment_filter([])
864     sources += [
865       "atomicops_internals_mac.h",
866       "base_paths_mac.h",
867       "base_paths_mac.mm",
868       "file_version_info_mac.h",
869       "file_version_info_mac.mm",
870       "files/file_util_mac.mm",
871       "mac/bundle_locations.h",
872       "mac/bundle_locations.mm",
873       "mac/call_with_eh_frame.cc",
874       "mac/call_with_eh_frame.h",
875       "mac/foundation_util.h",
876       "mac/foundation_util.mm",
877       "mac/mac_logging.cc",
878       "mac/mac_logging.h",
879       "mac/mach_logging.cc",
880       "mac/mach_logging.h",
881       "mac/objc_property_releaser.h",
882       "mac/objc_property_releaser.mm",
883       "mac/scoped_mach_port.cc",
884       "mac/scoped_mach_port.h",
885       "mac/scoped_mach_vm.cc",
886       "mac/scoped_mach_vm.h",
887       "mac/scoped_nsautorelease_pool.h",
888       "mac/scoped_nsautorelease_pool.mm",
889       "mac/scoped_nsobject.h",
890       "mac/scoped_objc_class_swizzler.h",
891       "mac/scoped_objc_class_swizzler.mm",
892       "message_loop/message_pump_mac.h",
893       "message_loop/message_pump_mac.mm",
894       "strings/sys_string_conversions_mac.mm",
895       "threading/platform_thread_mac.mm",
896       "time/time_mac.cc",
897     ]
899     set_sources_assignment_filter(sources_assignment_filter)
900   }
902   if (!use_glib) {
903     sources -= [
904       "message_loop/message_pump_glib.cc",
905       "message_loop/message_pump_glib.h",
906     ]
907   }
909   if (is_asan || is_lsan || is_msan || is_tsan) {
910     data += [ "//tools/valgrind/asan/" ]
911     if (is_win) {
912       data +=
913           [ "//third_party/llvm-build/Release+Asserts/bin/llvm-symbolizer.exe" ]
914     } else {
915       data += [ "//third_party/llvm-build/Release+Asserts/bin/llvm-symbolizer" ]
916     }
917   }
919   configs += [ "//build/config/compiler:wexit_time_destructors" ]
920   if (!is_debug) {
921     configs -= [ "//build/config/compiler:optimize" ]
922     configs += [ "//build/config/compiler:optimize_max" ]
923   }
925   allow_circular_includes_from = public_deps
928 # This is the subset of files from base that should not be used with a dynamic
929 # library. Note that this library cannot depend on base because base depends on
930 # base_static.
931 source_set("base_static") {
932   sources = [
933     "base_switches.cc",
934     "base_switches.h",
935     "win/pe_image.cc",
936     "win/pe_image.h",
937   ]
939   if (!is_debug) {
940     configs -= [ "//build/config/compiler:optimize" ]
941     configs += [ "//build/config/compiler:optimize_max" ]
942   }
945 component("i18n") {
946   output_name = "base_i18n"
947   sources = [
948     "i18n/base_i18n_export.h",
949     "i18n/bidi_line_iterator.cc",
950     "i18n/bidi_line_iterator.h",
951     "i18n/break_iterator.cc",
952     "i18n/break_iterator.h",
953     "i18n/case_conversion.cc",
954     "i18n/case_conversion.h",
955     "i18n/char_iterator.cc",
956     "i18n/char_iterator.h",
957     "i18n/file_util_icu.cc",
958     "i18n/file_util_icu.h",
959     "i18n/i18n_constants.cc",
960     "i18n/i18n_constants.h",
961     "i18n/icu_encoding_detection.cc",
962     "i18n/icu_encoding_detection.h",
963     "i18n/icu_string_conversions.cc",
964     "i18n/icu_string_conversions.h",
965     "i18n/icu_util.cc",
966     "i18n/icu_util.h",
967     "i18n/number_formatting.cc",
968     "i18n/number_formatting.h",
969     "i18n/rtl.cc",
970     "i18n/rtl.h",
971     "i18n/streaming_utf8_validator.cc",
972     "i18n/streaming_utf8_validator.h",
973     "i18n/string_compare.cc",
974     "i18n/string_compare.h",
975     "i18n/string_search.cc",
976     "i18n/string_search.h",
977     "i18n/time_formatting.cc",
978     "i18n/time_formatting.h",
979     "i18n/timezone.cc",
980     "i18n/timezone.h",
981     "i18n/utf8_validator_tables.cc",
982     "i18n/utf8_validator_tables.h",
983   ]
984   defines = [ "BASE_I18N_IMPLEMENTATION" ]
985   configs += [ "//build/config/compiler:wexit_time_destructors" ]
986   deps = [
987     ":base",
988     "//base/third_party/dynamic_annotations",
989     "//third_party/icu",
990   ]
992   if (!is_debug) {
993     configs -= [ "//build/config/compiler:optimize" ]
994     configs += [ "//build/config/compiler:optimize_max" ]
995   }
997   # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
998   configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
1001 if (is_win || (is_linux && !is_chromeos)) {
1002   # TODO(GYP): Figure out which of these work and are needed on other platforms.
1003   test("base_perftests") {
1004     sources = [
1005       "message_loop/message_pump_perftest.cc",
1007       # "test/run_all_unittests.cc",
1008       "threading/thread_perftest.cc",
1009     ]
1010     deps = [
1011       ":base",
1012       "//base/test:test_support",
1013       "//base/test:test_support_perf",
1014       "//testing/perf",
1015       "//testing/gtest",
1016     ]
1018     if (is_android) {
1019       deps += [ "//testing/android/native_test:native_test_native_code" ]
1020     }
1021   }
1023   test("base_i18n_perftests") {
1024     sources = [
1025       "i18n/streaming_utf8_validator_perftest.cc",
1026     ]
1027     deps = [
1028       ":base",
1029       ":i18n",
1030       "//base/test:test_support",
1031       "//base/test:test_support_perf",
1032       "//testing/gtest",
1033     ]
1034   }
1036   if (!is_ios) {
1037     executable("build_utf8_validator_tables") {
1038       sources = [
1039         "i18n/build_utf8_validator_tables.cc",
1040       ]
1041       deps = [
1042         ":base",
1043         "//third_party/icu:icuuc",
1044       ]
1045     }
1047     executable("check_example") {
1048       sources = [
1049         "check_example.cc",
1050       ]
1051       deps = [
1052         ":base",
1053       ]
1054     }
1055   }
1058 component("prefs") {
1059   sources = [
1060     "prefs/base_prefs_export.h",
1061     "prefs/default_pref_store.cc",
1062     "prefs/default_pref_store.h",
1063     "prefs/json_pref_store.cc",
1064     "prefs/json_pref_store.h",
1065     "prefs/overlay_user_pref_store.cc",
1066     "prefs/overlay_user_pref_store.h",
1067     "prefs/persistent_pref_store.h",
1068     "prefs/pref_change_registrar.cc",
1069     "prefs/pref_change_registrar.h",
1070     "prefs/pref_filter.h",
1071     "prefs/pref_member.cc",
1072     "prefs/pref_member.h",
1073     "prefs/pref_notifier.h",
1074     "prefs/pref_notifier_impl.cc",
1075     "prefs/pref_notifier_impl.h",
1076     "prefs/pref_observer.h",
1077     "prefs/pref_registry.cc",
1078     "prefs/pref_registry.h",
1079     "prefs/pref_registry_simple.cc",
1080     "prefs/pref_registry_simple.h",
1081     "prefs/pref_service.cc",
1082     "prefs/pref_service.h",
1083     "prefs/pref_service_factory.cc",
1084     "prefs/pref_service_factory.h",
1085     "prefs/pref_store.cc",
1086     "prefs/pref_store.h",
1087     "prefs/pref_value_map.cc",
1088     "prefs/pref_value_map.h",
1089     "prefs/pref_value_store.cc",
1090     "prefs/pref_value_store.h",
1091     "prefs/scoped_user_pref_update.cc",
1092     "prefs/scoped_user_pref_update.h",
1093     "prefs/value_map_pref_store.cc",
1094     "prefs/value_map_pref_store.h",
1095     "prefs/writeable_pref_store.h",
1096   ]
1098   defines = [ "BASE_PREFS_IMPLEMENTATION" ]
1100   deps = [
1101     ":base",
1102   ]
1104   if (!is_debug) {
1105     configs -= [ "//build/config/compiler:optimize" ]
1106     configs += [ "//build/config/compiler:optimize_max" ]
1107   }
1110 source_set("prefs_test_support") {
1111   testonly = true
1112   sources = [
1113     "prefs/mock_pref_change_callback.cc",
1114     "prefs/mock_pref_change_callback.h",
1115     "prefs/pref_store_observer_mock.cc",
1116     "prefs/pref_store_observer_mock.h",
1117     "prefs/testing_pref_service.cc",
1118     "prefs/testing_pref_service.h",
1119     "prefs/testing_pref_store.cc",
1120     "prefs/testing_pref_store.h",
1121   ]
1123   public_deps = [
1124     ":prefs",
1125   ]
1126   deps = [
1127     ":base",
1128     "//testing/gmock",
1129     "//testing/gtest",
1130   ]
1133 source_set("message_loop_tests") {
1134   testonly = true
1135   sources = [
1136     "message_loop/message_loop_test.cc",
1137     "message_loop/message_loop_test.h",
1138   ]
1140   deps = [
1141     ":base",
1142     "//testing/gtest",
1143   ]
1146 if (is_win) {
1147   # Target to manually rebuild pe_image_test.dll which is checked into
1148   # base/test/data/pe_image.
1149   shared_library("pe_image_test") {
1150     sources = [
1151       "win/pe_image_test.cc",
1152     ]
1153     ldflags = [
1154       "/DELAYLOAD:cfgmgr32.dll",
1155       "/DELAYLOAD:shell32.dll",
1156       "/SUBSYSTEM:WINDOWS",
1157     ]
1158     libs = [
1159       "cfgmgr32.lib",
1160       "shell32.lib",
1161     ]
1162   }
1165 # TODO(GYP): Delete this after we've converted everything to GN.
1166 # The _run targets exist only for compatibility w/ GYP.
1167 group("base_unittests_run") {
1168   testonly = true
1169   deps = [
1170     ":base_unittests",
1171   ]
1174 test("base_unittests") {
1175   sources = [
1176     "android/application_status_listener_unittest.cc",
1177     "android/content_uri_utils_unittest.cc",
1178     "android/jni_android_unittest.cc",
1179     "android/jni_array_unittest.cc",
1180     "android/jni_string_unittest.cc",
1181     "android/library_loader/library_prefetcher_unittest.cc",
1182     "android/path_utils_unittest.cc",
1183     "android/scoped_java_ref_unittest.cc",
1184     "android/sys_utils_unittest.cc",
1185     "async_socket_io_handler_unittest.cc",
1186     "at_exit_unittest.cc",
1187     "atomicops_unittest.cc",
1188     "barrier_closure_unittest.cc",
1189     "base64_unittest.cc",
1190     "big_endian_unittest.cc",
1191     "bind_unittest.cc",
1192     "bind_unittest.nc",
1193     "bits_unittest.cc",
1194     "build_time_unittest.cc",
1195     "callback_helpers_unittest.cc",
1196     "callback_list_unittest.cc",
1197     "callback_list_unittest.nc",
1198     "callback_unittest.cc",
1199     "callback_unittest.nc",
1200     "cancelable_callback_unittest.cc",
1201     "command_line_unittest.cc",
1202     "containers/adapters_unittest.cc",
1203     "containers/hash_tables_unittest.cc",
1204     "containers/linked_list_unittest.cc",
1205     "containers/mru_cache_unittest.cc",
1206     "containers/scoped_ptr_hash_map_unittest.cc",
1207     "containers/scoped_ptr_map_unittest.cc",
1208     "containers/small_map_unittest.cc",
1209     "containers/stack_container_unittest.cc",
1210     "cpu_unittest.cc",
1211     "debug/crash_logging_unittest.cc",
1212     "debug/debugger_unittest.cc",
1213     "debug/leak_tracker_unittest.cc",
1214     "debug/proc_maps_linux_unittest.cc",
1215     "debug/stack_trace_unittest.cc",
1216     "debug/task_annotator_unittest.cc",
1217     "deferred_sequenced_task_runner_unittest.cc",
1218     "environment_unittest.cc",
1219     "file_version_info_unittest.cc",
1220     "files/dir_reader_posix_unittest.cc",
1221     "files/file_path_unittest.cc",
1222     "files/file_path_watcher_unittest.cc",
1223     "files/file_proxy_unittest.cc",
1224     "files/file_unittest.cc",
1225     "files/file_util_proxy_unittest.cc",
1226     "files/file_util_unittest.cc",
1227     "files/important_file_writer_unittest.cc",
1228     "files/scoped_temp_dir_unittest.cc",
1229     "gmock_unittest.cc",
1230     "guid_unittest.cc",
1231     "hash_unittest.cc",
1232     "i18n/break_iterator_unittest.cc",
1233     "i18n/case_conversion_unittest.cc",
1234     "i18n/char_iterator_unittest.cc",
1235     "i18n/file_util_icu_unittest.cc",
1236     "i18n/icu_string_conversions_unittest.cc",
1237     "i18n/number_formatting_unittest.cc",
1238     "i18n/rtl_unittest.cc",
1239     "i18n/streaming_utf8_validator_unittest.cc",
1240     "i18n/string_search_unittest.cc",
1241     "i18n/time_formatting_unittest.cc",
1242     "i18n/timezone_unittest.cc",
1243     "id_map_unittest.cc",
1244     "ios/device_util_unittest.mm",
1245     "ios/weak_nsobject_unittest.mm",
1246     "json/json_parser_unittest.cc",
1247     "json/json_reader_unittest.cc",
1248     "json/json_value_converter_unittest.cc",
1249     "json/json_value_serializer_unittest.cc",
1250     "json/json_writer_unittest.cc",
1251     "json/string_escape_unittest.cc",
1252     "lazy_instance_unittest.cc",
1253     "logging_unittest.cc",
1254     "mac/bind_objc_block_unittest.mm",
1255     "mac/call_with_eh_frame_unittest.mm",
1256     "mac/dispatch_source_mach_unittest.cc",
1257     "mac/foundation_util_unittest.mm",
1258     "mac/libdispatch_task_runner_unittest.cc",
1259     "mac/mac_util_unittest.mm",
1260     "mac/objc_property_releaser_unittest.mm",
1261     "mac/scoped_nsobject_unittest.mm",
1262     "mac/scoped_objc_class_swizzler_unittest.mm",
1263     "mac/scoped_sending_event_unittest.mm",
1264     "md5_unittest.cc",
1265     "memory/aligned_memory_unittest.cc",
1266     "memory/discardable_shared_memory_unittest.cc",
1267     "memory/linked_ptr_unittest.cc",
1268     "memory/memory_pressure_monitor_chromeos_unittest.cc",
1269     "memory/memory_pressure_monitor_win_unittest.cc",
1270     "memory/ref_counted_memory_unittest.cc",
1271     "memory/ref_counted_unittest.cc",
1272     "memory/scoped_ptr_unittest.cc",
1273     "memory/scoped_ptr_unittest.nc",
1274     "memory/scoped_vector_unittest.cc",
1275     "memory/shared_memory_unittest.cc",
1276     "memory/singleton_unittest.cc",
1277     "memory/weak_ptr_unittest.cc",
1278     "memory/weak_ptr_unittest.nc",
1279     "message_loop/message_loop_task_runner_unittest.cc",
1280     "message_loop/message_loop_unittest.cc",
1281     "message_loop/message_pump_glib_unittest.cc",
1282     "message_loop/message_pump_io_ios_unittest.cc",
1283     "metrics/bucket_ranges_unittest.cc",
1284     "metrics/field_trial_unittest.cc",
1285     "metrics/histogram_base_unittest.cc",
1286     "metrics/histogram_delta_serialization_unittest.cc",
1287     "metrics/histogram_snapshot_manager_unittest.cc",
1288     "metrics/histogram_unittest.cc",
1289     "metrics/sample_map_unittest.cc",
1290     "metrics/sample_vector_unittest.cc",
1291     "metrics/sparse_histogram_unittest.cc",
1292     "metrics/statistics_recorder_unittest.cc",
1293     "move_unittest.cc",
1294     "numerics/safe_numerics_unittest.cc",
1295     "observer_list_unittest.cc",
1296     "os_compat_android_unittest.cc",
1297     "path_service_unittest.cc",
1298     "pickle_unittest.cc",
1299     "posix/file_descriptor_shuffle_unittest.cc",
1300     "posix/unix_domain_socket_linux_unittest.cc",
1301     "power_monitor/power_monitor_unittest.cc",
1302     "prefs/default_pref_store_unittest.cc",
1303     "prefs/json_pref_store_unittest.cc",
1304     "prefs/overlay_user_pref_store_unittest.cc",
1305     "prefs/pref_change_registrar_unittest.cc",
1306     "prefs/pref_member_unittest.cc",
1307     "prefs/pref_notifier_impl_unittest.cc",
1308     "prefs/pref_service_unittest.cc",
1309     "prefs/pref_value_map_unittest.cc",
1310     "prefs/pref_value_store_unittest.cc",
1311     "prefs/scoped_user_pref_update_unittest.cc",
1312     "process/memory_unittest.cc",
1313     "process/memory_unittest_mac.h",
1314     "process/memory_unittest_mac.mm",
1315     "process/process_metrics_unittest.cc",
1316     "process/process_metrics_unittest_ios.cc",
1317     "process/process_unittest.cc",
1318     "process/process_util_unittest.cc",
1319     "process/process_util_unittest_ios.cc",
1320     "profiler/stack_sampling_profiler_unittest.cc",
1321     "profiler/tracked_time_unittest.cc",
1322     "rand_util_unittest.cc",
1323     "scoped_clear_errno_unittest.cc",
1324     "scoped_generic_unittest.cc",
1325     "scoped_native_library_unittest.cc",
1326     "security_unittest.cc",
1327     "sequence_checker_unittest.cc",
1328     "sha1_unittest.cc",
1329     "stl_util_unittest.cc",
1330     "strings/nullable_string16_unittest.cc",
1331     "strings/pattern_unittest.cc",
1332     "strings/safe_sprintf_unittest.cc",
1333     "strings/string16_unittest.cc",
1334     "strings/string_number_conversions_unittest.cc",
1335     "strings/string_piece_unittest.cc",
1336     "strings/string_split_unittest.cc",
1337     "strings/string_tokenizer_unittest.cc",
1338     "strings/string_util_unittest.cc",
1339     "strings/stringize_macros_unittest.cc",
1340     "strings/stringprintf_unittest.cc",
1341     "strings/sys_string_conversions_mac_unittest.mm",
1342     "strings/sys_string_conversions_unittest.cc",
1343     "strings/utf_offset_string_conversions_unittest.cc",
1344     "strings/utf_string_conversions_unittest.cc",
1345     "supports_user_data_unittest.cc",
1346     "sync_socket_unittest.cc",
1347     "synchronization/cancellation_flag_unittest.cc",
1348     "synchronization/condition_variable_unittest.cc",
1349     "synchronization/lock_unittest.cc",
1350     "synchronization/waitable_event_unittest.cc",
1351     "synchronization/waitable_event_watcher_unittest.cc",
1352     "sys_info_unittest.cc",
1353     "system_monitor/system_monitor_unittest.cc",
1354     "task/cancelable_task_tracker_unittest.cc",
1355     "task_runner_util_unittest.cc",
1356     "template_util_unittest.cc",
1357     "test/histogram_tester_unittest.cc",
1358     "test/test_reg_util_win_unittest.cc",
1359     "test/trace_event_analyzer_unittest.cc",
1360     "test/user_action_tester_unittest.cc",
1361     "threading/non_thread_safe_unittest.cc",
1362     "threading/platform_thread_unittest.cc",
1363     "threading/sequenced_worker_pool_unittest.cc",
1364     "threading/simple_thread_unittest.cc",
1365     "threading/thread_checker_unittest.cc",
1366     "threading/thread_collision_warner_unittest.cc",
1367     "threading/thread_id_name_manager_unittest.cc",
1368     "threading/thread_local_storage_unittest.cc",
1369     "threading/thread_local_unittest.cc",
1370     "threading/thread_unittest.cc",
1371     "threading/watchdog_unittest.cc",
1372     "threading/worker_pool_posix_unittest.cc",
1373     "threading/worker_pool_unittest.cc",
1374     "time/pr_time_unittest.cc",
1375     "time/time_unittest.cc",
1376     "time/time_win_unittest.cc",
1377     "timer/hi_res_timer_manager_unittest.cc",
1378     "timer/mock_timer_unittest.cc",
1379     "timer/timer_unittest.cc",
1380     "tools_sanity_unittest.cc",
1381     "tracked_objects_unittest.cc",
1382     "tuple_unittest.cc",
1383     "values_unittest.cc",
1384     "version_unittest.cc",
1385     "vlog_unittest.cc",
1386     "win/dllmain.cc",
1387     "win/enum_variant_unittest.cc",
1388     "win/event_trace_consumer_unittest.cc",
1389     "win/event_trace_controller_unittest.cc",
1390     "win/event_trace_provider_unittest.cc",
1391     "win/i18n_unittest.cc",
1392     "win/iunknown_impl_unittest.cc",
1393     "win/message_window_unittest.cc",
1394     "win/object_watcher_unittest.cc",
1395     "win/pe_image_unittest.cc",
1396     "win/registry_unittest.cc",
1397     "win/scoped_bstr_unittest.cc",
1398     "win/scoped_comptr_unittest.cc",
1399     "win/scoped_process_information_unittest.cc",
1400     "win/scoped_variant_unittest.cc",
1401     "win/shortcut_unittest.cc",
1402     "win/startup_information_unittest.cc",
1403     "win/win_util_unittest.cc",
1404     "win/wrapped_window_proc_unittest.cc",
1405   ]
1407   deps = [
1408     ":base",
1409     ":i18n",
1410     ":message_loop_tests",
1411     ":prefs",
1412     ":prefs_test_support",
1413     "//base/allocator",
1414     "//base/test:run_all_unittests",
1415     "//base/test:test_support",
1416     "//base/third_party/dynamic_annotations",
1417     "//base/trace_event:trace_event_unittests",
1418     "//testing/gmock",
1419     "//testing/gtest",
1420     "//third_party/icu",
1421   ]
1423   data = [
1424     "test/data/",
1425   ]
1427   # Allow more direct string conversions on platforms with native utf8
1428   # strings
1429   if (is_mac || is_ios || is_chromeos) {
1430     defines = [ "SYSTEM_NATIVE_UTF8" ]
1431   }
1433   if (is_android) {
1434     apk_deps = [
1435       ":base_java",
1436       ":base_java_unittest_support",
1437     ]
1439     # TODO(brettw) I think this should not be here, we should not be using
1440     # isolate files.
1441     isolate_file = "base_unittests.isolate"
1442   }
1444   if (is_ios) {
1445     sources -= [
1446       "process/memory_unittest.cc",
1447       "process/process_unittest.cc",
1448       "process/process_util_unittest.cc",
1449     ]
1451     # Pull in specific Mac files for iOS (which have been filtered out by file
1452     # name rules).
1453     set_sources_assignment_filter([])
1454     sources += [
1455       "mac/bind_objc_block_unittest.mm",
1456       "mac/foundation_util_unittest.mm",
1457       "mac/objc_property_releaser_unittest.mm",
1458       "mac/scoped_nsobject_unittest.mm",
1459       "sys_string_conversions_mac_unittest.mm",
1460     ]
1461     set_sources_assignment_filter(sources_assignment_filter)
1463     # TODO(GYP): dep on copy_test_data_ios action.
1464   }
1466   if (is_linux) {
1467     sources -= [ "file_version_info_unittest.cc" ]
1468     sources += [ "nix/xdg_util_unittest.cc" ]
1469     deps += [ "//base/test:malloc_wrapper" ]
1471     if (use_glib) {
1472       configs += [ "//build/config/linux:glib" ]
1473     }
1474   }
1476   if (!is_linux || use_ozone) {
1477     sources -= [ "message_loop/message_pump_glib_unittest.cc" ]
1478   }
1480   if (is_posix || is_ios) {
1481     sources += [ "message_loop/message_pump_libevent_unittest.cc" ]
1482     deps += [ "//third_party/libevent" ]
1483   }
1485   if (is_android) {
1486     deps += [ "//testing/android/native_test:native_test_native_code" ]
1487     set_sources_assignment_filter([])
1488     sources += [ "debug/proc_maps_linux_unittest.cc" ]
1489     set_sources_assignment_filter(sources_assignment_filter)
1490   }
1492   # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
1493   configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
1495   # Symbols for crashes when running tests on swarming.
1496   if (symbol_level > 0) {
1497     if (is_win) {
1498       data += [ "$root_out_dir/base_unittests.exe.pdb" ]
1499     } else if (is_mac) {
1500       data += [ "$root_out_dir/base_unittests.dSYM/" ]
1501     }
1502   }
1505 if (is_android) {
1506   # GYP: //base.gyp:base_jni_headers
1507   generate_jni("base_jni_headers") {
1508     sources = [
1509       "android/java/src/org/chromium/base/AnimationFrameTimeHistogram.java",
1510       "android/java/src/org/chromium/base/ApkAssets.java",
1511       "android/java/src/org/chromium/base/ApplicationStatus.java",
1512       "android/java/src/org/chromium/base/BuildInfo.java",
1513       "android/java/src/org/chromium/base/CommandLine.java",
1514       "android/java/src/org/chromium/base/ContentUriUtils.java",
1515       "android/java/src/org/chromium/base/CpuFeatures.java",
1516       "android/java/src/org/chromium/base/EventLog.java",
1517       "android/java/src/org/chromium/base/FieldTrialList.java",
1518       "android/java/src/org/chromium/base/ImportantFileWriterAndroid.java",
1519       "android/java/src/org/chromium/base/JNIUtils.java",
1520       "android/java/src/org/chromium/base/JavaHandlerThread.java",
1521       "android/java/src/org/chromium/base/LocaleUtils.java",
1522       "android/java/src/org/chromium/base/MemoryPressureListener.java",
1523       "android/java/src/org/chromium/base/PathService.java",
1524       "android/java/src/org/chromium/base/PathUtils.java",
1525       "android/java/src/org/chromium/base/PowerMonitor.java",
1526       "android/java/src/org/chromium/base/SysUtils.java",
1527       "android/java/src/org/chromium/base/SystemMessageHandler.java",
1528       "android/java/src/org/chromium/base/ThreadUtils.java",
1529       "android/java/src/org/chromium/base/TraceEvent.java",
1530       "android/java/src/org/chromium/base/library_loader/LibraryLoader.java",
1531       "android/java/src/org/chromium/base/metrics/RecordHistogram.java",
1532       "android/java/src/org/chromium/base/metrics/RecordUserAction.java",
1533     ]
1535     deps = [
1536       ":android_runtime_jni_headers",
1537     ]
1539     jni_package = "base"
1540   }
1542   # GYP: //base.gyp:android_runtime_jni_headers
1543   generate_jar_jni("android_runtime_jni_headers") {
1544     jni_package = "base"
1545     classes = [ "java/lang/Runtime.class" ]
1546   }
1548   # GYP: //base.gyp:base_java
1549   android_library("base_java") {
1550     srcjar_deps = [
1551       ":base_android_java_enums_srcjar",
1552       ":base_native_libraries_gen",
1553     ]
1555     deps = [
1556       "//third_party/jsr-305:jsr_305_javalib",
1557     ]
1559     DEPRECATED_java_in_dir = "android/java/src"
1561     # A new version of NativeLibraries.java (with the actual correct values)
1562     # will be created when creating an apk.
1563     jar_excluded_patterns = [
1564       "*/NativeLibraries.class",
1565       "*/NativeLibraries##*.class",
1566     ]
1567   }
1569   # GYP: //base.gyp:base_javatests
1570   android_library("base_javatests") {
1571     deps = [
1572       ":base_java",
1573       ":base_java_test_support",
1574     ]
1575     DEPRECATED_java_in_dir = "android/javatests/src"
1576   }
1578   # GYP: //base.gyp:base_java_test_support
1579   android_library("base_java_test_support") {
1580     deps = [
1581       ":base_java",
1582       "//testing/android/reporter:reporter_java",
1583     ]
1584     DEPRECATED_java_in_dir = "test/android/javatests/src"
1585   }
1587   # GYP: //base.gyp:base_junit_tests
1588   junit_binary("base_junit_tests") {
1589     java_files = [ "android/junit/src/org/chromium/base/LogTest.java" ]
1590     deps = [
1591       ":base_java",
1592       ":base_java_test_support",
1593     ]
1594   }
1596   # GYP: //base.gyp:base_java_application_state
1597   # GYP: //base.gyp:base_java_library_load_from_apk_status_codes
1598   # GYP: //base.gyp:base_java_library_process_type
1599   # GYP: //base.gyp:base_java_memory_pressure_level
1600   java_cpp_enum("base_android_java_enums_srcjar") {
1601     sources = [
1602       "android/application_status_listener.h",
1603       "android/library_loader/library_load_from_apk_status_codes.h",
1604       "android/library_loader/library_loader_hooks.h",
1605       "memory/memory_pressure_listener.h",
1606     ]
1607     outputs = [
1608       "org/chromium/base/ApplicationState.java",
1609       "org/chromium/base/library_loader/LibraryLoadFromApkStatusCodes.java",
1610       "org/chromium/base/library_loader/LibraryProcessType.java",
1611       "org/chromium/base/MemoryPressureLevel.java",
1612     ]
1613   }
1615   # GYP: //base/base.gyp:base_native_libraries_gen
1616   java_cpp_template("base_native_libraries_gen") {
1617     sources = [
1618       "android/java/templates/NativeLibraries.template",
1619     ]
1620     package_name = "org/chromium/base/library_loader"
1621   }
1623   # GYP: //base.gyp:base_java_unittest_support
1624   android_library("base_java_unittest_support") {
1625     deps = [
1626       ":base_java",
1627     ]
1628     java_files =
1629         [ "test/android/java/src/org/chromium/base/ContentUriTestUtils.java" ]
1630   }