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_SENDER_H__ | 5 #ifndef IPC_IPC_SYNC_CHANNEL_H_ |
6 #define IPC_IPC_SYNC_SENDER_H__ | 6 #define IPC_IPC_SYNC_CHANNEL_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 #include <deque> | 10 #include <deque> |
11 | 11 |
12 #include "base/basictypes.h" | 12 #include "base/basictypes.h" |
13 #include "base/memory/ref_counted.h" | 13 #include "base/memory/ref_counted.h" |
14 #include "base/synchronization/lock.h" | 14 #include "base/synchronization/lock.h" |
15 #include "base/synchronization/waitable_event_watcher.h" | 15 #include "base/synchronization/waitable_event_watcher.h" |
16 #include "ipc/ipc_channel_handle.h" | 16 #include "ipc/ipc_channel_handle.h" |
17 #include "ipc/ipc_channel_proxy.h" | 17 #include "ipc/ipc_channel_proxy.h" |
18 #include "ipc/ipc_sync_message.h" | 18 #include "ipc/ipc_sync_message.h" |
19 | 19 |
20 namespace base { | 20 namespace base { |
21 class WaitableEvent; | 21 class WaitableEvent; |
22 }; | 22 }; |
23 | 23 |
24 namespace IPC { | 24 namespace IPC { |
25 | 25 |
26 class SyncMessage; | 26 class SyncMessage; |
27 class MessageReplyDeserializer; | |
28 | 27 |
29 // This is similar to ChannelProxy, with the added feature of supporting sending | 28 // This is similar to ChannelProxy, with the added feature of supporting sending |
30 // synchronous messages. | 29 // synchronous messages. |
31 // | 30 // |
32 // Overview of how the sync channel works | 31 // Overview of how the sync channel works |
33 // -------------------------------------- | 32 // -------------------------------------- |
34 // When the sending thread sends a synchronous message, we create a bunch | 33 // When the sending thread sends a synchronous message, we create a bunch |
35 // of tracking info (created in SendWithTimeout, stored in the PendingSyncMsg | 34 // of tracking info (created in SendWithTimeout, stored in the PendingSyncMsg |
36 // structure) associated with the message that we identify by the unique | 35 // structure) associated with the message that we identify by the unique |
37 // "MessageId" on the SyncMessage. Among the things we save is the | 36 // "MessageId" on the SyncMessage. Among the things we save is the |
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
190 bool sync_messages_with_no_timeout_allowed_; | 189 bool sync_messages_with_no_timeout_allowed_; |
191 | 190 |
192 // Used to signal events between the IPC and listener threads. | 191 // Used to signal events between the IPC and listener threads. |
193 base::WaitableEventWatcher dispatch_watcher_; | 192 base::WaitableEventWatcher dispatch_watcher_; |
194 | 193 |
195 DISALLOW_COPY_AND_ASSIGN(SyncChannel); | 194 DISALLOW_COPY_AND_ASSIGN(SyncChannel); |
196 }; | 195 }; |
197 | 196 |
198 } // namespace IPC | 197 } // namespace IPC |
199 | 198 |
200 #endif // IPC_IPC_SYNC_SENDER_H__ | 199 #endif // IPC_IPC_SYNC_CHANNEL_H_ |
OLD | NEW |