| 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 /* From private/ppb_nacl_private.idl modified Wed Jul 9 11:09:04 2014. */ | 6 /* From private/ppb_nacl_private.idl modified Thu Jul 10 10:34:30 2014. */ |
| 7 | 7 |
| 8 #ifndef PPAPI_C_PRIVATE_PPB_NACL_PRIVATE_H_ | 8 #ifndef PPAPI_C_PRIVATE_PPB_NACL_PRIVATE_H_ |
| 9 #define PPAPI_C_PRIVATE_PPB_NACL_PRIVATE_H_ | 9 #define PPAPI_C_PRIVATE_PPB_NACL_PRIVATE_H_ |
| 10 | 10 |
| 11 #include "ppapi/c/pp_bool.h" | 11 #include "ppapi/c/pp_bool.h" |
| 12 #include "ppapi/c/pp_completion_callback.h" | 12 #include "ppapi/c/pp_completion_callback.h" |
| 13 #include "ppapi/c/pp_instance.h" | 13 #include "ppapi/c/pp_instance.h" |
| 14 #include "ppapi/c/pp_macros.h" | 14 #include "ppapi/c/pp_macros.h" |
| 15 #include "ppapi/c/pp_stdint.h" | 15 #include "ppapi/c/pp_stdint.h" |
| 16 #include "ppapi/c/pp_var.h" | 16 #include "ppapi/c/pp_var.h" |
| 17 #include "ppapi/c/private/ppp_pexe_stream_handler.h" |
| 17 | 18 |
| 18 #define PPB_NACL_PRIVATE_INTERFACE_1_0 "PPB_NaCl_Private;1.0" | 19 #define PPB_NACL_PRIVATE_INTERFACE_1_0 "PPB_NaCl_Private;1.0" |
| 19 #define PPB_NACL_PRIVATE_INTERFACE PPB_NACL_PRIVATE_INTERFACE_1_0 | 20 #define PPB_NACL_PRIVATE_INTERFACE PPB_NACL_PRIVATE_INTERFACE_1_0 |
| 20 | 21 |
| 21 /** | 22 /** |
| 22 * @file | 23 * @file |
| 23 * This file contains NaCl private interfaces. This interface is not versioned | 24 * This file contains NaCl private interfaces. This interface is not versioned |
| 24 * and is for internal Chrome use. It may change without notice. */ | 25 * and is for internal Chrome use. It may change without notice. */ |
| 25 | 26 |
| 26 | 27 |
| (...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 263 struct PP_NaClFileInfo* out_file_info); | 264 struct PP_NaClFileInfo* out_file_info); |
| 264 /* This creates a temporary file that will be deleted by the time | 265 /* This creates a temporary file that will be deleted by the time |
| 265 * the last handle is closed (or earlier on POSIX systems), and | 266 * the last handle is closed (or earlier on POSIX systems), and |
| 266 * returns a posix handle to that temporary file. | 267 * returns a posix handle to that temporary file. |
| 267 */ | 268 */ |
| 268 PP_FileHandle (*CreateTemporaryFile)(PP_Instance instance); | 269 PP_FileHandle (*CreateTemporaryFile)(PP_Instance instance); |
| 269 /* Return the number of processors in the system as reported by the OS */ | 270 /* Return the number of processors in the system as reported by the OS */ |
| 270 int32_t (*GetNumberOfProcessors)(void); | 271 int32_t (*GetNumberOfProcessors)(void); |
| 271 /* Return whether the non-SFI mode is enabled. */ | 272 /* Return whether the non-SFI mode is enabled. */ |
| 272 PP_Bool (*IsNonSFIModeEnabled)(void); | 273 PP_Bool (*IsNonSFIModeEnabled)(void); |
| 273 /* Create a temporary file, which will be deleted by the time the | |
| 274 * last handle is closed (or earlier on POSIX systems), to use for | |
| 275 * the nexe with the cache information given by |pexe_url|, | |
| 276 * |abi_version|, |opt_level|, and |headers|. If the nexe is already present | |
| 277 * in the cache, |is_hit| is set to PP_TRUE and the contents of the nexe will | |
| 278 * be copied into the temporary file. Otherwise |is_hit| is set to PP_FALSE | |
| 279 * and the temporary file will be writeable. Currently the implementation is | |
| 280 * a stub, which always sets is_hit to false and calls the implementation of | |
| 281 * CreateTemporaryFile. In a subsequent CL it will call into the browser | |
| 282 * which will remember the association between the cache key and the fd, and | |
| 283 * copy the nexe into the cache after the translation finishes. | |
| 284 */ | |
| 285 int32_t (*GetNexeFd)(PP_Instance instance, | |
| 286 const char* pexe_url, | |
| 287 uint32_t abi_version, | |
| 288 uint32_t opt_level, | |
| 289 const char* headers, | |
| 290 const char* extra_flags, | |
| 291 PP_Bool* is_hit, | |
| 292 PP_FileHandle* nexe_handle, | |
| 293 struct PP_CompletionCallback callback); | |
| 294 /* Report to the browser that translation of the pexe for |instance| | 274 /* Report to the browser that translation of the pexe for |instance| |
| 295 * has finished, or aborted with an error. If |success| is true, the | 275 * has finished, or aborted with an error. If |success| is true, the |
| 296 * browser may then store the translation in the cache. The renderer | 276 * browser may then store the translation in the cache. The renderer |
| 297 * must first have called GetNexeFd for the same instance. (The browser is | 277 * must first have called GetNexeFd for the same instance. (The browser is |
| 298 * not guaranteed to store the nexe even if |success| is true; if there is | 278 * not guaranteed to store the nexe even if |success| is true; if there is |
| 299 * an error on the browser side, or the file is too big for the cache, or | 279 * an error on the browser side, or the file is too big for the cache, or |
| 300 * the browser is in incognito mode, no notification will be delivered to | 280 * the browser is in incognito mode, no notification will be delivered to |
| 301 * the plugin.) | 281 * the plugin.) |
| 302 */ | 282 */ |
| 303 void (*ReportTranslationFinished)(PP_Instance instance, | 283 void (*ReportTranslationFinished)(PP_Instance instance, |
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 409 */ | 389 */ |
| 410 void (*OpenManifestEntry)(PP_Instance instance, | 390 void (*OpenManifestEntry)(PP_Instance instance, |
| 411 PP_Bool is_helper_process, | 391 PP_Bool is_helper_process, |
| 412 const char* key, | 392 const char* key, |
| 413 struct PP_NaClFileInfo* file_info, | 393 struct PP_NaClFileInfo* file_info, |
| 414 struct PP_CompletionCallback callback); | 394 struct PP_CompletionCallback callback); |
| 415 /* Sets the start time for PNaCl downloading and translation to the current | 395 /* Sets the start time for PNaCl downloading and translation to the current |
| 416 * time. | 396 * time. |
| 417 */ | 397 */ |
| 418 void (*SetPNaClStartTime)(PP_Instance instance); | 398 void (*SetPNaClStartTime)(PP_Instance instance); |
| 399 /* Downloads and streams a pexe file for PNaCl translation. |
| 400 * Fetches the content at |pexe_url| for the given instance and opt_level. |
| 401 * If a translated cached nexe is already available, |cache_hit_handle| |
| 402 * is set and |cache_hit_callback| is called. |
| 403 * Otherwise, |stream_callback| is called repeatedly with blocks of data |
| 404 * as they are received. |stream_finished_callback| is called after all |
| 405 * data has been received and dispatched to |stream_callback|. |
| 406 */ |
| 407 void (*StreamPexe)(PP_Instance instance, |
| 408 const char* pexe_url, |
| 409 int32_t opt_level, |
| 410 const struct PPP_PexeStreamHandler_1_0* stream_handler, |
| 411 void* stream_handler_user_data); |
| 419 }; | 412 }; |
| 420 | 413 |
| 421 typedef struct PPB_NaCl_Private_1_0 PPB_NaCl_Private; | 414 typedef struct PPB_NaCl_Private_1_0 PPB_NaCl_Private; |
| 422 /** | 415 /** |
| 423 * @} | 416 * @} |
| 424 */ | 417 */ |
| 425 | 418 |
| 426 #endif /* PPAPI_C_PRIVATE_PPB_NACL_PRIVATE_H_ */ | 419 #endif /* PPAPI_C_PRIVATE_PPB_NACL_PRIVATE_H_ */ |
| 427 | 420 |
| OLD | NEW |