summaryrefslogtreecommitdiffstats
path: root/chrome/renderer
diff options
context:
space:
mode:
authoramarinichev@google.com <amarinichev@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2011-01-20 22:41:31 +0000
committeramarinichev@google.com <amarinichev@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2011-01-20 22:41:31 +0000
commit3ce4a91c9c58cf68e8c0c486c99a9da105a1d3a7 (patch)
tree08d612d83b63898622e4a8d21bb786d97a04d87b /chrome/renderer
parent22f3dbdc56ad0f821b146d8bfe8eb90d33c9ddd5 (diff)
downloadchromium_src-3ce4a91c9c58cf68e8c0c486c99a9da105a1d3a7.zip
chromium_src-3ce4a91c9c58cf68e8c0c486c99a9da105a1d3a7.tar.gz
chromium_src-3ce4a91c9c58cf68e8c0c486c99a9da105a1d3a7.tar.bz2
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
Diffstat (limited to 'chrome/renderer')
-rw-r--r--chrome/renderer/ggl/ggl.cc7
-rw-r--r--chrome/renderer/gpu_channel_host.cc4
-rw-r--r--chrome/renderer/gpu_channel_host.h3
3 files changed, 13 insertions, 1 deletions
diff --git a/chrome/renderer/ggl/ggl.cc b/chrome/renderer/ggl/ggl.cc
index c95bbb5..8dea509 100644
--- a/chrome/renderer/ggl/ggl.cc
+++ b/chrome/renderer/ggl/ggl.cc
@@ -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
diff --git a/chrome/renderer/gpu_channel_host.cc b/chrome/renderer/gpu_channel_host.cc
index ecf7bfc..719e8bf 100644
--- a/chrome/renderer/gpu_channel_host.cc
+++ b/chrome/renderer/gpu_channel_host.cc
@@ -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);
diff --git a/chrome/renderer/gpu_channel_host.h b/chrome/renderer/gpu_channel_host.h
index 42eebba..8f14841 100644
--- a/chrome/renderer/gpu_channel_host.h
+++ b/chrome/renderer/gpu_channel_host.h
@@ -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;