blob: fcec38ffa98a3def0017f5f61e5635d20ed10727 [file] [log] [blame]
# Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import("//build/buildflag_header.gni")
import("//build/config/features.gni")
import("//build/config/ui.gni")
import("//ipc/features.gni")
import("//mojo/public/tools/bindings/mojom.gni")
import("//ppapi/buildflags/buildflags.gni")
import("//sandbox/features.gni")
import("//tools/ipc_fuzzer/ipc_fuzzer.gni")
import("features.gni")
if (is_mac) {
import("//build/config/mac/mac_sdk.gni")
import("//content/public/app/mac_helpers.gni")
}
# For feature flags internal to content. See content/public/common:features
# for feature flags that clients of contents need to know about.
buildflag_header("buildflags") {
header = "buildflags.h"
flags = [
"USE_EXTERNAL_POPUP_MENU=$use_external_popup_menu",
"ALLOW_CRITICAL_MEMORY_PRESSURE_HANDLING_IN_FOREGROUND=$allow_critical_memory_pressure_handling_in_foreground",
"ENABLE_SCREEN_CAPTURE=$enable_screen_capture",
]
}
source_set("common") {
# Targets external to content should always link to the public API.
# In addition, targets outside of the content component (shell and tests)
# must not link to this because it will duplicate the code in the component
# build.
visibility = [
"//content/*",
"//tools/ipc_fuzzer/message_replay:ipc_fuzzer_replay",
]
sources = [
"accessibility_messages.h",
"all_messages.h",
"android/gin_java_bridge_errors.cc",
"android/gin_java_bridge_errors.h",
"android/gin_java_bridge_value.cc",
"android/gin_java_bridge_value.h",
"android/hash_set.cc",
"android/hash_set.h",
"android/surface_wrapper.cc",
"android/surface_wrapper.h",
"android/sync_compositor_statics.cc",
"android/sync_compositor_statics.h",
"android/use_zoom_for_dsf_policy_android.cc",
"appcache_interfaces.cc",
"appcache_interfaces.h",
"ax_content_node_data.cc",
"ax_content_node_data.h",
"background_fetch/background_fetch_types.cc",
"background_fetch/background_fetch_types.h",
"browser_plugin/browser_plugin_constants.cc",
"browser_plugin/browser_plugin_constants.h",
"browser_plugin/browser_plugin_messages.h",
"child_process_host_impl.cc",
"child_process_host_impl.h",
"common_param_traits.cc",
"common_param_traits.h",
"common_param_traits_macros.h",
"common_sandbox_support_linux.cc",
"content_constants_internal.cc",
"content_constants_internal.h",
"content_export.h",
"content_ipc_logging.cc",
"content_message_generator.cc",
"content_message_generator.h",
"content_param_traits.cc",
"content_param_traits.h",
"content_param_traits_macros.h",
"content_paths.cc",
"content_security_policy/content_security_policy.cc",
"content_security_policy/content_security_policy.h",
"content_security_policy/csp_context.cc",
"content_security_policy/csp_context.h",
"content_security_policy/csp_directive.cc",
"content_security_policy/csp_directive.h",
"content_security_policy/csp_disposition_enum.h",
"content_security_policy/csp_source.cc",
"content_security_policy/csp_source.h",
"content_security_policy/csp_source_list.cc",
"content_security_policy/csp_source_list.h",
"content_security_policy_header.cc",
"content_security_policy_header.h",
"content_switches_internal.cc",
"content_switches_internal.h",
"cursors/webcursor.cc",
"cursors/webcursor.h",
"cursors/webcursor_android.cc",
"cursors/webcursor_aura.cc",
"cursors/webcursor_aurawin.cc",
"cursors/webcursor_aurax11.cc",
"cursors/webcursor_mac.mm",
"cursors/webcursor_ozone.cc",
"drag_event_source_info.h",
"drag_messages.h",
"drag_traits.h",
"edit_command.h",
"fetch/fetch_api_request_proto.cc",
"fetch/fetch_api_request_proto.h",
"fetch/fetch_request_type_converters.cc",
"fetch/fetch_request_type_converters.h",
"font_cache_dispatcher_win.cc",
"font_list.cc",
"font_list.h",
"font_list_android.cc",
"font_list_fontconfig.cc",
"font_list_mac.mm",
"font_list_win.cc",
"frame_delete_intention.h",
"frame_message_structs.cc",
"frame_message_structs.h",
"frame_messages.h",
"frame_messages_forward.h",
"frame_owner_properties.cc",
"frame_owner_properties.h",
"frame_replication_state.cc",
"frame_replication_state.h",
"frame_visual_properties.cc",
"frame_visual_properties.h",
"gin_java_bridge_messages.h",
"in_process_child_thread_params.cc",
"in_process_child_thread_params.h",
"input/actions_parser.cc",
"input/actions_parser.h",
"input/event_with_latency_info.h",
"input/gesture_event_stream_validator.cc",
"input/gesture_event_stream_validator.h",
"input/ime_text_span_conversions.cc",
"input/ime_text_span_conversions.h",
"input/input_event.cc",
"input/input_event.h",
"input/input_event_ack.cc",
"input/input_event_ack.h",
"input/input_event_ack_state.cc",
"input/input_event_dispatch_type.h",
"input/input_event_mojom_traits.cc",
"input/input_event_mojom_traits.h",
"input/input_event_stream_validator.cc",
"input/input_event_stream_validator.h",
"input/input_param_traits.cc",
"input/input_param_traits.h",
"input/sync_compositor_messages.cc",
"input/sync_compositor_messages.h",
"input/synthetic_gesture_params.cc",
"input/synthetic_gesture_params.h",
"input/synthetic_pinch_gesture_params.cc",
"input/synthetic_pinch_gesture_params.h",
"input/synthetic_pointer_action_list_params.cc",
"input/synthetic_pointer_action_list_params.h",
"input/synthetic_pointer_action_params.cc",
"input/synthetic_pointer_action_params.h",
"input/synthetic_smooth_drag_gesture_params.cc",
"input/synthetic_smooth_drag_gesture_params.h",
"input/synthetic_smooth_scroll_gesture_params.cc",
"input/synthetic_smooth_scroll_gesture_params.h",
"input/synthetic_tap_gesture_params.cc",
"input/synthetic_tap_gesture_params.h",
"input/synthetic_web_input_event_builders.cc",
"input/synthetic_web_input_event_builders.h",
"input/touch_action_optional_mojom_traits.cc",
"input/touch_action_optional_mojom_traits.h",
"input/touch_event_stream_validator.cc",
"input/touch_event_stream_validator.h",
"input/web_mouse_wheel_event_traits.cc",
"input/web_mouse_wheel_event_traits.h",
"input/web_touch_event_traits.cc",
"input/web_touch_event_traits.h",
"input_messages.h",
"inter_process_time_ticks_converter.cc",
"inter_process_time_ticks_converter.h",
"mac/attributed_string_coder.h",
"mac/attributed_string_coder.mm",
"mac/font_loader.h",
"mac/font_loader.mm",
"media/cdm_info.cc",
"media/media_player_delegate_messages.h",
"navigation_gesture.h",
"navigation_params.cc",
"navigation_params.h",
"navigation_params_mojom_traits.h",
"navigation_params_utils.h",
"net/record_load_histograms.cc",
"net/record_load_histograms.h",
"origin_util.cc",
"page_messages.h",
"page_state_serialization.cc",
"page_state_serialization.h",
"pepper_file_util.cc",
"pepper_file_util.h",
"pepper_plugin_list.cc",
"pepper_plugin_list.h",
"pepper_renderer_instance_data.cc",
"pepper_renderer_instance_data.h",
"process_type.cc",
"resource_messages.h",
"resource_timing_info.cc",
"resource_timing_info.h",
"sandbox_init_linux.cc",
"sandbox_init_mac.cc",
"sandbox_init_win.cc",
"savable_subframe.h",
"service_manager/service_manager_connection_impl.cc",
"service_manager/service_manager_connection_impl.h",
"service_worker/service_worker_loader_helpers.cc",
"service_worker/service_worker_loader_helpers.h",
"service_worker/service_worker_utils.cc",
"service_worker/service_worker_utils.h",
"skia_utils.cc",
"skia_utils.h",
"swapped_out_messages.cc",
"swapped_out_messages.h",
"tab_switch_time_recorder.cc",
"tab_switch_time_recorder.h",
"text_input_client_messages.h",
"text_input_state.cc",
"text_input_state.h",
"thread_pool_util.cc",
"thread_pool_util.h",
"unfreezable_frame_messages.h",
"unique_name_helper.cc",
"unique_name_helper.h",
"url_schemes.cc",
"url_schemes.h",
"user_agent.cc",
"view_messages.h",
"visual_properties.cc",
"visual_properties.h",
"web_package/signed_exchange_utils.cc",
"web_package/signed_exchange_utils.h",
"widget_messages.h",
]
configs += [
"//content:content_implementation",
"//build/config:precompiled_headers",
"//build/config/compiler:no_size_t_to_int_warning",
]
public_deps = [
":mojo_bindings",
"//cc",
"//cc/ipc",
"//gpu/command_buffer/common",
"//ipc",
"//services/network:network_service",
"//services/service_manager/public/cpp",
"//services/service_manager/sandbox",
"//third_party/blink/public:blink_headers",
"//third_party/blink/public/common",
"//ui/accessibility",
]
deps = [
":buildflags",
"//base",
"//base/third_party/dynamic_annotations",
"//build:branding_buildflags",
"//build/util:webkit_version",
"//components/discardable_memory/common",
"//components/services/filesystem/public/mojom",
"//components/tracing",
"//components/tracing:startup_tracing",
"//components/viz/service",
"//content:resources",
"//content/app/resources",
"//content/common/fetch:fetch_api_request_proto",
"//content/public/common:interfaces",
"//content/public/common:service_names",
"//device/base/synchronization",
"//device/bluetooth",
"//gpu",
"//gpu/command_buffer/client:gles2_implementation",
"//gpu/command_buffer/client:gles2_interface",
"//gpu/command_buffer/service",
"//gpu/ipc/client",
"//gpu/ipc/common",
"//gpu/skia_bindings",
"//ipc",
"//media",
"//media:shared_memory_support",
"//media/base/ipc",
"//media/capture",
"//media/gpu:buildflags",
"//media/gpu/ipc/client",
"//media/gpu/ipc/common",
"//media/midi",
"//media/midi:mojo",
"//mojo/public/cpp/system",
"//net",
"//ppapi/buildflags",
"//sandbox",
"//sandbox:sandbox_buildflags",
"//services/network/public/cpp",
"//services/network/public/mojom",
"//services/resource_coordinator/public/cpp/memory_instrumentation",
"//services/service_manager/public/mojom",
"//services/service_manager/zygote:zygote_buildflags",
"//services/video_capture/public/mojom",
"//services/viz/public/mojom",
"//skia",
"//storage/common",
"//third_party/angle:angle_gpu_info_util",
"//third_party/boringssl",
"//third_party/icu",
"//ui/base",
"//ui/base/ime",
"//ui/display",
"//ui/events/blink",
"//ui/gfx",
"//ui/gfx/geometry",
"//ui/gfx/geometry/mojom:mojom_traits",
"//ui/gfx/ipc",
"//ui/gfx/ipc/color",
"//ui/gfx/ipc/geometry",
"//ui/gfx/ipc/skia",
"//ui/gl",
"//ui/gl/init",
"//ui/latency/ipc",
"//ui/native_theme",
"//ui/shell_dialogs",
"//url",
"//url/ipc:url_ipc",
]
defines = []
include_dirs = []
libs = []
ldflags = []
allow_circular_includes_from = [
":mojo_bindings",
"//content/public/common:interfaces",
]
if (is_android && use_seccomp_bpf) {
set_sources_assignment_filter([])
sources += [
"//services/service_manager/sandbox/linux/bpf_base_policy_linux.cc",
"//services/service_manager/sandbox/linux/bpf_base_policy_linux.h",
]
set_sources_assignment_filter(sources_assignment_filter)
}
if (is_mac) {
deps += [
":mac_helpers",
"//sandbox/mac:seatbelt",
]
}
if (is_android) {
deps += [
"//content/public/android:common_aidl",
"//content/public/android:jni",
]
libs += [ "android" ]
}
if (is_debug && !is_component_build && enable_plugins) {
# Content depends on the PPAPI message logging stuff; if this isn't here,
# some unit test binaries won't compile. This only worked in release mode
# because logging is disabled there.
deps += [ "//ppapi/proxy:ipc_sources" ]
}
if (use_ozone) {
deps += [ "//ui/ozone" ]
} else {
sources -= [ "cursors/webcursor_ozone.cc" ]
}
if (!use_aura) {
sources -= [ "cursors/webcursor_aura.cc" ]
}
if (!use_aura || !use_x11) {
sources -= [ "cursors/webcursor_aurax11.cc" ]
}
if (is_linux) {
deps += [ "//third_party/fontconfig" ]
}
if (is_mac || is_win || is_android || is_fuchsia) {
sources -= [ "font_list_fontconfig.cc" ]
}
if (enable_plugins) {
deps += [
"//ppapi/proxy:ipc",
"//ppapi/shared_impl",
]
} else {
sources -= [
"pepper_file_util.cc",
"pepper_file_util.h",
"pepper_plugin_list.cc",
"pepper_plugin_list.h",
"pepper_renderer_instance_data.cc",
"pepper_renderer_instance_data.h",
]
}
if (!is_win || !use_aura) {
sources -= [ "cursors/webcursor_aurawin.cc" ]
}
if (is_mac) {
deps += [ "//media/gpu" ]
}
if (enable_ipc_fuzzer) {
configs += [ "//tools/ipc_fuzzer:ipc_fuzzer_config" ]
sources += [
"external_ipc_dumper.cc",
"external_ipc_dumper.h",
]
}
if (is_fuchsia) {
sources += [ "font_list_fuchsia.cc" ]
deps += [ "//third_party/fuchsia-sdk/sdk:fdio" ]
}
if (use_clang_coverage) {
sources += [
"coverage_utils.cc",
"coverage_utils.h",
]
}
}
# See comment at the top of //content/BUILD.gn for how this works.
group("for_content_tests") {
visibility = [ "//content/test/*" ]
if (!is_component_build) {
public_deps = [
":common",
]
}
}
mojom("mojo_bindings") {
# This interface is internal to content.
visibility = [ "//content/*" ]
# indexed_db.mojom used a native typemap that was not available in Java.
# indexed_db.mojom was removed in an earlier commit. This should be removed
# at some point.
cpp_only = true
disable_variants = true
sources = [
"associated_interfaces.mojom",
"child_process.mojom",
"document_scoped_interface_bundle.mojom",
"download/mhtml_file_writer.mojom",
"field_trial_recorder.mojom",
"frame.mojom",
"frame_messages.mojom",
"frame_proxy.mojom",
"frame_sink_provider.mojom",
"histogram_fetcher.mojom",
"input/input_handler.mojom",
"input/input_injector.mojom",
"input/synchronous_compositor.mojom",
"media/renderer_audio_input_stream_factory.mojom",
"media/renderer_audio_output_stream_factory.mojom",
"native_types.mojom",
"navigation_client.mojom",
"navigation_params.mojom",
"page_state.mojom",
"prefetched_signed_exchange_info.mojom",
"render_frame_metadata.mojom",
"render_message_filter.mojom",
"renderer.mojom",
"renderer_host.mojom",
"widget.mojom",
]
enabled_features = []
if (enable_ipc_logging) {
enabled_features += [ "ipc_logging" ]
}
if (is_linux || is_chromeos) {
enabled_features += [ "supports_thread_priorities" ]
}
if (use_clang_coverage) {
enabled_features += [ "clang_coverage" ]
}
import_dirs = [ "//mojo/services" ]
public_deps = [
"//cc/mojom",
"//components/tracing/common:interfaces",
"//content/public/common:interfaces",
"//content/public/common:resource_type_bindings",
"//ipc:mojom",
"//ipc:mojom_constants",
"//media/capture/mojom:video_capture",
"//media/mojo/mojom",
"//mojo/public/mojom/base",
"//services/audio/public/mojom",
"//services/network/public/mojom",
"//services/service_manager/public/mojom",
"//services/video_capture/public/mojom",
"//services/viz/public/mojom",
"//skia/public/mojom",
"//third_party/blink/public/mojom:mojom_core",
"//third_party/blink/public/mojom:web_feature_mojo_bindings",
"//ui/base/ime/mojom",
"//ui/base/mojom",
"//ui/events/mojom",
"//ui/gfx/geometry/mojom",
"//ui/gfx/image/mojom",
"//ui/gfx/mojom",
"//ui/gfx/range/mojom",
"//ui/latency/mojom",
"//url/mojom:url_mojom_gurl",
"//url/mojom:url_mojom_origin",
]
if (is_mac) {
sources += [
"render_widget_host_ns_view.mojom",
"sandbox_support_mac.mojom",
"web_contents_ns_view_bridge.mojom",
]
public_deps += [ "//ui/display/mojom" ]
}
overridden_deps = [ "//third_party/blink/public/mojom:mojom_core" ]
component_deps = [ "//third_party/blink/public/common" ]
component_output_prefix = "content_common_mojo_bindings"
export_class_attribute = "CONTENT_EXPORT"
export_define = "CONTENT_IMPLEMENTATION=1"
export_header = "content/common/content_export.h"
}
if (is_mac) {
source_set("mac_helpers") {
_lines = [
"// This file is generated by " +
get_label_info(target_name, "label_no_toolchain"),
"",
"#ifndef GEN_CONTENT_COMMON_MAC_HELPERS_H_",
"#define GEN_CONTENT_COMMON_MAC_HELPERS_H_",
"",
"namespace content {",
"",
]
foreach(helper_params, content_mac_helpers) {
_lines += [ "const char kMacHelperSuffix_${helper_params[0]}[] = \"${helper_params[2]}\";" ]
}
_lines += [
"",
"} // namespace content",
"",
"#endif // GEN_CONTENT_COMMON_MAC_HELPERS_H_",
]
_file = "$target_gen_dir/mac_helpers.h"
write_file(_file, _lines)
sources = [
_file,
]
}
}