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

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

Issue 1939683002: Test X11 header pollution (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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
« no previous file with comments | « content/gpu/gpu_child_thread.cc ('k') | content/public/gpu/BUILD.gn » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 <stddef.h> 5 #include <stddef.h>
6 #include <stdlib.h> 6 #include <stdlib.h>
7 7
8 #include <memory> 8 #include <memory>
9 #include <utility> 9 #include <utility>
10 10
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
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" // nogncheck 64 #include "ui/base/x/x11_util.h" // nogncheck
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
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 212 matching lines...) Expand 10 before | Expand all | Expand 10 after
472 472
473 bool WarmUpSandbox(const base::CommandLine& command_line) { 473 bool WarmUpSandbox(const base::CommandLine& command_line) {
474 { 474 {
475 TRACE_EVENT0("gpu", "Warm up rand"); 475 TRACE_EVENT0("gpu", "Warm up rand");
476 // Warm up the random subsystem, which needs to be done pre-sandbox on all 476 // Warm up the random subsystem, which needs to be done pre-sandbox on all
477 // platforms. 477 // platforms.
478 (void) base::RandUint64(); 478 (void) base::RandUint64();
479 } 479 }
480 480
481 #if defined(OS_WIN) 481 #if defined(OS_WIN)
482 content::DXVAVideoDecodeAccelerator::PreSandboxInitialization(); 482 media::DXVAVideoDecodeAccelerator::PreSandboxInitialization();
483 #endif 483 #endif
484 return true; 484 return true;
485 } 485 }
486 486
487 #if !defined(OS_MACOSX) 487 #if !defined(OS_MACOSX)
488 bool CollectGraphicsInfo(gpu::GPUInfo& gpu_info) { 488 bool CollectGraphicsInfo(gpu::GPUInfo& gpu_info) {
489 TRACE_EVENT0("gpu,startup", "Collect Graphics Info"); 489 TRACE_EVENT0("gpu,startup", "Collect Graphics Info");
490 490
491 bool res = true; 491 bool res = true;
492 gpu::CollectInfoResult result = gpu::CollectContextGraphicsInfo(&gpu_info); 492 gpu::CollectInfoResult result = gpu::CollectContextGraphicsInfo(&gpu_info);
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
610 return true; 610 return true;
611 } 611 }
612 612
613 return false; 613 return false;
614 } 614 }
615 #endif // defined(OS_WIN) 615 #endif // defined(OS_WIN)
616 616
617 } // namespace. 617 } // namespace.
618 618
619 } // namespace content 619 } // namespace content
OLDNEW
« no previous file with comments | « content/gpu/gpu_child_thread.cc ('k') | content/public/gpu/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698