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