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