| 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 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 112 void AddFilter(MessageFilter* filter); | 112 void AddFilter(MessageFilter* filter); |
| 113 void RemoveFilter(MessageFilter* filter); | 113 void RemoveFilter(MessageFilter* filter); |
| 114 | 114 |
| 115 // Called to clear the pointer to the IPC task runner when it's going away. | 115 // Called to clear the pointer to the IPC task runner when it's going away. |
| 116 void ClearIPCTaskRunner(); | 116 void ClearIPCTaskRunner(); |
| 117 | 117 |
| 118 // Get the process ID for the connected peer. | 118 // Get the process ID for the connected peer. |
| 119 // Returns base::kNullProcessId if the peer is not connected yet. | 119 // Returns base::kNullProcessId if the peer is not connected yet. |
| 120 base::ProcessId GetPeerPID() const { return context_->peer_pid_; } | 120 base::ProcessId GetPeerPID() const { return context_->peer_pid_; } |
| 121 | 121 |
| 122 #if defined(OS_POSIX) && !defined(OS_NACL) | 122 #if defined(OS_POSIX) && \ |
| 123 (!defined(OS_NACL) || defined(__native_client_nonsfi__)) |
| 123 // Calls through to the underlying channel's methods. | 124 // Calls through to the underlying channel's methods. |
| 124 int GetClientFileDescriptor(); | 125 int GetClientFileDescriptor(); |
| 125 int TakeClientFileDescriptor(); | 126 int TakeClientFileDescriptor(); |
| 126 #endif // defined(OS_POSIX) | 127 #endif |
| 127 | 128 |
| 128 protected: | 129 protected: |
| 129 class Context; | 130 class Context; |
| 130 // A subclass uses this constructor if it needs to add more information | 131 // A subclass uses this constructor if it needs to add more information |
| 131 // to the internal state. | 132 // to the internal state. |
| 132 ChannelProxy(Context* context); | 133 ChannelProxy(Context* context); |
| 133 | 134 |
| 134 ChannelProxy( | 135 ChannelProxy( |
| 135 Listener* listener, | 136 Listener* listener, |
| 136 const scoped_refptr<base::SingleThreadTaskRunner>& ipc_task_runner); | 137 const scoped_refptr<base::SingleThreadTaskRunner>& ipc_task_runner); |
| (...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 232 // that involves this data. | 233 // that involves this data. |
| 233 scoped_refptr<Context> context_; | 234 scoped_refptr<Context> context_; |
| 234 | 235 |
| 235 // Whether the channel has been initialized. | 236 // Whether the channel has been initialized. |
| 236 bool did_init_; | 237 bool did_init_; |
| 237 }; | 238 }; |
| 238 | 239 |
| 239 } // namespace IPC | 240 } // namespace IPC |
| 240 | 241 |
| 241 #endif // IPC_IPC_CHANNEL_PROXY_H_ | 242 #endif // IPC_IPC_CHANNEL_PROXY_H_ |
| OLD | NEW |