| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef IPC_IPC_SYNC_MESSAGE_FILTER_H_ | 5 #ifndef IPC_IPC_SYNC_MESSAGE_FILTER_H_ |
| 6 #define IPC_IPC_SYNC_MESSAGE_FILTER_H_ | 6 #define IPC_IPC_SYNC_MESSAGE_FILTER_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <set> |
| 10 |
| 9 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
| 10 #include "base/memory/ref_counted.h" | 12 #include "base/memory/ref_counted.h" |
| 11 #include "base/synchronization/lock.h" | 13 #include "base/synchronization/lock.h" |
| 12 #include "ipc/ipc_channel_proxy.h" | 14 #include "ipc/ipc_channel_proxy.h" |
| 13 #include "ipc/ipc_sync_message.h" | 15 #include "ipc/ipc_sync_message.h" |
| 14 #include <set> | |
| 15 | 16 |
| 16 namespace base { | 17 namespace base { |
| 17 class MessageLoopProxy; | 18 class MessageLoopProxy; |
| 18 class WaitableEvent; | 19 class WaitableEvent; |
| 19 } | 20 } |
| 20 | 21 |
| 21 namespace IPC { | 22 namespace IPC { |
| 22 | 23 |
| 23 class MessageReplyDeserializer; | |
| 24 | |
| 25 // This MessageFilter allows sending synchronous IPC messages from a thread | 24 // This MessageFilter allows sending synchronous IPC messages from a thread |
| 26 // other than the listener thread associated with the SyncChannel. It does not | 25 // other than the listener thread associated with the SyncChannel. It does not |
| 27 // support fancy features that SyncChannel does, such as handling recursion or | 26 // support fancy features that SyncChannel does, such as handling recursion or |
| 28 // receiving messages while waiting for a response. Note that this object can | 27 // receiving messages while waiting for a response. Note that this object can |
| 29 // be used to send simultaneous synchronous messages from different threads. | 28 // be used to send simultaneous synchronous messages from different threads. |
| 30 class IPC_EXPORT SyncMessageFilter : public ChannelProxy::MessageFilter, | 29 class IPC_EXPORT SyncMessageFilter : public ChannelProxy::MessageFilter, |
| 31 public Message::Sender { | 30 public Message::Sender { |
| 32 public: | 31 public: |
| 33 explicit SyncMessageFilter(base::WaitableEvent* shutdown_event); | 32 explicit SyncMessageFilter(base::WaitableEvent* shutdown_event); |
| 34 virtual ~SyncMessageFilter(); | 33 virtual ~SyncMessageFilter(); |
| (...skipping 28 matching lines...) Expand all Loading... |
| 63 base::Lock lock_; | 62 base::Lock lock_; |
| 64 | 63 |
| 65 base::WaitableEvent* shutdown_event_; | 64 base::WaitableEvent* shutdown_event_; |
| 66 | 65 |
| 67 DISALLOW_COPY_AND_ASSIGN(SyncMessageFilter); | 66 DISALLOW_COPY_AND_ASSIGN(SyncMessageFilter); |
| 68 }; | 67 }; |
| 69 | 68 |
| 70 } // namespace IPC | 69 } // namespace IPC |
| 71 | 70 |
| 72 #endif // IPC_IPC_SYNC_MESSAGE_FILTER_H_ | 71 #endif // IPC_IPC_SYNC_MESSAGE_FILTER_H_ |
| OLD | NEW |