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 May 21 13:23:26 2014. */ | 6 /* From private/ppb_nacl_private.idl modified Fri May 23 08:51:49 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" |
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
197 /* Called when irt_open_resource() is invoked in the NaCl plugin. | 197 /* Called when irt_open_resource() is invoked in the NaCl plugin. |
198 * Upon completion, callback will be invoked with given callback_user_data | 198 * Upon completion, callback will be invoked with given callback_user_data |
199 * and the result file handle (or PP_kInvalidFileHandle on error). */ | 199 * and the result file handle (or PP_kInvalidFileHandle on error). */ |
200 PP_Bool (*OpenResource)(void* user_data, | 200 PP_Bool (*OpenResource)(void* user_data, |
201 const char* entry_key, | 201 const char* entry_key, |
202 PP_OpenResourceCompletionCallback callback, | 202 PP_OpenResourceCompletionCallback callback, |
203 void* callback_user_data); | 203 void* callback_user_data); |
204 }; | 204 }; |
205 | 205 |
206 typedef struct PPP_ManifestService_1_0 PPP_ManifestService; | 206 typedef struct PPP_ManifestService_1_0 PPP_ManifestService; |
| 207 /** |
| 208 * @} |
| 209 */ |
207 | 210 |
| 211 /** |
| 212 * @addtogroup Structs |
| 213 * @{ |
| 214 */ |
| 215 /* Corresponds to NaClFileInfo in |
| 216 * native_client/src/trusted/validator/nacl_file_info.h */ |
| 217 struct PP_NaClFileInfo { |
| 218 PP_FileHandle handle; |
| 219 /* See NaClFileToken comment in nacl_file_info.h */ |
| 220 uint64_t token_lo; |
| 221 uint64_t token_hi; |
| 222 }; |
| 223 /** |
| 224 * @} |
| 225 */ |
| 226 |
| 227 /** |
| 228 * @addtogroup Interfaces |
| 229 * @{ |
| 230 */ |
208 /* PPB_NaCl_Private */ | 231 /* PPB_NaCl_Private */ |
209 struct PPB_NaCl_Private_1_0 { | 232 struct PPB_NaCl_Private_1_0 { |
210 /* Launches NaCl's sel_ldr process. Returns PP_EXTERNAL_PLUGIN_OK on success | 233 /* Launches NaCl's sel_ldr process. Returns PP_EXTERNAL_PLUGIN_OK on success |
211 * and writes a NaClHandle to imc_handle. Returns PP_EXTERNAL_PLUGIN_FAILED on | 234 * and writes a NaClHandle to imc_handle. Returns PP_EXTERNAL_PLUGIN_FAILED on |
212 * failure. The |enable_ppapi_dev| parameter controls whether GetInterface | 235 * failure. The |enable_ppapi_dev| parameter controls whether GetInterface |
213 * returns 'Dev' interfaces to the NaCl plugin. The |uses_ppapi| flag | 236 * returns 'Dev' interfaces to the NaCl plugin. The |uses_ppapi| flag |
214 * indicates that the nexe run by sel_ldr will use the PPAPI APIs. | 237 * indicates that the nexe run by sel_ldr will use the PPAPI APIs. |
215 * This implies that LaunchSelLdr is run from the main thread. If a nexe | 238 * This implies that LaunchSelLdr is run from the main thread. If a nexe |
216 * does not need PPAPI, then it can run off the main thread. | 239 * does not need PPAPI, then it can run off the main thread. |
217 * The |uses_irt| flag indicates whether the IRT should be loaded in this | 240 * The |uses_irt| flag indicates whether the IRT should be loaded in this |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
302 /* Report to the browser that translation of the pexe for |instance| | 325 /* Report to the browser that translation of the pexe for |instance| |
303 * has finished, or aborted with an error. If |success| is true, the | 326 * has finished, or aborted with an error. If |success| is true, the |
304 * browser may then store the translation in the cache. The renderer | 327 * browser may then store the translation in the cache. The renderer |
305 * must first have called GetNexeFd for the same instance. (The browser is | 328 * must first have called GetNexeFd for the same instance. (The browser is |
306 * not guaranteed to store the nexe even if |success| is true; if there is | 329 * not guaranteed to store the nexe even if |success| is true; if there is |
307 * an error on the browser side, or the file is too big for the cache, or | 330 * an error on the browser side, or the file is too big for the cache, or |
308 * the browser is in incognito mode, no notification will be delivered to | 331 * the browser is in incognito mode, no notification will be delivered to |
309 * the plugin.) | 332 * the plugin.) |
310 */ | 333 */ |
311 void (*ReportTranslationFinished)(PP_Instance instance, PP_Bool success); | 334 void (*ReportTranslationFinished)(PP_Instance instance, PP_Bool success); |
312 /* Opens a NaCl executable file in the application's extension directory | |
313 * corresponding to the file URL and returns a file descriptor, or an invalid | |
314 * handle on failure. |metadata| is left unchanged on failure. | |
315 */ | |
316 PP_FileHandle (*OpenNaClExecutable)(PP_Instance instance, | |
317 const char* file_url, | |
318 uint64_t* file_token_lo, | |
319 uint64_t* file_token_hi); | |
320 /* Dispatch a progress event on the DOM element where the given instance is | 335 /* Dispatch a progress event on the DOM element where the given instance is |
321 * embedded. | 336 * embedded. |
322 */ | 337 */ |
323 void (*DispatchEvent)(PP_Instance instance, | 338 void (*DispatchEvent)(PP_Instance instance, |
324 PP_NaClEventType event_type, | 339 PP_NaClEventType event_type, |
325 const char* resource_url, | 340 const char* resource_url, |
326 PP_Bool length_is_computable, | 341 PP_Bool length_is_computable, |
327 uint64_t loaded_bytes, | 342 uint64_t loaded_bytes, |
328 uint64_t total_bytes); | 343 uint64_t total_bytes); |
329 /* Report that the nexe loaded successfully. */ | 344 /* Report that the nexe loaded successfully. */ |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
370 const char* argn[], | 385 const char* argn[], |
371 const char* argv[]); | 386 const char* argv[]); |
372 /* Returns the size of the nexe. */ | 387 /* Returns the size of the nexe. */ |
373 int64_t (*GetNexeSize)(PP_Instance instance); | 388 int64_t (*GetNexeSize)(PP_Instance instance); |
374 /* Performs accounting for requesting the NaCl manifest at the given URL. */ | 389 /* Performs accounting for requesting the NaCl manifest at the given URL. */ |
375 void (*RequestNaClManifest)(PP_Instance instance, | 390 void (*RequestNaClManifest)(PP_Instance instance, |
376 const char* manifest_url, | 391 const char* manifest_url, |
377 int32_t* manifest_id, | 392 int32_t* manifest_id, |
378 struct PP_CompletionCallback callback); | 393 struct PP_CompletionCallback callback); |
379 struct PP_Var (*GetManifestBaseURL)(PP_Instance instance); | 394 struct PP_Var (*GetManifestBaseURL)(PP_Instance instance); |
380 PP_Bool (*ResolvesRelativeToPluginBaseUrl)(PP_Instance instance, | |
381 const char* url); | |
382 /* Processes the NaCl manifest once it's been retrieved. | 395 /* Processes the NaCl manifest once it's been retrieved. |
383 * TODO(teravest): Move the rest of the supporting logic out of the trusted | 396 * TODO(teravest): Move the rest of the supporting logic out of the trusted |
384 * plugin. | 397 * plugin. |
385 */ | 398 */ |
386 void (*ProcessNaClManifest)(PP_Instance instance, const char* program_url); | 399 void (*ProcessNaClManifest)(PP_Instance instance, const char* program_url); |
387 /* Returns the manifest url as passed as a plugin argument. */ | 400 /* Returns the manifest url as passed as a plugin argument. */ |
388 struct PP_Var (*GetManifestURLArgument)(PP_Instance instance); | 401 struct PP_Var (*GetManifestURLArgument)(PP_Instance instance); |
389 PP_Bool (*DevInterfacesEnabled)(PP_Instance instance); | 402 PP_Bool (*DevInterfacesEnabled)(PP_Instance instance); |
390 int32_t (*CreatePnaclManifest)(PP_Instance instance); | 403 int32_t (*CreatePnaclManifest)(PP_Instance instance); |
391 void (*DestroyManifest)(PP_Instance instance, int32_t manifest_id); | 404 void (*DestroyManifest)(PP_Instance instance, int32_t manifest_id); |
(...skipping 27 matching lines...) Expand all Loading... |
419 * to a handle to a file containing its contents. | 432 * to a handle to a file containing its contents. |
420 * If metadata for identity-based validation caching is available | 433 * If metadata for identity-based validation caching is available |
421 * then it sets file_token_lo and file_token_lo (otherwise left untouched). | 434 * then it sets file_token_lo and file_token_lo (otherwise left untouched). |
422 */ | 435 */ |
423 void (*DownloadNexe)(PP_Instance instance, | 436 void (*DownloadNexe)(PP_Instance instance, |
424 const char* url, | 437 const char* url, |
425 PP_FileHandle* handle, | 438 PP_FileHandle* handle, |
426 uint64_t* file_token_lo, | 439 uint64_t* file_token_lo, |
427 uint64_t* file_token_hi, | 440 uint64_t* file_token_hi, |
428 struct PP_CompletionCallback callback); | 441 struct PP_CompletionCallback callback); |
| 442 /* Downloads a non-nexe file specified in the manifest, and sets |file_info| |
| 443 * to corresponding information about the file. */ |
| 444 void (*DownloadFile)(PP_Instance instance, |
| 445 const char* url, |
| 446 struct PP_NaClFileInfo* file_info, |
| 447 struct PP_CompletionCallback callback); |
429 }; | 448 }; |
430 | 449 |
431 typedef struct PPB_NaCl_Private_1_0 PPB_NaCl_Private; | 450 typedef struct PPB_NaCl_Private_1_0 PPB_NaCl_Private; |
432 /** | 451 /** |
433 * @} | 452 * @} |
434 */ | 453 */ |
435 | 454 |
436 #endif /* PPAPI_C_PRIVATE_PPB_NACL_PRIVATE_H_ */ | 455 #endif /* PPAPI_C_PRIVATE_PPB_NACL_PRIVATE_H_ */ |
437 | 456 |
OLD | NEW |