Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(423)

Side by Side Diff: content/gpu/gpu_main.cc

Issue 1137483002: VAAPI Wrapper: refactor management of drm file (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 <dwmapi.h> 8 #include <dwmapi.h>
9 #include <windows.h> 9 #include <windows.h>
10 #endif 10 #endif
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 55
56 #if defined(OS_LINUX) 56 #if defined(OS_LINUX)
57 #include "content/public/common/sandbox_init.h" 57 #include "content/public/common/sandbox_init.h"
58 #endif 58 #endif
59 59
60 #if defined(OS_MACOSX) 60 #if defined(OS_MACOSX)
61 #include "base/message_loop/message_pump_mac.h" 61 #include "base/message_loop/message_pump_mac.h"
62 #include "content/common/sandbox_mac.h" 62 #include "content/common/sandbox_mac.h"
63 #endif 63 #endif
64 64
65 #if defined(OS_CHROMEOS) && defined(ARCH_CPU_X86_FAMILY)
66 #include "content/common/gpu/media/vaapi_wrapper.h"
67 #endif
68
65 #if defined(SANITIZER_COVERAGE) 69 #if defined(SANITIZER_COVERAGE)
66 #include <sanitizer/common_interface_defs.h> 70 #include <sanitizer/common_interface_defs.h>
67 #include <sanitizer/coverage_interface.h> 71 #include <sanitizer/coverage_interface.h>
68 #endif 72 #endif
69 73
70 const int kGpuTimeout = 10000; 74 const int kGpuTimeout = 10000;
71 75
72 namespace content { 76 namespace content {
73 77
74 namespace { 78 namespace {
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after
211 } 215 }
212 216
213 // Initializes StatisticsRecorder which tracks UMA histograms. 217 // Initializes StatisticsRecorder which tracks UMA histograms.
214 base::StatisticsRecorder::Initialize(); 218 base::StatisticsRecorder::Initialize();
215 219
216 gpu::GPUInfo gpu_info; 220 gpu::GPUInfo gpu_info;
217 // Get vendor_id, device_id, driver_version from browser process through 221 // Get vendor_id, device_id, driver_version from browser process through
218 // commandline switches. 222 // commandline switches.
219 GetGpuInfoFromCommandLine(gpu_info, command_line); 223 GetGpuInfoFromCommandLine(gpu_info, command_line);
220 224
225 #if defined(OS_CHROMEOS) && defined(ARCH_CPU_X86_FAMILY)
226 VaapiWrapper::PreSandboxInitialization();
227 #endif
228
221 // Warm up resources that don't need access to GPUInfo. 229 // Warm up resources that don't need access to GPUInfo.
222 if (WarmUpSandbox(command_line)) { 230 if (WarmUpSandbox(command_line)) {
223 #if defined(OS_LINUX) 231 #if defined(OS_LINUX)
224 bool initialized_sandbox = false; 232 bool initialized_sandbox = false;
225 bool initialized_gl_context = false; 233 bool initialized_gl_context = false;
226 bool should_initialize_gl_context = false; 234 bool should_initialize_gl_context = false;
227 // On Chrome OS ARM Mali, GPU driver userspace creates threads when 235 // On Chrome OS ARM Mali, GPU driver userspace creates threads when
228 // initializing a GL context, so start the sandbox early. 236 // initializing a GL context, so start the sandbox early.
229 if (command_line.HasSwitch(switches::kGpuSandboxStartEarly)) { 237 if (command_line.HasSwitch(switches::kGpuSandboxStartEarly)) {
230 gpu_info.sandboxed = StartSandboxLinux( 238 gpu_info.sandboxed = StartSandboxLinux(
(...skipping 300 matching lines...) Expand 10 before | Expand all | Expand 10 after
531 return true; 539 return true;
532 } 540 }
533 541
534 return false; 542 return false;
535 } 543 }
536 #endif // defined(OS_WIN) 544 #endif // defined(OS_WIN)
537 545
538 } // namespace. 546 } // namespace.
539 547
540 } // namespace content 548 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698