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

Unified Diff: content/renderer/gpu/gpu_channel_host.cc

Issue 7835010: Fix thread-checker debug code in GpuChannelHost::MessageFilter. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: add include Created 9 years, 3 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 | « content/renderer/gpu/gpu_channel_host.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/gpu/gpu_channel_host.cc
diff --git a/content/renderer/gpu/gpu_channel_host.cc b/content/renderer/gpu/gpu_channel_host.cc
index 343f777b50b16f1098391f3261b434861041c993..d822316661b43b8ca95d73e93bdceba4275f62b9 100644
--- a/content/renderer/gpu/gpu_channel_host.cc
+++ b/content/renderer/gpu/gpu_channel_host.cc
@@ -4,6 +4,7 @@
#include "content/renderer/gpu/gpu_channel_host.h"
+#include "base/message_loop.h"
#include "base/message_loop_proxy.h"
#include "content/common/child_process.h"
#include "content/common/gpu/gpu_messages.h"
@@ -41,7 +42,6 @@ void GpuChannelHost::Listener::DispatchError() {
GpuChannelHost::MessageFilter::MessageFilter(GpuChannelHost* parent)
: parent_(parent) {
- DetachFromThread();
}
GpuChannelHost::MessageFilter::~MessageFilter() {
@@ -52,13 +52,13 @@ void GpuChannelHost::MessageFilter::AddRoute(
int route_id,
base::WeakPtr<IPC::Channel::Listener> listener,
scoped_refptr<MessageLoopProxy> loop) {
- DCHECK(CalledOnValidThread());
+ DCHECK(MessageLoop::current() == ChildProcess::current()->io_message_loop());
DCHECK(listeners_.find(route_id) == listeners_.end());
listeners_[route_id] = new GpuChannelHost::Listener(listener, loop);
}
void GpuChannelHost::MessageFilter::RemoveRoute(int route_id) {
- DCHECK(CalledOnValidThread());
+ DCHECK(MessageLoop::current() == ChildProcess::current()->io_message_loop());
ListenerMap::iterator it = listeners_.find(route_id);
if (it != listeners_.end())
listeners_.erase(it);
@@ -66,8 +66,7 @@ void GpuChannelHost::MessageFilter::RemoveRoute(int route_id) {
bool GpuChannelHost::MessageFilter::OnMessageReceived(
const IPC::Message& message) {
- DCHECK(CalledOnValidThread());
-
+ DCHECK(MessageLoop::current() == ChildProcess::current()->io_message_loop());
// Never handle sync message replies or we will deadlock here.
if (message.is_reply())
return false;
@@ -90,8 +89,7 @@ bool GpuChannelHost::MessageFilter::OnMessageReceived(
}
void GpuChannelHost::MessageFilter::OnChannelError() {
- DCHECK(CalledOnValidThread());
-
+ DCHECK(MessageLoop::current() == ChildProcess::current()->io_message_loop());
// 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();
« no previous file with comments | « content/renderer/gpu/gpu_channel_host.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698