Skip to content
This repository was archived by the owner on Jan 23, 2025. It is now read-only.

Commit 22f7318

Browse files
authored
Fix GPU process fallback logic. (869419)
Fix GPU process fallback logic. 1. In GpuProcessHost::OnProcessCrashed() record the process crash first. This means the GPU mode fallback will happen before a new GPU process is started. 2. Don't call FallBackToNextGpuMode() if GPU process initialization fails for an unsandboxed GPU process. The unsandboxed GPU is only used for collect information and it's failure doesn't indicate a need to change GPU modes.
1 parent 0c9da97 commit 22f7318

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

content/browser/gpu/gpu_process_host.cc

+5-2
Original file line numberDiff line numberDiff line change
@@ -1086,6 +1086,9 @@ void GpuProcessHost::OnProcessLaunchFailed(int error_code) {
10861086
}
10871087

10881088
void GpuProcessHost::OnProcessCrashed(int exit_code) {
1089+
// Record crash before doing anything that could start a new GPU process.
1090+
RecordProcessCrash();
1091+
10891092
// If the GPU process crashed while compiling a shader, we may have invalid
10901093
// cached binaries. Completely clear the shader cache to force shader binaries
10911094
// to be re-created.
@@ -1101,7 +1104,6 @@ void GpuProcessHost::OnProcessCrashed(int exit_code) {
11011104
}
11021105
}
11031106
SendOutstandingReplies(EstablishChannelStatus::GPU_HOST_INVALID);
1104-
RecordProcessCrash();
11051107

11061108
ChildProcessTerminationInfo info =
11071109
process_->GetTerminationInfo(true /* known_dead */);
@@ -1139,7 +1141,8 @@ void GpuProcessHost::DidFailInitialize() {
11391141
UMA_HISTOGRAM_BOOLEAN("GPU.GPUProcessInitialized", false);
11401142
status_ = FAILURE;
11411143
GpuDataManagerImpl* gpu_data_manager = GpuDataManagerImpl::GetInstance();
1142-
gpu_data_manager->FallBackToNextGpuMode();
1144+
if (kind_ == GPU_PROCESS_KIND_SANDBOXED)
1145+
gpu_data_manager->FallBackToNextGpuMode();
11431146
RunRequestGPUInfoCallbacks(gpu_data_manager->GetGPUInfo());
11441147
}
11451148

0 commit comments

Comments
 (0)