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 COMPONENTS_NACL_BROWSER_NACL_PROCESS_HOST_H_ | 5 #ifndef COMPONENTS_NACL_BROWSER_NACL_PROCESS_HOST_H_ |
6 #define COMPONENTS_NACL_BROWSER_NACL_PROCESS_HOST_H_ | 6 #define COMPONENTS_NACL_BROWSER_NACL_PROCESS_HOST_H_ |
7 | 7 |
8 #include "build/build_config.h" | 8 #include "build/build_config.h" |
9 | 9 |
10 #include <vector> | 10 #include <vector> |
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
159 | 159 |
160 // Sends the message to the NaCl process to load the plugin. Returns true | 160 // Sends the message to the NaCl process to load the plugin. Returns true |
161 // on success. | 161 // on success. |
162 bool StartNaClExecution(); | 162 bool StartNaClExecution(); |
163 | 163 |
164 void StartNaClFileResolved( | 164 void StartNaClFileResolved( |
165 NaClStartParams params, | 165 NaClStartParams params, |
166 const base::FilePath& file_path, | 166 const base::FilePath& file_path, |
167 base::File nexe_file); | 167 base::File nexe_file); |
168 | 168 |
| 169 #if defined(OS_LINUX) |
| 170 // Creates a pair of IPC::ChannelHandle. Returns true on success. |
| 171 static bool CreateChannelHandlePair(ScopedChannelHandle* channel_handle1, |
| 172 ScopedChannelHandle* channel_handle2); |
| 173 #endif |
| 174 |
| 175 // Starts browser PPAPI proxy. Returns true on success. |
| 176 bool StartPPAPIProxy(ScopedChannelHandle channel_handle); |
| 177 |
169 // Does post-process-launching tasks for starting the NaCl process once | 178 // Does post-process-launching tasks for starting the NaCl process once |
170 // we have a connection. | 179 // we have a connection. |
171 // | 180 // |
172 // Returns false on failure. | 181 // Returns false on failure. |
173 bool StartWithLaunchedProcess(); | 182 bool StartWithLaunchedProcess(); |
174 | 183 |
175 // Message handlers for validation caching. | 184 // Message handlers for validation caching. |
176 void OnQueryKnownToValidate(const std::string& signature, bool* result); | 185 void OnQueryKnownToValidate(const std::string& signature, bool* result); |
177 void OnSetKnownToValidate(const std::string& signature); | 186 void OnSetKnownToValidate(const std::string& signature); |
178 void OnResolveFileToken(uint64 file_token_lo, uint64 file_token_hi); | 187 void OnResolveFileToken(uint64 file_token_lo, uint64 file_token_hi); |
179 void FileResolved(uint64_t file_token_lo, | 188 void FileResolved(uint64_t file_token_lo, |
180 uint64_t file_token_hi, | 189 uint64_t file_token_hi, |
181 const base::FilePath& file_path, | 190 const base::FilePath& file_path, |
182 base::File file); | 191 base::File file); |
183 #if defined(OS_WIN) | 192 #if defined(OS_WIN) |
184 // Message handler for Windows hardware exception handling. | 193 // Message handler for Windows hardware exception handling. |
185 void OnAttachDebugExceptionHandler(const std::string& info, | 194 void OnAttachDebugExceptionHandler(const std::string& info, |
186 IPC::Message* reply_msg); | 195 IPC::Message* reply_msg); |
187 bool AttachDebugExceptionHandler(const std::string& info, | 196 bool AttachDebugExceptionHandler(const std::string& info, |
188 IPC::Message* reply_msg); | 197 IPC::Message* reply_msg); |
189 #endif | 198 #endif |
190 | 199 |
191 // Called when the PPAPI IPC channels to the browser/renderer have been | 200 // Called when the PPAPI IPC channels to the browser/renderer have been |
192 // created. | 201 // created. |
193 void OnPpapiChannelsCreated( | 202 void OnPpapiChannelsCreated( |
194 const IPC::ChannelHandle& browser_channel_handle, | 203 const IPC::ChannelHandle& ppapi_browser_channel_handle, |
195 const IPC::ChannelHandle& ppapi_renderer_channel_handle, | 204 const IPC::ChannelHandle& ppapi_renderer_channel_handle, |
196 const IPC::ChannelHandle& trusted_renderer_channel_handle, | 205 const IPC::ChannelHandle& trusted_renderer_channel_handle, |
197 const IPC::ChannelHandle& manifest_service_channel_handle); | 206 const IPC::ChannelHandle& manifest_service_channel_handle); |
198 | 207 |
199 GURL manifest_url_; | 208 GURL manifest_url_; |
200 base::File nexe_file_; | 209 base::File nexe_file_; |
201 NaClFileToken nexe_token_; | 210 NaClFileToken nexe_token_; |
202 std::vector<NaClResourcePrefetchResult> prefetched_resource_files_; | 211 std::vector<NaClResourcePrefetchResult> prefetched_resource_files_; |
203 | 212 |
204 ppapi::PpapiPermissions permissions_; | 213 ppapi::PpapiPermissions permissions_; |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
254 base::File socket_for_sel_ldr_; | 263 base::File socket_for_sel_ldr_; |
255 | 264 |
256 base::WeakPtrFactory<NaClProcessHost> weak_factory_; | 265 base::WeakPtrFactory<NaClProcessHost> weak_factory_; |
257 | 266 |
258 DISALLOW_COPY_AND_ASSIGN(NaClProcessHost); | 267 DISALLOW_COPY_AND_ASSIGN(NaClProcessHost); |
259 }; | 268 }; |
260 | 269 |
261 } // namespace nacl | 270 } // namespace nacl |
262 | 271 |
263 #endif // COMPONENTS_NACL_BROWSER_NACL_PROCESS_HOST_H_ | 272 #endif // COMPONENTS_NACL_BROWSER_NACL_PROCESS_HOST_H_ |
OLD | NEW |