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" ]
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") {
21 "/DELAYLOAD:cfgmgr32.dll",
22 "/DELAYLOAD:powrprof.dll",
23 "/DELAYLOAD:setupapi.dll",
28 source_set("base_paths") {
32 "base_paths_android.cc",
33 "base_paths_android.h",
36 "base_paths_posix.cc",
42 if (is_android || is_mac) {
43 sources -= [ "base_paths_posix.cc" ]
49 "base_paths_posix.cc",
53 configs += [ ":base_implementation" ]
60 visibility = [ ":base" ]
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/application_status_listener.cc",
72 "android/application_status_listener.h",
73 "android/base_jni_onload.cc",
74 "android/base_jni_onload.h",
75 "android/base_jni_registrar.cc",
76 "android/base_jni_registrar.h",
77 "android/build_info.cc",
78 "android/build_info.h",
79 "android/command_line_android.cc",
80 "android/command_line_android.h",
81 "android/content_uri_utils.cc",
82 "android/content_uri_utils.h",
83 "android/cpu_features.cc",
84 "android/event_log.cc",
85 "android/event_log.h",
86 "android/field_trial_list.cc",
87 "android/field_trial_list.h",
88 "android/fifo_utils.cc",
89 "android/fifo_utils.h",
90 "android/important_file_writer_android.cc",
91 "android/important_file_writer_android.h",
92 "android/java_handler_thread.cc",
93 "android/java_handler_thread.h",
94 "android/java_runtime.cc",
95 "android/java_runtime.h",
96 "android/jni_android.cc",
97 "android/jni_android.h",
98 "android/jni_array.cc",
99 "android/jni_array.h",
100 "android/jni_registrar.cc",
101 "android/jni_registrar.h",
102 "android/jni_string.cc",
103 "android/jni_string.h",
104 "android/jni_utils.cc",
105 "android/jni_utils.h",
106 "android/jni_weak_ref.cc",
107 "android/jni_weak_ref.h",
108 "android/library_loader/library_load_from_apk_status_codes.h",
109 "android/library_loader/library_loader_hooks.cc",
110 "android/library_loader/library_loader_hooks.h",
111 "android/locale_utils.cc",
112 "android/locale_utils.h",
113 "android/memory_pressure_listener_android.cc",
114 "android/memory_pressure_listener_android.h",
115 "android/path_service_android.cc",
116 "android/path_service_android.h",
117 "android/path_utils.cc",
118 "android/path_utils.h",
119 "android/record_histogram.cc",
120 "android/record_histogram.h",
121 "android/record_user_action.cc",
122 "android/record_user_action.h",
123 "android/scoped_java_ref.cc",
124 "android/scoped_java_ref.h",
125 "android/sys_utils.cc",
126 "android/sys_utils.h",
127 "android/thread_utils.h",
128 "android/trace_event_binding.cc",
129 "android/trace_event_binding.h",
130 "async_socket_io_handler.h",
131 "async_socket_io_handler_posix.cc",
132 "async_socket_io_handler_win.cc",
135 "atomic_ref_count.h",
136 "atomic_sequence_num.h",
138 "atomicops_internals_gcc.h",
139 "atomicops_internals_mac.h",
140 "atomicops_internals_portable.h",
141 "atomicops_internals_x86_gcc.cc",
142 "atomicops_internals_x86_gcc.h",
143 "atomicops_internals_x86_msvc.h",
145 "barrier_closure.cc",
158 "bind_internal_win.h",
163 "callback_helpers.cc",
164 "callback_helpers.h",
165 "callback_internal.cc",
166 "callback_internal.h",
167 "cancelable_callback.h",
168 "chromeos/memory_pressure_monitor_chromeos.cc",
169 "chromeos/memory_pressure_monitor_chromeos.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/small_map.h",
178 "containers/stack_container.h",
181 "critical_closure.h",
182 "critical_closure_internal_ios.mm",
183 "deferred_sequenced_task_runner.cc",
184 "deferred_sequenced_task_runner.h",
187 "file_descriptor_posix.h",
188 "file_version_info.h",
189 "file_version_info_mac.h",
190 "file_version_info_mac.mm",
191 "file_version_info_win.cc",
192 "file_version_info_win.h",
193 "files/dir_reader_fallback.h",
194 "files/dir_reader_linux.h",
195 "files/dir_reader_posix.h",
197 "files/file_enumerator.cc",
198 "files/file_enumerator.h",
199 "files/file_enumerator_posix.cc",
200 "files/file_enumerator_win.cc",
201 "files/file_path.cc",
203 "files/file_path_constants.cc",
204 "files/file_path_watcher.cc",
205 "files/file_path_watcher.h",
206 "files/file_path_watcher_fsevents.cc",
207 "files/file_path_watcher_fsevents.h",
208 "files/file_path_watcher_kqueue.cc",
209 "files/file_path_watcher_kqueue.h",
210 "files/file_path_watcher_linux.cc",
211 "files/file_path_watcher_mac.cc",
212 "files/file_path_watcher_win.cc",
213 "files/file_posix.cc",
214 "files/file_proxy.cc",
215 "files/file_proxy.h",
216 "files/file_util.cc",
218 "files/file_util_android.cc",
219 "files/file_util_linux.cc",
220 "files/file_util_mac.mm",
221 "files/file_util_posix.cc",
222 "files/file_util_proxy.cc",
223 "files/file_util_proxy.h",
224 "files/file_util_win.cc",
226 "files/important_file_writer.cc",
227 "files/important_file_writer.h",
228 "files/memory_mapped_file.cc",
229 "files/memory_mapped_file.h",
230 "files/memory_mapped_file_posix.cc",
231 "files/memory_mapped_file_win.cc",
232 "files/scoped_file.cc",
233 "files/scoped_file.h",
234 "files/scoped_temp_dir.cc",
235 "files/scoped_temp_dir.h",
247 "ios/device_util.mm",
250 "ios/scoped_critical_action.h",
251 "ios/scoped_critical_action.mm",
252 "ios/weak_nsobject.h",
253 "ios/weak_nsobject.mm",
264 "mac/authorization_util.h",
265 "mac/authorization_util.mm",
266 "mac/bind_objc_block.h",
267 "mac/bundle_locations.h",
268 "mac/bundle_locations.mm",
269 "mac/cocoa_protocols.h",
270 "mac/foundation_util.h",
271 "mac/foundation_util.mm",
272 "mac/launch_services_util.cc",
273 "mac/launch_services_util.h",
276 "mac/libdispatch_task_runner.cc",
277 "mac/libdispatch_task_runner.h",
278 "mac/mac_logging.cc",
282 "mac/mach_logging.cc",
283 "mac/mach_logging.h",
284 "mac/objc_property_releaser.h",
285 "mac/objc_property_releaser.mm",
286 "mac/os_crash_dumps.cc",
287 "mac/os_crash_dumps.h",
288 "mac/scoped_aedesc.h",
289 "mac/scoped_authorizationref.h",
290 "mac/scoped_block.h",
291 "mac/scoped_cftyperef.h",
292 "mac/scoped_ioobject.h",
293 "mac/scoped_ioplugininterface.h",
294 "mac/scoped_launch_data.h",
295 "mac/scoped_mach_port.cc",
296 "mac/scoped_mach_port.h",
297 "mac/scoped_mach_vm.cc",
298 "mac/scoped_mach_vm.h",
299 "mac/scoped_nsautorelease_pool.h",
300 "mac/scoped_nsautorelease_pool.mm",
301 "mac/scoped_nsexception_enabler.h",
302 "mac/scoped_nsexception_enabler.mm",
303 "mac/scoped_nsobject.h",
304 "mac/scoped_objc_class_swizzler.h",
305 "mac/scoped_objc_class_swizzler.mm",
306 "mac/scoped_sending_event.h",
307 "mac/scoped_sending_event.mm",
308 "mac/sdk_forward_declarations.h",
309 "mac/sdk_forward_declarations.mm",
313 "message_loop/incoming_task_queue.cc",
314 "message_loop/incoming_task_queue.h",
315 "message_loop/message_loop.cc",
316 "message_loop/message_loop.h",
317 "message_loop/message_loop_proxy.cc",
318 "message_loop/message_loop_proxy.h",
319 "message_loop/message_loop_proxy_impl.cc",
320 "message_loop/message_loop_proxy_impl.h",
321 "message_loop/message_pump.cc",
322 "message_loop/message_pump.h",
323 "message_loop/message_pump_android.cc",
324 "message_loop/message_pump_android.h",
325 "message_loop/message_pump_default.cc",
326 "message_loop/message_pump_default.h",
327 "message_loop/message_pump_glib.cc",
328 "message_loop/message_pump_glib.h",
329 "message_loop/message_pump_io_ios.cc",
330 "message_loop/message_pump_io_ios.h",
331 "message_loop/message_pump_libevent.cc",
332 "message_loop/message_pump_libevent.h",
333 "message_loop/message_pump_mac.h",
334 "message_loop/message_pump_mac.mm",
335 "message_loop/message_pump_win.cc",
336 "message_loop/message_pump_win.h",
339 "native_library_ios.mm",
340 "native_library_mac.mm",
341 "native_library_posix.cc",
342 "native_library_win.cc",
343 "nix/mime_util_xdg.cc",
344 "nix/mime_util_xdg.h",
347 "numerics/safe_conversions.h",
348 "numerics/safe_conversions_impl.h",
349 "numerics/safe_math.h",
350 "numerics/safe_math_impl.h",
352 "observer_list_threadsafe.h",
353 "os_compat_android.cc",
354 "os_compat_android.h",
364 "posix/eintr_wrapper.h",
365 "posix/file_descriptor_shuffle.cc",
366 "posix/global_descriptors.cc",
367 "posix/global_descriptors.h",
368 "posix/unix_domain_socket_linux.cc",
369 "posix/unix_domain_socket_linux.h",
370 "power_monitor/power_monitor.cc",
371 "power_monitor/power_monitor.h",
372 "power_monitor/power_monitor_device_source.cc",
373 "power_monitor/power_monitor_device_source.h",
374 "power_monitor/power_monitor_device_source_android.cc",
375 "power_monitor/power_monitor_device_source_android.h",
376 "power_monitor/power_monitor_device_source_chromeos.cc",
377 "power_monitor/power_monitor_device_source_ios.mm",
378 "power_monitor/power_monitor_device_source_mac.mm",
379 "power_monitor/power_monitor_device_source_posix.cc",
380 "power_monitor/power_monitor_device_source_win.cc",
381 "power_monitor/power_monitor_source.cc",
382 "power_monitor/power_monitor_source.h",
383 "power_monitor/power_observer.h",
384 "profiler/alternate_timer.cc",
385 "profiler/alternate_timer.h",
386 "profiler/native_stack_sampler.cc",
387 "profiler/native_stack_sampler.h",
388 "profiler/scoped_profile.cc",
389 "profiler/scoped_profile.h",
390 "profiler/scoped_tracker.cc",
391 "profiler/scoped_tracker.h",
392 "profiler/stack_sampling_profiler.cc",
393 "profiler/stack_sampling_profiler.h",
394 "profiler/stack_sampling_profiler_posix.cc",
395 "profiler/stack_sampling_profiler_win.cc",
396 "profiler/tracked_time.cc",
397 "profiler/tracked_time.h",
401 "rand_util_posix.cc",
405 "safe_strerror_posix.cc",
406 "safe_strerror_posix.h",
408 "scoped_native_library.cc",
409 "scoped_native_library.h",
411 "sequence_checker.h",
412 "sequence_checker_impl.cc",
413 "sequence_checker_impl.h",
414 "sequenced_task_runner.cc",
415 "sequenced_task_runner.h",
416 "sequenced_task_runner_helpers.h",
420 "single_thread_task_runner.h",
422 "strings/latin1_string_conversions.cc",
423 "strings/latin1_string_conversions.h",
424 "strings/nullable_string16.cc",
425 "strings/nullable_string16.h",
426 "strings/safe_sprintf.cc",
427 "strings/safe_sprintf.h",
428 "strings/string16.cc",
429 "strings/string16.h",
430 "strings/string_number_conversions.cc",
431 "strings/string_number_conversions.h",
432 "strings/string_piece.cc",
433 "strings/string_piece.h",
434 "strings/string_split.cc",
435 "strings/string_split.h",
436 "strings/string_tokenizer.h",
437 "strings/string_util.cc",
438 "strings/string_util.h",
439 "strings/string_util_constants.cc",
440 "strings/string_util_posix.h",
441 "strings/string_util_win.h",
442 "strings/stringize_macros.h",
443 "strings/stringprintf.cc",
444 "strings/stringprintf.h",
445 "strings/sys_string_conversions.h",
446 "strings/sys_string_conversions_mac.mm",
447 "strings/sys_string_conversions_posix.cc",
448 "strings/sys_string_conversions_win.cc",
449 "strings/utf_offset_string_conversions.cc",
450 "strings/utf_offset_string_conversions.h",
451 "strings/utf_string_conversion_utils.cc",
452 "strings/utf_string_conversion_utils.h",
453 "strings/utf_string_conversions.cc",
454 "strings/utf_string_conversions.h",
455 "supports_user_data.cc",
456 "supports_user_data.h",
458 "sync_socket_posix.cc",
459 "sync_socket_win.cc",
460 "synchronization/cancellation_flag.cc",
461 "synchronization/cancellation_flag.h",
462 "synchronization/condition_variable.h",
463 "synchronization/condition_variable_posix.cc",
464 "synchronization/condition_variable_win.cc",
465 "synchronization/lock.cc",
466 "synchronization/lock.h",
467 "synchronization/lock_impl.h",
468 "synchronization/lock_impl_posix.cc",
469 "synchronization/lock_impl_win.cc",
470 "synchronization/spin_wait.h",
471 "synchronization/waitable_event.h",
472 "synchronization/waitable_event_posix.cc",
473 "synchronization/waitable_event_watcher.h",
474 "synchronization/waitable_event_watcher_posix.cc",
475 "synchronization/waitable_event_watcher_win.cc",
476 "synchronization/waitable_event_win.cc",
480 "sys_info_android.cc",
481 "sys_info_chromeos.cc",
482 "sys_info_freebsd.cc",
486 "sys_info_openbsd.cc",
489 "system_monitor/system_monitor.cc",
490 "system_monitor/system_monitor.h",
491 "task/cancelable_task_tracker.cc",
492 "task/cancelable_task_tracker.h",
495 "task_runner_util.h",
497 "third_party/dmg_fp/dmg_fp.h",
498 "third_party/dmg_fp/dtoa_wrapper.cc",
499 "third_party/dmg_fp/g_fmt.cc",
500 "third_party/icu/icu_utf.cc",
501 "third_party/icu/icu_utf.h",
502 "third_party/nspr/prtime.cc",
503 "third_party/nspr/prtime.h",
504 "third_party/superfasthash/superfasthash.c",
505 "thread_task_runner_handle.cc",
506 "thread_task_runner_handle.h",
507 "threading/non_thread_safe.h",
508 "threading/non_thread_safe_impl.cc",
509 "threading/non_thread_safe_impl.h",
510 "threading/platform_thread.h",
511 "threading/platform_thread_android.cc",
512 "threading/platform_thread_internal_posix.cc",
513 "threading/platform_thread_internal_posix.h",
514 "threading/platform_thread_linux.cc",
515 "threading/platform_thread_mac.mm",
516 "threading/platform_thread_posix.cc",
517 "threading/platform_thread_win.cc",
518 "threading/post_task_and_reply_impl.cc",
519 "threading/post_task_and_reply_impl.h",
520 "threading/sequenced_worker_pool.cc",
521 "threading/sequenced_worker_pool.h",
522 "threading/simple_thread.cc",
523 "threading/simple_thread.h",
524 "threading/thread.cc",
525 "threading/thread.h",
526 "threading/thread_checker.h",
527 "threading/thread_checker_impl.cc",
528 "threading/thread_checker_impl.h",
529 "threading/thread_collision_warner.cc",
530 "threading/thread_collision_warner.h",
531 "threading/thread_id_name_manager.cc",
532 "threading/thread_id_name_manager.h",
533 "threading/thread_local.h",
534 "threading/thread_local_android.cc",
535 "threading/thread_local_posix.cc",
536 "threading/thread_local_storage.cc",
537 "threading/thread_local_storage.h",
538 "threading/thread_local_storage_posix.cc",
539 "threading/thread_local_storage_win.cc",
540 "threading/thread_local_win.cc",
541 "threading/thread_restrictions.cc",
542 "threading/thread_restrictions.h",
543 "threading/watchdog.cc",
544 "threading/watchdog.h",
545 "threading/worker_pool.cc",
546 "threading/worker_pool.h",
547 "threading/worker_pool_posix.cc",
548 "threading/worker_pool_posix.h",
549 "threading/worker_pool_win.cc",
552 "time/default_clock.cc",
553 "time/default_clock.h",
554 "time/default_tick_clock.cc",
555 "time/default_tick_clock.h",
556 "time/tick_clock.cc",
561 "time/time_posix.cc",
563 "timer/elapsed_timer.cc",
564 "timer/elapsed_timer.h",
565 "timer/hi_res_timer_manager.h",
566 "timer/hi_res_timer_manager_posix.cc",
567 "timer/hi_res_timer_manager_win.cc",
568 "timer/mock_timer.cc",
569 "timer/mock_timer.h",
572 "tracked_objects.cc",
577 "value_conversions.cc",
578 "value_conversions.h",
585 "win/enum_variant.cc",
586 "win/enum_variant.h",
587 "win/event_trace_consumer.h",
588 "win/event_trace_controller.cc",
589 "win/event_trace_controller.h",
590 "win/event_trace_provider.cc",
591 "win/event_trace_provider.h",
594 "win/iat_patch_function.cc",
595 "win/iat_patch_function.h",
596 "win/iunknown_impl.cc",
597 "win/iunknown_impl.h",
598 "win/message_window.cc",
599 "win/message_window.h",
602 "win/object_watcher.cc",
603 "win/object_watcher.h",
606 "win/resource_util.cc",
607 "win/resource_util.h",
608 "win/scoped_bstr.cc",
610 "win/scoped_co_mem.h",
611 "win/scoped_com_initializer.h",
612 "win/scoped_comptr.h",
613 "win/scoped_gdi_object.h",
614 "win/scoped_handle.cc",
615 "win/scoped_handle.h",
617 "win/scoped_hglobal.h",
618 "win/scoped_process_information.cc",
619 "win/scoped_process_information.h",
620 "win/scoped_propvariant.h",
621 "win/scoped_select_object.h",
622 "win/scoped_variant.cc",
623 "win/scoped_variant.h",
626 "win/startup_information.cc",
627 "win/startup_information.h",
630 "win/windows_version.cc",
631 "win/windows_version.h",
632 "win/wrapped_window_proc.cc",
633 "win/wrapped_window_proc.h",
637 "sys_info_freebsd.cc",
638 "sys_info_openbsd.cc",
641 configs += [ ":base_implementation" ]
645 "//base/allocator:allocator_extension_thunks",
646 "//base/third_party/dynamic_annotations",
647 "//third_party/modp_b64",
657 "//base/trace_event",
660 # Allow more direct string conversions on platforms with native utf8
662 if (is_mac || is_ios || is_chromeos) {
663 defines = [ "SYSTEM_NATIVE_UTF8" ]
667 sources -= [ "power_monitor/power_monitor_device_source_posix.cc" ]
669 # Android uses some Linux sources, put those back.
670 set_sources_assignment_filter([])
672 "files/file_path_watcher_linux.cc",
673 "posix/unix_domain_socket_linux.cc",
676 set_sources_assignment_filter(sources_assignment_filter)
680 "//third_party/ashmem",
681 "//third_party/android_tools:cpu_features",
684 # logging.cc uses the Android logging library.
689 sources -= [ "power_monitor/power_monitor_device_source_posix.cc" ]
693 # We reset sources_assignment_filter in order to explicitly include
694 # the linux file (which would otherwise be filtered out).
695 set_sources_assignment_filter([])
697 "files/file_path_watcher_stub.cc",
698 "sync_socket_nacl.cc",
699 "threading/platform_thread_linux.cc",
701 set_sources_assignment_filter(sources_assignment_filter)
704 "allocator/type_profiler_control.cc",
705 "allocator/type_profiler_control.h",
706 "async_socket_io_handler_posix.cc",
708 "files/file_enumerator_posix.cc",
709 "files/file_proxy.cc",
710 "files/file_util.cc",
711 "files/file_util_posix.cc",
712 "files/file_util_proxy.cc",
713 "files/important_file_writer.cc",
714 "files/important_file_writer.h",
715 "files/scoped_temp_dir.cc",
716 "message_loop/message_pump_libevent.cc",
717 "native_library_posix.cc",
719 "rand_util_posix.cc",
720 "scoped_native_library.cc",
721 "sync_socket_posix.cc",
737 "message_loop/message_pump_libevent.cc",
738 "strings/string16.cc",
740 # Not using sha1_win.cc because it may have caused a
741 # regression to page cycler moz.
745 # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
746 configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
754 all_dependent_configs = [ ":base_win_linker_flags" ]
755 } else if (!is_nacl) {
757 deps += [ "//third_party/libevent" ]
763 "native_library_posix.cc",
764 "strings/sys_string_conversions_posix.cc",
765 "threading/platform_thread_internal_posix.cc",
770 "files/file_path_watcher_fsevents.cc",
771 "files/file_path_watcher_fsevents.h",
772 "files/file_path_watcher_kqueue.cc",
773 "files/file_path_watcher_kqueue.h",
779 # TODO(brettw) this will need to be parameterized at some point.
782 linux_configs += [ "//build/config/linux:glib" ]
785 configs += linux_configs
786 all_dependent_configs = linux_configs
788 # These dependencies are not required on Android, and in the case
789 # of xdg_mime must be excluded due to licensing restrictions.
791 "//base/third_party/xdg_mime",
792 "//base/third_party/xdg_user_dirs",
797 "nix/mime_util_xdg.cc",
798 "nix/mime_util_xdg.h",
813 "message_loop/message_pump_glib.cc",
814 "message_loop/message_pump_glib.h",
818 configs += [ "//build/config/compiler:wexit_time_destructors" ]
819 if (is_android && !is_debug) {
820 configs -= [ "//build/config/compiler:optimize" ]
821 configs += [ "//build/config/compiler:optimize_max" ]
824 allow_circular_includes_from = public_deps
827 # This is the subset of files from base that should not be used with a dynamic
828 # library. Note that this library cannot depend on base because base depends on
830 source_set("base_static") {
838 if (is_android && !is_debug) {
839 configs -= [ "//build/config/compiler:optimize" ]
840 configs += [ "//build/config/compiler:optimize_max" ]
845 output_name = "base_i18n"
847 "i18n/base_i18n_export.h",
848 "i18n/bidi_line_iterator.cc",
849 "i18n/bidi_line_iterator.h",
850 "i18n/break_iterator.cc",
851 "i18n/break_iterator.h",
852 "i18n/case_conversion.cc",
853 "i18n/case_conversion.h",
854 "i18n/char_iterator.cc",
855 "i18n/char_iterator.h",
856 "i18n/file_util_icu.cc",
857 "i18n/file_util_icu.h",
858 "i18n/i18n_constants.cc",
859 "i18n/i18n_constants.h",
860 "i18n/icu_encoding_detection.cc",
861 "i18n/icu_encoding_detection.h",
862 "i18n/icu_string_conversions.cc",
863 "i18n/icu_string_conversions.h",
866 "i18n/number_formatting.cc",
867 "i18n/number_formatting.h",
870 "i18n/streaming_utf8_validator.cc",
871 "i18n/streaming_utf8_validator.h",
872 "i18n/string_compare.cc",
873 "i18n/string_compare.h",
874 "i18n/string_search.cc",
875 "i18n/string_search.h",
876 "i18n/time_formatting.cc",
877 "i18n/time_formatting.h",
880 "i18n/utf8_validator_tables.cc",
881 "i18n/utf8_validator_tables.h",
883 defines = [ "BASE_I18N_IMPLEMENTATION" ]
884 configs += [ "//build/config/compiler:wexit_time_destructors" ]
887 "//base/third_party/dynamic_annotations",
891 if (is_android && !is_debug) {
892 configs -= [ "//build/config/compiler:optimize" ]
893 configs += [ "//build/config/compiler:optimize_max" ]
896 # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
897 configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
900 if (is_win || (is_linux && !is_chromeos)) {
901 # TODO(GYP): Figure out which of these work and are needed on other platforms.
902 test("base_perftests") {
904 "message_loop/message_pump_perftest.cc",
906 # "test/run_all_unittests.cc",
907 "threading/thread_perftest.cc",
911 "//base/test:test_support",
912 "//base/test:test_support_perf",
918 deps += [ "//testing/android/native_test:native_test_native_code" ]
922 test("base_i18n_perftests") {
924 "i18n/streaming_utf8_validator_perftest.cc",
929 "//base/test:test_support",
930 "//base/test:test_support_perf",
936 executable("build_utf8_validator_tables") {
938 "i18n/build_utf8_validator_tables.cc",
942 "//third_party/icu:icuuc",
946 executable("check_example") {
959 "prefs/base_prefs_export.h",
960 "prefs/default_pref_store.cc",
961 "prefs/default_pref_store.h",
962 "prefs/json_pref_store.cc",
963 "prefs/json_pref_store.h",
964 "prefs/overlay_user_pref_store.cc",
965 "prefs/overlay_user_pref_store.h",
966 "prefs/persistent_pref_store.h",
967 "prefs/pref_change_registrar.cc",
968 "prefs/pref_change_registrar.h",
969 "prefs/pref_filter.h",
970 "prefs/pref_member.cc",
971 "prefs/pref_member.h",
972 "prefs/pref_notifier.h",
973 "prefs/pref_notifier_impl.cc",
974 "prefs/pref_notifier_impl.h",
975 "prefs/pref_observer.h",
976 "prefs/pref_registry.cc",
977 "prefs/pref_registry.h",
978 "prefs/pref_registry_simple.cc",
979 "prefs/pref_registry_simple.h",
980 "prefs/pref_service.cc",
981 "prefs/pref_service.h",
982 "prefs/pref_service_factory.cc",
983 "prefs/pref_service_factory.h",
984 "prefs/pref_store.cc",
985 "prefs/pref_store.h",
986 "prefs/pref_value_map.cc",
987 "prefs/pref_value_map.h",
988 "prefs/pref_value_store.cc",
989 "prefs/pref_value_store.h",
990 "prefs/scoped_user_pref_update.cc",
991 "prefs/scoped_user_pref_update.h",
992 "prefs/value_map_pref_store.cc",
993 "prefs/value_map_pref_store.h",
994 "prefs/writeable_pref_store.h",
997 defines = [ "BASE_PREFS_IMPLEMENTATION" ]
1003 if (is_android && !is_debug) {
1004 configs -= [ "//build/config/compiler:optimize" ]
1005 configs += [ "//build/config/compiler:optimize_max" ]
1009 source_set("prefs_test_support") {
1012 "prefs/mock_pref_change_callback.cc",
1013 "prefs/mock_pref_change_callback.h",
1014 "prefs/pref_store_observer_mock.cc",
1015 "prefs/pref_store_observer_mock.h",
1016 "prefs/testing_pref_service.cc",
1017 "prefs/testing_pref_service.h",
1018 "prefs/testing_pref_store.cc",
1019 "prefs/testing_pref_store.h",
1032 source_set("message_loop_tests") {
1035 "message_loop/message_loop_test.cc",
1036 "message_loop/message_loop_test.h",
1045 # TODO(pasko): Remove this target when crbug.com/424562 is fixed.
1046 source_set("protect_file_posix") {
1048 "files/protect_file_posix.cc",
1057 # Target to manually rebuild pe_image_test.dll which is checked into
1058 # base/test/data/pe_image.
1059 shared_library("pe_image_test") {
1061 "win/pe_image_test.cc",
1064 "/DELAYLOAD:cfgmgr32.dll",
1065 "/DELAYLOAD:shell32.dll",
1066 "/SUBSYSTEM:WINDOWS",
1075 test("base_unittests") {
1077 "android/application_status_listener_unittest.cc",
1078 "android/content_uri_utils_unittest.cc",
1079 "android/jni_android_unittest.cc",
1080 "android/jni_array_unittest.cc",
1081 "android/jni_string_unittest.cc",
1082 "android/path_utils_unittest.cc",
1083 "android/scoped_java_ref_unittest.cc",
1084 "android/sys_utils_unittest.cc",
1085 "async_socket_io_handler_unittest.cc",
1086 "at_exit_unittest.cc",
1087 "atomicops_unittest.cc",
1088 "barrier_closure_unittest.cc",
1089 "base64_unittest.cc",
1090 "big_endian_unittest.cc",
1094 "build_time_unittest.cc",
1095 "callback_helpers_unittest.cc",
1096 "callback_list_unittest.cc",
1097 "callback_list_unittest.nc",
1098 "callback_unittest.cc",
1099 "callback_unittest.nc",
1100 "cancelable_callback_unittest.cc",
1101 "chromeos/memory_pressure_monitor_chromeos_unittest.cc",
1102 "command_line_unittest.cc",
1103 "containers/adapters_unittest.cc",
1104 "containers/hash_tables_unittest.cc",
1105 "containers/linked_list_unittest.cc",
1106 "containers/mru_cache_unittest.cc",
1107 "containers/small_map_unittest.cc",
1108 "containers/stack_container_unittest.cc",
1110 "debug/crash_logging_unittest.cc",
1111 "debug/debugger_unittest.cc",
1112 "debug/leak_tracker_unittest.cc",
1113 "debug/proc_maps_linux_unittest.cc",
1114 "debug/stack_trace_unittest.cc",
1115 "debug/task_annotator_unittest.cc",
1116 "deferred_sequenced_task_runner_unittest.cc",
1117 "environment_unittest.cc",
1118 "file_version_info_unittest.cc",
1119 "files/dir_reader_posix_unittest.cc",
1120 "files/file_path_unittest.cc",
1121 "files/file_path_watcher_unittest.cc",
1122 "files/file_proxy_unittest.cc",
1123 "files/file_unittest.cc",
1124 "files/file_util_proxy_unittest.cc",
1125 "files/file_util_unittest.cc",
1126 "files/important_file_writer_unittest.cc",
1127 "files/scoped_temp_dir_unittest.cc",
1128 "gmock_unittest.cc",
1131 "i18n/break_iterator_unittest.cc",
1132 "i18n/case_conversion_unittest.cc",
1133 "i18n/char_iterator_unittest.cc",
1134 "i18n/file_util_icu_unittest.cc",
1135 "i18n/icu_string_conversions_unittest.cc",
1136 "i18n/number_formatting_unittest.cc",
1137 "i18n/rtl_unittest.cc",
1138 "i18n/streaming_utf8_validator_unittest.cc",
1139 "i18n/string_search_unittest.cc",
1140 "i18n/time_formatting_unittest.cc",
1141 "i18n/timezone_unittest.cc",
1142 "id_map_unittest.cc",
1143 "ios/device_util_unittest.mm",
1144 "ios/weak_nsobject_unittest.mm",
1145 "json/json_parser_unittest.cc",
1146 "json/json_reader_unittest.cc",
1147 "json/json_value_converter_unittest.cc",
1148 "json/json_value_serializer_unittest.cc",
1149 "json/json_writer_unittest.cc",
1150 "json/string_escape_unittest.cc",
1151 "lazy_instance_unittest.cc",
1152 "logging_unittest.cc",
1153 "mac/bind_objc_block_unittest.mm",
1154 "mac/foundation_util_unittest.mm",
1155 "mac/libdispatch_task_runner_unittest.cc",
1156 "mac/mac_util_unittest.mm",
1157 "mac/objc_property_releaser_unittest.mm",
1158 "mac/scoped_nsobject_unittest.mm",
1159 "mac/scoped_objc_class_swizzler_unittest.mm",
1160 "mac/scoped_sending_event_unittest.mm",
1162 "memory/aligned_memory_unittest.cc",
1163 "memory/discardable_shared_memory_unittest.cc",
1164 "memory/linked_ptr_unittest.cc",
1165 "memory/ref_counted_memory_unittest.cc",
1166 "memory/ref_counted_unittest.cc",
1167 "memory/scoped_ptr_unittest.cc",
1168 "memory/scoped_ptr_unittest.nc",
1169 "memory/scoped_vector_unittest.cc",
1170 "memory/shared_memory_unittest.cc",
1171 "memory/singleton_unittest.cc",
1172 "memory/weak_ptr_unittest.cc",
1173 "memory/weak_ptr_unittest.nc",
1174 "message_loop/message_loop_proxy_impl_unittest.cc",
1175 "message_loop/message_loop_proxy_unittest.cc",
1176 "message_loop/message_loop_unittest.cc",
1177 "message_loop/message_pump_glib_unittest.cc",
1178 "message_loop/message_pump_io_ios_unittest.cc",
1179 "metrics/bucket_ranges_unittest.cc",
1180 "metrics/field_trial_unittest.cc",
1181 "metrics/histogram_base_unittest.cc",
1182 "metrics/histogram_delta_serialization_unittest.cc",
1183 "metrics/histogram_snapshot_manager_unittest.cc",
1184 "metrics/histogram_unittest.cc",
1185 "metrics/sample_map_unittest.cc",
1186 "metrics/sample_vector_unittest.cc",
1187 "metrics/sparse_histogram_unittest.cc",
1188 "metrics/statistics_recorder_unittest.cc",
1190 "numerics/safe_numerics_unittest.cc",
1191 "observer_list_unittest.cc",
1192 "os_compat_android_unittest.cc",
1193 "path_service_unittest.cc",
1194 "pickle_unittest.cc",
1195 "posix/file_descriptor_shuffle_unittest.cc",
1196 "posix/unix_domain_socket_linux_unittest.cc",
1197 "power_monitor/power_monitor_unittest.cc",
1198 "prefs/default_pref_store_unittest.cc",
1199 "prefs/json_pref_store_unittest.cc",
1200 "prefs/overlay_user_pref_store_unittest.cc",
1201 "prefs/pref_change_registrar_unittest.cc",
1202 "prefs/pref_member_unittest.cc",
1203 "prefs/pref_notifier_impl_unittest.cc",
1204 "prefs/pref_service_unittest.cc",
1205 "prefs/pref_value_map_unittest.cc",
1206 "prefs/pref_value_store_unittest.cc",
1207 "prefs/scoped_user_pref_update_unittest.cc",
1208 "process/memory_unittest.cc",
1209 "process/memory_unittest_mac.h",
1210 "process/memory_unittest_mac.mm",
1211 "process/process_metrics_unittest.cc",
1212 "process/process_metrics_unittest_ios.cc",
1213 "process/process_unittest.cc",
1214 "process/process_util_unittest.cc",
1215 "process/process_util_unittest_ios.cc",
1216 "profiler/stack_sampling_profiler_unittest.cc",
1217 "profiler/tracked_time_unittest.cc",
1218 "rand_util_unittest.cc",
1219 "scoped_clear_errno_unittest.cc",
1220 "scoped_generic_unittest.cc",
1221 "scoped_native_library_unittest.cc",
1222 "security_unittest.cc",
1223 "sequence_checker_unittest.cc",
1225 "stl_util_unittest.cc",
1226 "strings/nullable_string16_unittest.cc",
1227 "strings/safe_sprintf_unittest.cc",
1228 "strings/string16_unittest.cc",
1229 "strings/string_number_conversions_unittest.cc",
1230 "strings/string_piece_unittest.cc",
1231 "strings/string_split_unittest.cc",
1232 "strings/string_tokenizer_unittest.cc",
1233 "strings/string_util_unittest.cc",
1234 "strings/stringize_macros_unittest.cc",
1235 "strings/stringprintf_unittest.cc",
1236 "strings/sys_string_conversions_mac_unittest.mm",
1237 "strings/sys_string_conversions_unittest.cc",
1238 "strings/utf_offset_string_conversions_unittest.cc",
1239 "strings/utf_string_conversions_unittest.cc",
1240 "supports_user_data_unittest.cc",
1241 "sync_socket_unittest.cc",
1242 "synchronization/cancellation_flag_unittest.cc",
1243 "synchronization/condition_variable_unittest.cc",
1244 "synchronization/lock_unittest.cc",
1245 "synchronization/waitable_event_unittest.cc",
1246 "synchronization/waitable_event_watcher_unittest.cc",
1247 "sys_info_unittest.cc",
1248 "system_monitor/system_monitor_unittest.cc",
1249 "task/cancelable_task_tracker_unittest.cc",
1250 "task_runner_util_unittest.cc",
1251 "template_util_unittest.cc",
1252 "test/expectations/expectation_unittest.cc",
1253 "test/expectations/parser_unittest.cc",
1254 "test/histogram_tester_unittest.cc",
1255 "test/test_reg_util_win_unittest.cc",
1256 "test/trace_event_analyzer_unittest.cc",
1257 "test/user_action_tester_unittest.cc",
1258 "threading/non_thread_safe_unittest.cc",
1259 "threading/platform_thread_unittest.cc",
1260 "threading/sequenced_worker_pool_unittest.cc",
1261 "threading/simple_thread_unittest.cc",
1262 "threading/thread_checker_unittest.cc",
1263 "threading/thread_collision_warner_unittest.cc",
1264 "threading/thread_id_name_manager_unittest.cc",
1265 "threading/thread_local_storage_unittest.cc",
1266 "threading/thread_local_unittest.cc",
1267 "threading/thread_unittest.cc",
1268 "threading/watchdog_unittest.cc",
1269 "threading/worker_pool_posix_unittest.cc",
1270 "threading/worker_pool_unittest.cc",
1271 "time/pr_time_unittest.cc",
1272 "time/time_unittest.cc",
1273 "time/time_win_unittest.cc",
1274 "timer/hi_res_timer_manager_unittest.cc",
1275 "timer/mock_timer_unittest.cc",
1276 "timer/timer_unittest.cc",
1277 "tools_sanity_unittest.cc",
1278 "tracked_objects_unittest.cc",
1279 "tuple_unittest.cc",
1280 "values_unittest.cc",
1281 "version_unittest.cc",
1284 "win/enum_variant_unittest.cc",
1285 "win/event_trace_consumer_unittest.cc",
1286 "win/event_trace_controller_unittest.cc",
1287 "win/event_trace_provider_unittest.cc",
1288 "win/i18n_unittest.cc",
1289 "win/iunknown_impl_unittest.cc",
1290 "win/message_window_unittest.cc",
1291 "win/object_watcher_unittest.cc",
1292 "win/pe_image_unittest.cc",
1293 "win/registry_unittest.cc",
1294 "win/scoped_bstr_unittest.cc",
1295 "win/scoped_comptr_unittest.cc",
1296 "win/scoped_process_information_unittest.cc",
1297 "win/scoped_variant_unittest.cc",
1298 "win/shortcut_unittest.cc",
1299 "win/startup_information_unittest.cc",
1300 "win/win_util_unittest.cc",
1301 "win/wrapped_window_proc_unittest.cc",
1307 ":message_loop_tests",
1309 ":prefs_test_support",
1311 "//base/test:run_all_unittests",
1312 "//base/test:test_support",
1313 "//base/third_party/dynamic_annotations",
1314 "//base/trace_event:trace_event_unittests",
1317 "//third_party/icu",
1320 # Allow more direct string conversions on platforms with native utf8
1322 if (is_mac || is_ios || is_chromeos) {
1323 defines = [ "SYSTEM_NATIVE_UTF8" ]
1329 ":base_java_unittest_support",
1335 "process/memory_unittest.cc",
1336 "process/memory_unittest_mac.h",
1337 "process/memory_unittest_mac.mm",
1338 "process/process_unittest.cc",
1339 "process/process_util_unittest.cc",
1342 # Pull in specific Mac files for iOS (which have been filtered out by file
1344 set_sources_assignment_filter([])
1346 "mac/bind_objc_block_unittest.mm",
1347 "mac/foundation_util_unittest.mm",
1348 "mac/objc_property_releaser_unittest.mm",
1349 "mac/scoped_nsobject_unittest.mm",
1350 "sys_string_conversions_mac_unittest.mm",
1352 set_sources_assignment_filter(sources_assignment_filter)
1354 # TODO(GYP): dep on copy_test_data_ios action.
1358 sources -= [ "file_version_info_unittest.cc" ]
1359 sources += [ "nix/xdg_util_unittest.cc" ]
1360 deps += [ "//base/test:malloc_wrapper" ]
1363 configs += [ "//build/config/linux:glib" ]
1367 if (!is_linux || use_ozone) {
1368 sources -= [ "message_loop/message_pump_glib_unittest.cc" ]
1371 if (is_posix || is_ios) {
1372 sources += [ "message_loop/message_pump_libevent_unittest.cc" ]
1373 deps += [ "//third_party/libevent" ]
1377 deps += [ "//testing/android/native_test:native_test_native_code" ]
1378 set_sources_assignment_filter([])
1379 sources += [ "debug/proc_maps_linux_unittest.cc" ]
1380 set_sources_assignment_filter(sources_assignment_filter)
1383 # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
1384 configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
1388 # GYP: //base.gyp:base_jni_headers
1389 generate_jni("base_jni_headers") {
1391 "android/java/src/org/chromium/base/AnimationFrameTimeHistogram.java",
1392 "android/java/src/org/chromium/base/ApplicationStatus.java",
1393 "android/java/src/org/chromium/base/BuildInfo.java",
1394 "android/java/src/org/chromium/base/CommandLine.java",
1395 "android/java/src/org/chromium/base/ContentUriUtils.java",
1396 "android/java/src/org/chromium/base/CpuFeatures.java",
1397 "android/java/src/org/chromium/base/EventLog.java",
1398 "android/java/src/org/chromium/base/FieldTrialList.java",
1399 "android/java/src/org/chromium/base/ImportantFileWriterAndroid.java",
1400 "android/java/src/org/chromium/base/JNIUtils.java",
1401 "android/java/src/org/chromium/base/JavaHandlerThread.java",
1402 "android/java/src/org/chromium/base/LocaleUtils.java",
1403 "android/java/src/org/chromium/base/MemoryPressureListener.java",
1404 "android/java/src/org/chromium/base/PathService.java",
1405 "android/java/src/org/chromium/base/PathUtils.java",
1406 "android/java/src/org/chromium/base/PowerMonitor.java",
1407 "android/java/src/org/chromium/base/SysUtils.java",
1408 "android/java/src/org/chromium/base/SystemMessageHandler.java",
1409 "android/java/src/org/chromium/base/ThreadUtils.java",
1410 "android/java/src/org/chromium/base/TraceEvent.java",
1411 "android/java/src/org/chromium/base/library_loader/LibraryLoader.java",
1412 "android/java/src/org/chromium/base/metrics/RecordHistogram.java",
1413 "android/java/src/org/chromium/base/metrics/RecordUserAction.java",
1417 ":android_runtime_jni_headers",
1420 jni_package = "base"
1423 # GYP: //base.gyp:android_runtime_jni_headers
1424 generate_jar_jni("android_runtime_jni_headers") {
1425 jni_package = "base"
1426 classes = [ "java/lang/Runtime.class" ]
1429 # GYP: //base.gyp:base_java
1430 android_library("base_java") {
1432 ":base_android_java_enums_srcjar",
1433 ":base_native_libraries_gen",
1437 "//third_party/jsr-305:jsr_305_javalib",
1440 DEPRECATED_java_in_dir = "android/java/src"
1442 # A new version of NativeLibraries.java (with the actual correct values)
1443 # will be created when creating an apk.
1444 jar_excluded_patterns = [
1445 "*/NativeLibraries.class",
1446 "*/NativeLibraries##*.class",
1450 # GYP: //base.gyp:base_javatests
1451 android_library("base_javatests") {
1454 ":base_java_test_support",
1456 DEPRECATED_java_in_dir = "android/javatests/src"
1459 # GYP: //base.gyp:base_java_test_support
1460 android_library("base_java_test_support") {
1464 DEPRECATED_java_in_dir = "test/android/javatests/src"
1467 # GYP: //base.gyp:base_java_application_state
1468 # GYP: //base.gyp:base_java_library_load_from_apk_status_codes
1469 # GYP: //base.gyp:base_java_library_process_type
1470 # GYP: //base.gyp:base_java_memory_pressure_level
1471 java_cpp_enum("base_android_java_enums_srcjar") {
1473 "android/application_status_listener.h",
1474 "android/library_loader/library_load_from_apk_status_codes.h",
1475 "android/library_loader/library_loader_hooks.h",
1476 "memory/memory_pressure_listener.h",
1479 "org/chromium/base/ApplicationState.java",
1480 "org/chromium/base/library_loader/LibraryLoadFromApkStatusCodes.java",
1481 "org/chromium/base/library_loader/LibraryProcessType.java",
1482 "org/chromium/base/MemoryPressureLevel.java",
1486 # GYP: //base/base.gyp:base_native_libraries_gen
1487 java_cpp_template("base_native_libraries_gen") {
1489 "android/java/templates/NativeLibraries.template",
1491 package_name = "org/chromium/base/library_loader"
1494 # GYP: //base.gyp:base_java_unittest_support
1495 android_library("base_java_unittest_support") {
1500 [ "test/android/java/src/org/chromium/base/ContentUriTestUtils.java" ]