| 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/simple_watcher.h" | 22 #include "mojo/public/cpp/system/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; |
| 30 } | 31 } |
| 31 | 32 |
| 32 namespace IPC { | 33 namespace IPC { |
| 33 | 34 |
| 34 class ChannelFactory; | 35 class ChannelFactory; |
| 35 class MojoEvent; | 36 class MojoEvent; |
| 36 class SyncMessage; | 37 class SyncMessage; |
| 37 | 38 |
| 38 // This is similar to ChannelProxy, with the added feature of supporting sending | 39 // This is similar to ChannelProxy, with the added feature of supporting sending |
| 39 // synchronous messages. | 40 // synchronous messages. |
| (...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 233 | 234 |
| 234 // Starts the dispatch watcher. | 235 // Starts the dispatch watcher. |
| 235 void StartWatching(); | 236 void StartWatching(); |
| 236 | 237 |
| 237 // ChannelProxy overrides: | 238 // ChannelProxy overrides: |
| 238 void OnChannelInit() override; | 239 void OnChannelInit() override; |
| 239 | 240 |
| 240 scoped_refptr<mojo::SyncHandleRegistry> sync_handle_registry_; | 241 scoped_refptr<mojo::SyncHandleRegistry> sync_handle_registry_; |
| 241 | 242 |
| 242 // Used to signal events between the IPC and listener threads. | 243 // Used to signal events between the IPC and listener threads. |
| 243 mojo::SimpleWatcher dispatch_watcher_; | 244 mojo::Watcher dispatch_watcher_; |
| 244 | 245 |
| 245 // Tracks SyncMessageFilters created before complete channel initialization. | 246 // Tracks SyncMessageFilters created before complete channel initialization. |
| 246 std::vector<scoped_refptr<SyncMessageFilter>> pre_init_sync_message_filters_; | 247 std::vector<scoped_refptr<SyncMessageFilter>> pre_init_sync_message_filters_; |
| 247 | 248 |
| 248 DISALLOW_COPY_AND_ASSIGN(SyncChannel); | 249 DISALLOW_COPY_AND_ASSIGN(SyncChannel); |
| 249 }; | 250 }; |
| 250 | 251 |
| 251 } // namespace IPC | 252 } // namespace IPC |
| 252 | 253 |
| 253 #endif // IPC_IPC_SYNC_CHANNEL_H_ | 254 #endif // IPC_IPC_SYNC_CHANNEL_H_ |
| OLD | NEW |