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