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

Unified Diff: content/gpu/gpu_child_thread.cc

Issue 11451021: Only launch a second un-sandboxed gpu process on Windows. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 8 years 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/browser/gpu/gpu_data_manager_impl.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/gpu/gpu_child_thread.cc
===================================================================
--- content/gpu/gpu_child_thread.cc (revision 171329)
+++ content/gpu/gpu_child_thread.cc (working copy)
@@ -160,35 +160,40 @@
}
void GpuChildThread::OnCollectGraphicsInfo() {
+#if defined(OS_WIN)
+ // GPU full info collection should only happen on un-sandboxed GPU process
+ // or single process/in-process gpu mode on Windows.
CommandLine* command_line = CommandLine::ForCurrentProcess();
- if (command_line->HasSwitch(switches::kDisableGpuSandbox) ||
- command_line->ForCurrentProcess()->HasSwitch(switches::kSingleProcess) ||
- command_line->ForCurrentProcess()->HasSwitch(switches::kInProcessGPU)) {
- // GPU full info collection should only happen on un-sandboxed GPU process
- // or single process/in-process gpu mode.
+ DCHECK(command_line->HasSwitch(switches::kDisableGpuSandbox) ||
+ command_line->HasSwitch(switches::kSingleProcess) ||
+ command_line->HasSwitch(switches::kInProcessGPU));
+#endif // OS_WIN
- if (!gpu_info_collector::CollectGraphicsInfo(&gpu_info_))
- VLOG(1) << "gpu_info_collector::CollectGraphicsInfo failed";
- GetContentClient()->SetGpuInfo(gpu_info_);
+ // Sandbox state is not part of the gpu info collection. It is determined
+ // in GpuMain() and passed down to GpuChildThread.
+ bool sandboxed = gpu_info_.sandboxed;
+ if (!gpu_info_collector::CollectGraphicsInfo(&gpu_info_))
+ VLOG(1) << "gpu_info_collector::CollectGraphicsInfo failed";
+ gpu_info_.sandboxed = sandboxed;
apatrick_chromium 2012/12/05 23:31:08 Do any of the implementations of CollectGraphicsIn
Zhenyao Mo 2012/12/05 23:34:11 CollectGraphicsInfo always reset GPUInfo, so sandb
+ GetContentClient()->SetGpuInfo(gpu_info_);
#if defined(OS_WIN)
- if (!collecting_dx_diagnostics_) {
- // Prevent concurrent collection of DirectX diagnostics.
- collecting_dx_diagnostics_ = true;
+ if (!collecting_dx_diagnostics_) {
+ // Prevent concurrent collection of DirectX diagnostics.
+ collecting_dx_diagnostics_ = true;
- // Asynchronously collect the DirectX diagnostics because this can take a
- // couple of seconds.
- if (!base::WorkerPool::PostTask(
- FROM_HERE, base::Bind(&GpuChildThread::CollectDxDiagnostics, this),
- true)) {
- // Flag GPU info as complete if the DirectX diagnostics cannot be
- // collected.
- collecting_dx_diagnostics_ = false;
- gpu_info_.finalized = true;
- }
+ // Asynchronously collect the DirectX diagnostics because this can take a
+ // couple of seconds.
+ if (!base::WorkerPool::PostTask(
+ FROM_HERE, base::Bind(&GpuChildThread::CollectDxDiagnostics, this),
+ true)) {
+ // Flag GPU info as complete if the DirectX diagnostics cannot be
+ // collected.
+ collecting_dx_diagnostics_ = false;
+ gpu_info_.finalized = true;
}
-#endif
}
+#endif // OS_WIN
Send(new GpuHostMsg_GraphicsInfoCollected(gpu_info_));
}
« no previous file with comments | « content/browser/gpu/gpu_data_manager_impl.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698