Index: content/common/sandbox_linux/bpf_gpu_policy_linux.cc |
diff --git a/content/common/sandbox_linux/bpf_gpu_policy_linux.cc b/content/common/sandbox_linux/bpf_gpu_policy_linux.cc |
index d6b54f8ef55abd7bd96b4565eaa0c153e6ed39cd..14eab4984d09fce1feb43434436dfd162e9cc7e5 100644 |
--- a/content/common/sandbox_linux/bpf_gpu_policy_linux.cc |
+++ b/content/common/sandbox_linux/bpf_gpu_policy_linux.cc |
@@ -72,9 +72,15 @@ inline bool IsArchitectureArm() { |
#endif |
} |
-bool IsAcceleratedVideoDecodeEnabled() { |
+bool IsAcceleratedVideoEnabled() { |
const CommandLine& command_line = *CommandLine::ForCurrentProcess(); |
- return !command_line.HasSwitch(switches::kDisableAcceleratedVideoDecode); |
+ bool accelerated_encode_enabled = false; |
+#if defined(OS_CHROMEOS) |
+ accelerated_encode_enabled = |
+ command_line.HasSwitch(switches::kEnableVaapiAcceleratedVideoEncode); |
+#endif |
+ return !command_line.HasSwitch(switches::kDisableAcceleratedVideoDecode) || |
+ accelerated_encode_enabled; |
} |
intptr_t GpuSIGSYS_Handler(const struct arch_seccomp_data& args, |
@@ -214,9 +220,9 @@ bool GpuProcessPolicy::PreSandboxHook() { |
std::vector<std::string>()); |
if (IsArchitectureX86_64() || IsArchitectureI386()) { |
- // Accelerated video decode dlopen()'s some shared objects |
+ // Accelerated video dlopen()'s some shared objects |
// inside the sandbox, so preload them now. |
- if (IsAcceleratedVideoDecodeEnabled()) { |
+ if (IsAcceleratedVideoEnabled()) { |
const char* I965DrvVideoPath = NULL; |
if (IsArchitectureX86_64()) { |