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")
9 import("//build/config/android/rules.gni")
12 source_set("base_paths") {
16 "base_paths_android.cc",
17 "base_paths_android.h",
20 "base_paths_posix.cc",
26 if (is_android || is_mac) {
27 sources -= [ "base_paths_posix.cc" ]
33 "base_paths_posix.cc",
37 defines = [ "BASE_IMPLEMENTATION" ]
44 visibility = [ ":base" ]
49 "allocator/allocator_extension.cc",
50 "allocator/allocator_extension.h",
51 "allocator/type_profiler_control.cc",
52 "allocator/type_profiler_control.h",
53 "android/animation_frame_time_histogram.cc",
54 "android/animation_frame_time_histogram.h",
55 "android/application_status_listener.cc",
56 "android/application_status_listener.h",
57 "android/base_jni_onload.cc",
58 "android/base_jni_onload.h",
59 "android/base_jni_registrar.cc",
60 "android/base_jni_registrar.h",
61 "android/build_info.cc",
62 "android/build_info.h",
63 "android/command_line_android.cc",
64 "android/command_line_android.h",
65 "android/content_uri_utils.cc",
66 "android/content_uri_utils.h",
67 "android/cpu_features.cc",
68 "android/event_log.cc",
69 "android/event_log.h",
70 "android/field_trial_list.cc",
71 "android/field_trial_list.h",
72 "android/fifo_utils.cc",
73 "android/fifo_utils.h",
74 "android/important_file_writer_android.cc",
75 "android/important_file_writer_android.h",
76 "android/java_handler_thread.cc",
77 "android/java_handler_thread.h",
78 "android/jni_android.cc",
79 "android/jni_android.h",
80 "android/jni_array.cc",
81 "android/jni_array.h",
82 "android/jni_registrar.cc",
83 "android/jni_registrar.h",
84 "android/jni_string.cc",
85 "android/jni_string.h",
86 "android/jni_utils.cc",
87 "android/jni_utils.h",
88 "android/jni_weak_ref.cc",
89 "android/jni_weak_ref.h",
90 "android/library_loader/library_load_from_apk_status_codes.h",
91 "android/library_loader/library_loader_hooks.cc",
92 "android/library_loader/library_loader_hooks.h",
93 "android/locale_utils.cc",
94 "android/locale_utils.h",
95 "android/memory_pressure_listener_android.cc",
96 "android/memory_pressure_listener_android.h",
97 "android/path_service_android.cc",
98 "android/path_service_android.h",
99 "android/path_utils.cc",
100 "android/path_utils.h",
101 "android/record_histogram.cc",
102 "android/record_histogram.h",
103 "android/scoped_java_ref.cc",
104 "android/scoped_java_ref.h",
105 "android/sys_utils.cc",
106 "android/sys_utils.h",
107 "android/thread_utils.h",
108 "android/trace_event_binding.cc",
109 "android/trace_event_binding.h",
110 "async_socket_io_handler.h",
111 "async_socket_io_handler_posix.cc",
112 "async_socket_io_handler_win.cc",
115 "atomic_ref_count.h",
116 "atomic_sequence_num.h",
118 "atomicops_internals_gcc.h",
119 "atomicops_internals_mac.h",
120 "atomicops_internals_portable.h",
121 "atomicops_internals_x86_gcc.cc",
122 "atomicops_internals_x86_gcc.h",
123 "atomicops_internals_x86_msvc.h",
125 "barrier_closure.cc",
138 "bind_internal_win.h",
143 "callback_helpers.cc",
144 "callback_helpers.h",
145 "callback_internal.cc",
146 "callback_internal.h",
147 "cancelable_callback.h",
148 "chromeos/memory_pressure_observer_chromeos.cc",
149 "chromeos/memory_pressure_observer_chromeos.h",
152 "compiler_specific.h",
153 "containers/adapters.h",
154 "containers/hash_tables.h",
155 "containers/linked_list.h",
156 "containers/mru_cache.h",
157 "containers/small_map.h",
158 "containers/stack_container.h",
161 "critical_closure.h",
162 "critical_closure_internal_ios.mm",
163 "deferred_sequenced_task_runner.cc",
164 "deferred_sequenced_task_runner.h",
167 "file_descriptor_posix.h",
168 "file_version_info.h",
169 "file_version_info_mac.h",
170 "file_version_info_mac.mm",
171 "file_version_info_win.cc",
172 "file_version_info_win.h",
173 "files/dir_reader_fallback.h",
174 "files/dir_reader_linux.h",
175 "files/dir_reader_posix.h",
177 "files/file_enumerator.cc",
178 "files/file_enumerator.h",
179 "files/file_enumerator_posix.cc",
180 "files/file_enumerator_win.cc",
181 "files/file_path.cc",
183 "files/file_path_constants.cc",
184 "files/file_path_watcher.cc",
185 "files/file_path_watcher.h",
186 "files/file_path_watcher_fsevents.cc",
187 "files/file_path_watcher_fsevents.h",
188 "files/file_path_watcher_kqueue.cc",
189 "files/file_path_watcher_kqueue.h",
190 "files/file_path_watcher_linux.cc",
191 "files/file_path_watcher_mac.cc",
192 "files/file_path_watcher_win.cc",
193 "files/file_posix.cc",
194 "files/file_proxy.cc",
195 "files/file_proxy.h",
196 "files/file_util.cc",
198 "files/file_util_android.cc",
199 "files/file_util_linux.cc",
200 "files/file_util_mac.mm",
201 "files/file_util_posix.cc",
202 "files/file_util_proxy.cc",
203 "files/file_util_proxy.h",
204 "files/file_util_win.cc",
206 "files/important_file_writer.cc",
207 "files/important_file_writer.h",
208 "files/memory_mapped_file.cc",
209 "files/memory_mapped_file.h",
210 "files/memory_mapped_file_posix.cc",
211 "files/memory_mapped_file_win.cc",
212 "files/scoped_file.cc",
213 "files/scoped_file.h",
214 "files/scoped_temp_dir.cc",
215 "files/scoped_temp_dir.h",
227 "ios/device_util.mm",
230 "ios/scoped_critical_action.h",
231 "ios/scoped_critical_action.mm",
232 "ios/weak_nsobject.h",
233 "ios/weak_nsobject.mm",
244 "mac/authorization_util.h",
245 "mac/authorization_util.mm",
246 "mac/bind_objc_block.h",
247 "mac/bundle_locations.h",
248 "mac/bundle_locations.mm",
249 "mac/cocoa_protocols.h",
250 "mac/foundation_util.h",
251 "mac/foundation_util.mm",
252 "mac/launch_services_util.cc",
253 "mac/launch_services_util.h",
256 "mac/libdispatch_task_runner.cc",
257 "mac/libdispatch_task_runner.h",
258 "mac/mac_logging.cc",
262 "mac/mach_logging.cc",
263 "mac/mach_logging.h",
264 "mac/objc_property_releaser.h",
265 "mac/objc_property_releaser.mm",
266 "mac/os_crash_dumps.cc",
267 "mac/os_crash_dumps.h",
268 "mac/scoped_aedesc.h",
269 "mac/scoped_authorizationref.h",
270 "mac/scoped_block.h",
271 "mac/scoped_cftyperef.h",
272 "mac/scoped_ioobject.h",
273 "mac/scoped_ioplugininterface.h",
274 "mac/scoped_launch_data.h",
275 "mac/scoped_mach_port.cc",
276 "mac/scoped_mach_port.h",
277 "mac/scoped_mach_vm.cc",
278 "mac/scoped_mach_vm.h",
279 "mac/scoped_nsautorelease_pool.h",
280 "mac/scoped_nsautorelease_pool.mm",
281 "mac/scoped_nsexception_enabler.h",
282 "mac/scoped_nsexception_enabler.mm",
283 "mac/scoped_nsobject.h",
284 "mac/scoped_objc_class_swizzler.h",
285 "mac/scoped_objc_class_swizzler.mm",
286 "mac/scoped_sending_event.h",
287 "mac/scoped_sending_event.mm",
288 "mac/sdk_forward_declarations.h",
289 "mac/sdk_forward_declarations.mm",
293 "message_loop/incoming_task_queue.cc",
294 "message_loop/incoming_task_queue.h",
295 "message_loop/message_loop.cc",
296 "message_loop/message_loop.h",
297 "message_loop/message_loop_proxy.cc",
298 "message_loop/message_loop_proxy.h",
299 "message_loop/message_loop_proxy_impl.cc",
300 "message_loop/message_loop_proxy_impl.h",
301 "message_loop/message_pump.cc",
302 "message_loop/message_pump.h",
303 "message_loop/message_pump_android.cc",
304 "message_loop/message_pump_android.h",
305 "message_loop/message_pump_default.cc",
306 "message_loop/message_pump_default.h",
307 "message_loop/message_pump_glib.cc",
308 "message_loop/message_pump_glib.h",
309 "message_loop/message_pump_io_ios.cc",
310 "message_loop/message_pump_io_ios.h",
311 "message_loop/message_pump_libevent.cc",
312 "message_loop/message_pump_libevent.h",
313 "message_loop/message_pump_mac.h",
314 "message_loop/message_pump_mac.mm",
315 "message_loop/message_pump_win.cc",
316 "message_loop/message_pump_win.h",
319 "native_library_mac.mm",
320 "native_library_posix.cc",
321 "native_library_win.cc",
322 "nix/mime_util_xdg.cc",
323 "nix/mime_util_xdg.h",
326 "numerics/safe_conversions.h",
327 "numerics/safe_conversions_impl.h",
328 "numerics/safe_math.h",
329 "numerics/safe_math_impl.h",
331 "observer_list_threadsafe.h",
332 "os_compat_android.cc",
333 "os_compat_android.h",
343 "posix/eintr_wrapper.h",
344 "posix/file_descriptor_shuffle.cc",
345 "posix/global_descriptors.cc",
346 "posix/global_descriptors.h",
347 "posix/unix_domain_socket_linux.cc",
348 "posix/unix_domain_socket_linux.h",
349 "power_monitor/power_monitor.cc",
350 "power_monitor/power_monitor.h",
351 "power_monitor/power_monitor_device_source.cc",
352 "power_monitor/power_monitor_device_source.h",
353 "power_monitor/power_monitor_device_source_android.cc",
354 "power_monitor/power_monitor_device_source_android.h",
355 "power_monitor/power_monitor_device_source_chromeos.cc",
356 "power_monitor/power_monitor_device_source_ios.mm",
357 "power_monitor/power_monitor_device_source_mac.mm",
358 "power_monitor/power_monitor_device_source_posix.cc",
359 "power_monitor/power_monitor_device_source_win.cc",
360 "power_monitor/power_monitor_source.cc",
361 "power_monitor/power_monitor_source.h",
362 "power_monitor/power_observer.h",
363 "profiler/alternate_timer.cc",
364 "profiler/alternate_timer.h",
365 "profiler/scoped_profile.cc",
366 "profiler/scoped_profile.h",
367 "profiler/scoped_tracker.cc",
368 "profiler/scoped_tracker.h",
369 "profiler/tracked_time.cc",
370 "profiler/tracked_time.h",
374 "rand_util_posix.cc",
378 "safe_strerror_posix.cc",
379 "safe_strerror_posix.h",
381 "scoped_native_library.cc",
382 "scoped_native_library.h",
384 "sequence_checker.h",
385 "sequence_checker_impl.cc",
386 "sequence_checker_impl.h",
387 "sequenced_task_runner.cc",
388 "sequenced_task_runner.h",
389 "sequenced_task_runner_helpers.h",
393 "single_thread_task_runner.h",
395 "strings/latin1_string_conversions.cc",
396 "strings/latin1_string_conversions.h",
397 "strings/nullable_string16.cc",
398 "strings/nullable_string16.h",
399 "strings/safe_sprintf.cc",
400 "strings/safe_sprintf.h",
401 "strings/string16.cc",
402 "strings/string16.h",
403 "strings/string_number_conversions.cc",
404 "strings/string_number_conversions.h",
405 "strings/string_piece.cc",
406 "strings/string_piece.h",
407 "strings/string_split.cc",
408 "strings/string_split.h",
409 "strings/string_tokenizer.h",
410 "strings/string_util.cc",
411 "strings/string_util.h",
412 "strings/string_util_constants.cc",
413 "strings/string_util_posix.h",
414 "strings/string_util_win.h",
415 "strings/stringize_macros.h",
416 "strings/stringprintf.cc",
417 "strings/stringprintf.h",
418 "strings/sys_string_conversions.h",
419 "strings/sys_string_conversions_mac.mm",
420 "strings/sys_string_conversions_posix.cc",
421 "strings/sys_string_conversions_win.cc",
422 "strings/utf_offset_string_conversions.cc",
423 "strings/utf_offset_string_conversions.h",
424 "strings/utf_string_conversion_utils.cc",
425 "strings/utf_string_conversion_utils.h",
426 "strings/utf_string_conversions.cc",
427 "strings/utf_string_conversions.h",
428 "supports_user_data.cc",
429 "supports_user_data.h",
431 "sync_socket_posix.cc",
432 "sync_socket_win.cc",
433 "synchronization/cancellation_flag.cc",
434 "synchronization/cancellation_flag.h",
435 "synchronization/condition_variable.h",
436 "synchronization/condition_variable_posix.cc",
437 "synchronization/condition_variable_win.cc",
438 "synchronization/lock.cc",
439 "synchronization/lock.h",
440 "synchronization/lock_impl.h",
441 "synchronization/lock_impl_posix.cc",
442 "synchronization/lock_impl_win.cc",
443 "synchronization/spin_wait.h",
444 "synchronization/waitable_event.h",
445 "synchronization/waitable_event_posix.cc",
446 "synchronization/waitable_event_watcher.h",
447 "synchronization/waitable_event_watcher_posix.cc",
448 "synchronization/waitable_event_watcher_win.cc",
449 "synchronization/waitable_event_win.cc",
453 "sys_info_android.cc",
454 "sys_info_chromeos.cc",
455 "sys_info_freebsd.cc",
459 "sys_info_openbsd.cc",
462 "system_monitor/system_monitor.cc",
463 "system_monitor/system_monitor.h",
464 "task/cancelable_task_tracker.cc",
465 "task/cancelable_task_tracker.h",
468 "task_runner_util.h",
470 "third_party/dmg_fp/dmg_fp.h",
471 "third_party/dmg_fp/dtoa_wrapper.cc",
472 "third_party/dmg_fp/g_fmt.cc",
473 "third_party/icu/icu_utf.cc",
474 "third_party/icu/icu_utf.h",
475 "third_party/superfasthash/superfasthash.c",
476 "thread_task_runner_handle.cc",
477 "thread_task_runner_handle.h",
478 "threading/non_thread_safe.h",
479 "threading/non_thread_safe_impl.cc",
480 "threading/non_thread_safe_impl.h",
481 "threading/platform_thread.h",
482 "threading/platform_thread_android.cc",
483 "threading/platform_thread_linux.cc",
484 "threading/platform_thread_mac.mm",
485 "threading/platform_thread_posix.cc",
486 "threading/platform_thread_win.cc",
487 "threading/post_task_and_reply_impl.cc",
488 "threading/post_task_and_reply_impl.h",
489 "threading/sequenced_worker_pool.cc",
490 "threading/sequenced_worker_pool.h",
491 "threading/simple_thread.cc",
492 "threading/simple_thread.h",
493 "threading/thread.cc",
494 "threading/thread.h",
495 "threading/thread_checker.h",
496 "threading/thread_checker_impl.cc",
497 "threading/thread_checker_impl.h",
498 "threading/thread_collision_warner.cc",
499 "threading/thread_collision_warner.h",
500 "threading/thread_id_name_manager.cc",
501 "threading/thread_id_name_manager.h",
502 "threading/thread_local.h",
503 "threading/thread_local_android.cc",
504 "threading/thread_local_posix.cc",
505 "threading/thread_local_storage.cc",
506 "threading/thread_local_storage.h",
507 "threading/thread_local_storage_posix.cc",
508 "threading/thread_local_storage_win.cc",
509 "threading/thread_local_win.cc",
510 "threading/thread_restrictions.cc",
511 "threading/thread_restrictions.h",
512 "threading/watchdog.cc",
513 "threading/watchdog.h",
514 "threading/worker_pool.cc",
515 "threading/worker_pool.h",
516 "threading/worker_pool_posix.cc",
517 "threading/worker_pool_posix.h",
518 "threading/worker_pool_win.cc",
521 "time/default_clock.cc",
522 "time/default_clock.h",
523 "time/default_tick_clock.cc",
524 "time/default_tick_clock.h",
525 "time/tick_clock.cc",
530 "time/time_posix.cc",
532 "timer/elapsed_timer.cc",
533 "timer/elapsed_timer.h",
534 "timer/hi_res_timer_manager.h",
535 "timer/hi_res_timer_manager_posix.cc",
536 "timer/hi_res_timer_manager_win.cc",
537 "timer/mock_timer.cc",
538 "timer/mock_timer.h",
541 "tracked_objects.cc",
546 "value_conversions.cc",
547 "value_conversions.h",
554 "win/enum_variant.cc",
555 "win/enum_variant.h",
556 "win/event_trace_consumer.h",
557 "win/event_trace_controller.cc",
558 "win/event_trace_controller.h",
559 "win/event_trace_provider.cc",
560 "win/event_trace_provider.h",
563 "win/iat_patch_function.cc",
564 "win/iat_patch_function.h",
565 "win/iunknown_impl.cc",
566 "win/iunknown_impl.h",
567 "win/message_window.cc",
568 "win/message_window.h",
571 "win/object_watcher.cc",
572 "win/object_watcher.h",
575 "win/resource_util.cc",
576 "win/resource_util.h",
577 "win/scoped_bstr.cc",
579 "win/scoped_co_mem.h",
580 "win/scoped_com_initializer.h",
581 "win/scoped_comptr.h",
582 "win/scoped_gdi_object.h",
583 "win/scoped_handle.cc",
584 "win/scoped_handle.h",
586 "win/scoped_hglobal.h",
587 "win/scoped_process_information.cc",
588 "win/scoped_process_information.h",
589 "win/scoped_propvariant.h",
590 "win/scoped_select_object.h",
591 "win/scoped_variant.cc",
592 "win/scoped_variant.h",
595 "win/startup_information.cc",
596 "win/startup_information.h",
599 "win/windows_version.cc",
600 "win/windows_version.h",
601 "win/wrapped_window_proc.cc",
602 "win/wrapped_window_proc.h",
606 "sys_info_freebsd.cc",
607 "sys_info_openbsd.cc",
610 defines = [ "BASE_IMPLEMENTATION" ]
614 "//base/allocator:allocator_extension_thunks",
615 "//base/third_party/dynamic_annotations",
616 "//base/third_party/nspr",
617 "//third_party/modp_b64",
627 "//base/trace_event",
630 # Allow more direct string conversions on platforms with native utf8
632 if (is_mac || is_ios || is_chromeos) {
633 defines += [ "SYSTEM_NATIVE_UTF8" ]
637 sources -= [ "power_monitor/power_monitor_device_source_posix.cc" ]
639 # Android uses some Linux sources, put those back.
640 set_sources_assignment_filter([])
642 "files/file_path_watcher_linux.cc",
643 "posix/unix_domain_socket_linux.cc",
646 set_sources_assignment_filter(sources_assignment_filter)
650 "//third_party/ashmem",
651 "//third_party/android_tools:cpu_features",
654 # logging.cc uses the Android logging library.
659 sources -= [ "power_monitor/power_monitor_device_source_posix.cc" ]
663 # We reset sources_assignment_filter in order to explicitly include
664 # the linux file (which would otherwise be filtered out).
665 set_sources_assignment_filter([])
667 "files/file_path_watcher_stub.cc",
668 "sync_socket_nacl.cc",
669 "threading/platform_thread_linux.cc",
671 set_sources_assignment_filter(sources_assignment_filter)
674 "allocator/type_profiler_control.cc",
675 "allocator/type_profiler_control.h",
676 "async_socket_io_handler_posix.cc",
678 "files/file_enumerator_posix.cc",
679 "files/file_proxy.cc",
680 "files/file_util.cc",
681 "files/file_util_posix.cc",
682 "files/file_util_proxy.cc",
683 "files/important_file_writer.cc",
684 "files/important_file_writer.h",
685 "files/scoped_temp_dir.cc",
686 "message_loop/message_pump_libevent.cc",
687 "native_library_posix.cc",
689 "rand_util_posix.cc",
690 "scoped_native_library.cc",
691 "sync_socket_posix.cc",
707 "message_loop/message_pump_libevent.cc",
708 "strings/string16.cc",
710 # Not using sha1_win.cc because it may have caused a
711 # regression to page cycler moz.
715 # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
716 configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
725 "/DELAYLOAD:cfgmgr32.dll",
726 "/DELAYLOAD:powrprof.dll",
727 "/DELAYLOAD:setupapi.dll",
729 } else if (!is_nacl) {
731 deps += [ "//third_party/libevent" ]
737 "native_library_posix.cc",
738 "strings/sys_string_conversions_posix.cc",
743 "files/file_path_watcher_fsevents.cc",
744 "files/file_path_watcher_fsevents.h",
745 "files/file_path_watcher_kqueue.cc",
746 "files/file_path_watcher_kqueue.h",
752 # TODO(brettw) this will need to be parameterized at some point.
755 linux_configs += [ "//build/config/linux:glib" ]
758 configs += linux_configs
759 all_dependent_configs = linux_configs
761 defines += [ "USE_SYMBOLIZE" ]
763 # These dependencies are not required on Android, and in the case
764 # of xdg_mime must be excluded due to licensing restrictions.
766 "//base/third_party/symbolize",
767 "//base/third_party/xdg_mime",
768 "//base/third_party/xdg_user_dirs",
773 "nix/mime_util_xdg.cc",
774 "nix/mime_util_xdg.h",
789 "message_loop/message_pump_glib.cc",
790 "message_loop/message_pump_glib.h",
794 configs += [ "//build/config/compiler:wexit_time_destructors" ]
795 if (is_android && !is_debug) {
796 configs -= [ "//build/config/compiler:optimize" ]
797 configs += [ "//build/config/compiler:optimize_max" ]
800 allow_circular_includes_from = public_deps
803 # This is the subset of files from base that should not be used with a dynamic
804 # library. Note that this library cannot depend on base because base depends on
806 source_set("base_static") {
814 if (is_android && !is_debug) {
815 configs -= [ "//build/config/compiler:optimize" ]
816 configs += [ "//build/config/compiler:optimize_max" ]
821 output_name = "base_i18n"
823 "i18n/base_i18n_export.h",
824 "i18n/bidi_line_iterator.cc",
825 "i18n/bidi_line_iterator.h",
826 "i18n/break_iterator.cc",
827 "i18n/break_iterator.h",
828 "i18n/case_conversion.cc",
829 "i18n/case_conversion.h",
830 "i18n/char_iterator.cc",
831 "i18n/char_iterator.h",
832 "i18n/file_util_icu.cc",
833 "i18n/file_util_icu.h",
834 "i18n/i18n_constants.cc",
835 "i18n/i18n_constants.h",
836 "i18n/icu_encoding_detection.cc",
837 "i18n/icu_encoding_detection.h",
838 "i18n/icu_string_conversions.cc",
839 "i18n/icu_string_conversions.h",
842 "i18n/number_formatting.cc",
843 "i18n/number_formatting.h",
846 "i18n/streaming_utf8_validator.cc",
847 "i18n/streaming_utf8_validator.h",
848 "i18n/string_compare.cc",
849 "i18n/string_compare.h",
850 "i18n/string_search.cc",
851 "i18n/string_search.h",
852 "i18n/time_formatting.cc",
853 "i18n/time_formatting.h",
856 "i18n/utf8_validator_tables.cc",
857 "i18n/utf8_validator_tables.h",
859 defines = [ "BASE_I18N_IMPLEMENTATION" ]
860 configs += [ "//build/config/compiler:wexit_time_destructors" ]
863 "//base/third_party/dynamic_annotations",
867 if (is_android && !is_debug) {
868 configs -= [ "//build/config/compiler:optimize" ]
869 configs += [ "//build/config/compiler:optimize_max" ]
872 # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
873 configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
876 if (is_linux && !is_chromeos) {
877 # TODO(GYP): Figure out which of these work and are needed on other platforms.
878 test("base_perftests") {
880 "message_loop/message_pump_perftest.cc",
882 # "test/run_all_unittests.cc",
883 "threading/thread_perftest.cc",
887 "//base/test:test_support",
888 "//base/test:test_support_perf",
894 deps += [ "//testing/android:native_test_native_code" ]
898 test("base_i18n_perftests") {
900 "i18n/streaming_utf8_validator_perftest.cc",
905 "//base/test:test_support",
906 "//base/test:test_support_perf",
912 executable("build_utf8_validator_tables") {
914 "i18n/build_utf8_validator_tables.cc",
918 "//third_party/icu:icuuc",
922 executable("check_example") {
933 source_set("prefs") {
935 "prefs/base_prefs_export.h",
936 "prefs/default_pref_store.cc",
937 "prefs/default_pref_store.h",
938 "prefs/json_pref_store.cc",
939 "prefs/json_pref_store.h",
940 "prefs/overlay_user_pref_store.cc",
941 "prefs/overlay_user_pref_store.h",
942 "prefs/persistent_pref_store.h",
943 "prefs/pref_change_registrar.cc",
944 "prefs/pref_change_registrar.h",
945 "prefs/pref_filter.h",
946 "prefs/pref_member.cc",
947 "prefs/pref_member.h",
948 "prefs/pref_notifier.h",
949 "prefs/pref_notifier_impl.cc",
950 "prefs/pref_notifier_impl.h",
951 "prefs/pref_observer.h",
952 "prefs/pref_registry.cc",
953 "prefs/pref_registry.h",
954 "prefs/pref_registry_simple.cc",
955 "prefs/pref_registry_simple.h",
956 "prefs/pref_service.cc",
957 "prefs/pref_service.h",
958 "prefs/pref_service_factory.cc",
959 "prefs/pref_service_factory.h",
960 "prefs/pref_store.cc",
961 "prefs/pref_store.h",
962 "prefs/pref_value_map.cc",
963 "prefs/pref_value_map.h",
964 "prefs/pref_value_store.cc",
965 "prefs/pref_value_store.h",
966 "prefs/scoped_user_pref_update.cc",
967 "prefs/scoped_user_pref_update.h",
968 "prefs/value_map_pref_store.cc",
969 "prefs/value_map_pref_store.h",
970 "prefs/writeable_pref_store.h",
973 defines = [ "BASE_PREFS_IMPLEMENTATION" ]
979 if (is_android && !is_debug) {
980 configs -= [ "//build/config/compiler:optimize" ]
981 configs += [ "//build/config/compiler:optimize_max" ]
985 source_set("prefs_test_support") {
988 "prefs/mock_pref_change_callback.cc",
989 "prefs/mock_pref_change_callback.h",
990 "prefs/pref_store_observer_mock.cc",
991 "prefs/pref_store_observer_mock.h",
992 "prefs/testing_pref_service.cc",
993 "prefs/testing_pref_service.h",
994 "prefs/testing_pref_store.cc",
995 "prefs/testing_pref_store.h",
1008 source_set("message_loop_tests") {
1011 "message_loop/message_loop_test.cc",
1012 "message_loop/message_loop_test.h",
1021 # TODO(pasko): Remove this target when crbug.com/424562 is fixed.
1022 source_set("protect_file_posix") {
1024 "files/protect_file_posix.cc",
1033 # Target to manually rebuild pe_image_test.dll which is checked into
1034 # base/test/data/pe_image.
1035 shared_library("pe_image_test") {
1037 "win/pe_image_test.cc",
1040 "/DELAYLOAD:cfgmgr32.dll",
1041 "/DELAYLOAD:shell32.dll",
1042 "/SUBSYSTEM:WINDOWS",
1051 test("base_unittests") {
1053 "android/application_status_listener_unittest.cc",
1054 "android/content_uri_utils_unittest.cc",
1055 "android/jni_android_unittest.cc",
1056 "android/jni_array_unittest.cc",
1057 "android/jni_string_unittest.cc",
1058 "android/path_utils_unittest.cc",
1059 "android/scoped_java_ref_unittest.cc",
1060 "android/sys_utils_unittest.cc",
1061 "async_socket_io_handler_unittest.cc",
1062 "at_exit_unittest.cc",
1063 "atomicops_unittest.cc",
1064 "barrier_closure_unittest.cc",
1065 "base64_unittest.cc",
1066 "big_endian_unittest.cc",
1070 "build_time_unittest.cc",
1071 "callback_helpers_unittest.cc",
1072 "callback_list_unittest.cc",
1073 "callback_list_unittest.nc",
1074 "callback_unittest.cc",
1075 "callback_unittest.nc",
1076 "cancelable_callback_unittest.cc",
1077 "chromeos/memory_pressure_observer_chromeos_unittest.cc",
1078 "command_line_unittest.cc",
1079 "containers/adapters_unittest.cc",
1080 "containers/hash_tables_unittest.cc",
1081 "containers/linked_list_unittest.cc",
1082 "containers/mru_cache_unittest.cc",
1083 "containers/small_map_unittest.cc",
1084 "containers/stack_container_unittest.cc",
1086 "debug/crash_logging_unittest.cc",
1087 "debug/debugger_unittest.cc",
1088 "debug/leak_tracker_unittest.cc",
1089 "debug/proc_maps_linux_unittest.cc",
1090 "debug/stack_trace_unittest.cc",
1091 "debug/task_annotator_unittest.cc",
1092 "deferred_sequenced_task_runner_unittest.cc",
1093 "environment_unittest.cc",
1094 "file_version_info_unittest.cc",
1095 "files/dir_reader_posix_unittest.cc",
1096 "files/file_path_unittest.cc",
1097 "files/file_proxy_unittest.cc",
1098 "files/file_unittest.cc",
1099 "files/file_util_proxy_unittest.cc",
1100 "files/file_util_unittest.cc",
1101 "files/important_file_writer_unittest.cc",
1102 "files/scoped_temp_dir_unittest.cc",
1103 "gmock_unittest.cc",
1106 "i18n/break_iterator_unittest.cc",
1107 "i18n/case_conversion_unittest.cc",
1108 "i18n/char_iterator_unittest.cc",
1109 "i18n/file_util_icu_unittest.cc",
1110 "i18n/icu_string_conversions_unittest.cc",
1111 "i18n/number_formatting_unittest.cc",
1112 "i18n/rtl_unittest.cc",
1113 "i18n/streaming_utf8_validator_unittest.cc",
1114 "i18n/string_search_unittest.cc",
1115 "i18n/time_formatting_unittest.cc",
1116 "i18n/timezone_unittest.cc",
1117 "id_map_unittest.cc",
1118 "ios/device_util_unittest.mm",
1119 "ios/weak_nsobject_unittest.mm",
1120 "json/json_parser_unittest.cc",
1121 "json/json_reader_unittest.cc",
1122 "json/json_value_converter_unittest.cc",
1123 "json/json_value_serializer_unittest.cc",
1124 "json/json_writer_unittest.cc",
1125 "json/string_escape_unittest.cc",
1126 "lazy_instance_unittest.cc",
1127 "logging_unittest.cc",
1128 "mac/bind_objc_block_unittest.mm",
1129 "mac/foundation_util_unittest.mm",
1130 "mac/libdispatch_task_runner_unittest.cc",
1131 "mac/mac_util_unittest.mm",
1132 "mac/objc_property_releaser_unittest.mm",
1133 "mac/scoped_nsobject_unittest.mm",
1134 "mac/scoped_objc_class_swizzler_unittest.mm",
1135 "mac/scoped_sending_event_unittest.mm",
1137 "memory/aligned_memory_unittest.cc",
1138 "memory/discardable_memory_unittest.cc",
1139 "memory/discardable_shared_memory_unittest.cc",
1140 "memory/linked_ptr_unittest.cc",
1141 "memory/ref_counted_memory_unittest.cc",
1142 "memory/ref_counted_unittest.cc",
1143 "memory/scoped_ptr_unittest.cc",
1144 "memory/scoped_ptr_unittest.nc",
1145 "memory/scoped_vector_unittest.cc",
1146 "memory/shared_memory_unittest.cc",
1147 "memory/singleton_unittest.cc",
1148 "memory/weak_ptr_unittest.cc",
1149 "memory/weak_ptr_unittest.nc",
1150 "message_loop/message_loop_proxy_impl_unittest.cc",
1151 "message_loop/message_loop_proxy_unittest.cc",
1152 "message_loop/message_loop_unittest.cc",
1153 "message_loop/message_pump_glib_unittest.cc",
1154 "message_loop/message_pump_io_ios_unittest.cc",
1155 "metrics/bucket_ranges_unittest.cc",
1156 "metrics/field_trial_unittest.cc",
1157 "metrics/histogram_base_unittest.cc",
1158 "metrics/histogram_delta_serialization_unittest.cc",
1159 "metrics/histogram_snapshot_manager_unittest.cc",
1160 "metrics/histogram_unittest.cc",
1161 "metrics/sample_map_unittest.cc",
1162 "metrics/sample_vector_unittest.cc",
1163 "metrics/sparse_histogram_unittest.cc",
1164 "metrics/statistics_recorder_unittest.cc",
1165 "numerics/safe_numerics_unittest.cc",
1166 "observer_list_unittest.cc",
1167 "os_compat_android_unittest.cc",
1168 "path_service_unittest.cc",
1169 "pickle_unittest.cc",
1170 "posix/file_descriptor_shuffle_unittest.cc",
1171 "posix/unix_domain_socket_linux_unittest.cc",
1172 "power_monitor/power_monitor_unittest.cc",
1173 "prefs/default_pref_store_unittest.cc",
1174 "prefs/json_pref_store_unittest.cc",
1175 "prefs/overlay_user_pref_store_unittest.cc",
1176 "prefs/pref_change_registrar_unittest.cc",
1177 "prefs/pref_member_unittest.cc",
1178 "prefs/pref_notifier_impl_unittest.cc",
1179 "prefs/pref_service_unittest.cc",
1180 "prefs/pref_value_map_unittest.cc",
1181 "prefs/pref_value_store_unittest.cc",
1182 "prefs/scoped_user_pref_update_unittest.cc",
1183 "process/memory_unittest.cc",
1184 "process/memory_unittest_mac.h",
1185 "process/memory_unittest_mac.mm",
1186 "process/process_metrics_unittest.cc",
1187 "process/process_metrics_unittest_ios.cc",
1188 "process/process_unittest.cc",
1189 "process/process_util_unittest.cc",
1190 "process/process_util_unittest_ios.cc",
1191 "profiler/tracked_time_unittest.cc",
1192 "rand_util_unittest.cc",
1193 "scoped_clear_errno_unittest.cc",
1194 "scoped_generic_unittest.cc",
1195 "scoped_native_library_unittest.cc",
1196 "security_unittest.cc",
1197 "sequence_checker_unittest.cc",
1199 "stl_util_unittest.cc",
1200 "strings/nullable_string16_unittest.cc",
1201 "strings/safe_sprintf_unittest.cc",
1202 "strings/string16_unittest.cc",
1203 "strings/string_number_conversions_unittest.cc",
1204 "strings/string_piece_unittest.cc",
1205 "strings/string_split_unittest.cc",
1206 "strings/string_tokenizer_unittest.cc",
1207 "strings/string_util_unittest.cc",
1208 "strings/stringize_macros_unittest.cc",
1209 "strings/stringprintf_unittest.cc",
1210 "strings/sys_string_conversions_mac_unittest.mm",
1211 "strings/sys_string_conversions_unittest.cc",
1212 "strings/utf_offset_string_conversions_unittest.cc",
1213 "strings/utf_string_conversions_unittest.cc",
1214 "supports_user_data_unittest.cc",
1215 "sync_socket_unittest.cc",
1216 "synchronization/cancellation_flag_unittest.cc",
1217 "synchronization/condition_variable_unittest.cc",
1218 "synchronization/lock_unittest.cc",
1219 "synchronization/waitable_event_unittest.cc",
1220 "synchronization/waitable_event_watcher_unittest.cc",
1221 "sys_info_unittest.cc",
1222 "system_monitor/system_monitor_unittest.cc",
1223 "task/cancelable_task_tracker_unittest.cc",
1224 "task_runner_util_unittest.cc",
1225 "template_util_unittest.cc",
1226 "test/expectations/expectation_unittest.cc",
1227 "test/expectations/parser_unittest.cc",
1228 "test/histogram_tester_unittest.cc",
1229 "test/test_reg_util_win_unittest.cc",
1230 "test/trace_event_analyzer_unittest.cc",
1231 "threading/non_thread_safe_unittest.cc",
1232 "threading/platform_thread_unittest.cc",
1233 "threading/sequenced_worker_pool_unittest.cc",
1234 "threading/simple_thread_unittest.cc",
1235 "threading/thread_checker_unittest.cc",
1236 "threading/thread_collision_warner_unittest.cc",
1237 "threading/thread_id_name_manager_unittest.cc",
1238 "threading/thread_local_storage_unittest.cc",
1239 "threading/thread_local_unittest.cc",
1240 "threading/thread_unittest.cc",
1241 "threading/watchdog_unittest.cc",
1242 "threading/worker_pool_posix_unittest.cc",
1243 "threading/worker_pool_unittest.cc",
1244 "time/pr_time_unittest.cc",
1245 "time/time_unittest.cc",
1246 "time/time_win_unittest.cc",
1247 "timer/hi_res_timer_manager_unittest.cc",
1248 "timer/mock_timer_unittest.cc",
1249 "timer/timer_unittest.cc",
1250 "tools_sanity_unittest.cc",
1251 "trace_event/memory_dump_manager_unittest.cc",
1252 "trace_event/process_memory_maps_dump_provider_unittest.cc",
1253 "trace_event/process_memory_totals_dump_provider_unittest.cc",
1254 "trace_event/trace_event_argument_unittest.cc",
1255 "trace_event/trace_event_memory_unittest.cc",
1256 "trace_event/trace_event_synthetic_delay_unittest.cc",
1257 "trace_event/trace_event_system_stats_monitor_unittest.cc",
1258 "trace_event/trace_event_unittest.cc",
1259 "trace_event/trace_event_win_unittest.cc",
1260 "tracked_objects_unittest.cc",
1261 "tuple_unittest.cc",
1262 "values_unittest.cc",
1263 "version_unittest.cc",
1266 "win/enum_variant_unittest.cc",
1267 "win/event_trace_consumer_unittest.cc",
1268 "win/event_trace_controller_unittest.cc",
1269 "win/event_trace_provider_unittest.cc",
1270 "win/i18n_unittest.cc",
1271 "win/iunknown_impl_unittest.cc",
1272 "win/message_window_unittest.cc",
1273 "win/object_watcher_unittest.cc",
1274 "win/pe_image_unittest.cc",
1275 "win/registry_unittest.cc",
1276 "win/scoped_bstr_unittest.cc",
1277 "win/scoped_comptr_unittest.cc",
1278 "win/scoped_process_information_unittest.cc",
1279 "win/scoped_variant_unittest.cc",
1280 "win/shortcut_unittest.cc",
1281 "win/startup_information_unittest.cc",
1282 "win/win_util_unittest.cc",
1283 "win/wrapped_window_proc_unittest.cc",
1291 ":message_loop_tests",
1293 ":prefs_test_support",
1295 "//base/test:run_all_unittests",
1296 "//base/test:test_support",
1297 "//base/third_party/dynamic_annotations",
1298 "//base/third_party/nspr",
1301 "//third_party/icu",
1304 # Allow more direct string conversions on platforms with native utf8
1306 if (is_mac || is_ios || is_chromeos) {
1307 defines += [ "SYSTEM_NATIVE_UTF8" ]
1313 ":base_java_unittest_support",
1319 "process/memory_unittest.cc",
1320 "process/memory_unittest_mac.h",
1321 "process/memory_unittest_mac.mm",
1322 "process/process_unittest.cc",
1323 "process/process_util_unittest.cc",
1326 # Pull in specific Mac files for iOS (which have been filtered out by file
1328 set_sources_assignment_filter([])
1330 "mac/bind_objc_block_unittest.mm",
1331 "mac/foundation_util_unittest.mm",
1332 "mac/objc_property_releaser_unittest.mm",
1333 "mac/scoped_nsobject_unittest.mm",
1334 "sys_string_conversions_mac_unittest.mm",
1336 set_sources_assignment_filter(sources_assignment_filter)
1338 # TODO(GYP): dep on copy_test_data_ios action.
1342 sources -= [ "file_version_info_unittest.cc" ]
1343 sources += [ "nix/xdg_util_unittest.cc" ]
1344 defines += [ "USE_SYMBOLIZE" ]
1346 configs += [ "//build/config/linux:glib" ]
1350 if (!is_linux || use_ozone) {
1351 sources -= [ "message_loop/message_pump_glib_unittest.cc" ]
1354 if (is_posix || is_ios) {
1355 sources += [ "message_loop/message_pump_libevent_unittest.cc" ]
1356 deps += [ "//third_party/libevent" ]
1360 deps += [ "//testing/android:native_test_native_code" ]
1361 set_sources_assignment_filter([])
1362 sources += [ "debug/proc_maps_linux_unittest.cc" ]
1363 set_sources_assignment_filter(sources_assignment_filter)
1366 # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
1367 configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
1371 # GYP: //base.gyp:base_jni_headers
1372 generate_jni("base_jni_headers") {
1374 "android/java/src/org/chromium/base/AnimationFrameTimeHistogram.java",
1375 "android/java/src/org/chromium/base/ApplicationStatus.java",
1376 "android/java/src/org/chromium/base/BuildInfo.java",
1377 "android/java/src/org/chromium/base/CommandLine.java",
1378 "android/java/src/org/chromium/base/ContentUriUtils.java",
1379 "android/java/src/org/chromium/base/CpuFeatures.java",
1380 "android/java/src/org/chromium/base/EventLog.java",
1381 "android/java/src/org/chromium/base/FieldTrialList.java",
1382 "android/java/src/org/chromium/base/ImportantFileWriterAndroid.java",
1383 "android/java/src/org/chromium/base/JNIUtils.java",
1384 "android/java/src/org/chromium/base/JavaHandlerThread.java",
1385 "android/java/src/org/chromium/base/LocaleUtils.java",
1386 "android/java/src/org/chromium/base/MemoryPressureListener.java",
1387 "android/java/src/org/chromium/base/PathService.java",
1388 "android/java/src/org/chromium/base/PathUtils.java",
1389 "android/java/src/org/chromium/base/PowerMonitor.java",
1390 "android/java/src/org/chromium/base/SysUtils.java",
1391 "android/java/src/org/chromium/base/SystemMessageHandler.java",
1392 "android/java/src/org/chromium/base/ThreadUtils.java",
1393 "android/java/src/org/chromium/base/TraceEvent.java",
1394 "android/java/src/org/chromium/base/library_loader/LibraryLoader.java",
1395 "android/java/src/org/chromium/base/metrics/RecordHistogram.java",
1397 jni_package = "base"
1400 # GYP: //base.gyp:base_java
1401 android_library("base_java") {
1403 ":base_android_java_enums_srcjar",
1404 ":base_native_libraries_gen",
1408 "//third_party/jsr-305:jsr_305_javalib",
1411 DEPRECATED_java_in_dir = "android/java/src"
1413 # A new version of NativeLibraries.java (with the actual correct values)
1414 # will be created when creating an apk.
1415 jar_excluded_patterns = [
1416 "*/NativeLibraries.class",
1417 "*/NativeLibraries##*.class",
1421 # GYP: //base.gyp:base_javatests
1422 android_library("base_javatests") {
1425 ":base_java_test_support",
1427 DEPRECATED_java_in_dir = "android/javatests/src"
1430 # GYP: //base.gyp:base_java_test_support
1431 android_library("base_java_test_support") {
1435 DEPRECATED_java_in_dir = "test/android/javatests/src"
1438 # GYP: //base.gyp:base_java_application_state
1439 # GYP: //base.gyp:base_java_library_load_from_apk_status_codes
1440 # GYP: //base.gyp:base_java_library_process_type
1441 # GYP: //base.gyp:base_java_memory_pressure_level
1442 java_cpp_enum("base_android_java_enums_srcjar") {
1444 "android/application_status_listener.h",
1445 "android/library_loader/library_load_from_apk_status_codes.h",
1446 "android/library_loader/library_loader_hooks.h",
1447 "memory/memory_pressure_listener.h",
1450 "org/chromium/base/ApplicationState.java",
1451 "org/chromium/base/library_loader/LibraryLoadFromApkStatusCodes.java",
1452 "org/chromium/base/library_loader/LibraryProcessType.java",
1453 "org/chromium/base/MemoryPressureLevel.java",
1457 # GYP: //base/base.gyp:base_native_libraries_gen
1458 java_cpp_template("base_native_libraries_gen") {
1460 "android/java/templates/NativeLibraries.template",
1462 package_name = "org/chromium/base/library_loader"
1465 # GYP: //base.gyp:base_java_unittest_support
1466 android_library("base_java_unittest_support") {
1471 [ "test/android/java/src/org/chromium/base/ContentUriTestUtils.java" ]