| 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 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 138 private: | 138 private: |
| 139 // WaitableEventWatcher::Delegate implementation. | 139 // WaitableEventWatcher::Delegate implementation. |
| 140 virtual void OnWaitableEventSignaled(base::WaitableEvent* arg); | 140 virtual void OnWaitableEventSignaled(base::WaitableEvent* arg); |
| 141 | 141 |
| 142 SyncContext* sync_context() { | 142 SyncContext* sync_context() { |
| 143 return reinterpret_cast<SyncContext*>(context()); | 143 return reinterpret_cast<SyncContext*>(context()); |
| 144 } | 144 } |
| 145 | 145 |
| 146 // Both these functions wait for a reply, timeout or process shutdown. The | 146 // Both these functions wait for a reply, timeout or process shutdown. The |
| 147 // latter one also runs a nested message loop in the meantime. | 147 // latter one also runs a nested message loop in the meantime. |
| 148 void WaitForReply(base::WaitableEvent* pump_messages_event); | 148 static void WaitForReply( |
| 149 SyncContext* context, base::WaitableEvent* pump_messages_event); |
| 149 | 150 |
| 150 // 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 |
| 151 // shuts down. | 152 // shuts down. |
| 152 void WaitForReplyWithNestedMessageLoop(); | 153 static void WaitForReplyWithNestedMessageLoop(SyncContext* context); |
| 153 | 154 |
| 154 bool sync_messages_with_no_timeout_allowed_; | 155 bool sync_messages_with_no_timeout_allowed_; |
| 155 | 156 |
| 156 // Used to signal events between the IPC and listener threads. | 157 // Used to signal events between the IPC and listener threads. |
| 157 base::WaitableEventWatcher dispatch_watcher_; | 158 base::WaitableEventWatcher dispatch_watcher_; |
| 158 | 159 |
| 159 DISALLOW_EVIL_CONSTRUCTORS(SyncChannel); | 160 DISALLOW_EVIL_CONSTRUCTORS(SyncChannel); |
| 160 }; | 161 }; |
| 161 | 162 |
| 162 } // namespace IPC | 163 } // namespace IPC |
| 163 | 164 |
| 164 #endif // IPC_IPC_SYNC_SENDER_H__ | 165 #endif // IPC_IPC_SYNC_SENDER_H__ |
| OLD | NEW |