diff options
Diffstat (limited to 'chrome/renderer')
-rw-r--r-- | chrome/renderer/gpu_channel_host.cc | 1 | ||||
-rw-r--r-- | chrome/renderer/render_thread.cc | 18 |
2 files changed, 14 insertions, 5 deletions
diff --git a/chrome/renderer/gpu_channel_host.cc b/chrome/renderer/gpu_channel_host.cc index 8d2cdd9..3562c0b 100644 --- a/chrome/renderer/gpu_channel_host.cc +++ b/chrome/renderer/gpu_channel_host.cc @@ -44,7 +44,6 @@ void GpuChannelHost::OnChannelError() { // OpenGL as a lost context. for (ProxyMap::iterator iter = proxies_.begin(); iter != proxies_.end(); iter++) { - proxies_.erase(iter->first); router_.RemoveRoute(iter->first); iter->second->OnChannelError(); } diff --git a/chrome/renderer/render_thread.cc b/chrome/renderer/render_thread.cc index aff8fa6..81636c7 100644 --- a/chrome/renderer/render_thread.cc +++ b/chrome/renderer/render_thread.cc @@ -687,8 +687,10 @@ void RenderThread::UpdateActiveExtensions() { void RenderThread::EstablishGpuChannel() { if (gpu_channel_.get()) { - // Do nothing if we are already establishing GPU channel. - if (gpu_channel_->state() == GpuChannelHost::UNCONNECTED) + // Do nothing if we already have a GPU channel or are already + // establishing one. + if (gpu_channel_->state() == GpuChannelHost::UNCONNECTED || + gpu_channel_->state() == GpuChannelHost::CONNECTED) return; // Recreate the channel if it has been lost. @@ -704,8 +706,16 @@ void RenderThread::EstablishGpuChannel() { } GpuChannelHost* RenderThread::EstablishGpuChannelSync() { - EstablishGpuChannel(); - Send(new ViewHostMsg_SynchronizeGpu()); + // We may need to retry the connection establishment if an existing + // connection has gone bad, which will not be detected in + // EstablishGpuChannel since we do not send duplicate + // ViewHostMsg_EstablishGpuChannel messages -- doing so breaks the + // preexisting connection in bad ways. + bool retry = true; + for (int i = 0; i < 2 && retry; ++i) { + EstablishGpuChannel(); + retry = !Send(new ViewHostMsg_SynchronizeGpu()); + } // TODO(kbr): the GPU channel is still in the unconnected state at this point. // Need to figure out whether it is really safe to return it. return gpu_channel_.get(); |