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