| # Copyright 2017 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/chromecast_build.gni") |
| import("//build/config/sanitizers/sanitizers.gni") |
| |
| component("sandbox") { |
| sources = [ |
| "export.h", |
| "features.cc", |
| "features.h", |
| "sandbox.cc", |
| "sandbox.h", |
| "sandbox_delegate.h", |
| "sandbox_type.cc", |
| "sandbox_type.h", |
| "switches.cc", |
| "switches.h", |
| ] |
| defines = [ "SERVICE_MANAGER_SANDBOX_IMPL" ] |
| public_deps = [ |
| "//services/service_manager/embedder:embedder_switches", |
| ] |
| deps = [ |
| ":sanitizer_buildflags", |
| "//base", |
| "//sandbox:common", |
| ] |
| if (is_linux) { |
| sources += [ |
| "linux/bpf_audio_policy_linux.cc", |
| "linux/bpf_audio_policy_linux.h", |
| "linux/bpf_base_policy_linux.cc", |
| "linux/bpf_base_policy_linux.h", |
| "linux/bpf_broker_policy_linux.cc", |
| "linux/bpf_broker_policy_linux.h", |
| "linux/bpf_cdm_policy_linux.cc", |
| "linux/bpf_cdm_policy_linux.h", |
| "linux/bpf_cros_amd_gpu_policy_linux.cc", |
| "linux/bpf_cros_amd_gpu_policy_linux.h", |
| "linux/bpf_cros_arm_gpu_policy_linux.cc", |
| "linux/bpf_cros_arm_gpu_policy_linux.h", |
| "linux/bpf_gpu_policy_linux.cc", |
| "linux/bpf_gpu_policy_linux.h", |
| "linux/bpf_network_policy_linux.cc", |
| "linux/bpf_network_policy_linux.h", |
| "linux/bpf_pdf_compositor_policy_linux.cc", |
| "linux/bpf_pdf_compositor_policy_linux.h", |
| "linux/bpf_ppapi_policy_linux.cc", |
| "linux/bpf_ppapi_policy_linux.h", |
| "linux/bpf_renderer_policy_linux.cc", |
| "linux/bpf_renderer_policy_linux.h", |
| "linux/bpf_utility_policy_linux.cc", |
| "linux/bpf_utility_policy_linux.h", |
| "linux/sandbox_debug_handling_linux.cc", |
| "linux/sandbox_debug_handling_linux.h", |
| "linux/sandbox_linux.cc", |
| "linux/sandbox_linux.h", |
| "linux/sandbox_seccomp_bpf_linux.cc", |
| "linux/sandbox_seccomp_bpf_linux.h", |
| ] |
| configs += [ |
| "//media:media_config", |
| "//media/audio:platform_config", |
| ] |
| deps += [ |
| ":chromecast_sandbox_whitelist_buildflags", |
| "//sandbox:sandbox_buildflags", |
| "//sandbox/linux:sandbox_services", |
| "//sandbox/linux:seccomp_bpf", |
| "//sandbox/linux:suid_sandbox_client", |
| ] |
| } |
| if (is_chromeos) { |
| sources += [ |
| "linux/bpf_ime_policy_linux.cc", |
| "linux/bpf_ime_policy_linux.h", |
| ] |
| } |
| if (is_mac) { |
| sources += [ |
| "mac/sandbox_mac.h", |
| "mac/sandbox_mac.mm", |
| ] |
| deps += [ "//sandbox/mac:seatbelt" ] |
| public_deps += [ "mac:packaged_sb_files" ] |
| libs = [ |
| "AppKit.framework", |
| "CoreFoundation.framework", |
| "CoreGraphics.framework", |
| "Foundation.framework", |
| "IOSurface.framework", |
| ] |
| } |
| if (is_win) { |
| sources += [ |
| "win/sandbox_win.cc", |
| "win/sandbox_win.h", |
| ] |
| deps += [ "//sandbox/win:sandbox" ] |
| } |
| if (is_fuchsia) { |
| sources += [ |
| "fuchsia/sandbox_policy_fuchsia.cc", |
| "fuchsia/sandbox_policy_fuchsia.h", |
| ] |
| |
| deps += [ |
| "//third_party/fuchsia-sdk/sdk:deprecatedtimezone", |
| "//third_party/fuchsia-sdk/sdk:fonts", |
| "//third_party/fuchsia-sdk/sdk:logger", |
| "//third_party/fuchsia-sdk/sdk:mediacodec", |
| "//third_party/fuchsia-sdk/sdk:net", |
| "//third_party/fuchsia-sdk/sdk:netstack", |
| "//third_party/fuchsia-sdk/sdk:sysmem", |
| "//third_party/fuchsia-sdk/sdk:ui_scenic", |
| ] |
| } |
| } |
| |
| buildflag_header("sanitizer_buildflags") { |
| header = "sanitizer_buildflags.h" |
| flags = [ "USING_SANITIZER=$using_sanitizer" ] |
| } |
| |
| buildflag_header("chromecast_sandbox_whitelist_buildflags") { |
| header = "chromecast_sandbox_whitelist_buildflags.h" |
| flags = [ "ENABLE_CHROMECAST_GPU_SANDBOX_WHITELIST=$is_chromecast" ] |
| } |