| 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 #inline c | 9 #inline c |
| 10 #include "ppapi/c/private/pp_file_handle.h" | 10 #include "ppapi/c/private/pp_file_handle.h" |
| 11 #include "ppapi/c/private/ppb_instance_private.h" |
| 11 #endinl | 12 #endinl |
| 12 | 13 |
| 13 /** | |
| 14 * The <code>PP_NaClResult</code> enum contains NaCl result codes. | |
| 15 */ | |
| 16 [assert_size(4)] | |
| 17 enum PP_NaClResult { | |
| 18 /** Successful NaCl call */ | |
| 19 PP_NACL_OK = 0, | |
| 20 /** Unspecified NaCl error */ | |
| 21 PP_NACL_FAILED = 1, | |
| 22 /** Error creating the module */ | |
| 23 PP_NACL_ERROR_MODULE = 2, | |
| 24 /** Error creating and initializing the instance */ | |
| 25 PP_NACL_ERROR_INSTANCE = 3 | |
| 26 }; | |
| 27 | |
| 28 /** NaCl-specific errors that should be reported to the user */ | 14 /** NaCl-specific errors that should be reported to the user */ |
| 29 enum PP_NaClError { | 15 enum PP_NaClError { |
| 30 /** | 16 /** |
| 31 * The manifest program element does not contain a program usable on the | 17 * The manifest program element does not contain a program usable on the |
| 32 * user's architecture | 18 * user's architecture |
| 33 */ | 19 */ |
| 34 PP_NACL_MANIFEST_MISSING_ARCH = 0 | 20 PP_NACL_MANIFEST_MISSING_ARCH = 0 |
| 35 }; | 21 }; |
| 36 | 22 |
| 37 /* PPB_NaCl_Private */ | 23 /* PPB_NaCl_Private */ |
| 38 interface PPB_NaCl_Private { | 24 interface PPB_NaCl_Private { |
| 39 /* Launches NaCl's sel_ldr process. Returns PP_NACL_OK on success and | 25 /* Launches NaCl's sel_ldr process. Returns PP_EXTERNAL_PLUGIN_OK on success |
| 40 * writes a NaClHandle to imc_handle. Returns PP_NACL_FAILED on failure. | 26 * and writes a NaClHandle to imc_handle. Returns PP_EXTERNAL_PLUGIN_FAILED on |
| 41 * The |enable_ppapi_dev| parameter controls whether GetInterface | 27 * failure. The |enable_ppapi_dev| parameter controls whether GetInterface |
| 42 * returns 'Dev' interfaces to the NaCl plugin. The |uses_ppapi| flag | 28 * returns 'Dev' interfaces to the NaCl plugin. The |uses_ppapi| flag |
| 43 * indicates that the nexe run by sel_ldr will use the PPAPI APIs. | 29 * indicates that the nexe run by sel_ldr will use the PPAPI APIs. |
| 44 * This implies that LaunchSelLdr is run from the main thread. If a nexe | 30 * This implies that LaunchSelLdr is run from the main thread. If a nexe |
| 45 * does not need PPAPI, then it can run off the main thread. | 31 * does not need PPAPI, then it can run off the main thread. |
| 46 * The |uses_irt| flag indicates whether the IRT should be loaded in this | 32 * The |uses_irt| flag indicates whether the IRT should be loaded in this |
| 47 * NaCl process. This is true for ABI stable nexes. | 33 * NaCl process. This is true for ABI stable nexes. |
| 48 * The |enable_dyncode_syscalls| flag indicates whether or not the nexe | 34 * The |enable_dyncode_syscalls| flag indicates whether or not the nexe |
| 49 * will be able to use dynamic code system calls (e.g., mmap with PROT_EXEC). | 35 * will be able to use dynamic code system calls (e.g., mmap with PROT_EXEC). |
| 50 * The |enable_exception_handling| flag indicates whether or not the nexe | 36 * The |enable_exception_handling| flag indicates whether or not the nexe |
| 51 * will be able to use hardware exception handling. | 37 * will be able to use hardware exception handling. |
| 52 */ | 38 */ |
| 53 PP_NaClResult LaunchSelLdr([in] PP_Instance instance, | 39 PP_ExternalPluginResult LaunchSelLdr([in] PP_Instance instance, |
| 54 [in] str_t alleged_url, | 40 [in] str_t alleged_url, |
| 55 [in] PP_Bool uses_irt, | 41 [in] PP_Bool uses_irt, |
| 56 [in] PP_Bool uses_ppapi, | 42 [in] PP_Bool uses_ppapi, |
| 57 [in] PP_Bool enable_ppapi_dev, | 43 [in] PP_Bool enable_ppapi_dev, |
| 58 [in] PP_Bool enable_dyncode_syscalls, | 44 [in] PP_Bool enable_dyncode_syscalls, |
| 59 [in] PP_Bool enable_exception_handling, | 45 [in] PP_Bool enable_exception_handling, |
| 60 [out] mem_t imc_handle, | 46 [out] mem_t imc_handle, |
| 61 [out] PP_Var error_message); | 47 [out] PP_Var error_message); |
| 62 | 48 |
| 63 /* This function starts the IPC proxy so the nexe can communicate with the | 49 /* This function starts the IPC proxy so the nexe can communicate with the |
| 64 * browser. Returns PP_NACL_OK on success, otherwise a result code indicating | 50 * browser. Returns PP_EXTERNAL_PLUGIN_OK on success, otherwise a result code |
| 65 * the failure. PP_NACL_FAILED is returned if LaunchSelLdr wasn't called with | 51 * indicating the failure. PP_EXTERNAL_PLUGIN_FAILED is returned if |
| 66 * the instance. PP_NACL_ERROR_MODULE is returned if the module can't be | 52 * LaunchSelLdr wasn't called with the instance. |
| 67 * initialized. PP_NACL_ERROR_INSTANCE is returned if the instance can't be | 53 * PP_EXTERNAL_PLUGIN_ERROR_MODULE is returned if the module can't be |
| 68 * initialized. PP_NACL_USE_SRPC is returned if the plugin should use SRPC. | 54 * initialized. PP_EXTERNAL_PLUGIN_ERROR_INSTANCE is returned if the instance |
| 55 * can't be initialized. |
| 69 */ | 56 */ |
| 70 PP_NaClResult StartPpapiProxy(PP_Instance instance); | 57 PP_ExternalPluginResult StartPpapiProxy(PP_Instance instance); |
| 71 | 58 |
| 72 /* On POSIX systems, this function returns the file descriptor of | 59 /* On POSIX systems, this function returns the file descriptor of |
| 73 * /dev/urandom. On non-POSIX systems, this function returns 0. | 60 * /dev/urandom. On non-POSIX systems, this function returns 0. |
| 74 */ | 61 */ |
| 75 int32_t UrandomFD(); | 62 int32_t UrandomFD(); |
| 76 | 63 |
| 77 /* Whether the Pepper 3D interfaces should be disabled in the NaCl PPAPI | 64 /* Whether the Pepper 3D interfaces should be disabled in the NaCl PPAPI |
| 78 * proxy. This is so paranoid admins can effectively prevent untrusted shader | 65 * proxy. This is so paranoid admins can effectively prevent untrusted shader |
| 79 * code to be processed by the graphics stack. | 66 * code to be processed by the graphics stack. |
| 80 */ | 67 */ |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 139 | 126 |
| 140 /* Return true if we are off the record. | 127 /* Return true if we are off the record. |
| 141 */ | 128 */ |
| 142 PP_Bool IsOffTheRecord(); | 129 PP_Bool IsOffTheRecord(); |
| 143 | 130 |
| 144 /* Return true if PNaCl is turned on. | 131 /* Return true if PNaCl is turned on. |
| 145 */ | 132 */ |
| 146 PP_Bool IsPnaclEnabled(); | 133 PP_Bool IsPnaclEnabled(); |
| 147 | 134 |
| 148 /* Display a UI message to the user. */ | 135 /* Display a UI message to the user. */ |
| 149 PP_NaClResult ReportNaClError([in] PP_Instance instance, | 136 PP_ExternalPluginResult ReportNaClError([in] PP_Instance instance, |
| 150 [in] PP_NaClError message_id); | 137 [in] PP_NaClError message_id); |
| 151 | 138 |
| 152 /* Opens a NaCl executable file in the application's extension directory | 139 /* Opens a NaCl executable file in the application's extension directory |
| 153 * corresponding to the file URL and returns a file descriptor, or an invalid | 140 * corresponding to the file URL and returns a file descriptor, or an invalid |
| 154 * handle on failure. |metadata| is left unchanged on failure. | 141 * handle on failure. |metadata| is left unchanged on failure. |
| 155 */ | 142 */ |
| 156 PP_FileHandle OpenNaClExecutable([in] PP_Instance instance, | 143 PP_FileHandle OpenNaClExecutable([in] PP_Instance instance, |
| 157 [in] str_t file_url, | 144 [in] str_t file_url, |
| 158 [out] uint64_t file_token_lo, | 145 [out] uint64_t file_token_lo, |
| 159 [out] uint64_t file_token_hi); | 146 [out] uint64_t file_token_hi); |
| 160 }; | 147 }; |
| OLD | NEW |