1 # Copyright 2014 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. 4 5 import("//build/config/features.gni") 6 import("//build/config/ui.gni") 7 import("//content/common/common.gni") 8 import("//mojo/public/tools/bindings/mojom.gni") 9 10 source_set("common") { 11 # Only the public target should depend on this. All other targets (even 12 # internal content ones) should depend on the public one. 13 visibility = [ "//content/public/common:common_sources" ] 14 15 sources = rebase_path(content_common_gypi_values.private_common_sources, 16 ".", "//content") 17 18 configs += [ 19 "//content:content_implementation", 20 ] 21 22 public_deps = [ 23 "//gpu/command_buffer/common", 24 "//third_party/WebKit/public:blink_headers", 25 ] 26 deps = [ 27 "//base", 28 "//build/util:webkit_version", 29 "//components/tracing", 30 "//gpu/command_buffer/client:gles2_interface", 31 "//net", 32 "//skia", 33 "//third_party/icu", 34 "//ui/accessibility", 35 "//ui/base", 36 "//ui/gfx", 37 "//ui/gfx/geometry", 38 "//ui/gfx/ipc", 39 "//ui/shell_dialogs", 40 "//url", 41 "//third_party/libjingle", 42 ] 43 44 if (!is_ios) { 45 deps += [ 46 "//cc", 47 "//ipc", 48 "//ipc/mojo", 49 # TODO: the dependency on gl_in_process_context should be decoupled from 50 # content and moved to android_webview. See crbug.com/365797. 51 "//gpu/command_buffer/client:gl_in_process_context", 52 "//gpu/command_buffer/client:gles2_c_lib", 53 "//gpu/command_buffer/client:gles2_cmd_helper", 54 "//gpu/command_buffer/client:gles2_implementation", 55 "//gpu/command_buffer/service", 56 "//gpu/ipc", 57 "//gpu/skia_bindings", 58 "//media", 59 "//media:shared_memory_support", 60 "//mojo/environment:chromium", 61 "//mojo/public/interfaces/application", 62 "//mojo/system", 63 "//sandbox", 64 "//storage/browser", 65 "//storage/common", 66 "//third_party/WebKit/public:blink", 67 "//ui/gl", 68 "//webkit/common/gpu", 69 ] 70 } 71 72 defines = [] 73 include_dirs = [] 74 libs = [] 75 ldflags = [] 76 77 if (is_android && use_seccomp_bpf) { 78 set_sources_assignment_filter([]) 79 sources += [ 80 "sandbox_linux/sandbox_bpf_base_policy_linux.cc", 81 "sandbox_linux/sandbox_bpf_base_policy_linux.h", 82 ] 83 set_sources_assignment_filter(sources_assignment_filter) 84 } 85 86 if (is_mac) { 87 sources += [ 88 "gpu/client/gpu_memory_buffer_impl_io_surface.cc", 89 "gpu/client/gpu_memory_buffer_impl_io_surface.h", 90 ] 91 sources -= [ 92 "plugin_list_posix.cc", 93 ] 94 95 deps += [ 96 "//content/app/resources", 97 "//content:resources", 98 "//third_party/WebKit/public:resources", 99 ] 100 libs += [ "QuartzCore.framework" ] 101 } 102 103 if (is_android) { 104 sources += [ 105 "gpu/client/gpu_memory_buffer_impl_surface_texture.cc", 106 "gpu/client/gpu_memory_buffer_impl_surface_texture.h", 107 ] 108 109 deps += [ 110 "//content/public/android:jni", 111 "//content/public/android:common_aidl", 112 ] 113 114 libs += [ "android" ] 115 } 116 117 if (is_ios) { 118 sources -= [ "user_agent.cc" ] 119 assert(false, "Need to add lots of conditions here") 120 } 121 122 if (!use_ozone) { 123 sources -= [ 124 "cursors/webcursor_ozone.cc", 125 "font_list_ozone.cc", 126 "gpu/gpu_memory_buffer_factory_ozone.cc", 127 ] 128 } 129 130 if (!use_aura) { 131 sources -= [ "cursors/webcursor_aura.cc" ] 132 } 133 134 if (!use_aura || !use_x11) { 135 sources -= [ "cursors/webcursor_aurax11.cc" ] 136 } 137 138 if (use_pango) { 139 configs += [ "//build/config/linux:pangocairo" ] 140 if (use_ozone) { 141 # If we're using pango, never use this ozone file (it was removed in all 142 # non-ozone cases above). 143 sources -= [ "font_list_ozone.cc" ] 144 } 145 } else { 146 sources -= [ 147 "font_list_pango.cc", 148 ] 149 } 150 151 if (use_x11) { 152 sources += [ 153 "gpu/gpu_memory_buffer_factory_x11_pixmap.cc", 154 "common/gpu/gpu_memory_buffer_factory_x11_pixmap.h", 155 ] 156 include_dirs += [ "//third_party/khronos" ] 157 configs += [ "//build/config/linux:xcomposite" ] 158 159 if (cpu_arch != "arm" || !is_chromeos) { 160 sources +=[ 161 "gpu/x_util.cc", 162 "gpu/x_util.h", 163 ] 164 } 165 } else { 166 sources -= [ 167 "gpu/gpu_memory_buffer_factory_x11.cc", 168 ] 169 } 170 171 if (enable_plugins) { 172 deps += [ 173 "//ppapi:ppapi_shared", 174 ] 175 } else { 176 sources -= [ 177 "pepper_file_util.cc", 178 "pepper_file_util.h", 179 "pepper_messages.h", 180 "pepper_plugin_list.cc", 181 "pepper_plugin_list.h", 182 "pepper_renderer_instance_data.cc", 183 "pepper_renderer_instance_data.h", 184 "plugin_list.cc", 185 "plugin_list.h", 186 "plugin_list_posix.cc", 187 "sandbox_util.cc", 188 ] 189 } 190 191 if (is_android) { 192 sources += [ 193 "gpu/media/android_video_decode_accelerator.cc", 194 "gpu/media/android_video_decode_accelerator.h", 195 ] 196 197 if (enable_webrtc) { 198 deps += [ "//third_party/libyuv" ] 199 } 200 } 201 202 if (is_chromeos && use_x11) { 203 if (cpu_arch == "arm") { 204 sources += [ 205 "gpu/media/exynos_v4l2_video_device.cc", 206 "gpu/media/exynos_v4l2_video_device.h", 207 "gpu/media/tegra_v4l2_video_device.cc", 208 "gpu/media/tegra_v4l2_video_device.h", 209 "gpu/media/v4l2_image_processor.cc", 210 "gpu/media/v4l2_image_processor.h", 211 "gpu/media/v4l2_video_decode_accelerator.cc", 212 "gpu/media/v4l2_video_decode_accelerator.h", 213 "gpu/media/v4l2_video_device.cc", 214 "gpu/media/v4l2_video_device.h", 215 "gpu/media/v4l2_video_encode_accelerator.cc", 216 "gpu/media/v4l2_video_encode_accelerator.h", 217 ] 218 libs = [ "EGL", "GLESv2" ] 219 } else { # !arm 220 sources += [ 221 "gpu/media/h264_dpb.cc", 222 "gpu/media/h264_dpb.h", 223 "gpu/media/va_surface.h", 224 "gpu/media/vaapi_h264_decoder.cc", 225 "gpu/media/vaapi_h264_decoder.h", 226 "gpu/media/vaapi_video_decode_accelerator.cc", 227 "gpu/media/vaapi_video_decode_accelerator.h", 228 "gpu/media/vaapi_wrapper.cc", 229 "gpu/media/vaapi_wrapper.h", 230 ] 231 assert(false, "Implement generate_stubs for libva") 232 } 233 } 234 235 if (is_win) { 236 sources += [ 237 "gpu/media/dxva_video_decode_accelerator.cc", 238 "gpu/media/dxva_video_decode_accelerator.h", 239 ] 240 include_dirs += [ "//third_party/khronos" ] 241 deps += [ 242 "//ui/gl", 243 ] 244 245 # TODO(GYP): extract_xinput action. 246 } 247 248 if (!is_win || !use_aura) { 249 sources -= [ "cursors/webcursor_aurawin.cc" ] 250 } 251 252 if (use_seccomp_bpf) { 253 defines += [ "USE_SECCOMP_BPF" ] 254 } else { 255 if (is_linux) { 256 sources -= [ 257 "sandbox_linux/bpf_cros_arm_gpu_policy_linux.cc", 258 "sandbox_linux/bpf_cros_arm_gpu_policy_linux.h", 259 "sandbox_linux/bpf_gpu_policy_linux.cc", 260 "sandbox_linux/bpf_gpu_policy_linux.h", 261 "sandbox_linux/bpf_ppapi_policy_linux.cc", 262 "sandbox_linux/bpf_ppapi_policy_linux.h", 263 "sandbox_linux/bpf_renderer_policy_linux.cc", 264 "sandbox_linux/bpf_renderer_policy_linux.h", 265 "sandbox_linux/bpf_utility_policy_linux.cc", 266 "sandbox_linux/bpf_utility_policy_linux.h", 267 "sandbox_linux/sandbox_bpf_base_policy_linux.cc", 268 "sandbox_linux/sandbox_bpf_base_policy_linux.h", 269 ] 270 } 271 if (is_android) { 272 sources -= [ 273 "sandbox_linux/android/sandbox_bpf_base_policy_android.cc", 274 "sandbox_linux/android/sandbox_bpf_base_policy_android.h", 275 ] 276 } 277 } 278 } 279 280 mojom("mojo_bindings") { 281 sources = [ 282 "render_frame_setup.mojom", 283 ] 284 285 deps = [ 286 "//mojo/public/interfaces/application:application", 287 ] 288 } 289