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 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
54 // can be deleted while it's being used in a different thread. See | 54 // can be deleted while it's being used in a different thread. See |
55 // ChannelProxy::Context for more information. | 55 // ChannelProxy::Context for more information. |
56 class SyncContext : public Context, | 56 class SyncContext : public Context, |
57 public base::WaitableEventWatcher::Delegate { | 57 public base::WaitableEventWatcher::Delegate { |
58 public: | 58 public: |
59 SyncContext(Channel::Listener* listener, | 59 SyncContext(Channel::Listener* listener, |
60 MessageFilter* filter, | 60 MessageFilter* filter, |
61 MessageLoop* ipc_thread, | 61 MessageLoop* ipc_thread, |
62 base::WaitableEvent* shutdown_event); | 62 base::WaitableEvent* shutdown_event); |
63 | 63 |
64 ~SyncContext(); | |
65 | |
66 // Adds information about an outgoing sync message to the context so that | 64 // Adds information about an outgoing sync message to the context so that |
67 // we know how to deserialize the reply. | 65 // we know how to deserialize the reply. |
68 void Push(IPC::SyncMessage* sync_msg); | 66 void Push(IPC::SyncMessage* sync_msg); |
69 | 67 |
70 // Cleanly remove the top deserializer (and throw it away). Returns the | 68 // Cleanly remove the top deserializer (and throw it away). Returns the |
71 // result of the Send call for that message. | 69 // result of the Send call for that message. |
72 bool Pop(); | 70 bool Pop(); |
73 | 71 |
74 // Returns an event that's set when the send is complete, timed out or the | 72 // Returns an event that's set when the send is complete, timed out or the |
75 // process shut down. | 73 // process shut down. |
(...skipping 14 matching lines...) Expand all Loading... | |
90 // times out. | 88 // times out. |
91 void OnSendTimeout(int message_id); | 89 void OnSendTimeout(int message_id); |
92 | 90 |
93 base::WaitableEvent* shutdown_event() { return shutdown_event_; } | 91 base::WaitableEvent* shutdown_event() { return shutdown_event_; } |
94 | 92 |
95 ReceivedSyncMsgQueue* received_sync_msgs() { | 93 ReceivedSyncMsgQueue* received_sync_msgs() { |
96 return received_sync_msgs_; | 94 return received_sync_msgs_; |
97 } | 95 } |
98 | 96 |
99 private: | 97 private: |
98 ~SyncContext(); | |
M-A Ruel
2009/11/05 20:31:28
virtual
jam
2009/11/05 21:52:37
no need, nothing derives from this class.
awong
2009/11/05 21:58:39
It's already virtual because it's inheriting from
| |
100 // IPC::ChannelProxy methods that we override. | 99 // IPC::ChannelProxy methods that we override. |
101 | 100 |
102 // Called on the listener thread. | 101 // Called on the listener thread. |
103 virtual void Clear(); | 102 virtual void Clear(); |
M-A Ruel
2009/11/05 20:31:28
please fix alignment while at it.
jam
2009/11/05 21:52:37
Done.
| |
104 | 103 |
105 // Called on the IPC thread. | 104 // Called on the IPC thread. |
106 virtual void OnMessageReceived(const Message& msg); | 105 virtual void OnMessageReceived(const Message& msg); |
107 virtual void OnChannelError(); | 106 virtual void OnChannelError(); |
108 virtual void OnChannelOpened(); | 107 virtual void OnChannelOpened(); |
109 virtual void OnChannelClosed(); | 108 virtual void OnChannelClosed(); |
110 | 109 |
111 // Cancels all pending Send calls. | 110 // Cancels all pending Send calls. |
112 void CancelPendingSends(); | 111 void CancelPendingSends(); |
113 | 112 |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
156 | 155 |
157 // Used to signal events between the IPC and listener threads. | 156 // Used to signal events between the IPC and listener threads. |
158 base::WaitableEventWatcher dispatch_watcher_; | 157 base::WaitableEventWatcher dispatch_watcher_; |
159 | 158 |
160 DISALLOW_EVIL_CONSTRUCTORS(SyncChannel); | 159 DISALLOW_EVIL_CONSTRUCTORS(SyncChannel); |
161 }; | 160 }; |
162 | 161 |
163 } // namespace IPC | 162 } // namespace IPC |
164 | 163 |
165 #endif // IPC_IPC_SYNC_SENDER_H__ | 164 #endif // IPC_IPC_SYNC_SENDER_H__ |
OLD | NEW |