| 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 <deque> |
| 9 #include <memory> | 9 #include <memory> |
| 10 #include <string> | 10 #include <string> |
| 11 #include <vector> | 11 #include <vector> |
| 12 | 12 |
| 13 #include "base/macros.h" | 13 #include "base/macros.h" |
| 14 #include "base/memory/ref_counted.h" | 14 #include "base/memory/ref_counted.h" |
| 15 #include "base/synchronization/lock.h" | 15 #include "base/synchronization/lock.h" |
| 16 #include "base/synchronization/waitable_event_watcher.h" | 16 #include "base/synchronization/waitable_event_watcher.h" |
| 17 #include "ipc/ipc_channel_handle.h" | 17 #include "ipc/ipc_channel_handle.h" |
| 18 #include "ipc/ipc_channel_proxy.h" | 18 #include "ipc/ipc_channel_proxy.h" |
| 19 #include "ipc/ipc_sync_message.h" | 19 #include "ipc/ipc_sync_message.h" |
| 20 #include "ipc/ipc_sync_message_filter.h" | 20 #include "ipc/ipc_sync_message_filter.h" |
| 21 #include "mojo/public/c/system/types.h" | 21 #include "mojo/public/c/system/types.h" |
| 22 #include "mojo/public/cpp/system/watcher.h" | 22 #include "mojo/public/cpp/system/simple_watcher.h" |
| 23 | 23 |
| 24 namespace base { | 24 namespace base { |
| 25 class WaitableEvent; | 25 class WaitableEvent; |
| 26 }; | 26 }; |
| 27 | 27 |
| 28 namespace mojo { | 28 namespace mojo { |
| 29 class SyncHandleRegistry; | 29 class SyncHandleRegistry; |
| 30 class Watcher; | |
| 31 } | 30 } |
| 32 | 31 |
| 33 namespace IPC { | 32 namespace IPC { |
| 34 | 33 |
| 35 class ChannelFactory; | 34 class ChannelFactory; |
| 36 class MojoEvent; | 35 class MojoEvent; |
| 37 class SyncMessage; | 36 class SyncMessage; |
| 38 | 37 |
| 39 // This is similar to ChannelProxy, with the added feature of supporting sending | 38 // This is similar to ChannelProxy, with the added feature of supporting sending |
| 40 // synchronous messages. | 39 // synchronous messages. |
| (...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 234 | 233 |
| 235 // Starts the dispatch watcher. | 234 // Starts the dispatch watcher. |
| 236 void StartWatching(); | 235 void StartWatching(); |
| 237 | 236 |
| 238 // ChannelProxy overrides: | 237 // ChannelProxy overrides: |
| 239 void OnChannelInit() override; | 238 void OnChannelInit() override; |
| 240 | 239 |
| 241 scoped_refptr<mojo::SyncHandleRegistry> sync_handle_registry_; | 240 scoped_refptr<mojo::SyncHandleRegistry> sync_handle_registry_; |
| 242 | 241 |
| 243 // Used to signal events between the IPC and listener threads. | 242 // Used to signal events between the IPC and listener threads. |
| 244 mojo::Watcher dispatch_watcher_; | 243 mojo::SimpleWatcher dispatch_watcher_; |
| 245 | 244 |
| 246 // Tracks SyncMessageFilters created before complete channel initialization. | 245 // Tracks SyncMessageFilters created before complete channel initialization. |
| 247 std::vector<scoped_refptr<SyncMessageFilter>> pre_init_sync_message_filters_; | 246 std::vector<scoped_refptr<SyncMessageFilter>> pre_init_sync_message_filters_; |
| 248 | 247 |
| 249 DISALLOW_COPY_AND_ASSIGN(SyncChannel); | 248 DISALLOW_COPY_AND_ASSIGN(SyncChannel); |
| 250 }; | 249 }; |
| 251 | 250 |
| 252 } // namespace IPC | 251 } // namespace IPC |
| 253 | 252 |
| 254 #endif // IPC_IPC_SYNC_CHANNEL_H_ | 253 #endif // IPC_IPC_SYNC_CHANNEL_H_ |
| OLD | NEW |