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_CHANNEL_PROXY_H_ | 5 #ifndef IPC_IPC_CHANNEL_PROXY_H_ |
6 #define IPC_IPC_CHANNEL_PROXY_H_ | 6 #define IPC_IPC_CHANNEL_PROXY_H_ |
7 | 7 |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
170 virtual void OnChannelOpened(); | 170 virtual void OnChannelOpened(); |
171 virtual void OnChannelClosed(); | 171 virtual void OnChannelClosed(); |
172 | 172 |
173 // Called on the consumers thread when the ChannelProxy is closed. At that | 173 // Called on the consumers thread when the ChannelProxy is closed. At that |
174 // point the consumer is telling us that they don't want to receive any | 174 // point the consumer is telling us that they don't want to receive any |
175 // more messages, so we honor that wish by forgetting them! | 175 // more messages, so we honor that wish by forgetting them! |
176 virtual void Clear(); | 176 virtual void Clear(); |
177 | 177 |
178 private: | 178 private: |
179 friend class ChannelProxy; | 179 friend class ChannelProxy; |
180 friend class SendCallbackHelper; | 180 friend class IpcSecurityTestUtil; |
181 | 181 |
182 // Create the Channel | 182 // Create the Channel |
183 void CreateChannel(scoped_ptr<ChannelFactory> factory); | 183 void CreateChannel(scoped_ptr<ChannelFactory> factory); |
184 | 184 |
185 // Methods called on the IO thread. | 185 // Methods called on the IO thread. |
186 void OnSendMessage(scoped_ptr<Message> message_ptr); | 186 void OnSendMessage(scoped_ptr<Message> message_ptr); |
187 void OnAddFilter(); | 187 void OnAddFilter(); |
188 void OnRemoveFilter(MessageFilter* filter); | 188 void OnRemoveFilter(MessageFilter* filter); |
189 | 189 |
190 // Methods called on the listener thread. | 190 // Methods called on the listener thread. |
(...skipping 27 matching lines...) Expand all Loading... |
218 base::Lock pending_filters_lock_; | 218 base::Lock pending_filters_lock_; |
219 | 219 |
220 // Cached copy of the peer process ID. Set on IPC but read on both IPC and | 220 // Cached copy of the peer process ID. Set on IPC but read on both IPC and |
221 // listener threads. | 221 // listener threads. |
222 base::ProcessId peer_pid_; | 222 base::ProcessId peer_pid_; |
223 }; | 223 }; |
224 | 224 |
225 Context* context() { return context_.get(); } | 225 Context* context() { return context_.get(); } |
226 | 226 |
227 private: | 227 private: |
228 friend class SendCallbackHelper; | 228 friend class IpcSecurityTestUtil; |
229 | 229 |
230 // By maintaining this indirection (ref-counted) to our internal state, we | 230 // By maintaining this indirection (ref-counted) to our internal state, we |
231 // can safely be destroyed while the background thread continues to do stuff | 231 // can safely be destroyed while the background thread continues to do stuff |
232 // that involves this data. | 232 // that involves this data. |
233 scoped_refptr<Context> context_; | 233 scoped_refptr<Context> context_; |
234 | 234 |
235 // Whether the channel has been initialized. | 235 // Whether the channel has been initialized. |
236 bool did_init_; | 236 bool did_init_; |
237 }; | 237 }; |
238 | 238 |
239 } // namespace IPC | 239 } // namespace IPC |
240 | 240 |
241 #endif // IPC_IPC_CHANNEL_PROXY_H_ | 241 #endif // IPC_IPC_CHANNEL_PROXY_H_ |
OLD | NEW |