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 <stddef.h> | 5 #include <stddef.h> |
6 #include <stdlib.h> | 6 #include <stdlib.h> |
7 | 7 |
8 #include <utility> | 8 #include <utility> |
9 | 9 |
10 #include "base/lazy_instance.h" | 10 #include "base/lazy_instance.h" |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
49 #endif | 49 #endif |
50 | 50 |
51 #if defined(OS_ANDROID) | 51 #if defined(OS_ANDROID) |
52 #include "base/trace_event/memory_dump_manager.h" | 52 #include "base/trace_event/memory_dump_manager.h" |
53 #include "components/tracing/graphics_memory_dump_provider_android.h" | 53 #include "components/tracing/graphics_memory_dump_provider_android.h" |
54 #endif | 54 #endif |
55 | 55 |
56 #if defined(OS_WIN) | 56 #if defined(OS_WIN) |
57 #include "base/win/windows_version.h" | 57 #include "base/win/windows_version.h" |
58 #include "base/win/scoped_com_initializer.h" | 58 #include "base/win/scoped_com_initializer.h" |
59 #include "content/common/gpu/media/dxva_video_decode_accelerator_win.h" | 59 #include "media/gpu/dxva_video_decode_accelerator_win.h" |
60 #include "sandbox/win/src/sandbox.h" | 60 #include "sandbox/win/src/sandbox.h" |
61 #endif | 61 #endif |
62 | 62 |
63 #if defined(USE_X11) | 63 #if defined(USE_X11) |
64 #include "ui/base/x/x11_util.h" | 64 #include "ui/base/x/x11_util.h" |
65 #include "ui/gfx/x/x11_switches.h" // nogncheck | 65 #include "ui/gfx/x/x11_switches.h" // nogncheck |
66 #endif | 66 #endif |
67 | 67 |
68 #if defined(OS_LINUX) | 68 #if defined(OS_LINUX) |
69 #include "content/public/common/sandbox_init.h" | 69 #include "content/public/common/sandbox_init.h" |
70 #endif | 70 #endif |
71 | 71 |
72 #if defined(OS_MACOSX) | 72 #if defined(OS_MACOSX) |
73 #include "base/message_loop/message_pump_mac.h" | 73 #include "base/message_loop/message_pump_mac.h" |
74 #include "content/common/sandbox_mac.h" | 74 #include "content/common/sandbox_mac.h" |
75 #endif | 75 #endif |
76 | 76 |
77 #if defined(OS_CHROMEOS) && defined(ARCH_CPU_X86_FAMILY) | 77 #if defined(OS_CHROMEOS) && defined(ARCH_CPU_X86_FAMILY) |
78 #include "content/common/gpu/media/vaapi_wrapper.h" | 78 #include "media/gpu/vaapi_wrapper.h" |
79 #endif | 79 #endif |
80 | 80 |
81 #if defined(SANITIZER_COVERAGE) | 81 #if defined(SANITIZER_COVERAGE) |
82 #include <sanitizer/common_interface_defs.h> | 82 #include <sanitizer/common_interface_defs.h> |
83 #include <sanitizer/coverage_interface.h> | 83 #include <sanitizer/coverage_interface.h> |
84 #endif | 84 #endif |
85 | 85 |
86 #if defined(CYGPROFILE_INSTRUMENTATION) | 86 #if defined(CYGPROFILE_INSTRUMENTATION) |
87 const int kGpuTimeout = 30000; | 87 const int kGpuTimeout = 30000; |
88 #else | 88 #else |
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
239 // Initializes StatisticsRecorder which tracks UMA histograms. | 239 // Initializes StatisticsRecorder which tracks UMA histograms. |
240 base::StatisticsRecorder::Initialize(); | 240 base::StatisticsRecorder::Initialize(); |
241 | 241 |
242 gpu::GPUInfo gpu_info; | 242 gpu::GPUInfo gpu_info; |
243 // Get vendor_id, device_id, driver_version from browser process through | 243 // Get vendor_id, device_id, driver_version from browser process through |
244 // commandline switches. | 244 // commandline switches. |
245 GetGpuInfoFromCommandLine(gpu_info, command_line); | 245 GetGpuInfoFromCommandLine(gpu_info, command_line); |
246 gpu_info.in_process_gpu = false; | 246 gpu_info.in_process_gpu = false; |
247 | 247 |
248 #if defined(OS_CHROMEOS) && defined(ARCH_CPU_X86_FAMILY) | 248 #if defined(OS_CHROMEOS) && defined(ARCH_CPU_X86_FAMILY) |
249 VaapiWrapper::PreSandboxInitialization(); | 249 media::VaapiWrapper::PreSandboxInitialization(); |
250 #endif | 250 #endif |
251 | 251 |
252 #if defined(OS_ANDROID) || defined(OS_CHROMEOS) | 252 #if defined(OS_ANDROID) || defined(OS_CHROMEOS) |
253 // Set thread priority before sandbox initialization. | 253 // Set thread priority before sandbox initialization. |
254 base::PlatformThread::SetCurrentThreadPriority(base::ThreadPriority::DISPLAY); | 254 base::PlatformThread::SetCurrentThreadPriority(base::ThreadPriority::DISPLAY); |
255 #endif | 255 #endif |
256 | 256 |
257 // Warm up resources that don't need access to GPUInfo. | 257 // Warm up resources that don't need access to GPUInfo. |
258 if (WarmUpSandbox(command_line)) { | 258 if (WarmUpSandbox(command_line)) { |
259 #if defined(OS_LINUX) | 259 #if defined(OS_LINUX) |
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
446 | 446 |
447 bool WarmUpSandbox(const base::CommandLine& command_line) { | 447 bool WarmUpSandbox(const base::CommandLine& command_line) { |
448 { | 448 { |
449 TRACE_EVENT0("gpu", "Warm up rand"); | 449 TRACE_EVENT0("gpu", "Warm up rand"); |
450 // Warm up the random subsystem, which needs to be done pre-sandbox on all | 450 // Warm up the random subsystem, which needs to be done pre-sandbox on all |
451 // platforms. | 451 // platforms. |
452 (void) base::RandUint64(); | 452 (void) base::RandUint64(); |
453 } | 453 } |
454 | 454 |
455 #if defined(OS_WIN) | 455 #if defined(OS_WIN) |
456 content::DXVAVideoDecodeAccelerator::PreSandboxInitialization(); | 456 media::DXVAVideoDecodeAccelerator::PreSandboxInitialization(); |
457 #endif | 457 #endif |
458 return true; | 458 return true; |
459 } | 459 } |
460 | 460 |
461 #if !defined(OS_MACOSX) | 461 #if !defined(OS_MACOSX) |
462 bool CollectGraphicsInfo(gpu::GPUInfo& gpu_info) { | 462 bool CollectGraphicsInfo(gpu::GPUInfo& gpu_info) { |
463 TRACE_EVENT0("gpu,startup", "Collect Graphics Info"); | 463 TRACE_EVENT0("gpu,startup", "Collect Graphics Info"); |
464 | 464 |
465 bool res = true; | 465 bool res = true; |
466 gpu::CollectInfoResult result = gpu::CollectContextGraphicsInfo(&gpu_info); | 466 gpu::CollectInfoResult result = gpu::CollectContextGraphicsInfo(&gpu_info); |
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
584 return true; | 584 return true; |
585 } | 585 } |
586 | 586 |
587 return false; | 587 return false; |
588 } | 588 } |
589 #endif // defined(OS_WIN) | 589 #endif // defined(OS_WIN) |
590 | 590 |
591 } // namespace. | 591 } // namespace. |
592 | 592 |
593 } // namespace content | 593 } // namespace content |
OLD | NEW |