Index: content/common/gpu/client/gpu_channel_host.cc |
diff --git a/content/common/gpu/client/gpu_channel_host.cc b/content/common/gpu/client/gpu_channel_host.cc |
index cd5683f07893cb5630f3b4656b299c9e4f9b58eb..b225a3ad11c110e2d8b3183d837edb291b425db7 100644 |
--- a/content/common/gpu/client/gpu_channel_host.cc |
+++ b/content/common/gpu/client/gpu_channel_host.cc |
@@ -286,6 +286,13 @@ bool GpuChannelHost::MessageFilter::OnMessageReceived( |
void GpuChannelHost::MessageFilter::OnChannelError() { |
DCHECK(parent_->factory_->IsIOThread()); |
+ |
+ // Post the task to signal the GpuChannelHost before the proxies. That way, if |
+ // they themselves post a task to recreate the context, they will not try to |
+ // re-use this channel host before it has a chance to mark itself lost. |
+ MessageLoop* main_loop = parent_->factory_->GetMainLoop(); |
+ main_loop->PostTask(FROM_HERE, |
+ base::Bind(&GpuChannelHost::OnChannelError, parent_)); |
// Inform all the proxies that an error has occurred. This will be reported |
// via OpenGL as a lost context. |
for (ListenerMap::iterator it = listeners_.begin(); |
@@ -298,10 +305,6 @@ void GpuChannelHost::MessageFilter::OnChannelError() { |
} |
listeners_.clear(); |
- |
- MessageLoop* main_loop = parent_->factory_->GetMainLoop(); |
- main_loop->PostTask(FROM_HERE, |
- base::Bind(&GpuChannelHost::OnChannelError, parent_)); |
} |