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 config("base_implementation") {
13 defines = [ "BASE_IMPLEMENTATION" ]
16 source_set("base_paths") {
20 "base_paths_android.cc",
21 "base_paths_android.h",
24 "base_paths_posix.cc",
30 if (is_android || is_mac) {
31 sources -= [ "base_paths_posix.cc" ]
37 "base_paths_posix.cc",
41 configs += [ ":base_implementation" ]
48 visibility = [ ":base" ]
53 "allocator/allocator_extension.cc",
54 "allocator/allocator_extension.h",
55 "allocator/type_profiler_control.cc",
56 "allocator/type_profiler_control.h",
57 "android/animation_frame_time_histogram.cc",
58 "android/animation_frame_time_histogram.h",
59 "android/application_status_listener.cc",
60 "android/application_status_listener.h",
61 "android/base_jni_onload.cc",
62 "android/base_jni_onload.h",
63 "android/base_jni_registrar.cc",
64 "android/base_jni_registrar.h",
65 "android/build_info.cc",
66 "android/build_info.h",
67 "android/command_line_android.cc",
68 "android/command_line_android.h",
69 "android/content_uri_utils.cc",
70 "android/content_uri_utils.h",
71 "android/cpu_features.cc",
72 "android/event_log.cc",
73 "android/event_log.h",
74 "android/field_trial_list.cc",
75 "android/field_trial_list.h",
76 "android/fifo_utils.cc",
77 "android/fifo_utils.h",
78 "android/important_file_writer_android.cc",
79 "android/important_file_writer_android.h",
80 "android/java_handler_thread.cc",
81 "android/java_handler_thread.h",
82 "android/jni_android.cc",
83 "android/jni_android.h",
84 "android/jni_array.cc",
85 "android/jni_array.h",
86 "android/jni_registrar.cc",
87 "android/jni_registrar.h",
88 "android/jni_string.cc",
89 "android/jni_string.h",
90 "android/jni_utils.cc",
91 "android/jni_utils.h",
92 "android/jni_weak_ref.cc",
93 "android/jni_weak_ref.h",
94 "android/library_loader/library_load_from_apk_status_codes.h",
95 "android/library_loader/library_loader_hooks.cc",
96 "android/library_loader/library_loader_hooks.h",
97 "android/locale_utils.cc",
98 "android/locale_utils.h",
99 "android/memory_pressure_listener_android.cc",
100 "android/memory_pressure_listener_android.h",
101 "android/path_service_android.cc",
102 "android/path_service_android.h",
103 "android/path_utils.cc",
104 "android/path_utils.h",
105 "android/record_histogram.cc",
106 "android/record_histogram.h",
107 "android/scoped_java_ref.cc",
108 "android/scoped_java_ref.h",
109 "android/sys_utils.cc",
110 "android/sys_utils.h",
111 "android/thread_utils.h",
112 "android/trace_event_binding.cc",
113 "android/trace_event_binding.h",
114 "async_socket_io_handler.h",
115 "async_socket_io_handler_posix.cc",
116 "async_socket_io_handler_win.cc",
119 "atomic_ref_count.h",
120 "atomic_sequence_num.h",
122 "atomicops_internals_gcc.h",
123 "atomicops_internals_mac.h",
124 "atomicops_internals_portable.h",
125 "atomicops_internals_x86_gcc.cc",
126 "atomicops_internals_x86_gcc.h",
127 "atomicops_internals_x86_msvc.h",
129 "barrier_closure.cc",
142 "bind_internal_win.h",
147 "callback_helpers.cc",
148 "callback_helpers.h",
149 "callback_internal.cc",
150 "callback_internal.h",
151 "cancelable_callback.h",
152 "chromeos/memory_pressure_observer_chromeos.cc",
153 "chromeos/memory_pressure_observer_chromeos.h",
156 "compiler_specific.h",
157 "containers/adapters.h",
158 "containers/hash_tables.h",
159 "containers/linked_list.h",
160 "containers/mru_cache.h",
161 "containers/small_map.h",
162 "containers/stack_container.h",
165 "critical_closure.h",
166 "critical_closure_internal_ios.mm",
167 "deferred_sequenced_task_runner.cc",
168 "deferred_sequenced_task_runner.h",
171 "file_descriptor_posix.h",
172 "file_version_info.h",
173 "file_version_info_mac.h",
174 "file_version_info_mac.mm",
175 "file_version_info_win.cc",
176 "file_version_info_win.h",
177 "files/dir_reader_fallback.h",
178 "files/dir_reader_linux.h",
179 "files/dir_reader_posix.h",
181 "files/file_enumerator.cc",
182 "files/file_enumerator.h",
183 "files/file_enumerator_posix.cc",
184 "files/file_enumerator_win.cc",
185 "files/file_path.cc",
187 "files/file_path_constants.cc",
188 "files/file_path_watcher.cc",
189 "files/file_path_watcher.h",
190 "files/file_path_watcher_fsevents.cc",
191 "files/file_path_watcher_fsevents.h",
192 "files/file_path_watcher_kqueue.cc",
193 "files/file_path_watcher_kqueue.h",
194 "files/file_path_watcher_linux.cc",
195 "files/file_path_watcher_mac.cc",
196 "files/file_path_watcher_win.cc",
197 "files/file_posix.cc",
198 "files/file_proxy.cc",
199 "files/file_proxy.h",
200 "files/file_util.cc",
202 "files/file_util_android.cc",
203 "files/file_util_linux.cc",
204 "files/file_util_mac.mm",
205 "files/file_util_posix.cc",
206 "files/file_util_proxy.cc",
207 "files/file_util_proxy.h",
208 "files/file_util_win.cc",
210 "files/important_file_writer.cc",
211 "files/important_file_writer.h",
212 "files/memory_mapped_file.cc",
213 "files/memory_mapped_file.h",
214 "files/memory_mapped_file_posix.cc",
215 "files/memory_mapped_file_win.cc",
216 "files/scoped_file.cc",
217 "files/scoped_file.h",
218 "files/scoped_temp_dir.cc",
219 "files/scoped_temp_dir.h",
231 "ios/device_util.mm",
234 "ios/scoped_critical_action.h",
235 "ios/scoped_critical_action.mm",
236 "ios/weak_nsobject.h",
237 "ios/weak_nsobject.mm",
248 "mac/authorization_util.h",
249 "mac/authorization_util.mm",
250 "mac/bind_objc_block.h",
251 "mac/bundle_locations.h",
252 "mac/bundle_locations.mm",
253 "mac/cocoa_protocols.h",
254 "mac/foundation_util.h",
255 "mac/foundation_util.mm",
256 "mac/launch_services_util.cc",
257 "mac/launch_services_util.h",
260 "mac/libdispatch_task_runner.cc",
261 "mac/libdispatch_task_runner.h",
262 "mac/mac_logging.cc",
266 "mac/mach_logging.cc",
267 "mac/mach_logging.h",
268 "mac/objc_property_releaser.h",
269 "mac/objc_property_releaser.mm",
270 "mac/os_crash_dumps.cc",
271 "mac/os_crash_dumps.h",
272 "mac/scoped_aedesc.h",
273 "mac/scoped_authorizationref.h",
274 "mac/scoped_block.h",
275 "mac/scoped_cftyperef.h",
276 "mac/scoped_ioobject.h",
277 "mac/scoped_ioplugininterface.h",
278 "mac/scoped_launch_data.h",
279 "mac/scoped_mach_port.cc",
280 "mac/scoped_mach_port.h",
281 "mac/scoped_mach_vm.cc",
282 "mac/scoped_mach_vm.h",
283 "mac/scoped_nsautorelease_pool.h",
284 "mac/scoped_nsautorelease_pool.mm",
285 "mac/scoped_nsexception_enabler.h",
286 "mac/scoped_nsexception_enabler.mm",
287 "mac/scoped_nsobject.h",
288 "mac/scoped_objc_class_swizzler.h",
289 "mac/scoped_objc_class_swizzler.mm",
290 "mac/scoped_sending_event.h",
291 "mac/scoped_sending_event.mm",
292 "mac/sdk_forward_declarations.h",
293 "mac/sdk_forward_declarations.mm",
297 "message_loop/incoming_task_queue.cc",
298 "message_loop/incoming_task_queue.h",
299 "message_loop/message_loop.cc",
300 "message_loop/message_loop.h",
301 "message_loop/message_loop_proxy.cc",
302 "message_loop/message_loop_proxy.h",
303 "message_loop/message_loop_proxy_impl.cc",
304 "message_loop/message_loop_proxy_impl.h",
305 "message_loop/message_pump.cc",
306 "message_loop/message_pump.h",
307 "message_loop/message_pump_android.cc",
308 "message_loop/message_pump_android.h",
309 "message_loop/message_pump_default.cc",
310 "message_loop/message_pump_default.h",
311 "message_loop/message_pump_glib.cc",
312 "message_loop/message_pump_glib.h",
313 "message_loop/message_pump_io_ios.cc",
314 "message_loop/message_pump_io_ios.h",
315 "message_loop/message_pump_libevent.cc",
316 "message_loop/message_pump_libevent.h",
317 "message_loop/message_pump_mac.h",
318 "message_loop/message_pump_mac.mm",
319 "message_loop/message_pump_win.cc",
320 "message_loop/message_pump_win.h",
323 "native_library_mac.mm",
324 "native_library_posix.cc",
325 "native_library_win.cc",
326 "nix/mime_util_xdg.cc",
327 "nix/mime_util_xdg.h",
330 "numerics/safe_conversions.h",
331 "numerics/safe_conversions_impl.h",
332 "numerics/safe_math.h",
333 "numerics/safe_math_impl.h",
335 "observer_list_threadsafe.h",
336 "os_compat_android.cc",
337 "os_compat_android.h",
347 "posix/eintr_wrapper.h",
348 "posix/file_descriptor_shuffle.cc",
349 "posix/global_descriptors.cc",
350 "posix/global_descriptors.h",
351 "posix/unix_domain_socket_linux.cc",
352 "posix/unix_domain_socket_linux.h",
353 "power_monitor/power_monitor.cc",
354 "power_monitor/power_monitor.h",
355 "power_monitor/power_monitor_device_source.cc",
356 "power_monitor/power_monitor_device_source.h",
357 "power_monitor/power_monitor_device_source_android.cc",
358 "power_monitor/power_monitor_device_source_android.h",
359 "power_monitor/power_monitor_device_source_chromeos.cc",
360 "power_monitor/power_monitor_device_source_ios.mm",
361 "power_monitor/power_monitor_device_source_mac.mm",
362 "power_monitor/power_monitor_device_source_posix.cc",
363 "power_monitor/power_monitor_device_source_win.cc",
364 "power_monitor/power_monitor_source.cc",
365 "power_monitor/power_monitor_source.h",
366 "power_monitor/power_observer.h",
367 "profiler/alternate_timer.cc",
368 "profiler/alternate_timer.h",
369 "profiler/scoped_profile.cc",
370 "profiler/scoped_profile.h",
371 "profiler/scoped_tracker.cc",
372 "profiler/scoped_tracker.h",
373 "profiler/stack_sampling_profiler.cc",
374 "profiler/stack_sampling_profiler.h",
375 "profiler/stack_sampling_profiler_posix.cc",
376 "profiler/stack_sampling_profiler_win.cc",
377 "profiler/tracked_time.cc",
378 "profiler/tracked_time.h",
382 "rand_util_posix.cc",
386 "safe_strerror_posix.cc",
387 "safe_strerror_posix.h",
389 "scoped_native_library.cc",
390 "scoped_native_library.h",
392 "sequence_checker.h",
393 "sequence_checker_impl.cc",
394 "sequence_checker_impl.h",
395 "sequenced_task_runner.cc",
396 "sequenced_task_runner.h",
397 "sequenced_task_runner_helpers.h",
401 "single_thread_task_runner.h",
403 "strings/latin1_string_conversions.cc",
404 "strings/latin1_string_conversions.h",
405 "strings/nullable_string16.cc",
406 "strings/nullable_string16.h",
407 "strings/safe_sprintf.cc",
408 "strings/safe_sprintf.h",
409 "strings/string16.cc",
410 "strings/string16.h",
411 "strings/string_number_conversions.cc",
412 "strings/string_number_conversions.h",
413 "strings/string_piece.cc",
414 "strings/string_piece.h",
415 "strings/string_split.cc",
416 "strings/string_split.h",
417 "strings/string_tokenizer.h",
418 "strings/string_util.cc",
419 "strings/string_util.h",
420 "strings/string_util_constants.cc",
421 "strings/string_util_posix.h",
422 "strings/string_util_win.h",
423 "strings/stringize_macros.h",
424 "strings/stringprintf.cc",
425 "strings/stringprintf.h",
426 "strings/sys_string_conversions.h",
427 "strings/sys_string_conversions_mac.mm",
428 "strings/sys_string_conversions_posix.cc",
429 "strings/sys_string_conversions_win.cc",
430 "strings/utf_offset_string_conversions.cc",
431 "strings/utf_offset_string_conversions.h",
432 "strings/utf_string_conversion_utils.cc",
433 "strings/utf_string_conversion_utils.h",
434 "strings/utf_string_conversions.cc",
435 "strings/utf_string_conversions.h",
436 "supports_user_data.cc",
437 "supports_user_data.h",
439 "sync_socket_posix.cc",
440 "sync_socket_win.cc",
441 "synchronization/cancellation_flag.cc",
442 "synchronization/cancellation_flag.h",
443 "synchronization/condition_variable.h",
444 "synchronization/condition_variable_posix.cc",
445 "synchronization/condition_variable_win.cc",
446 "synchronization/lock.cc",
447 "synchronization/lock.h",
448 "synchronization/lock_impl.h",
449 "synchronization/lock_impl_posix.cc",
450 "synchronization/lock_impl_win.cc",
451 "synchronization/spin_wait.h",
452 "synchronization/waitable_event.h",
453 "synchronization/waitable_event_posix.cc",
454 "synchronization/waitable_event_watcher.h",
455 "synchronization/waitable_event_watcher_posix.cc",
456 "synchronization/waitable_event_watcher_win.cc",
457 "synchronization/waitable_event_win.cc",
461 "sys_info_android.cc",
462 "sys_info_chromeos.cc",
463 "sys_info_freebsd.cc",
467 "sys_info_openbsd.cc",
470 "system_monitor/system_monitor.cc",
471 "system_monitor/system_monitor.h",
472 "task/cancelable_task_tracker.cc",
473 "task/cancelable_task_tracker.h",
476 "task_runner_util.h",
478 "third_party/dmg_fp/dmg_fp.h",
479 "third_party/dmg_fp/dtoa_wrapper.cc",
480 "third_party/dmg_fp/g_fmt.cc",
481 "third_party/icu/icu_utf.cc",
482 "third_party/icu/icu_utf.h",
483 "third_party/superfasthash/superfasthash.c",
484 "thread_task_runner_handle.cc",
485 "thread_task_runner_handle.h",
486 "threading/non_thread_safe.h",
487 "threading/non_thread_safe_impl.cc",
488 "threading/non_thread_safe_impl.h",
489 "threading/platform_thread.h",
490 "threading/platform_thread_android.cc",
491 "threading/platform_thread_internal_posix.cc",
492 "threading/platform_thread_internal_posix.h",
493 "threading/platform_thread_linux.cc",
494 "threading/platform_thread_mac.mm",
495 "threading/platform_thread_posix.cc",
496 "threading/platform_thread_win.cc",
497 "threading/post_task_and_reply_impl.cc",
498 "threading/post_task_and_reply_impl.h",
499 "threading/sequenced_worker_pool.cc",
500 "threading/sequenced_worker_pool.h",
501 "threading/simple_thread.cc",
502 "threading/simple_thread.h",
503 "threading/thread.cc",
504 "threading/thread.h",
505 "threading/thread_checker.h",
506 "threading/thread_checker_impl.cc",
507 "threading/thread_checker_impl.h",
508 "threading/thread_collision_warner.cc",
509 "threading/thread_collision_warner.h",
510 "threading/thread_id_name_manager.cc",
511 "threading/thread_id_name_manager.h",
512 "threading/thread_local.h",
513 "threading/thread_local_android.cc",
514 "threading/thread_local_posix.cc",
515 "threading/thread_local_storage.cc",
516 "threading/thread_local_storage.h",
517 "threading/thread_local_storage_posix.cc",
518 "threading/thread_local_storage_win.cc",
519 "threading/thread_local_win.cc",
520 "threading/thread_restrictions.cc",
521 "threading/thread_restrictions.h",
522 "threading/watchdog.cc",
523 "threading/watchdog.h",
524 "threading/worker_pool.cc",
525 "threading/worker_pool.h",
526 "threading/worker_pool_posix.cc",
527 "threading/worker_pool_posix.h",
528 "threading/worker_pool_win.cc",
531 "time/default_clock.cc",
532 "time/default_clock.h",
533 "time/default_tick_clock.cc",
534 "time/default_tick_clock.h",
535 "time/tick_clock.cc",
540 "time/time_posix.cc",
542 "timer/elapsed_timer.cc",
543 "timer/elapsed_timer.h",
544 "timer/hi_res_timer_manager.h",
545 "timer/hi_res_timer_manager_posix.cc",
546 "timer/hi_res_timer_manager_win.cc",
547 "timer/mock_timer.cc",
548 "timer/mock_timer.h",
551 "tracked_objects.cc",
556 "value_conversions.cc",
557 "value_conversions.h",
564 "win/enum_variant.cc",
565 "win/enum_variant.h",
566 "win/event_trace_consumer.h",
567 "win/event_trace_controller.cc",
568 "win/event_trace_controller.h",
569 "win/event_trace_provider.cc",
570 "win/event_trace_provider.h",
573 "win/iat_patch_function.cc",
574 "win/iat_patch_function.h",
575 "win/iunknown_impl.cc",
576 "win/iunknown_impl.h",
577 "win/message_window.cc",
578 "win/message_window.h",
581 "win/object_watcher.cc",
582 "win/object_watcher.h",
585 "win/resource_util.cc",
586 "win/resource_util.h",
587 "win/scoped_bstr.cc",
589 "win/scoped_co_mem.h",
590 "win/scoped_com_initializer.h",
591 "win/scoped_comptr.h",
592 "win/scoped_gdi_object.h",
593 "win/scoped_handle.cc",
594 "win/scoped_handle.h",
596 "win/scoped_hglobal.h",
597 "win/scoped_process_information.cc",
598 "win/scoped_process_information.h",
599 "win/scoped_propvariant.h",
600 "win/scoped_select_object.h",
601 "win/scoped_variant.cc",
602 "win/scoped_variant.h",
605 "win/startup_information.cc",
606 "win/startup_information.h",
609 "win/windows_version.cc",
610 "win/windows_version.h",
611 "win/wrapped_window_proc.cc",
612 "win/wrapped_window_proc.h",
616 "sys_info_freebsd.cc",
617 "sys_info_openbsd.cc",
620 configs += [ ":base_implementation" ]
624 "//base/allocator:allocator_extension_thunks",
625 "//base/third_party/dynamic_annotations",
626 "//base/third_party/nspr",
627 "//third_party/modp_b64",
637 "//base/trace_event",
640 # Allow more direct string conversions on platforms with native utf8
642 if (is_mac || is_ios || is_chromeos) {
643 defines = [ "SYSTEM_NATIVE_UTF8" ]
647 sources -= [ "power_monitor/power_monitor_device_source_posix.cc" ]
649 # Android uses some Linux sources, put those back.
650 set_sources_assignment_filter([])
652 "files/file_path_watcher_linux.cc",
653 "posix/unix_domain_socket_linux.cc",
656 set_sources_assignment_filter(sources_assignment_filter)
660 "//third_party/ashmem",
661 "//third_party/android_tools:cpu_features",
664 # logging.cc uses the Android logging library.
669 sources -= [ "power_monitor/power_monitor_device_source_posix.cc" ]
673 # We reset sources_assignment_filter in order to explicitly include
674 # the linux file (which would otherwise be filtered out).
675 set_sources_assignment_filter([])
677 "files/file_path_watcher_stub.cc",
678 "sync_socket_nacl.cc",
679 "threading/platform_thread_linux.cc",
681 set_sources_assignment_filter(sources_assignment_filter)
684 "allocator/type_profiler_control.cc",
685 "allocator/type_profiler_control.h",
686 "async_socket_io_handler_posix.cc",
688 "files/file_enumerator_posix.cc",
689 "files/file_proxy.cc",
690 "files/file_util.cc",
691 "files/file_util_posix.cc",
692 "files/file_util_proxy.cc",
693 "files/important_file_writer.cc",
694 "files/important_file_writer.h",
695 "files/scoped_temp_dir.cc",
696 "message_loop/message_pump_libevent.cc",
697 "native_library_posix.cc",
699 "rand_util_posix.cc",
700 "scoped_native_library.cc",
701 "sync_socket_posix.cc",
717 "message_loop/message_pump_libevent.cc",
718 "strings/string16.cc",
720 # Not using sha1_win.cc because it may have caused a
721 # regression to page cycler moz.
725 # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
726 configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
735 "/DELAYLOAD:cfgmgr32.dll",
736 "/DELAYLOAD:powrprof.dll",
737 "/DELAYLOAD:setupapi.dll",
739 } else if (!is_nacl) {
741 deps += [ "//third_party/libevent" ]
747 "native_library_posix.cc",
748 "strings/sys_string_conversions_posix.cc",
749 "threading/platform_thread_internal_posix.cc",
754 "files/file_path_watcher_fsevents.cc",
755 "files/file_path_watcher_fsevents.h",
756 "files/file_path_watcher_kqueue.cc",
757 "files/file_path_watcher_kqueue.h",
763 # TODO(brettw) this will need to be parameterized at some point.
766 linux_configs += [ "//build/config/linux:glib" ]
769 configs += linux_configs
770 all_dependent_configs = linux_configs
772 # These dependencies are not required on Android, and in the case
773 # of xdg_mime must be excluded due to licensing restrictions.
775 "//base/third_party/xdg_mime",
776 "//base/third_party/xdg_user_dirs",
781 "nix/mime_util_xdg.cc",
782 "nix/mime_util_xdg.h",
797 "message_loop/message_pump_glib.cc",
798 "message_loop/message_pump_glib.h",
802 configs += [ "//build/config/compiler:wexit_time_destructors" ]
803 if (is_android && !is_debug) {
804 configs -= [ "//build/config/compiler:optimize" ]
805 configs += [ "//build/config/compiler:optimize_max" ]
808 allow_circular_includes_from = public_deps
811 # This is the subset of files from base that should not be used with a dynamic
812 # library. Note that this library cannot depend on base because base depends on
814 source_set("base_static") {
822 if (is_android && !is_debug) {
823 configs -= [ "//build/config/compiler:optimize" ]
824 configs += [ "//build/config/compiler:optimize_max" ]
829 output_name = "base_i18n"
831 "i18n/base_i18n_export.h",
832 "i18n/bidi_line_iterator.cc",
833 "i18n/bidi_line_iterator.h",
834 "i18n/break_iterator.cc",
835 "i18n/break_iterator.h",
836 "i18n/case_conversion.cc",
837 "i18n/case_conversion.h",
838 "i18n/char_iterator.cc",
839 "i18n/char_iterator.h",
840 "i18n/file_util_icu.cc",
841 "i18n/file_util_icu.h",
842 "i18n/i18n_constants.cc",
843 "i18n/i18n_constants.h",
844 "i18n/icu_encoding_detection.cc",
845 "i18n/icu_encoding_detection.h",
846 "i18n/icu_string_conversions.cc",
847 "i18n/icu_string_conversions.h",
850 "i18n/number_formatting.cc",
851 "i18n/number_formatting.h",
854 "i18n/streaming_utf8_validator.cc",
855 "i18n/streaming_utf8_validator.h",
856 "i18n/string_compare.cc",
857 "i18n/string_compare.h",
858 "i18n/string_search.cc",
859 "i18n/string_search.h",
860 "i18n/time_formatting.cc",
861 "i18n/time_formatting.h",
864 "i18n/utf8_validator_tables.cc",
865 "i18n/utf8_validator_tables.h",
867 defines = [ "BASE_I18N_IMPLEMENTATION" ]
868 configs += [ "//build/config/compiler:wexit_time_destructors" ]
871 "//base/third_party/dynamic_annotations",
875 if (is_android && !is_debug) {
876 configs -= [ "//build/config/compiler:optimize" ]
877 configs += [ "//build/config/compiler:optimize_max" ]
880 # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
881 configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
884 if (is_linux && !is_chromeos) {
885 # TODO(GYP): Figure out which of these work and are needed on other platforms.
886 test("base_perftests") {
888 "message_loop/message_pump_perftest.cc",
890 # "test/run_all_unittests.cc",
891 "threading/thread_perftest.cc",
895 "//base/test:test_support",
896 "//base/test:test_support_perf",
902 deps += [ "//testing/android:native_test_native_code" ]
906 test("base_i18n_perftests") {
908 "i18n/streaming_utf8_validator_perftest.cc",
913 "//base/test:test_support",
914 "//base/test:test_support_perf",
920 executable("build_utf8_validator_tables") {
922 "i18n/build_utf8_validator_tables.cc",
926 "//third_party/icu:icuuc",
930 executable("check_example") {
941 source_set("prefs") {
943 "prefs/base_prefs_export.h",
944 "prefs/default_pref_store.cc",
945 "prefs/default_pref_store.h",
946 "prefs/json_pref_store.cc",
947 "prefs/json_pref_store.h",
948 "prefs/overlay_user_pref_store.cc",
949 "prefs/overlay_user_pref_store.h",
950 "prefs/persistent_pref_store.h",
951 "prefs/pref_change_registrar.cc",
952 "prefs/pref_change_registrar.h",
953 "prefs/pref_filter.h",
954 "prefs/pref_member.cc",
955 "prefs/pref_member.h",
956 "prefs/pref_notifier.h",
957 "prefs/pref_notifier_impl.cc",
958 "prefs/pref_notifier_impl.h",
959 "prefs/pref_observer.h",
960 "prefs/pref_registry.cc",
961 "prefs/pref_registry.h",
962 "prefs/pref_registry_simple.cc",
963 "prefs/pref_registry_simple.h",
964 "prefs/pref_service.cc",
965 "prefs/pref_service.h",
966 "prefs/pref_service_factory.cc",
967 "prefs/pref_service_factory.h",
968 "prefs/pref_store.cc",
969 "prefs/pref_store.h",
970 "prefs/pref_value_map.cc",
971 "prefs/pref_value_map.h",
972 "prefs/pref_value_store.cc",
973 "prefs/pref_value_store.h",
974 "prefs/scoped_user_pref_update.cc",
975 "prefs/scoped_user_pref_update.h",
976 "prefs/value_map_pref_store.cc",
977 "prefs/value_map_pref_store.h",
978 "prefs/writeable_pref_store.h",
981 defines = [ "BASE_PREFS_IMPLEMENTATION" ]
987 if (is_android && !is_debug) {
988 configs -= [ "//build/config/compiler:optimize" ]
989 configs += [ "//build/config/compiler:optimize_max" ]
993 source_set("prefs_test_support") {
996 "prefs/mock_pref_change_callback.cc",
997 "prefs/mock_pref_change_callback.h",
998 "prefs/pref_store_observer_mock.cc",
999 "prefs/pref_store_observer_mock.h",
1000 "prefs/testing_pref_service.cc",
1001 "prefs/testing_pref_service.h",
1002 "prefs/testing_pref_store.cc",
1003 "prefs/testing_pref_store.h",
1016 source_set("message_loop_tests") {
1019 "message_loop/message_loop_test.cc",
1020 "message_loop/message_loop_test.h",
1029 # TODO(pasko): Remove this target when crbug.com/424562 is fixed.
1030 source_set("protect_file_posix") {
1032 "files/protect_file_posix.cc",
1041 # Target to manually rebuild pe_image_test.dll which is checked into
1042 # base/test/data/pe_image.
1043 shared_library("pe_image_test") {
1045 "win/pe_image_test.cc",
1048 "/DELAYLOAD:cfgmgr32.dll",
1049 "/DELAYLOAD:shell32.dll",
1050 "/SUBSYSTEM:WINDOWS",
1059 test("base_unittests") {
1061 "android/application_status_listener_unittest.cc",
1062 "android/content_uri_utils_unittest.cc",
1063 "android/jni_android_unittest.cc",
1064 "android/jni_array_unittest.cc",
1065 "android/jni_string_unittest.cc",
1066 "android/path_utils_unittest.cc",
1067 "android/scoped_java_ref_unittest.cc",
1068 "android/sys_utils_unittest.cc",
1069 "async_socket_io_handler_unittest.cc",
1070 "at_exit_unittest.cc",
1071 "atomicops_unittest.cc",
1072 "barrier_closure_unittest.cc",
1073 "base64_unittest.cc",
1074 "big_endian_unittest.cc",
1078 "build_time_unittest.cc",
1079 "callback_helpers_unittest.cc",
1080 "callback_list_unittest.cc",
1081 "callback_list_unittest.nc",
1082 "callback_unittest.cc",
1083 "callback_unittest.nc",
1084 "cancelable_callback_unittest.cc",
1085 "chromeos/memory_pressure_observer_chromeos_unittest.cc",
1086 "command_line_unittest.cc",
1087 "containers/adapters_unittest.cc",
1088 "containers/hash_tables_unittest.cc",
1089 "containers/linked_list_unittest.cc",
1090 "containers/mru_cache_unittest.cc",
1091 "containers/small_map_unittest.cc",
1092 "containers/stack_container_unittest.cc",
1094 "debug/crash_logging_unittest.cc",
1095 "debug/debugger_unittest.cc",
1096 "debug/leak_tracker_unittest.cc",
1097 "debug/proc_maps_linux_unittest.cc",
1098 "debug/stack_trace_unittest.cc",
1099 "debug/task_annotator_unittest.cc",
1100 "deferred_sequenced_task_runner_unittest.cc",
1101 "environment_unittest.cc",
1102 "file_version_info_unittest.cc",
1103 "files/dir_reader_posix_unittest.cc",
1104 "files/file_path_unittest.cc",
1105 "files/file_proxy_unittest.cc",
1106 "files/file_unittest.cc",
1107 "files/file_util_proxy_unittest.cc",
1108 "files/file_util_unittest.cc",
1109 "files/important_file_writer_unittest.cc",
1110 "files/scoped_temp_dir_unittest.cc",
1111 "gmock_unittest.cc",
1114 "i18n/break_iterator_unittest.cc",
1115 "i18n/case_conversion_unittest.cc",
1116 "i18n/char_iterator_unittest.cc",
1117 "i18n/file_util_icu_unittest.cc",
1118 "i18n/icu_string_conversions_unittest.cc",
1119 "i18n/number_formatting_unittest.cc",
1120 "i18n/rtl_unittest.cc",
1121 "i18n/streaming_utf8_validator_unittest.cc",
1122 "i18n/string_search_unittest.cc",
1123 "i18n/time_formatting_unittest.cc",
1124 "i18n/timezone_unittest.cc",
1125 "id_map_unittest.cc",
1126 "ios/device_util_unittest.mm",
1127 "ios/weak_nsobject_unittest.mm",
1128 "json/json_parser_unittest.cc",
1129 "json/json_reader_unittest.cc",
1130 "json/json_value_converter_unittest.cc",
1131 "json/json_value_serializer_unittest.cc",
1132 "json/json_writer_unittest.cc",
1133 "json/string_escape_unittest.cc",
1134 "lazy_instance_unittest.cc",
1135 "logging_unittest.cc",
1136 "mac/bind_objc_block_unittest.mm",
1137 "mac/foundation_util_unittest.mm",
1138 "mac/libdispatch_task_runner_unittest.cc",
1139 "mac/mac_util_unittest.mm",
1140 "mac/objc_property_releaser_unittest.mm",
1141 "mac/scoped_nsobject_unittest.mm",
1142 "mac/scoped_objc_class_swizzler_unittest.mm",
1143 "mac/scoped_sending_event_unittest.mm",
1145 "memory/aligned_memory_unittest.cc",
1146 "memory/discardable_shared_memory_unittest.cc",
1147 "memory/linked_ptr_unittest.cc",
1148 "memory/ref_counted_memory_unittest.cc",
1149 "memory/ref_counted_unittest.cc",
1150 "memory/scoped_ptr_unittest.cc",
1151 "memory/scoped_ptr_unittest.nc",
1152 "memory/scoped_vector_unittest.cc",
1153 "memory/shared_memory_unittest.cc",
1154 "memory/singleton_unittest.cc",
1155 "memory/weak_ptr_unittest.cc",
1156 "memory/weak_ptr_unittest.nc",
1157 "message_loop/message_loop_proxy_impl_unittest.cc",
1158 "message_loop/message_loop_proxy_unittest.cc",
1159 "message_loop/message_loop_unittest.cc",
1160 "message_loop/message_pump_glib_unittest.cc",
1161 "message_loop/message_pump_io_ios_unittest.cc",
1162 "metrics/bucket_ranges_unittest.cc",
1163 "metrics/field_trial_unittest.cc",
1164 "metrics/histogram_base_unittest.cc",
1165 "metrics/histogram_delta_serialization_unittest.cc",
1166 "metrics/histogram_snapshot_manager_unittest.cc",
1167 "metrics/histogram_unittest.cc",
1168 "metrics/sample_map_unittest.cc",
1169 "metrics/sample_vector_unittest.cc",
1170 "metrics/sparse_histogram_unittest.cc",
1171 "metrics/statistics_recorder_unittest.cc",
1172 "numerics/safe_numerics_unittest.cc",
1173 "observer_list_unittest.cc",
1174 "os_compat_android_unittest.cc",
1175 "path_service_unittest.cc",
1176 "pickle_unittest.cc",
1177 "posix/file_descriptor_shuffle_unittest.cc",
1178 "posix/unix_domain_socket_linux_unittest.cc",
1179 "power_monitor/power_monitor_unittest.cc",
1180 "prefs/default_pref_store_unittest.cc",
1181 "prefs/json_pref_store_unittest.cc",
1182 "prefs/overlay_user_pref_store_unittest.cc",
1183 "prefs/pref_change_registrar_unittest.cc",
1184 "prefs/pref_member_unittest.cc",
1185 "prefs/pref_notifier_impl_unittest.cc",
1186 "prefs/pref_service_unittest.cc",
1187 "prefs/pref_value_map_unittest.cc",
1188 "prefs/pref_value_store_unittest.cc",
1189 "prefs/scoped_user_pref_update_unittest.cc",
1190 "process/memory_unittest.cc",
1191 "process/memory_unittest_mac.h",
1192 "process/memory_unittest_mac.mm",
1193 "process/process_metrics_unittest.cc",
1194 "process/process_metrics_unittest_ios.cc",
1195 "process/process_unittest.cc",
1196 "process/process_util_unittest.cc",
1197 "process/process_util_unittest_ios.cc",
1198 "profiler/stack_sampling_profiler_unittest.cc",
1199 "profiler/tracked_time_unittest.cc",
1200 "rand_util_unittest.cc",
1201 "scoped_clear_errno_unittest.cc",
1202 "scoped_generic_unittest.cc",
1203 "scoped_native_library_unittest.cc",
1204 "security_unittest.cc",
1205 "sequence_checker_unittest.cc",
1207 "stl_util_unittest.cc",
1208 "strings/nullable_string16_unittest.cc",
1209 "strings/safe_sprintf_unittest.cc",
1210 "strings/string16_unittest.cc",
1211 "strings/string_number_conversions_unittest.cc",
1212 "strings/string_piece_unittest.cc",
1213 "strings/string_split_unittest.cc",
1214 "strings/string_tokenizer_unittest.cc",
1215 "strings/string_util_unittest.cc",
1216 "strings/stringize_macros_unittest.cc",
1217 "strings/stringprintf_unittest.cc",
1218 "strings/sys_string_conversions_mac_unittest.mm",
1219 "strings/sys_string_conversions_unittest.cc",
1220 "strings/utf_offset_string_conversions_unittest.cc",
1221 "strings/utf_string_conversions_unittest.cc",
1222 "supports_user_data_unittest.cc",
1223 "sync_socket_unittest.cc",
1224 "synchronization/cancellation_flag_unittest.cc",
1225 "synchronization/condition_variable_unittest.cc",
1226 "synchronization/lock_unittest.cc",
1227 "synchronization/waitable_event_unittest.cc",
1228 "synchronization/waitable_event_watcher_unittest.cc",
1229 "sys_info_unittest.cc",
1230 "system_monitor/system_monitor_unittest.cc",
1231 "task/cancelable_task_tracker_unittest.cc",
1232 "task_runner_util_unittest.cc",
1233 "template_util_unittest.cc",
1234 "test/expectations/expectation_unittest.cc",
1235 "test/expectations/parser_unittest.cc",
1236 "test/histogram_tester_unittest.cc",
1237 "test/test_reg_util_win_unittest.cc",
1238 "test/trace_event_analyzer_unittest.cc",
1239 "threading/non_thread_safe_unittest.cc",
1240 "threading/platform_thread_unittest.cc",
1241 "threading/sequenced_worker_pool_unittest.cc",
1242 "threading/simple_thread_unittest.cc",
1243 "threading/thread_checker_unittest.cc",
1244 "threading/thread_collision_warner_unittest.cc",
1245 "threading/thread_id_name_manager_unittest.cc",
1246 "threading/thread_local_storage_unittest.cc",
1247 "threading/thread_local_unittest.cc",
1248 "threading/thread_unittest.cc",
1249 "threading/watchdog_unittest.cc",
1250 "threading/worker_pool_posix_unittest.cc",
1251 "threading/worker_pool_unittest.cc",
1252 "time/pr_time_unittest.cc",
1253 "time/time_unittest.cc",
1254 "time/time_win_unittest.cc",
1255 "timer/hi_res_timer_manager_unittest.cc",
1256 "timer/mock_timer_unittest.cc",
1257 "timer/timer_unittest.cc",
1258 "tools_sanity_unittest.cc",
1259 "tracked_objects_unittest.cc",
1260 "tuple_unittest.cc",
1261 "values_unittest.cc",
1262 "version_unittest.cc",
1265 "win/enum_variant_unittest.cc",
1266 "win/event_trace_consumer_unittest.cc",
1267 "win/event_trace_controller_unittest.cc",
1268 "win/event_trace_provider_unittest.cc",
1269 "win/i18n_unittest.cc",
1270 "win/iunknown_impl_unittest.cc",
1271 "win/message_window_unittest.cc",
1272 "win/object_watcher_unittest.cc",
1273 "win/pe_image_unittest.cc",
1274 "win/registry_unittest.cc",
1275 "win/scoped_bstr_unittest.cc",
1276 "win/scoped_comptr_unittest.cc",
1277 "win/scoped_process_information_unittest.cc",
1278 "win/scoped_variant_unittest.cc",
1279 "win/shortcut_unittest.cc",
1280 "win/startup_information_unittest.cc",
1281 "win/win_util_unittest.cc",
1282 "win/wrapped_window_proc_unittest.cc",
1288 ":message_loop_tests",
1290 ":prefs_test_support",
1292 "//base/test:run_all_unittests",
1293 "//base/test:test_support",
1294 "//base/third_party/dynamic_annotations",
1295 "//base/third_party/nspr",
1296 "//base/trace_event:trace_event_unittests",
1299 "//third_party/icu",
1302 # Allow more direct string conversions on platforms with native utf8
1304 if (is_mac || is_ios || is_chromeos) {
1305 defines = [ "SYSTEM_NATIVE_UTF8" ]
1311 ":base_java_unittest_support",
1317 "process/memory_unittest.cc",
1318 "process/memory_unittest_mac.h",
1319 "process/memory_unittest_mac.mm",
1320 "process/process_unittest.cc",
1321 "process/process_util_unittest.cc",
1324 # Pull in specific Mac files for iOS (which have been filtered out by file
1326 set_sources_assignment_filter([])
1328 "mac/bind_objc_block_unittest.mm",
1329 "mac/foundation_util_unittest.mm",
1330 "mac/objc_property_releaser_unittest.mm",
1331 "mac/scoped_nsobject_unittest.mm",
1332 "sys_string_conversions_mac_unittest.mm",
1334 set_sources_assignment_filter(sources_assignment_filter)
1336 # TODO(GYP): dep on copy_test_data_ios action.
1340 sources -= [ "file_version_info_unittest.cc" ]
1341 sources += [ "nix/xdg_util_unittest.cc" ]
1342 deps += [ "//base/test:malloc_wrapper" ]
1345 configs += [ "//build/config/linux:glib" ]
1349 if (!is_linux || use_ozone) {
1350 sources -= [ "message_loop/message_pump_glib_unittest.cc" ]
1353 if (is_posix || is_ios) {
1354 sources += [ "message_loop/message_pump_libevent_unittest.cc" ]
1355 deps += [ "//third_party/libevent" ]
1359 deps += [ "//testing/android:native_test_native_code" ]
1360 set_sources_assignment_filter([])
1361 sources += [ "debug/proc_maps_linux_unittest.cc" ]
1362 set_sources_assignment_filter(sources_assignment_filter)
1365 # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
1366 configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
1370 # GYP: //base.gyp:base_jni_headers
1371 generate_jni("base_jni_headers") {
1373 "android/java/src/org/chromium/base/AnimationFrameTimeHistogram.java",
1374 "android/java/src/org/chromium/base/ApplicationStatus.java",
1375 "android/java/src/org/chromium/base/BuildInfo.java",
1376 "android/java/src/org/chromium/base/CommandLine.java",
1377 "android/java/src/org/chromium/base/ContentUriUtils.java",
1378 "android/java/src/org/chromium/base/CpuFeatures.java",
1379 "android/java/src/org/chromium/base/EventLog.java",
1380 "android/java/src/org/chromium/base/FieldTrialList.java",
1381 "android/java/src/org/chromium/base/ImportantFileWriterAndroid.java",
1382 "android/java/src/org/chromium/base/JNIUtils.java",
1383 "android/java/src/org/chromium/base/JavaHandlerThread.java",
1384 "android/java/src/org/chromium/base/LocaleUtils.java",
1385 "android/java/src/org/chromium/base/MemoryPressureListener.java",
1386 "android/java/src/org/chromium/base/PathService.java",
1387 "android/java/src/org/chromium/base/PathUtils.java",
1388 "android/java/src/org/chromium/base/PowerMonitor.java",
1389 "android/java/src/org/chromium/base/SysUtils.java",
1390 "android/java/src/org/chromium/base/SystemMessageHandler.java",
1391 "android/java/src/org/chromium/base/ThreadUtils.java",
1392 "android/java/src/org/chromium/base/TraceEvent.java",
1393 "android/java/src/org/chromium/base/library_loader/LibraryLoader.java",
1394 "android/java/src/org/chromium/base/metrics/RecordHistogram.java",
1396 jni_package = "base"
1399 # GYP: //base.gyp:base_java
1400 android_library("base_java") {
1402 ":base_android_java_enums_srcjar",
1403 ":base_native_libraries_gen",
1407 "//third_party/jsr-305:jsr_305_javalib",
1410 DEPRECATED_java_in_dir = "android/java/src"
1412 # A new version of NativeLibraries.java (with the actual correct values)
1413 # will be created when creating an apk.
1414 jar_excluded_patterns = [
1415 "*/NativeLibraries.class",
1416 "*/NativeLibraries##*.class",
1420 # GYP: //base.gyp:base_javatests
1421 android_library("base_javatests") {
1424 ":base_java_test_support",
1426 DEPRECATED_java_in_dir = "android/javatests/src"
1429 # GYP: //base.gyp:base_java_test_support
1430 android_library("base_java_test_support") {
1434 DEPRECATED_java_in_dir = "test/android/javatests/src"
1437 # GYP: //base.gyp:base_java_application_state
1438 # GYP: //base.gyp:base_java_library_load_from_apk_status_codes
1439 # GYP: //base.gyp:base_java_library_process_type
1440 # GYP: //base.gyp:base_java_memory_pressure_level
1441 java_cpp_enum("base_android_java_enums_srcjar") {
1443 "android/application_status_listener.h",
1444 "android/library_loader/library_load_from_apk_status_codes.h",
1445 "android/library_loader/library_loader_hooks.h",
1446 "memory/memory_pressure_listener.h",
1449 "org/chromium/base/ApplicationState.java",
1450 "org/chromium/base/library_loader/LibraryLoadFromApkStatusCodes.java",
1451 "org/chromium/base/library_loader/LibraryProcessType.java",
1452 "org/chromium/base/MemoryPressureLevel.java",
1456 # GYP: //base/base.gyp:base_native_libraries_gen
1457 java_cpp_template("base_native_libraries_gen") {
1459 "android/java/templates/NativeLibraries.template",
1461 package_name = "org/chromium/base/library_loader"
1464 # GYP: //base.gyp:base_java_unittest_support
1465 android_library("base_java_unittest_support") {
1470 [ "test/android/java/src/org/chromium/base/ContentUriTestUtils.java" ]