OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 <stdlib.h> | 5 #include <stdlib.h> |
6 | 6 |
7 #if defined(OS_WIN) | 7 #if defined(OS_WIN) |
8 #include <windows.h> | 8 #include <windows.h> |
9 #endif | 9 #endif |
10 | 10 |
11 #include "base/debug/trace_event.h" | 11 #include "base/debug/trace_event.h" |
12 #include "base/message_loop.h" | 12 #include "base/message_loop.h" |
13 #include "base/rand_util.h" | 13 #include "base/rand_util.h" |
14 #include "base/string_number_conversions.h" | 14 #include "base/string_number_conversions.h" |
15 #include "base/stringprintf.h" | 15 #include "base/stringprintf.h" |
16 #include "base/threading/platform_thread.h" | 16 #include "base/threading/platform_thread.h" |
17 #include "build/build_config.h" | 17 #include "build/build_config.h" |
18 #include "content/common/gpu/gpu_config.h" | 18 #include "content/common/gpu/gpu_config.h" |
| 19 #include "content/common/sandbox_linux.h" |
19 #include "content/gpu/gpu_child_thread.h" | 20 #include "content/gpu/gpu_child_thread.h" |
20 #include "content/gpu/gpu_info_collector.h" | 21 #include "content/gpu/gpu_info_collector.h" |
21 #include "content/gpu/gpu_process.h" | 22 #include "content/gpu/gpu_process.h" |
22 #include "content/gpu/gpu_watchdog_thread.h" | 23 #include "content/gpu/gpu_watchdog_thread.h" |
23 #include "content/public/common/content_client.h" | 24 #include "content/public/common/content_client.h" |
24 #include "content/public/common/content_switches.h" | 25 #include "content/public/common/content_switches.h" |
25 #include "content/public/common/gpu_switching_option.h" | 26 #include "content/public/common/gpu_switching_option.h" |
26 #include "content/public/common/main_function_params.h" | 27 #include "content/public/common/main_function_params.h" |
27 #include "crypto/hmac.h" | 28 #include "crypto/hmac.h" |
28 #include "ui/gl/gl_implementation.h" | 29 #include "ui/gl/gl_implementation.h" |
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
226 | 227 |
227 #if defined(OS_CHROMEOS) && defined(NDEBUG) | 228 #if defined(OS_CHROMEOS) && defined(NDEBUG) |
228 // On Chrome OS and when not on a debug build, initialize | 229 // On Chrome OS and when not on a debug build, initialize |
229 // the GPU process' sandbox only for Intel GPUs. | 230 // the GPU process' sandbox only for Intel GPUs. |
230 do_init_sandbox = gpu_info.gpu.vendor_id == 0x8086; // Intel GPU. | 231 do_init_sandbox = gpu_info.gpu.vendor_id == 0x8086; // Intel GPU. |
231 #endif | 232 #endif |
232 | 233 |
233 if (do_init_sandbox) { | 234 if (do_init_sandbox) { |
234 if (watchdog_thread.get()) | 235 if (watchdog_thread.get()) |
235 watchdog_thread->Stop(); | 236 watchdog_thread->Stop(); |
236 gpu_info.sandboxed = InitializeSandbox(); | 237 gpu_info.sandboxed = LinuxSandbox::InitializeSandbox(); |
237 if (watchdog_thread.get()) | 238 if (watchdog_thread.get()) |
238 watchdog_thread->Start(); | 239 watchdog_thread->Start(); |
239 } | 240 } |
240 } | 241 } |
241 #endif | 242 #endif |
242 | 243 |
243 #if defined(OS_WIN) | 244 #if defined(OS_WIN) |
244 { | 245 { |
245 TRACE_EVENT0("gpu", "Lower token"); | 246 TRACE_EVENT0("gpu", "Lower token"); |
246 // For windows, if the target_services interface is not zero, the process | 247 // For windows, if the target_services interface is not zero, the process |
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
354 TRACE_EVENT0("gpu", "Initialize DXVA"); | 355 TRACE_EVENT0("gpu", "Initialize DXVA"); |
355 // Initialize H/W video decoding stuff which fails in the sandbox. | 356 // Initialize H/W video decoding stuff which fails in the sandbox. |
356 DXVAVideoDecodeAccelerator::PreSandboxInitialization(); | 357 DXVAVideoDecodeAccelerator::PreSandboxInitialization(); |
357 } | 358 } |
358 #endif | 359 #endif |
359 } | 360 } |
360 | 361 |
361 } // namespace. | 362 } // namespace. |
362 | 363 |
363 } // namespace content | 364 } // namespace content |
OLD | NEW |