| 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 286 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 297 | 297 |
| 298 if (IsArchitectureX86_64() || IsArchitectureI386()) { | 298 if (IsArchitectureX86_64() || IsArchitectureI386()) { |
| 299 // Accelerated video dlopen()'s some shared objects | 299 // Accelerated video dlopen()'s some shared objects |
| 300 // inside the sandbox, so preload them now. | 300 // inside the sandbox, so preload them now. |
| 301 if (IsAcceleratedVaapiVideoEncodeEnabled() || | 301 if (IsAcceleratedVaapiVideoEncodeEnabled() || |
| 302 IsAcceleratedVideoDecodeEnabled()) { | 302 IsAcceleratedVideoDecodeEnabled()) { |
| 303 const char* I965DrvVideoPath = NULL; | 303 const char* I965DrvVideoPath = NULL; |
| 304 const char* I965HybridDrvVideoPath = NULL; | 304 const char* I965HybridDrvVideoPath = NULL; |
| 305 | 305 |
| 306 if (IsArchitectureX86_64()) { | 306 if (IsArchitectureX86_64()) { |
| 307 I965DrvVideoPath = "/usr/lib64/va/drivers/i965_drv_video.so"; | 307 if (IsChromeOS()) { |
| 308 I965HybridDrvVideoPath = "/usr/lib64/va/drivers/hybrid_drv_video.so"; | 308 I965DrvVideoPath = "/usr/lib64/va/drivers/i965_drv_video.so"; |
| 309 I965HybridDrvVideoPath = "/usr/lib64/va/drivers/hybrid_drv_video.so"; |
| 310 } else { |
| 311 // TODO(dshwang): it's the path for Ubuntu. Support it in general. |
| 312 // crbug.com/590209 |
| 313 I965DrvVideoPath = "/usr/lib/x86_64-linux-gnu/dri/i965_drv_video.so"; |
| 314 } |
| 309 } else if (IsArchitectureI386()) { | 315 } else if (IsArchitectureI386()) { |
| 310 I965DrvVideoPath = "/usr/lib/va/drivers/i965_drv_video.so"; | 316 I965DrvVideoPath = "/usr/lib/va/drivers/i965_drv_video.so"; |
| 311 } | 317 } |
| 312 | 318 |
| 313 dlopen(I965DrvVideoPath, RTLD_NOW|RTLD_GLOBAL|RTLD_NODELETE); | 319 dlopen(I965DrvVideoPath, RTLD_NOW|RTLD_GLOBAL|RTLD_NODELETE); |
| 314 if (I965HybridDrvVideoPath) | 320 if (I965HybridDrvVideoPath) |
| 315 dlopen(I965HybridDrvVideoPath, RTLD_NOW|RTLD_GLOBAL|RTLD_NODELETE); | 321 dlopen(I965HybridDrvVideoPath, RTLD_NOW|RTLD_GLOBAL|RTLD_NODELETE); |
| 316 dlopen("libva.so.1", RTLD_NOW|RTLD_GLOBAL|RTLD_NODELETE); | 322 dlopen("libva.so.1", RTLD_NOW|RTLD_GLOBAL|RTLD_NODELETE); |
| 317 #if defined(USE_OZONE) | 323 #if defined(USE_OZONE) |
| 318 dlopen("libva-drm.so.1", RTLD_NOW|RTLD_GLOBAL|RTLD_NODELETE); | 324 dlopen("libva-drm.so.1", RTLD_NOW|RTLD_GLOBAL|RTLD_NODELETE); |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 357 } | 363 } |
| 358 | 364 |
| 359 broker_process_ = new BrokerProcess(GetFSDeniedErrno(), permissions); | 365 broker_process_ = new BrokerProcess(GetFSDeniedErrno(), permissions); |
| 360 // The initialization callback will perform generic initialization and then | 366 // The initialization callback will perform generic initialization and then |
| 361 // call broker_sandboxer_callback. | 367 // call broker_sandboxer_callback. |
| 362 CHECK(broker_process_->Init(base::Bind(&UpdateProcessTypeAndEnableSandbox, | 368 CHECK(broker_process_->Init(base::Bind(&UpdateProcessTypeAndEnableSandbox, |
| 363 broker_sandboxer_allocator))); | 369 broker_sandboxer_allocator))); |
| 364 } | 370 } |
| 365 | 371 |
| 366 } // namespace content | 372 } // namespace content |
| OLD | NEW |