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

Unified Diff: content/common/gpu/client/gpu_channel_host.cc

Issue 10837104: Fix channel lost race in GpuChannelHost (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 8 years, 4 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_));
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698