OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_CHANNEL_H_ | 5 #ifndef IPC_IPC_SYNC_CHANNEL_H_ |
6 #define IPC_IPC_SYNC_CHANNEL_H_ | 6 #define IPC_IPC_SYNC_CHANNEL_H_ |
7 | 7 |
| 8 #include <deque> |
8 #include <string> | 9 #include <string> |
9 #include <deque> | 10 #include <vector> |
10 | 11 |
11 #include "base/basictypes.h" | 12 #include "base/basictypes.h" |
12 #include "base/memory/ref_counted.h" | 13 #include "base/memory/ref_counted.h" |
13 #include "base/synchronization/lock.h" | 14 #include "base/synchronization/lock.h" |
14 #include "base/synchronization/waitable_event_watcher.h" | 15 #include "base/synchronization/waitable_event_watcher.h" |
15 #include "ipc/ipc_channel_handle.h" | 16 #include "ipc/ipc_channel_handle.h" |
16 #include "ipc/ipc_channel_proxy.h" | 17 #include "ipc/ipc_channel_proxy.h" |
17 #include "ipc/ipc_sync_message.h" | 18 #include "ipc/ipc_sync_message.h" |
18 #include "ipc/ipc_sync_message_filter.h" | 19 #include "ipc/ipc_sync_message_filter.h" |
19 | 20 |
(...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
226 static void WaitForReply( | 227 static void WaitForReply( |
227 SyncContext* context, base::WaitableEvent* pump_messages_event); | 228 SyncContext* context, base::WaitableEvent* pump_messages_event); |
228 | 229 |
229 // Runs a nested message loop until a reply arrives, times out, or the process | 230 // Runs a nested message loop until a reply arrives, times out, or the process |
230 // shuts down. | 231 // shuts down. |
231 static void WaitForReplyWithNestedMessageLoop(SyncContext* context); | 232 static void WaitForReplyWithNestedMessageLoop(SyncContext* context); |
232 | 233 |
233 // Starts the dispatch watcher. | 234 // Starts the dispatch watcher. |
234 void StartWatching(); | 235 void StartWatching(); |
235 | 236 |
| 237 // ChannelProxy overrides: |
| 238 void OnChannelInit() override; |
| 239 |
236 // Used to signal events between the IPC and listener threads. | 240 // Used to signal events between the IPC and listener threads. |
237 base::WaitableEventWatcher dispatch_watcher_; | 241 base::WaitableEventWatcher dispatch_watcher_; |
238 base::WaitableEventWatcher::EventCallback dispatch_watcher_callback_; | 242 base::WaitableEventWatcher::EventCallback dispatch_watcher_callback_; |
239 | 243 |
| 244 // Tracks SyncMessageFilters created before complete channel initialization. |
| 245 std::vector<scoped_refptr<SyncMessageFilter>> pre_init_sync_message_filters_; |
| 246 |
240 DISALLOW_COPY_AND_ASSIGN(SyncChannel); | 247 DISALLOW_COPY_AND_ASSIGN(SyncChannel); |
241 }; | 248 }; |
242 | 249 |
243 } // namespace IPC | 250 } // namespace IPC |
244 | 251 |
245 #endif // IPC_IPC_SYNC_CHANNEL_H_ | 252 #endif // IPC_IPC_SYNC_CHANNEL_H_ |
OLD | NEW |