| 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 18 matching lines...) Expand all Loading... |
| 29 // is more than this object. If the message loop goes away while this object | 29 // is more than this object. If the message loop goes away while this object |
| 30 // is running and it's used to send a message, then it will use the invalid | 30 // is running and it's used to send a message, then it will use the invalid |
| 31 // message loop pointer to proxy it to the ipc thread. | 31 // message loop pointer to proxy it to the ipc thread. |
| 32 class SyncChannel : public ChannelProxy, | 32 class SyncChannel : public ChannelProxy, |
| 33 public base::WaitableEventWatcher::Delegate { | 33 public base::WaitableEventWatcher::Delegate { |
| 34 public: | 34 public: |
| 35 SyncChannel(const std::string& channel_id, Channel::Mode mode, | 35 SyncChannel(const std::string& channel_id, Channel::Mode mode, |
| 36 Channel::Listener* listener, MessageFilter* filter, | 36 Channel::Listener* listener, MessageFilter* filter, |
| 37 MessageLoop* ipc_message_loop, bool create_pipe_now, | 37 MessageLoop* ipc_message_loop, bool create_pipe_now, |
| 38 base::WaitableEvent* shutdown_event); | 38 base::WaitableEvent* shutdown_event); |
| 39 ~SyncChannel(); | 39 virtual ~SyncChannel(); |
| 40 | 40 |
| 41 virtual bool Send(Message* message); | 41 virtual bool Send(Message* message); |
| 42 virtual bool SendWithTimeout(Message* message, int timeout_ms); | 42 virtual bool SendWithTimeout(Message* message, int timeout_ms); |
| 43 | 43 |
| 44 // Whether we allow sending messages with no time-out. | 44 // Whether we allow sending messages with no time-out. |
| 45 void set_sync_messages_with_no_timeout_allowed(bool value) { | 45 void set_sync_messages_with_no_timeout_allowed(bool value) { |
| 46 sync_messages_with_no_timeout_allowed_ = value; | 46 sync_messages_with_no_timeout_allowed_ = value; |
| 47 } | 47 } |
| 48 | 48 |
| 49 protected: | 49 protected: |
| (...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 153 // Used to signal events between the IPC and listener threads. | 153 // Used to signal events between the IPC and listener threads. |
| 154 base::WaitableEventWatcher send_done_watcher_; | 154 base::WaitableEventWatcher send_done_watcher_; |
| 155 base::WaitableEventWatcher dispatch_watcher_; | 155 base::WaitableEventWatcher dispatch_watcher_; |
| 156 | 156 |
| 157 DISALLOW_EVIL_CONSTRUCTORS(SyncChannel); | 157 DISALLOW_EVIL_CONSTRUCTORS(SyncChannel); |
| 158 }; | 158 }; |
| 159 | 159 |
| 160 } // namespace IPC | 160 } // namespace IPC |
| 161 | 161 |
| 162 #endif // IPC_IPC_SYNC_SENDER_H__ | 162 #endif // IPC_IPC_SYNC_SENDER_H__ |
| OLD | NEW |