diff options
author | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2018-01-29 16:35:13 +0100 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2018-02-01 15:33:35 +0000 |
commit | c8c2d1901aec01e934adf561a9fdf0cc776cdef8 (patch) | |
tree | 9157c3d9815e5870799e070b113813bec53e0535 /chromium/base/BUILD.gn | |
parent | abefd5095b41dac94ca451d784ab6e27372e981a (diff) | |
download | qtwebengine-chromium-c8c2d1901aec01e934adf561a9fdf0cc776cdef8.tar.gz |
BASELINE: Update Chromium to 64.0.3282.139
Change-Id: I1cae68fe9c94ff7608b26b8382fc19862cdb293a
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Diffstat (limited to 'chromium/base/BUILD.gn')
-rw-r--r-- | chromium/base/BUILD.gn | 188 |
1 files changed, 142 insertions, 46 deletions
diff --git a/chromium/base/BUILD.gn b/chromium/base/BUILD.gn index 6ecbad17b20..28ebd2cd454 100644 --- a/chromium/base/BUILD.gn +++ b/chromium/base/BUILD.gn @@ -24,6 +24,7 @@ import("//build/config/chromecast_build.gni") import("//build/config/clang/clang.gni") import("//build/config/compiler/compiler.gni") import("//build/config/dcheck_always_on.gni") +import("//build/config/jumbo.gni") import("//build/config/nacl/config.gni") import("//build/config/sysroot.gni") import("//build/config/ui.gni") @@ -44,6 +45,14 @@ declare_args() { # (file, function, line). False means only the program counter (and currently # file name) is saved. enable_location_source = true + + # Unsafe developer build. Has developer-friendly features that may weaken or + # disable security measures like sandboxing or ASLR. + # IMPORTANT: Unsafe developer builds should never be distributed to end users. + is_unsafe_developer_build = !is_official_build + + # Set to true to disable COM init check hooks. + com_init_check_hook_disabled = false } if (is_android) { @@ -105,7 +114,7 @@ if (is_android) { # to be linked in where they wouldn't have otherwise. This does not include # test code (test support and anything in the test directory) which should use # source_set as is recommended for GN targets). -component("base") { +jumbo_component("base") { if (is_nacl_nonsfi) { # TODO(phosek) bug 570839: If field_trial.cc is in a static library, # nacl_helper_nonsfi doesn't link properly on Linux in debug builds. The @@ -114,6 +123,12 @@ component("base") { # non-component case. static_component_type = "source_set" } + if (is_nacl || is_ios) { + # Link errors related to malloc functions if libbase for nacl is + # compiled with jumbo: https://crbug.com/775959. + # Same for ios: https://crbug.com/776313. + never_build_jumbo = true + } sources = [ "allocator/allocator_check.cc", @@ -125,6 +140,9 @@ component("base") { "allocator/allocator_shim.h", "allocator/malloc_zone_functions_mac.cc", "allocator/malloc_zone_functions_mac.h", + "android/android_hardware_buffer_abi.h", + "android/android_hardware_buffer_compat.cc", + "android/android_hardware_buffer_compat.h", "android/animation_frame_time_histogram.cc", "android/apk_assets.cc", "android/apk_assets.h", @@ -151,7 +169,6 @@ component("base") { "android/java_exception_reporter.h", "android/java_handler_thread.cc", "android/java_handler_thread.h", - "android/java_message_handler_factory.h", "android/java_runtime.cc", "android/java_runtime.h", "android/jni_android.cc", @@ -168,6 +185,8 @@ component("base") { "android/jni_utils.h", "android/jni_weak_ref.cc", "android/jni_weak_ref.h", + "android/library_loader/anchor_functions.cc", + "android/library_loader/anchor_functions.h", "android/library_loader/library_load_from_apk_status_codes.h", "android/library_loader/library_loader_hooks.cc", "android/library_loader/library_loader_hooks.h", @@ -294,6 +313,7 @@ component("base") { "environment.cc", "environment.h", "event_types.h", + "export_template.h", "feature_list.cc", "feature_list.h", "file_descriptor_posix.h", @@ -360,6 +380,8 @@ component("base") { "hash.cc", "hash.h", "ios/block_types.h", + "ios/callback_counter.h", + "ios/callback_counter.mm", "ios/crb_protocol_observers.h", "ios/crb_protocol_observers.mm", "ios/device_util.h", @@ -424,8 +446,6 @@ component("base") { "mac/mach_port_broker.mm", "mac/mach_port_util.cc", "mac/mach_port_util.h", - "mac/objc_property_releaser.h", - "mac/objc_property_releaser.mm", "mac/objc_release_properties.h", "mac/objc_release_properties.mm", "mac/os_crash_dumps.cc", @@ -467,7 +487,6 @@ component("base") { "memory/discardable_shared_memory.h", "memory/free_deleter.h", "memory/linked_ptr.h", - "memory/manual_constructor.h", "memory/memory_coordinator_client.cc", "memory/memory_coordinator_client.h", "memory/memory_coordinator_client_registry.cc", @@ -484,6 +503,9 @@ component("base") { "memory/memory_pressure_monitor_mac.h", "memory/memory_pressure_monitor_win.cc", "memory/memory_pressure_monitor_win.h", + "memory/protected_memory.h", + "memory/protected_memory_cfi.h", + "memory/protected_memory_posix.cc", "memory/ptr_util.h", "memory/raw_scoped_refptr_mismatch_checker.h", "memory/ref_counted.cc", @@ -492,20 +514,14 @@ component("base") { "memory/ref_counted_memory.cc", "memory/ref_counted_memory.h", "memory/scoped_policy.h", + "memory/scoped_refptr.h", "memory/shared_memory.h", - "memory/shared_memory_android.cc", "memory/shared_memory_handle.cc", "memory/shared_memory_handle.h", - "memory/shared_memory_handle_mac.cc", - "memory/shared_memory_handle_win.cc", "memory/shared_memory_helper.cc", "memory/shared_memory_helper.h", - "memory/shared_memory_mac.cc", - "memory/shared_memory_nacl.cc", - "memory/shared_memory_posix.cc", "memory/shared_memory_tracker.cc", "memory/shared_memory_tracker.h", - "memory/shared_memory_win.cc", "memory/singleton.cc", "memory/singleton.h", "memory/weak_ptr.cc", @@ -590,6 +606,7 @@ component("base") { "nix/xdg_util.cc", "nix/xdg_util.h", "observer_list.h", + "observer_list_threadsafe.cc", "observer_list_threadsafe.h", "optional.h", "os_compat_android.cc", @@ -1046,8 +1063,8 @@ component("base") { "win/scoped_bstr.cc", "win/scoped_bstr.h", "win/scoped_co_mem.h", + "win/scoped_com_initializer.cc", "win/scoped_com_initializer.h", - "win/scoped_comptr.h", "win/scoped_gdi_object.h", "win/scoped_handle.cc", "win/scoped_handle.h", @@ -1061,6 +1078,9 @@ component("base") { "win/scoped_select_object.h", "win/scoped_variant.cc", "win/scoped_variant.h", + "win/scoped_windows_thread_environment.h", + "win/scoped_winrt_initializer.cc", + "win/scoped_winrt_initializer.h", "win/shortcut.cc", "win/shortcut.h", "win/startup_information.cc", @@ -1071,10 +1091,19 @@ component("base") { "win/win_util.h", "win/windows_version.cc", "win/windows_version.h", + "win/winrt_storage_util.cc", + "win/winrt_storage_util.h", "win/wrapped_window_proc.cc", "win/wrapped_window_proc.h", ] + # winternl.h and NTSecAPI.h have different definitions of UNICODE_STRING. + # There's only one client of NTSecAPI.h in base but several of winternl.h, + # so exclude the NTSecAPI.h one. + if (is_win) { + jumbo_excluded_sources = [ "rand_util_win.cc" ] + } + if (!is_nacl) { sources += [ "base_paths.cc", @@ -1094,10 +1123,6 @@ component("base") { } } - if (!is_mac && is_posix) { - sources += [ "memory/shared_memory_handle_posix.cc" ] - } - all_dependent_configs = [] defines = [] data = [] @@ -1106,6 +1131,7 @@ component("base") { ":base_flags", ":base_implementation", "//build/config:precompiled_headers", + "//build/config/compiler:noshadowing", ] deps = [ @@ -1118,6 +1144,7 @@ component("base") { public_deps = [ ":base_static", ":build_date", + ":cfi_flags", ":debugging_flags", "//base/numerics:base_numerics", ] @@ -1177,14 +1204,20 @@ component("base") { # Android. if (is_android) { sources -= [ "debug/stack_trace_posix.cc" ] + sources += [ + "memory/shared_memory_android.cc", + "memory/shared_memory_handle_android.cc", + ] # Android uses some Linux sources, put those back. set_sources_assignment_filter([]) sources += [ "debug/proc_maps_linux.cc", + "debug/proc_maps_linux.h", "files/file_path_watcher_linux.cc", "power_monitor/power_monitor_device_source_android.cc", "process/internal_linux.cc", + "process/internal_linux.h", "process/memory_linux.cc", "process/process_handle_linux.cc", "process/process_info_linux.cc", @@ -1215,8 +1248,6 @@ component("base") { # below, rather than using the generic POSIX or Linux-y ones. sources -= [ "debug/stack_trace_posix.cc", - "memory/shared_memory_handle_posix.cc", - "memory/shared_memory_posix.cc", "message_loop/message_pump_libevent.cc", "message_loop/message_pump_libevent.h", "posix/unix_domain_socket.cc", @@ -1234,6 +1265,8 @@ component("base") { "files/file_path_watcher_fuchsia.cc", "fuchsia/default_job.cc", "fuchsia/default_job.h", + "fuchsia/fuchsia_logging.cc", + "fuchsia/fuchsia_logging.h", "fuchsia/scoped_zx_handle.h", "memory/shared_memory_fuchsia.cc", "memory/shared_memory_handle_fuchsia.cc", @@ -1264,6 +1297,7 @@ component("base") { set_sources_assignment_filter([]) sources += [ "files/file_path_watcher_stub.cc", + "memory/shared_memory_nacl.cc", "process/process_metrics_nacl.cc", "sync_socket_nacl.cc", "threading/platform_thread_linux.cc", @@ -1290,7 +1324,6 @@ component("base") { "memory/discardable_shared_memory.h", "memory/shared_memory_helper.cc", "memory/shared_memory_helper.h", - "memory/shared_memory_posix.cc", "native_library.cc", "native_library_posix.cc", "path_service.cc", @@ -1314,7 +1347,10 @@ component("base") { if (is_nacl_nonsfi) { set_sources_assignment_filter([]) - sources += [ "posix/unix_domain_socket.cc" ] + sources += [ + "posix/unix_domain_socket.cc", + "posix/unix_domain_socket.h", + ] set_sources_assignment_filter(sources_assignment_filter) sources -= [ "rand_util_nacl.cc" ] configs += [ ":nacl_nonsfi_warnings" ] @@ -1341,7 +1377,6 @@ component("base") { } else { # Remove NaCl stuff. sources -= [ - "memory/shared_memory_nacl.cc", "os_compat_nacl.cc", "os_compat_nacl.h", "rand_util_nacl.cc", @@ -1367,6 +1402,8 @@ component("base") { # Windows. if (is_win) { sources += [ + "memory/shared_memory_handle_win.cc", + "memory/shared_memory_win.cc", "power_monitor/power_monitor_device_source_win.cc", "profiler/win32_stack_frame_unwinder.cc", "profiler/win32_stack_frame_unwinder.h", @@ -1387,6 +1424,10 @@ component("base") { "//base/win:base_win_features", ] + if (com_init_check_hook_disabled) { + defines += [ "COM_INIT_CHECK_HOOK_DISABLED" ] + } + if (is_component_build) { # Copy the VS runtime DLLs into the isolate so that they don't have to be # preinstalled on the target machine. The debug runtimes have a "d" at @@ -1462,6 +1503,7 @@ component("base") { libs = [ "cfgmgr32.lib", "powrprof.lib", + "propsys.lib", "setupapi.lib", "userenv.lib", "winmm.lib", @@ -1477,10 +1519,14 @@ component("base") { # Desktop Mac. if (is_mac) { + sources -= [ "profiler/native_stack_sampler_posix.cc" ] sources += [ "mac/scoped_typeref.h", + "memory/shared_memory_handle_mac.cc", + "memory/shared_memory_mac.cc", "power_monitor/power_monitor_device_source_mac.mm", "time/time_conversion_posix.cc", + "time/time_exploded_posix.cc", "time/time_mac.cc", ] @@ -1497,17 +1543,12 @@ component("base") { # Mac or iOS. if (is_mac || is_ios) { sources -= [ - "memory/shared_memory_posix.cc", "native_library_posix.cc", "strings/sys_string_conversions_posix.cc", "synchronization/waitable_event_posix.cc", "synchronization/waitable_event_watcher_posix.cc", "threading/platform_thread_internal_posix.cc", ] - - if (is_mac) { - sources -= [ "profiler/native_stack_sampler_posix.cc" ] - } } else { # Non-Mac/ios. sources -= [ @@ -1602,8 +1643,6 @@ component("base") { "mac/mac_logging.mm", "mac/mach_logging.cc", "mac/mach_logging.h", - "mac/objc_property_releaser.h", - "mac/objc_property_releaser.mm", "mac/objc_release_properties.h", "mac/objc_release_properties.mm", "mac/scoped_block.h", @@ -1618,7 +1657,6 @@ component("base") { "mac/scoped_objc_class_swizzler.h", "mac/scoped_objc_class_swizzler.mm", "mac/scoped_typeref.h", - "memory/shared_memory_posix.cc", "message_loop/message_pump_mac.h", "message_loop/message_pump_mac.mm", "power_monitor/power_monitor_device_source_ios.mm", @@ -1633,6 +1671,16 @@ component("base") { set_sources_assignment_filter(sources_assignment_filter) } + # Android, Fuchsia, and MacOS have their own custom shared memory handle + # implementations. e.g. due to supporting both POSIX and native handles. + if (is_posix && !is_android && !is_fuchsia && !is_mac) { + sources += [ "memory/shared_memory_handle_posix.cc" ] + } + + if (is_posix && !is_fuchsia && !is_mac && !is_nacl) { + sources += [ "memory/shared_memory_posix.cc" ] + } + if (is_posix && !is_fuchsia && !is_mac && !is_ios) { sources += [ "time/time_conversion_posix.cc", @@ -1669,13 +1717,33 @@ component("base") { } } +# Build flags for Control Flow Integrity +# https://www.chromium.org/developers/testing/control-flow-integrity +buildflag_header("cfi_flags") { + header = "cfi_flags.h" + + # buildflag entries added to this header must also must be manually added to + # tools/gn/bootstrap/bootstrap.py + flags = [ + # TODO(pcc): remove CFI_CAST_CHECK, see https://crbug.com/626794. + "CFI_CAST_CHECK=$is_cfi && $use_cfi_cast", + "CFI_ICALL_CHECK=$is_cfi && $use_cfi_icall", + "CFI_ENFORCEMENT_TRAP=$is_cfi && !$use_cfi_diag", + "CFI_ENFORCEMENT_DIAGNOSTIC=$is_cfi && $use_cfi_diag && !$use_cfi_recover", + ] +} + buildflag_header("debugging_flags") { header = "debugging_flags.h" header_dir = "base/debug" + + # buildflag entries added to this header must also must be manually added to + # tools/gn/bootstrap/bootstrap.py flags = [ "ENABLE_LOCATION_SOURCE=$enable_location_source", "ENABLE_PROFILING=$enable_profiling", "CAN_UNWIND_WITH_FRAME_POINTERS=$can_unwind_with_frame_pointers", + "UNSAFE_DEVELOPER_BUILD=$is_unsafe_developer_build", ] } @@ -2021,6 +2089,7 @@ test("base_unittests") { "i18n/string_search_unittest.cc", "i18n/time_formatting_unittest.cc", "i18n/timezone_unittest.cc", + "ios/callback_counter_unittest.mm", "ios/crb_protocol_observers_unittest.mm", "ios/device_util_unittest.mm", "ios/weak_nsobject_unittest.mm", @@ -2038,7 +2107,6 @@ test("base_unittests") { "mac/foundation_util_unittest.mm", "mac/mac_util_unittest.mm", "mac/mach_port_broker_unittest.cc", - "mac/objc_property_releaser_unittest.mm", "mac/objc_release_properties_unittest.mm", "mac/scoped_nsobject_unittest.mm", "mac/scoped_objc_class_swizzler_unittest.mm", @@ -2053,6 +2121,7 @@ test("base_unittests") { "memory/memory_pressure_monitor_mac_unittest.cc", "memory/memory_pressure_monitor_unittest.cc", "memory/memory_pressure_monitor_win_unittest.cc", + "memory/protected_memory_unittest.cc", "memory/ptr_util_unittest.cc", "memory/ref_counted_memory_unittest.cc", "memory/ref_counted_unittest.cc", @@ -2247,11 +2316,13 @@ test("base_unittests") { "win/scoped_hstring_unittest.cc", "win/scoped_process_information_unittest.cc", "win/scoped_variant_unittest.cc", + "win/scoped_winrt_initializer_unittest.cc", "win/shortcut_unittest.cc", "win/startup_information_unittest.cc", "win/wait_chain_unittest.cc", "win/win_util_unittest.cc", "win/windows_version_unittest.cc", + "win/winrt_storage_util_unittest.cc", "win/wrapped_window_proc_unittest.cc", ] @@ -2323,7 +2394,6 @@ test("base_unittests") { sources += [ "mac/bind_objc_block_unittest.mm", "mac/foundation_util_unittest.mm", - "mac/objc_property_releaser_unittest.mm", "mac/objc_release_properties_unittest.mm", "mac/scoped_nsobject_unittest.mm", "strings/sys_string_conversions_mac_unittest.mm", @@ -2414,15 +2484,6 @@ test("base_unittests") { # data += [ "$root_out_dir/base_unittests.dSYM/" ] } } - - if (use_cfi_cast) { - # TODO(krasin): remove CFI_CAST_CHECK, see https://crbug.com/626794. - defines += [ "CFI_CAST_CHECK" ] - } - - if (use_cfi_diag && !use_cfi_recover) { - defines += [ "CFI_ENFORCEMENT_DIAGNOSTIC" ] - } } action("build_date") { @@ -2594,7 +2655,6 @@ if (is_android) { "android/java/src/org/chromium/base/annotations/NativeCall.java", "android/java/src/org/chromium/base/annotations/NativeClassQualifiedName.java", "android/java/src/org/chromium/base/annotations/RemovableInRelease.java", - "android/java/src/org/chromium/base/annotations/SuppressFBWarnings.java", "android/java/src/org/chromium/base/annotations/UsedByReflection.java", "android/java/src/org/chromium/base/library_loader/LegacyLinker.java", "android/java/src/org/chromium/base/library_loader/LibraryLoader.java", @@ -2689,18 +2749,22 @@ if (is_android) { "test/android/javatests/src/org/chromium/base/test/params/ParameterizedRunner.java", "test/android/javatests/src/org/chromium/base/test/params/BlockJUnit4RunnerDelegate.java", "test/android/javatests/src/org/chromium/base/test/params/BaseJUnit4RunnerDelegate.java", + "test/android/javatests/src/org/chromium/base/test/params/MethodParamAnnotationRule.java", + "test/android/javatests/src/org/chromium/base/test/params/MethodParamRule.java", "test/android/javatests/src/org/chromium/base/test/params/ParameterizedRunnerDelegateFactory.java", "test/android/javatests/src/org/chromium/base/test/params/ParameterizedFrameworkMethod.java", "test/android/javatests/src/org/chromium/base/test/params/ParameterSet.java", "test/android/javatests/src/org/chromium/base/test/params/ParameterizedRunnerDelegate.java", "test/android/javatests/src/org/chromium/base/test/params/ParameterizedRunnerDelegateCommon.java", "test/android/javatests/src/org/chromium/base/test/params/ParameterAnnotations.java", + "test/android/javatests/src/org/chromium/base/test/params/ParameterProvider.java", "test/android/javatests/src/org/chromium/base/test/util/AdvancedMockContext.java", - "test/android/javatests/src/org/chromium/base/test/util/AnnotationProcessor.java", + "test/android/javatests/src/org/chromium/base/test/util/AnnotationRule.java", "test/android/javatests/src/org/chromium/base/test/util/CallbackHelper.java", "test/android/javatests/src/org/chromium/base/test/util/CommandLineFlags.java", "test/android/javatests/src/org/chromium/base/test/util/DisableIf.java", "test/android/javatests/src/org/chromium/base/test/util/DisableIfSkipCheck.java", + "test/android/javatests/src/org/chromium/base/test/util/AnnotationProcessingUtils.java", "test/android/javatests/src/org/chromium/base/test/util/DisabledTest.java", "test/android/javatests/src/org/chromium/base/test/util/EnormousTest.java", "test/android/javatests/src/org/chromium/base/test/util/Feature.java", @@ -2737,9 +2801,20 @@ if (is_android) { java_files = [ "test/android/javatests/src/org/chromium/base/test/TestChildProcessConnection.java" ] } + android_library("base_junit_test_support") { + # Plaform checks are broken for Robolectric. + bypass_platform_checks = true + testonly = true + java_files = [ "android/junit/src/org/chromium/base/metrics/test/ShadowRecordHistogram.java" ] + deps = [ + ":base_java", + "//third_party/robolectric:robolectric_all_java", + ] + } + junit_binary("base_junit_tests") { java_files = [ - "android/junit/src/org/chromium/base/BaseChromiumApplicationTest.java", + "android/junit/src/org/chromium/base/ApplicationStatusTest.java", "android/junit/src/org/chromium/base/DiscardableReferencePoolTest.java", "android/junit/src/org/chromium/base/LogTest.java", "android/junit/src/org/chromium/base/NonThreadSafeTest.java", @@ -2748,6 +2823,7 @@ if (is_android) { "android/junit/src/org/chromium/base/process_launcher/ChildProcessConnectionTest.java", "test/android/junit/src/org/chromium/base/test/SetUpStatementTest.java", "test/android/junit/src/org/chromium/base/test/TestListInstrumentationRunListenerTest.java", + "test/android/junit/src/org/chromium/base/test/util/AnnotationProcessingUtilsTest.java", "test/android/junit/src/org/chromium/base/test/util/DisableIfTest.java", "test/android/junit/src/org/chromium/base/test/util/MinAndroidSdkLevelSkipCheckTest.java", "test/android/junit/src/org/chromium/base/test/util/RestrictionSkipCheckTest.java", @@ -2762,6 +2838,7 @@ if (is_android) { ":base_java_process_launcher_test_support", ":base_java_test_support", "//third_party/android_support_test_runner:runner_java", + "//third_party/hamcrest:hamcrest_java", ] srcjar_deps = [ ":base_build_config_gen" ] } @@ -2772,6 +2849,7 @@ if (is_android) { "android/library_loader/library_load_from_apk_status_codes.h", "android/library_loader/library_loader_hooks.h", "memory/memory_pressure_listener.h", + "metrics/histogram_base.h", ] } @@ -2801,12 +2879,30 @@ if (is_android) { ] java_files = [ "test/android/java/src/org/chromium/base/ContentUriTestUtils.java", - "test/android/java/src/org/chromium/base/JavaHandlerThreadTest.java", - "test/android/java/src/org/chromium/base/TestSystemMessageHandler.java", + "test/android/java/src/org/chromium/base/JavaHandlerThreadHelpers.java", ] } } +# Keep the list of fuzzer_tests in alphabetical order. +fuzzer_test("base64_decode_fuzzer") { + sources = [ + "base64_decode_fuzzer.cc", + ] + deps = [ + "//base", + ] +} + +fuzzer_test("base64_encode_fuzzer") { + sources = [ + "base64_encode_fuzzer.cc", + ] + deps = [ + "//base", + ] +} + fuzzer_test("base_json_correctness_fuzzer") { sources = [ "json/correctness_fuzzer.cc", |