OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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_SENDER_H__ |
6 #define IPC_IPC_SYNC_SENDER_H__ | 6 #define IPC_IPC_SYNC_SENDER_H__ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <deque> | 9 #include <deque> |
10 | 10 |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
85 // synchronous send. If it is, the thread is unblocked and true is | 85 // synchronous send. If it is, the thread is unblocked and true is |
86 // returned. Otherwise the function returns false. | 86 // returned. Otherwise the function returns false. |
87 bool TryToUnblockListener(const Message* msg); | 87 bool TryToUnblockListener(const Message* msg); |
88 | 88 |
89 // Called on the IPC thread when a sync send that runs a nested message loop | 89 // Called on the IPC thread when a sync send that runs a nested message loop |
90 // times out. | 90 // times out. |
91 void OnSendTimeout(int message_id); | 91 void OnSendTimeout(int message_id); |
92 | 92 |
93 base::WaitableEvent* shutdown_event() { return shutdown_event_; } | 93 base::WaitableEvent* shutdown_event() { return shutdown_event_; } |
94 | 94 |
| 95 ReceivedSyncMsgQueue* received_sync_msgs() { |
| 96 return received_sync_msgs_; |
| 97 } |
| 98 |
95 private: | 99 private: |
96 // IPC::ChannelProxy methods that we override. | 100 // IPC::ChannelProxy methods that we override. |
97 | 101 |
98 // Called on the listener thread. | 102 // Called on the listener thread. |
99 virtual void Clear(); | 103 virtual void Clear(); |
100 | 104 |
101 // Called on the IPC thread. | 105 // Called on the IPC thread. |
102 virtual void OnMessageReceived(const Message& msg); | 106 virtual void OnMessageReceived(const Message& msg); |
103 virtual void OnChannelError(); | 107 virtual void OnChannelError(); |
104 virtual void OnChannelOpened(); | 108 virtual void OnChannelOpened(); |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
144 // latter one also runs a nested message loop in the meantime. | 148 // latter one also runs a nested message loop in the meantime. |
145 void WaitForReply(base::WaitableEvent* pump_messages_event); | 149 void WaitForReply(base::WaitableEvent* pump_messages_event); |
146 | 150 |
147 // Runs a nested message loop until a reply arrives, times out, or the process | 151 // Runs a nested message loop until a reply arrives, times out, or the process |
148 // shuts down. | 152 // shuts down. |
149 void WaitForReplyWithNestedMessageLoop(); | 153 void WaitForReplyWithNestedMessageLoop(); |
150 | 154 |
151 bool sync_messages_with_no_timeout_allowed_; | 155 bool sync_messages_with_no_timeout_allowed_; |
152 | 156 |
153 // Used to signal events between the IPC and listener threads. | 157 // Used to signal events between the IPC and listener threads. |
154 base::WaitableEventWatcher send_done_watcher_; | |
155 base::WaitableEventWatcher dispatch_watcher_; | 158 base::WaitableEventWatcher dispatch_watcher_; |
156 | 159 |
157 DISALLOW_EVIL_CONSTRUCTORS(SyncChannel); | 160 DISALLOW_EVIL_CONSTRUCTORS(SyncChannel); |
158 }; | 161 }; |
159 | 162 |
160 } // namespace IPC | 163 } // namespace IPC |
161 | 164 |
162 #endif // IPC_IPC_SYNC_SENDER_H__ | 165 #endif // IPC_IPC_SYNC_SENDER_H__ |
OLD | NEW |