diff options
Diffstat (limited to 'ipc')
-rw-r--r-- | ipc/ipc_sync_message_filter.cc | 15 | ||||
-rw-r--r-- | ipc/ipc_sync_message_filter.h | 10 |
2 files changed, 14 insertions, 11 deletions
diff --git a/ipc/ipc_sync_message_filter.cc b/ipc/ipc_sync_message_filter.cc index cffbaa6..c7a184c 100644 --- a/ipc/ipc_sync_message_filter.cc +++ b/ipc/ipc_sync_message_filter.cc @@ -1,20 +1,21 @@ -// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "ipc/ipc_sync_message_filter.h" #include "base/logging.h" -#include "base/message_loop.h" +#include "base/message_loop_proxy.h" #include "base/synchronization/waitable_event.h" #include "ipc/ipc_sync_message.h" +using base::MessageLoopProxy; + namespace IPC { SyncMessageFilter::SyncMessageFilter(base::WaitableEvent* shutdown_event) : channel_(NULL), - listener_loop_(MessageLoop::current()), - io_loop_(NULL), + listener_loop_(MessageLoopProxy::current()), shutdown_event_(shutdown_event) { } @@ -47,8 +48,8 @@ bool SyncMessageFilter::Send(Message* message) { base::AutoLock auto_lock(lock_); // Can't use this class on the main thread or else it can lead to deadlocks. // Also by definition, can't use this on IO thread since we're blocking it. - DCHECK(MessageLoop::current() != listener_loop_); - DCHECK(MessageLoop::current() != io_loop_); + DCHECK(MessageLoopProxy::current() != listener_loop_); + DCHECK(MessageLoopProxy::current() != io_loop_); pending_sync_messages_.insert(&pending_message); } @@ -94,7 +95,7 @@ void SyncMessageFilter::SignalAllEvents() { void SyncMessageFilter::OnFilterAdded(Channel* channel) { channel_ = channel; base::AutoLock auto_lock(lock_); - io_loop_ = MessageLoop::current(); + io_loop_ = MessageLoopProxy::current(); } void SyncMessageFilter::OnChannelError() { diff --git a/ipc/ipc_sync_message_filter.h b/ipc/ipc_sync_message_filter.h index 0dc471a..cdaef85 100644 --- a/ipc/ipc_sync_message_filter.h +++ b/ipc/ipc_sync_message_filter.h @@ -14,11 +14,10 @@ #include <set> namespace base { +class MessageLoopProxy; class WaitableEvent; } -class MessageLoop; - namespace IPC { class MessageReplyDeserializer; @@ -51,8 +50,11 @@ class IPC_EXPORT SyncMessageFilter : public ChannelProxy::MessageFilter, // The channel to which this filter was added. Channel* channel_; - MessageLoop* listener_loop_; // The process's main thread. - MessageLoop* io_loop_; // The message loop where the Channel lives. + // The process's main thread. + scoped_refptr<base::MessageLoopProxy> listener_loop_; + + // The message loop where the Channel lives. + scoped_refptr<base::MessageLoopProxy> io_loop_; typedef std::set<PendingSyncMsg*> PendingSyncMessages; PendingSyncMessages pending_sync_messages_; |