Commit 7a05931c authored by jbauman's avatar jbauman Committed by Commit bot

Cause GPU process to exit upon lost context in more circumstances.

The code to exit was only being hit in some codepaths, but it should be run for every possible way that it could receive a lost context.

BUG=424301

Review URL: https://codereview.chromium.org/657003002

Cr-Commit-Position: refs/heads/master@{#299954}
parent 86e95b3c
......@@ -1571,6 +1571,7 @@ class GLES2DecoderImpl : public GLES2Decoder,
error::Error* error, GLint* real_location, GLuint* service_id,
void** result, GLenum* result_type);
void MaybeExitOnContextLost();
virtual bool WasContextLost() override;
virtual bool WasContextLostByRobustnessExtension() override;
virtual void LoseContext(uint32 reset_status) override;
......@@ -3051,16 +3052,7 @@ bool GLES2DecoderImpl::MakeCurrent() {
if (!context_->MakeCurrent(surface_.get()) || WasContextLost()) {
LOG(ERROR) << " GLES2DecoderImpl: Context lost during MakeCurrent.";
// Some D3D drivers cannot recover from device lost in the GPU process
// sandbox. Allow a new GPU process to launch.
if (workarounds().exit_on_context_lost) {
LOG(ERROR) << "Exiting GPU process because some drivers cannot reset"
<< " a D3D device in the Chrome GPU process sandbox.";
#if defined(OS_WIN)
base::win::SetShouldCrashOnProcessDetach(false);
#endif
exit(0);
}
MaybeExitOnContextLost();
return false;
}
......@@ -9660,8 +9652,22 @@ error::ContextLostReason GLES2DecoderImpl::GetContextLostReason() {
return error::kUnknown;
}
void GLES2DecoderImpl::MaybeExitOnContextLost() {
// Some D3D drivers cannot recover from device lost in the GPU process
// sandbox. Allow a new GPU process to launch.
if (workarounds().exit_on_context_lost) {
LOG(ERROR) << "Exiting GPU process because some drivers cannot reset"
<< " a D3D device in the Chrome GPU process sandbox.";
#if defined(OS_WIN)
base::win::SetShouldCrashOnProcessDetach(false);
#endif
exit(0);
}
}
bool GLES2DecoderImpl::WasContextLost() {
if (reset_status_ != GL_NO_ERROR) {
MaybeExitOnContextLost();
return true;
}
if (context_->WasAllocatedUsingRobustnessExtension()) {
......@@ -9675,6 +9681,7 @@ bool GLES2DecoderImpl::WasContextLost() {
LOG(ERROR) << (surface_->IsOffscreen() ? "Offscreen" : "Onscreen")
<< " context lost via ARB/EXT_robustness. Reset status = "
<< GLES2Util::GetStringEnum(status);
MaybeExitOnContextLost();
return true;
}
}
......
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