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 282 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
293 InitGpuBrokerProcess( | 293 InitGpuBrokerProcess( |
294 GpuBrokerProcessPolicy::Create, | 294 GpuBrokerProcessPolicy::Create, |
295 std::vector<BrokerFilePermission>()); // No extra files in whitelist. | 295 std::vector<BrokerFilePermission>()); // No extra files in whitelist. |
296 | 296 |
297 if (IsArchitectureX86_64() || IsArchitectureI386()) { | 297 if (IsArchitectureX86_64() || IsArchitectureI386()) { |
298 // Accelerated video dlopen()'s some shared objects | 298 // Accelerated video dlopen()'s some shared objects |
299 // inside the sandbox, so preload them now. | 299 // inside the sandbox, so preload them now. |
300 if (IsAcceleratedVaapiVideoEncodeEnabled() || | 300 if (IsAcceleratedVaapiVideoEncodeEnabled() || |
301 IsAcceleratedVideoDecodeEnabled()) { | 301 IsAcceleratedVideoDecodeEnabled()) { |
302 const char* I965DrvVideoPath = NULL; | 302 const char* I965DrvVideoPath = NULL; |
303 const char* I965HybridDrvVideoPath = NULL; | |
304 | 303 |
305 if (IsArchitectureX86_64()) { | 304 if (IsArchitectureX86_64()) { |
306 I965DrvVideoPath = "/usr/lib64/va/drivers/i965_drv_video.so"; | 305 I965DrvVideoPath = "/usr/lib64/va/drivers/i965_drv_video.so"; |
307 I965HybridDrvVideoPath = "/usr/lib64/va/drivers/hybrid_drv_video.so"; | |
308 } else if (IsArchitectureI386()) { | 306 } else if (IsArchitectureI386()) { |
309 I965DrvVideoPath = "/usr/lib/va/drivers/i965_drv_video.so"; | 307 I965DrvVideoPath = "/usr/lib/va/drivers/i965_drv_video.so"; |
310 } | 308 } |
311 | 309 |
312 dlopen(I965DrvVideoPath, RTLD_NOW|RTLD_GLOBAL|RTLD_NODELETE); | 310 dlopen(I965DrvVideoPath, RTLD_NOW|RTLD_GLOBAL|RTLD_NODELETE); |
313 if (I965HybridDrvVideoPath) | |
314 dlopen(I965HybridDrvVideoPath, RTLD_NOW|RTLD_GLOBAL|RTLD_NODELETE); | |
315 dlopen("libva.so.1", RTLD_NOW|RTLD_GLOBAL|RTLD_NODELETE); | 311 dlopen("libva.so.1", RTLD_NOW|RTLD_GLOBAL|RTLD_NODELETE); |
316 #if defined(USE_OZONE) | 312 #if defined(USE_OZONE) |
317 dlopen("libva-drm.so.1", RTLD_NOW|RTLD_GLOBAL|RTLD_NODELETE); | 313 dlopen("libva-drm.so.1", RTLD_NOW|RTLD_GLOBAL|RTLD_NODELETE); |
318 #elif defined(USE_X11) | 314 #elif defined(USE_X11) |
319 dlopen("libva-x11.so.1", RTLD_NOW|RTLD_GLOBAL|RTLD_NODELETE); | 315 dlopen("libva-x11.so.1", RTLD_NOW|RTLD_GLOBAL|RTLD_NODELETE); |
320 #endif | 316 #endif |
321 } | 317 } |
322 } | 318 } |
323 | 319 |
324 return true; | 320 return true; |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
356 } | 352 } |
357 | 353 |
358 broker_process_ = new BrokerProcess(GetFSDeniedErrno(), permissions); | 354 broker_process_ = new BrokerProcess(GetFSDeniedErrno(), permissions); |
359 // The initialization callback will perform generic initialization and then | 355 // The initialization callback will perform generic initialization and then |
360 // call broker_sandboxer_callback. | 356 // call broker_sandboxer_callback. |
361 CHECK(broker_process_->Init(base::Bind(&UpdateProcessTypeAndEnableSandbox, | 357 CHECK(broker_process_->Init(base::Bind(&UpdateProcessTypeAndEnableSandbox, |
362 broker_sandboxer_allocator))); | 358 broker_sandboxer_allocator))); |
363 } | 359 } |
364 | 360 |
365 } // namespace content | 361 } // namespace content |
OLD | NEW |