OLD | NEW |
---|---|
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
161 void AddFilter(MessageFilter* filter); | 161 void AddFilter(MessageFilter* filter); |
162 void RemoveFilter(MessageFilter* filter); | 162 void RemoveFilter(MessageFilter* filter); |
163 | 163 |
164 void set_outgoing_message_filter(OutgoingMessageFilter* filter) { | 164 void set_outgoing_message_filter(OutgoingMessageFilter* filter) { |
165 outgoing_message_filter_ = filter; | 165 outgoing_message_filter_ = filter; |
166 } | 166 } |
167 | 167 |
168 // Called to clear the pointer to the IPC message loop when it's going away. | 168 // Called to clear the pointer to the IPC message loop when it's going away. |
169 void ClearIPCMessageLoop(); | 169 void ClearIPCMessageLoop(); |
170 | 170 |
171 base::ProcessId peer_pid() const; | |
Tom Sepez
2012/04/04 19:07:07
include what you use?
jschuh
2012/04/04 21:05:13
Done.
| |
172 | |
171 #if defined(OS_POSIX) | 173 #if defined(OS_POSIX) |
172 // Calls through to the underlying channel's methods. | 174 // Calls through to the underlying channel's methods. |
173 int GetClientFileDescriptor(); | 175 int GetClientFileDescriptor(); |
174 int TakeClientFileDescriptor(); | 176 int TakeClientFileDescriptor(); |
175 bool GetClientEuid(uid_t* client_euid) const; | 177 bool GetClientEuid(uid_t* client_euid) const; |
176 #endif // defined(OS_POSIX) | 178 #endif // defined(OS_POSIX) |
177 | 179 |
178 protected: | 180 protected: |
179 class Context; | 181 class Context; |
180 // A subclass uses this constructor if it needs to add more information | 182 // A subclass uses this constructor if it needs to add more information |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
239 void OnDispatchError(); | 241 void OnDispatchError(); |
240 | 242 |
241 scoped_refptr<base::MessageLoopProxy> listener_message_loop_; | 243 scoped_refptr<base::MessageLoopProxy> listener_message_loop_; |
242 Channel::Listener* listener_; | 244 Channel::Listener* listener_; |
243 | 245 |
244 // List of filters. This is only accessed on the IPC thread. | 246 // List of filters. This is only accessed on the IPC thread. |
245 std::vector<scoped_refptr<MessageFilter> > filters_; | 247 std::vector<scoped_refptr<MessageFilter> > filters_; |
246 scoped_refptr<base::MessageLoopProxy> ipc_message_loop_; | 248 scoped_refptr<base::MessageLoopProxy> ipc_message_loop_; |
247 scoped_ptr<Channel> channel_; | 249 scoped_ptr<Channel> channel_; |
248 std::string channel_id_; | 250 std::string channel_id_; |
249 int peer_pid_; | |
250 bool channel_connected_called_; | 251 bool channel_connected_called_; |
251 | 252 |
252 // Holds filters between the AddFilter call on the listerner thread and the | 253 // Holds filters between the AddFilter call on the listerner thread and the |
253 // IPC thread when they're added to filters_. | 254 // IPC thread when they're added to filters_. |
254 std::vector<scoped_refptr<MessageFilter> > pending_filters_; | 255 std::vector<scoped_refptr<MessageFilter> > pending_filters_; |
255 // Lock for pending_filters_. | 256 // Lock for pending_filters_. |
256 base::Lock pending_filters_lock_; | 257 base::Lock pending_filters_lock_; |
257 }; | 258 }; |
258 | 259 |
259 Context* context() { return context_; } | 260 Context* context() { return context_; } |
(...skipping 12 matching lines...) Expand all Loading... | |
272 | 273 |
273 OutgoingMessageFilter* outgoing_message_filter_; | 274 OutgoingMessageFilter* outgoing_message_filter_; |
274 | 275 |
275 // Whether the channel has been initialized. | 276 // Whether the channel has been initialized. |
276 bool did_init_; | 277 bool did_init_; |
277 }; | 278 }; |
278 | 279 |
279 } // namespace IPC | 280 } // namespace IPC |
280 | 281 |
281 #endif // IPC_IPC_CHANNEL_PROXY_H_ | 282 #endif // IPC_IPC_CHANNEL_PROXY_H_ |
OLD | NEW |