Gpu process restart fix.

If the gpu process dies, CommandBufferProxy might be the first one to find out about it.  When the context is being created, GpuChannelHost still thinks there is no error.  It will send CreateViewCommandBuffer message to establish a communication channel, which will fail, and GPU process will not restart.  To prevent that, we set GpuChannelHost state to lost as soon as CommandBufferProxy finds out about it.

BUG=58785
TEST=open a composited tab, in another tab go to about:gpucrash

Review URL: http://codereview.chromium.org/6384003

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@72023 0039d316-1c4b-4281-b951-d872f2087c98
parent 22f3dbdc
......@@ -412,7 +412,12 @@ void Context::SetError(Error error) {
bool Context::IsCommandBufferContextLost() {
gpu::CommandBuffer::State state = command_buffer_->GetLastState();
return state.error == gpu::error::kLostContext;
if (state.error == gpu::error::kLostContext) {
// Tell the host that the connection was lost right away.
channel_->SetStateLost();
return true;
}
return false;
}
// TODO(gman): Remove This
......
......@@ -37,6 +37,10 @@ const GPUInfo& GpuChannelHost::gpu_info() const {
return gpu_info_;
}
void GpuChannelHost::SetStateLost() {
state_ = kLost;
}
bool GpuChannelHost::OnMessageReceived(const IPC::Message& message) {
DCHECK(message.routing_id() != MSG_ROUTING_CONTROL);
......
......@@ -48,6 +48,9 @@ class GpuChannelHost : public IPC::Channel::Listener,
State state() const { return state_; }
// Change state to kLost.
void SetStateLost();
// The GPU stats reported by the GPU process.
void set_gpu_info(const GPUInfo& gpu_info);
const GPUInfo& gpu_info() const;
......
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