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 | 5 |
6 /* This file contains NaCl private interfaces. This interface is not versioned | 6 /* This file contains NaCl private interfaces. This interface is not versioned |
7 * and is for internal Chrome use. It may change without notice. */ | 7 * and is for internal Chrome use. It may change without notice. */ |
8 | 8 |
9 label Chrome { | 9 label Chrome { |
10 M25 = 1.0 | 10 M25 = 1.0 |
(...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
230 * returns a posix handle to that temporary file. | 230 * returns a posix handle to that temporary file. |
231 */ | 231 */ |
232 PP_FileHandle CreateTemporaryFile([in] PP_Instance instance); | 232 PP_FileHandle CreateTemporaryFile([in] PP_Instance instance); |
233 | 233 |
234 /* Return the number of processors in the system as reported by the OS */ | 234 /* Return the number of processors in the system as reported by the OS */ |
235 int32_t GetNumberOfProcessors(); | 235 int32_t GetNumberOfProcessors(); |
236 | 236 |
237 /* Return whether the non-SFI mode is enabled. */ | 237 /* Return whether the non-SFI mode is enabled. */ |
238 PP_Bool IsNonSFIModeEnabled(); | 238 PP_Bool IsNonSFIModeEnabled(); |
239 | 239 |
| 240 /* Create a temporary file, which will be deleted by the time the |
| 241 * last handle is closed (or earlier on POSIX systems), to use for |
| 242 * the nexe with the cache information given by |pexe_url|, |
| 243 * |abi_version|, |opt_level|, and |headers|. If the nexe is already present |
| 244 * in the cache, |is_hit| is set to PP_TRUE and the contents of the nexe will |
| 245 * be copied into the temporary file. Otherwise |is_hit| is set to PP_FALSE |
| 246 * and the temporary file will be writeable. Currently the implementation is |
| 247 * a stub, which always sets is_hit to false and calls the implementation of |
| 248 * CreateTemporaryFile. In a subsequent CL it will call into the browser |
| 249 * which will remember the association between the cache key and the fd, and |
| 250 * copy the nexe into the cache after the translation finishes. |
| 251 */ |
| 252 int32_t GetNexeFd([in] PP_Instance instance, |
| 253 [in] str_t pexe_url, |
| 254 [in] uint32_t abi_version, |
| 255 [in] uint32_t opt_level, |
| 256 [in] str_t headers, |
| 257 [in] str_t extra_flags, |
| 258 [out] PP_Bool is_hit, |
| 259 [out] PP_FileHandle nexe_handle, |
| 260 [in] PP_CompletionCallback callback); |
| 261 |
240 /* Report to the browser that translation of the pexe for |instance| | 262 /* Report to the browser that translation of the pexe for |instance| |
241 * has finished, or aborted with an error. If |success| is true, the | 263 * has finished, or aborted with an error. If |success| is true, the |
242 * browser may then store the translation in the cache. The renderer | 264 * browser may then store the translation in the cache. The renderer |
243 * must first have called GetNexeFd for the same instance. (The browser is | 265 * must first have called GetNexeFd for the same instance. (The browser is |
244 * not guaranteed to store the nexe even if |success| is true; if there is | 266 * not guaranteed to store the nexe even if |success| is true; if there is |
245 * an error on the browser side, or the file is too big for the cache, or | 267 * an error on the browser side, or the file is too big for the cache, or |
246 * the browser is in incognito mode, no notification will be delivered to | 268 * the browser is in incognito mode, no notification will be delivered to |
247 * the plugin.) | 269 * the plugin.) |
248 */ | 270 */ |
249 void ReportTranslationFinished([in] PP_Instance instance, | 271 void ReportTranslationFinished([in] PP_Instance instance, |
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
390 void OpenManifestEntry([in] PP_Instance instance, | 412 void OpenManifestEntry([in] PP_Instance instance, |
391 [in] PP_Bool is_helper_process, | 413 [in] PP_Bool is_helper_process, |
392 [in] str_t key, | 414 [in] str_t key, |
393 [out] PP_NaClFileInfo file_info, | 415 [out] PP_NaClFileInfo file_info, |
394 [in] PP_CompletionCallback callback); | 416 [in] PP_CompletionCallback callback); |
395 | 417 |
396 /* Sets the start time for PNaCl downloading and translation to the current | 418 /* Sets the start time for PNaCl downloading and translation to the current |
397 * time. | 419 * time. |
398 */ | 420 */ |
399 void SetPNaClStartTime([in] PP_Instance instance); | 421 void SetPNaClStartTime([in] PP_Instance instance); |
400 | |
401 /* Downloads and streams a pexe file for PNaCl translation. | |
402 * Fetches the content at |pexe_url| for the given instance and opt_level. | |
403 * If a translated cached nexe is already available, |cache_hit_handle| | |
404 * is set and |cache_hit_callback| is called. | |
405 * Otherwise, |stream_callback| is called repeatedly with blocks of data | |
406 * as they are received. |stream_finished_callback| is called after all | |
407 * data has been received and dispatched to |stream_callback|. | |
408 */ | |
409 void StreamPexe([in] PP_Instance instance, | |
410 [in] str_t pexe_url, | |
411 [in] int32_t opt_level, | |
412 [in] PPP_PexeStreamHandler stream_handler, | |
413 [inout] mem_t stream_handler_user_data); | |
414 }; | 422 }; |
OLD | NEW |