| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "content/common/sandbox_linux/bpf_gpu_policy_linux.h" | 5 #include "content/common/sandbox_linux/bpf_gpu_policy_linux.h" |
| 6 | 6 |
| 7 #include <dlfcn.h> | 7 #include <dlfcn.h> |
| 8 #include <errno.h> | 8 #include <errno.h> |
| 9 #include <fcntl.h> | 9 #include <fcntl.h> |
| 10 #include <sys/socket.h> | 10 #include <sys/socket.h> |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 66 | 66 |
| 67 inline bool IsArchitectureArm() { | 67 inline bool IsArchitectureArm() { |
| 68 #if defined(__arm__) | 68 #if defined(__arm__) |
| 69 return true; | 69 return true; |
| 70 #else | 70 #else |
| 71 return false; | 71 return false; |
| 72 #endif | 72 #endif |
| 73 } | 73 } |
| 74 | 74 |
| 75 bool IsAcceleratedVideoDecodeEnabled() { | 75 bool IsAcceleratedVideoDecodeEnabled() { |
| 76 // Accelerated video decode is currently enabled on Chrome OS, | |
| 77 // but not on Linux: crbug.com/137247. | |
| 78 bool is_enabled = IsChromeOS(); | |
| 79 | |
| 80 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); | 76 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); |
| 81 is_enabled &= | 77 return !command_line.HasSwitch(switches::kDisableAcceleratedVideoDecode); |
| 82 !command_line.HasSwitch(switches::kDisableAcceleratedVideoDecode); | |
| 83 | |
| 84 return is_enabled; | |
| 85 } | 78 } |
| 86 | 79 |
| 87 intptr_t GpuSIGSYS_Handler(const struct arch_seccomp_data& args, | 80 intptr_t GpuSIGSYS_Handler(const struct arch_seccomp_data& args, |
| 88 void* aux_broker_process) { | 81 void* aux_broker_process) { |
| 89 RAW_CHECK(aux_broker_process); | 82 RAW_CHECK(aux_broker_process); |
| 90 BrokerProcess* broker_process = | 83 BrokerProcess* broker_process = |
| 91 static_cast<BrokerProcess*>(aux_broker_process); | 84 static_cast<BrokerProcess*>(aux_broker_process); |
| 92 switch (args.nr) { | 85 switch (args.nr) { |
| 93 case __NR_access: | 86 case __NR_access: |
| 94 return broker_process->Access(reinterpret_cast<const char*>(args.args[0]), | 87 return broker_process->Access(reinterpret_cast<const char*>(args.args[0]), |
| (...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 260 broker_process_ = new BrokerProcess(GetFSDeniedErrno(), | 253 broker_process_ = new BrokerProcess(GetFSDeniedErrno(), |
| 261 read_whitelist, | 254 read_whitelist, |
| 262 write_whitelist); | 255 write_whitelist); |
| 263 // The initialization callback will perform generic initialization and then | 256 // The initialization callback will perform generic initialization and then |
| 264 // call broker_sandboxer_callback. | 257 // call broker_sandboxer_callback. |
| 265 CHECK(broker_process_->Init(base::Bind(&UpdateProcessTypeAndEnableSandbox, | 258 CHECK(broker_process_->Init(base::Bind(&UpdateProcessTypeAndEnableSandbox, |
| 266 broker_sandboxer_callback))); | 259 broker_sandboxer_callback))); |
| 267 } | 260 } |
| 268 | 261 |
| 269 } // namespace content | 262 } // namespace content |
| OLD | NEW |