| 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 Tue Jul 23 13:16:52 2013. */ | 6 /* From private/ppb_nacl_private.idl modified Mon Jul 29 16:44:58 2013. */ |
| 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 26 matching lines...) Expand all Loading... |
| 43 /** | 43 /** |
| 44 * @} | 44 * @} |
| 45 */ | 45 */ |
| 46 | 46 |
| 47 /** | 47 /** |
| 48 * @addtogroup Interfaces | 48 * @addtogroup Interfaces |
| 49 * @{ | 49 * @{ |
| 50 */ | 50 */ |
| 51 /* PPB_NaCl_Private */ | 51 /* PPB_NaCl_Private */ |
| 52 struct PPB_NaCl_Private_1_0 { | 52 struct PPB_NaCl_Private_1_0 { |
| 53 /* Launches NaCl's sel_ldr process. Returns PP_NACL_OK on success and | 53 /* Launches NaCl's sel_ldr process. Returns PP_EXTERNAL_PLUGIN_OK on success |
| 54 * writes a NaClHandle to imc_handle. Returns PP_NACL_FAILED on failure. | 54 * and writes a NaClHandle to imc_handle. Returns PP_EXTERNAL_PLUGIN_FAILED on |
| 55 * The |enable_ppapi_dev| parameter controls whether GetInterface | 55 * failure. The |enable_ppapi_dev| parameter controls whether GetInterface |
| 56 * returns 'Dev' interfaces to the NaCl plugin. The |uses_ppapi| flag | 56 * returns 'Dev' interfaces to the NaCl plugin. The |uses_ppapi| flag |
| 57 * indicates that the nexe run by sel_ldr will use the PPAPI APIs. | 57 * indicates that the nexe run by sel_ldr will use the PPAPI APIs. |
| 58 * This implies that LaunchSelLdr is run from the main thread. If a nexe | 58 * This implies that LaunchSelLdr is run from the main thread. If a nexe |
| 59 * does not need PPAPI, then it can run off the main thread. | 59 * does not need PPAPI, then it can run off the main thread. |
| 60 * The |uses_irt| flag indicates whether the IRT should be loaded in this | 60 * The |uses_irt| flag indicates whether the IRT should be loaded in this |
| 61 * NaCl process. This is true for ABI stable nexes. | 61 * NaCl process. This is true for ABI stable nexes. |
| 62 * The |enable_dyncode_syscalls| flag indicates whether or not the nexe | 62 * The |enable_dyncode_syscalls| flag indicates whether or not the nexe |
| 63 * will be able to use dynamic code system calls (e.g., mmap with PROT_EXEC). | 63 * will be able to use dynamic code system calls (e.g., mmap with PROT_EXEC). |
| 64 * The |enable_exception_handling| flag indicates whether or not the nexe | 64 * The |enable_exception_handling| flag indicates whether or not the nexe |
| 65 * will be able to use hardware exception handling. | 65 * will be able to use hardware exception handling. |
| 66 */ | 66 */ |
| 67 PP_ExternalPluginResult (*LaunchSelLdr)(PP_Instance instance, | 67 PP_ExternalPluginResult (*LaunchSelLdr)(PP_Instance instance, |
| 68 const char* alleged_url, | 68 const char* alleged_url, |
| 69 PP_Bool uses_irt, | 69 PP_Bool uses_irt, |
| 70 PP_Bool uses_ppapi, | 70 PP_Bool uses_ppapi, |
| 71 PP_Bool enable_ppapi_dev, | 71 PP_Bool enable_ppapi_dev, |
| 72 PP_Bool enable_dyncode_syscalls, | 72 PP_Bool enable_dyncode_syscalls, |
| 73 PP_Bool enable_exception_handling, | 73 PP_Bool enable_exception_handling, |
| 74 void* imc_handle, | 74 void* imc_handle, |
| 75 struct PP_Var* error_message); | 75 struct PP_Var* error_message); |
| 76 /* This function starts the IPC proxy so the nexe can communicate with the | 76 /* This function starts the IPC proxy so the nexe can communicate with the |
| 77 * browser. Returns PP_NACL_OK on success, otherwise a result code indicating | 77 * browser. Returns PP_EXTERNAL_PLUGIN_OK on success, otherwise a result code |
| 78 * the failure. PP_NACL_FAILED is returned if LaunchSelLdr wasn't called with | 78 * indicating the failure. PP_EXTERNAL_PLUGIN_FAILED is returned if |
| 79 * the instance. PP_NACL_ERROR_MODULE is returned if the module can't be | 79 * LaunchSelLdr wasn't called with the instance. |
| 80 * initialized. PP_NACL_ERROR_INSTANCE is returned if the instance can't be | 80 * PP_EXTERNAL_PLUGIN_ERROR_MODULE is returned if the module can't be |
| 81 * initialized. PP_NACL_USE_SRPC is returned if the plugin should use SRPC. | 81 * initialized. PP_EXTERNAL_PLUGIN_ERROR_INSTANCE is returned if the instance |
| 82 * can't be initialized. |
| 82 */ | 83 */ |
| 83 PP_ExternalPluginResult (*StartPpapiProxy)(PP_Instance instance); | 84 PP_ExternalPluginResult (*StartPpapiProxy)(PP_Instance instance); |
| 84 /* On POSIX systems, this function returns the file descriptor of | 85 /* On POSIX systems, this function returns the file descriptor of |
| 85 * /dev/urandom. On non-POSIX systems, this function returns 0. | 86 * /dev/urandom. On non-POSIX systems, this function returns 0. |
| 86 */ | 87 */ |
| 87 int32_t (*UrandomFD)(void); | 88 int32_t (*UrandomFD)(void); |
| 88 /* Whether the Pepper 3D interfaces should be disabled in the NaCl PPAPI | 89 /* Whether the Pepper 3D interfaces should be disabled in the NaCl PPAPI |
| 89 * proxy. This is so paranoid admins can effectively prevent untrusted shader | 90 * proxy. This is so paranoid admins can effectively prevent untrusted shader |
| 90 * code to be processed by the graphics stack. | 91 * code to be processed by the graphics stack. |
| 91 */ | 92 */ |
| 92 PP_Bool (*Are3DInterfacesDisabled)(void); | 93 PP_Bool (*Are3DInterfacesDisabled)(void); |
| 93 /* This is Windows-specific. This is a replacement for DuplicateHandle() for | 94 /* This is Windows-specific. This is a replacement for DuplicateHandle() for |
| 94 * use inside the Windows sandbox. Note that we provide this via dependency | 95 * use inside the Windows sandbox. Note that we provide this via dependency |
| 95 * injection only to avoid the linkage problems that occur because the NaCl | 96 * injection only to avoid the linkage problems that occur because the NaCl |
| 96 * plugin is built as a separate DLL/DSO | 97 * plugin is built as a separate DLL/DSO |
| 97 * (see http://code.google.com/p/chromium/issues/detail?id=114439#c8). | 98 * (see http://code.google.com/p/chromium/issues/detail?id=114439#c8). |
| 98 */ | 99 */ |
| 99 int32_t (*BrokerDuplicateHandle)(PP_FileHandle source_handle, | 100 int32_t (*BrokerDuplicateHandle)(PP_FileHandle source_handle, |
| 100 uint32_t process_id, | 101 uint32_t process_id, |
| 101 PP_FileHandle* target_handle, | 102 PP_FileHandle* target_handle, |
| 102 uint32_t desired_access, | 103 uint32_t desired_access, |
| 103 uint32_t options); | 104 uint32_t options); |
| 105 /* Check if PNaCl is installed and attempt to install if necessary. |
| 106 * Callback is called when the check is done and PNaCl is already installed, |
| 107 * or after an on-demand install is attempted. Called back with PP_OK if |
| 108 * PNaCl is available. Called back with an error otherwise. |
| 109 */ |
| 110 int32_t (*EnsurePnaclInstalled)(PP_Instance instance, |
| 111 struct PP_CompletionCallback callback); |
| 104 /* Returns a read-only file descriptor of a file rooted in the Pnacl | 112 /* Returns a read-only file descriptor of a file rooted in the Pnacl |
| 105 * component directory, or an invalid handle on failure. | 113 * component directory, or an invalid handle on failure. |
| 106 * Do we want this to take a completion callback and be async, or | |
| 107 * could we make this happen on another thread? | |
| 108 */ | 114 */ |
| 109 PP_FileHandle (*GetReadonlyPnaclFd)(const char* filename); | 115 PP_FileHandle (*GetReadonlyPnaclFd)(const char* filename); |
| 110 /* This creates a temporary file that will be deleted by the time | 116 /* This creates a temporary file that will be deleted by the time |
| 111 * the last handle is closed (or earlier on POSIX systems), and | 117 * the last handle is closed (or earlier on POSIX systems), and |
| 112 * returns a posix handle to that temporary file. | 118 * returns a posix handle to that temporary file. |
| 113 */ | 119 */ |
| 114 PP_FileHandle (*CreateTemporaryFile)(PP_Instance instance); | 120 PP_FileHandle (*CreateTemporaryFile)(PP_Instance instance); |
| 115 /* Create a temporary file, which will be deleted by the time the last | 121 /* Create a temporary file, which will be deleted by the time the last |
| 116 * handle is closed (or earlier on POSIX systems), to use for the nexe | 122 * handle is closed (or earlier on POSIX systems), to use for the nexe |
| 117 * with the cache information given by |pexe_url|, |abi_version|, |opt_level|, | 123 * with the cache information given by |pexe_url|, |abi_version|, |opt_level|, |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 161 uint64_t* file_token_hi); | 167 uint64_t* file_token_hi); |
| 162 }; | 168 }; |
| 163 | 169 |
| 164 typedef struct PPB_NaCl_Private_1_0 PPB_NaCl_Private; | 170 typedef struct PPB_NaCl_Private_1_0 PPB_NaCl_Private; |
| 165 /** | 171 /** |
| 166 * @} | 172 * @} |
| 167 */ | 173 */ |
| 168 | 174 |
| 169 #endif /* PPAPI_C_PRIVATE_PPB_NACL_PRIVATE_H_ */ | 175 #endif /* PPAPI_C_PRIVATE_PPB_NACL_PRIVATE_H_ */ |
| 170 | 176 |
| OLD | NEW |