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

Unified Diff: content/common/gpu/gpu_command_buffer_stub.cc

Issue 1282973004: gpu: Crash GPU process when context was lost through robustness (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/common/gpu/gpu_command_buffer_stub.cc
diff --git a/content/common/gpu/gpu_command_buffer_stub.cc b/content/common/gpu/gpu_command_buffer_stub.cc
index 905a15481a4f0baf6fda08d13179fdc173ee5791..f0e04d2343786f0c4e09beb2771dbbbc47e91518 100644
--- a/content/common/gpu/gpu_command_buffer_stub.cc
+++ b/content/common/gpu/gpu_command_buffer_stub.cc
@@ -1114,26 +1114,34 @@ bool GpuCommandBufferStub::CheckContextLost() {
gpu::CommandBuffer::State state = command_buffer_->GetLastState();
bool was_lost = state.error == gpu::error::kLostContext;
- // Work around issues with recovery by allowing a new GPU process to launch.
- if (was_lost &&
- context_group_->feature_info()->workarounds().exit_on_context_lost &&
- !base::CommandLine::ForCurrentProcess()->HasSwitch(
- switches::kSingleProcess) &&
- !base::CommandLine::ForCurrentProcess()->HasSwitch(
- switches::kInProcessGPU)) {
- LOG(ERROR) << "Exiting GPU process because some drivers cannot recover"
- << " from problems.";
+ if (was_lost) {
+ bool was_lost_by_robustness =
+ decoder_ && decoder_->WasContextLostByRobustnessExtension();
+
+ // Work around issues with recovery by allowing a new GPU process to launch.
+ if ((was_lost_by_robustness ||
+ context_group_->feature_info()->workarounds().exit_on_context_lost) &&
+ !base::CommandLine::ForCurrentProcess()->HasSwitch(
+ switches::kSingleProcess) &&
+ !base::CommandLine::ForCurrentProcess()->HasSwitch(
+ switches::kInProcessGPU)) {
+ LOG(ERROR) << "Exiting GPU process because some drivers cannot recover"
+ << " from problems.";
#if defined(OS_WIN)
- base::win::SetShouldCrashOnProcessDetach(false);
+ base::win::SetShouldCrashOnProcessDetach(false);
#endif
- exit(0);
+ exit(0);
+ }
+
+ // Lose all other contexts if the reset was triggered by the robustness
+ // extension instead of being synthetic.
+ if (was_lost_by_robustness &&
+ (gfx::GLContext::LosesAllContextsOnContextLost() ||
+ use_virtualized_gl_context_)) {
+ channel_->LoseAllContexts();
+ }
}
- // Lose all other contexts if the reset was triggered by the robustness
- // extension instead of being synthetic.
- if (was_lost && decoder_ && decoder_->WasContextLostByRobustnessExtension() &&
- (gfx::GLContext::LosesAllContextsOnContextLost() ||
- use_virtualized_gl_context_))
- channel_->LoseAllContexts();
+
CheckCompleteWaits();
return was_lost;
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698