Commit 960c955a authored by Maggie Chen's avatar Maggie Chen Committed by Commit Bot

No DX Diag and DX12/Vulkan Info collection if --disable-gpu is in the command line

The unsandboxed GPU process to run DX Diagnostics and to collect DX12/Vulkan info should
not be launched if "--disable-gpu" is added to the command line switch.

Bug: 916338
Change-Id: Ib2551902f81e011e746436076b3d10c5848f5b37
Reviewed-on: https://chromium-review.googlesource.com/c/1394990
Commit-Queue: Maggie Chen <magchen@chromium.org>
Reviewed-by: default avatarAntoine Labour <piman@chromium.org>
Reviewed-by: default avatarZhenyao Mo <zmo@chromium.org>
Cr-Commit-Position: refs/heads/master@{#619860}
parent a69701fa
...@@ -292,7 +292,6 @@ GpuDataManagerImplPrivate::GpuDataManagerImplPrivate(GpuDataManagerImpl* owner) ...@@ -292,7 +292,6 @@ GpuDataManagerImplPrivate::GpuDataManagerImplPrivate(GpuDataManagerImpl* owner)
if (command_line->HasSwitch(switches::kSingleProcess) || if (command_line->HasSwitch(switches::kSingleProcess) ||
command_line->HasSwitch(switches::kInProcessGPU)) { command_line->HasSwitch(switches::kInProcessGPU)) {
in_process_gpu_ = true;
AppendGpuCommandLine(command_line); AppendGpuCommandLine(command_line);
} }
...@@ -388,10 +387,6 @@ void GpuDataManagerImplPrivate::RequestCompleteGpuInfoIfNeeded() { ...@@ -388,10 +387,6 @@ void GpuDataManagerImplPrivate::RequestCompleteGpuInfoIfNeeded() {
return; return;
#if defined(OS_WIN) #if defined(OS_WIN)
if (!GpuAccessAllowed(nullptr))
return;
if (in_process_gpu_)
return;
complete_gpu_info_already_requested_ = true; complete_gpu_info_already_requested_ = true;
GpuProcessHost::CallOnIO(GpuProcessHost::GPU_PROCESS_KIND_UNSANDBOXED_NO_GL, GpuProcessHost::CallOnIO(GpuProcessHost::GPU_PROCESS_KIND_UNSANDBOXED_NO_GL,
true /* force_create */, true /* force_create */,
...@@ -410,8 +405,6 @@ void GpuDataManagerImplPrivate::RequestCompleteGpuInfoIfNeeded() { ...@@ -410,8 +405,6 @@ void GpuDataManagerImplPrivate::RequestCompleteGpuInfoIfNeeded() {
void GpuDataManagerImplPrivate::RequestGpuSupportedRuntimeVersion() { void GpuDataManagerImplPrivate::RequestGpuSupportedRuntimeVersion() {
#if defined(OS_WIN) #if defined(OS_WIN)
if (in_process_gpu_)
return;
base::OnceClosure task = base::BindOnce([]() { base::OnceClosure task = base::BindOnce([]() {
GpuProcessHost* host = GpuProcessHost* host =
GpuProcessHost::Get(GpuProcessHost::GPU_PROCESS_KIND_UNSANDBOXED_NO_GL, GpuProcessHost::Get(GpuProcessHost::GPU_PROCESS_KIND_UNSANDBOXED_NO_GL,
......
...@@ -211,9 +211,6 @@ class CONTENT_EXPORT GpuDataManagerImplPrivate { ...@@ -211,9 +211,6 @@ class CONTENT_EXPORT GpuDataManagerImplPrivate {
bool application_is_visible_ = true; bool application_is_visible_ = true;
// True if --single-process or --in-process-gpu is passed in.
bool in_process_gpu_ = false;
DISALLOW_COPY_AND_ASSIGN(GpuDataManagerImplPrivate); DISALLOW_COPY_AND_ASSIGN(GpuDataManagerImplPrivate);
}; };
......
...@@ -529,6 +529,15 @@ GpuProcessHost* GpuProcessHost::Get(GpuProcessKind kind, bool force_create) { ...@@ -529,6 +529,15 @@ GpuProcessHost* GpuProcessHost::Get(GpuProcessKind kind, bool force_create) {
return nullptr; return nullptr;
} }
// Do not launch the unsandboxed GPU process if GPU is disabled
if (kind == GPU_PROCESS_KIND_UNSANDBOXED_NO_GL) {
auto* command_line = base::CommandLine::ForCurrentProcess();
if (command_line->HasSwitch(switches::kDisableGpu) ||
command_line->HasSwitch(switches::kSingleProcess) ||
command_line->HasSwitch(switches::kInProcessGPU))
return nullptr;
}
if (g_gpu_process_hosts[kind] && ValidateHost(g_gpu_process_hosts[kind])) if (g_gpu_process_hosts[kind] && ValidateHost(g_gpu_process_hosts[kind]))
return g_gpu_process_hosts[kind]; return g_gpu_process_hosts[kind];
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment