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

Unified Diff: chrome/renderer/render_thread.cc

Issue 1546001: Split GpuProcessHost into GpuProcessHostUIShim, which runs on the UI... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 years, 9 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 | « chrome/renderer/gpu_channel_host.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/renderer/render_thread.cc
===================================================================
--- chrome/renderer/render_thread.cc (revision 43024)
+++ chrome/renderer/render_thread.cc (working copy)
@@ -687,8 +687,10 @@
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 @@
}
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();
« no previous file with comments | « chrome/renderer/gpu_channel_host.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698