| 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 <string> | 8 #include <string> |
| 9 #include <deque> | 9 #include <deque> |
| 10 | 10 |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 61 // message loop pointer to proxy it to the ipc thread. | 61 // message loop pointer to proxy it to the ipc thread. |
| 62 class IPC_EXPORT SyncChannel : public ChannelProxy { | 62 class IPC_EXPORT SyncChannel : public ChannelProxy { |
| 63 public: | 63 public: |
| 64 enum RestrictDispatchGroup { | 64 enum RestrictDispatchGroup { |
| 65 kRestrictDispatchGroup_None = 0, | 65 kRestrictDispatchGroup_None = 0, |
| 66 }; | 66 }; |
| 67 | 67 |
| 68 // Creates and initializes a sync channel. If create_pipe_now is specified, | 68 // Creates and initializes a sync channel. If create_pipe_now is specified, |
| 69 // the channel will be initialized synchronously. | 69 // the channel will be initialized synchronously. |
| 70 // The naming pattern follows IPC::Channel. | 70 // The naming pattern follows IPC::Channel. |
| 71 // TODO(erikchen): Remove default parameter for |broker|. It exists only to |
| 72 // make the upcoming refactor decomposable into smaller CLs. |
| 73 // http://crbug.com/493414. |
| 71 static scoped_ptr<SyncChannel> Create( | 74 static scoped_ptr<SyncChannel> Create( |
| 72 const IPC::ChannelHandle& channel_handle, | 75 const IPC::ChannelHandle& channel_handle, |
| 73 IPC::Channel::Mode mode, | 76 IPC::Channel::Mode mode, |
| 74 Listener* listener, | 77 Listener* listener, |
| 75 const scoped_refptr<base::SingleThreadTaskRunner>& ipc_task_runner, | 78 const scoped_refptr<base::SingleThreadTaskRunner>& ipc_task_runner, |
| 76 bool create_pipe_now, | 79 bool create_pipe_now, |
| 77 base::WaitableEvent* shutdown_event); | 80 base::WaitableEvent* shutdown_event, |
| 81 AttachmentBroker* broker = nullptr); |
| 78 | 82 |
| 79 static scoped_ptr<SyncChannel> Create( | 83 static scoped_ptr<SyncChannel> Create( |
| 80 scoped_ptr<ChannelFactory> factory, | 84 scoped_ptr<ChannelFactory> factory, |
| 81 Listener* listener, | 85 Listener* listener, |
| 82 const scoped_refptr<base::SingleThreadTaskRunner>& ipc_task_runner, | 86 const scoped_refptr<base::SingleThreadTaskRunner>& ipc_task_runner, |
| 83 bool create_pipe_now, | 87 bool create_pipe_now, |
| 84 base::WaitableEvent* shutdown_event); | 88 base::WaitableEvent* shutdown_event); |
| 85 | 89 |
| 86 // Creates an uninitialized sync channel. Call ChannelProxy::Init to | 90 // Creates an uninitialized sync channel. Call ChannelProxy::Init to |
| 87 // initialize the channel. This two-step setup allows message filters to be | 91 // initialize the channel. This two-step setup allows message filters to be |
| (...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 226 // Used to signal events between the IPC and listener threads. | 230 // Used to signal events between the IPC and listener threads. |
| 227 base::WaitableEventWatcher dispatch_watcher_; | 231 base::WaitableEventWatcher dispatch_watcher_; |
| 228 base::WaitableEventWatcher::EventCallback dispatch_watcher_callback_; | 232 base::WaitableEventWatcher::EventCallback dispatch_watcher_callback_; |
| 229 | 233 |
| 230 DISALLOW_COPY_AND_ASSIGN(SyncChannel); | 234 DISALLOW_COPY_AND_ASSIGN(SyncChannel); |
| 231 }; | 235 }; |
| 232 | 236 |
| 233 } // namespace IPC | 237 } // namespace IPC |
| 234 | 238 |
| 235 #endif // IPC_IPC_SYNC_CHANNEL_H_ | 239 #endif // IPC_IPC_SYNC_CHANNEL_H_ |
| OLD | NEW |