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 PPAPI_PROXY_PROXY_CHANNEL_H_ | 5 #ifndef PPAPI_PROXY_PROXY_CHANNEL_H_ |
6 #define PPAPI_PROXY_PROXY_CHANNEL_H_ | 6 #define PPAPI_PROXY_PROXY_CHANNEL_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 | 9 |
10 #include "base/files/scoped_file.h" | 10 #include "base/files/scoped_file.h" |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
95 bool Send(IPC::Message* msg) override; | 95 bool Send(IPC::Message* msg) override; |
96 | 96 |
97 // IPC::Listener implementation. | 97 // IPC::Listener implementation. |
98 void OnChannelError() override; | 98 void OnChannelError() override; |
99 | 99 |
100 // Will be NULL in some unit tests and if the remote side has crashed. | 100 // Will be NULL in some unit tests and if the remote side has crashed. |
101 IPC::SyncChannel* channel() const { | 101 IPC::SyncChannel* channel() const { |
102 return channel_.get(); | 102 return channel_.get(); |
103 } | 103 } |
104 | 104 |
| 105 base::ProcessId peer_pid() { return peer_pid_; } |
| 106 |
105 protected: | 107 protected: |
106 explicit ProxyChannel(); | 108 explicit ProxyChannel(); |
107 | 109 |
108 // You must call this function before anything else. Returns true on success. | 110 // You must call this function before anything else. Returns true on success. |
109 // The delegate pointer must outlive this class, ownership is not | 111 // The delegate pointer must outlive this class, ownership is not |
110 // transferred. | 112 // transferred. |
111 virtual bool InitWithChannel(Delegate* delegate, | 113 virtual bool InitWithChannel(Delegate* delegate, |
112 base::ProcessId peer_pid, | 114 base::ProcessId peer_pid, |
113 const IPC::ChannelHandle& channel_handle, | 115 const IPC::ChannelHandle& channel_handle, |
114 bool is_client); | 116 bool is_client); |
(...skipping 20 matching lines...) Expand all Loading... |
135 // remote side has crashed. | 137 // remote side has crashed. |
136 std::unique_ptr<IPC::SyncChannel> channel_; | 138 std::unique_ptr<IPC::SyncChannel> channel_; |
137 | 139 |
138 DISALLOW_COPY_AND_ASSIGN(ProxyChannel); | 140 DISALLOW_COPY_AND_ASSIGN(ProxyChannel); |
139 }; | 141 }; |
140 | 142 |
141 } // namespace proxy | 143 } // namespace proxy |
142 } // namespace ppapi | 144 } // namespace ppapi |
143 | 145 |
144 #endif // PPAPI_PROXY_PROXY_CHANNEL_H_ | 146 #endif // PPAPI_PROXY_PROXY_CHANNEL_H_ |
OLD | NEW |