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_NACL_OK on success and |
bbudge
2013/07/23 23:59:58
This comment should be rewritten to match the new
jam
2013/07/24 05:07:39
Done.
| |
40 * writes a NaClHandle to imc_handle. Returns PP_NACL_FAILED on failure. | 26 * writes a NaClHandle to imc_handle. Returns PP_NACL_FAILED on failure. |
41 * The |enable_ppapi_dev| parameter controls whether GetInterface | 27 * 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_NACL_OK on success, otherwise a result code indicating |
65 * the failure. PP_NACL_FAILED is returned if LaunchSelLdr wasn't called with | 51 * the failure. PP_NACL_FAILED is returned if LaunchSelLdr wasn't called with |
66 * the instance. PP_NACL_ERROR_MODULE is returned if the module can't be | 52 * the instance. PP_NACL_ERROR_MODULE is returned if the module can't be |
67 * initialized. PP_NACL_ERROR_INSTANCE is returned if the instance can't be | 53 * initialized. PP_NACL_ERROR_INSTANCE is returned if the instance can't be |
68 * initialized. PP_NACL_USE_SRPC is returned if the plugin should use SRPC. | 54 * initialized. PP_NACL_USE_SRPC is returned if the plugin should use SRPC. |
69 */ | 55 */ |
70 PP_NaClResult StartPpapiProxy(PP_Instance instance); | 56 PP_ExternalPluginResult StartPpapiProxy(PP_Instance instance); |
71 | 57 |
72 /* On POSIX systems, this function returns the file descriptor of | 58 /* On POSIX systems, this function returns the file descriptor of |
73 * /dev/urandom. On non-POSIX systems, this function returns 0. | 59 * /dev/urandom. On non-POSIX systems, this function returns 0. |
74 */ | 60 */ |
75 int32_t UrandomFD(); | 61 int32_t UrandomFD(); |
76 | 62 |
77 /* Whether the Pepper 3D interfaces should be disabled in the NaCl PPAPI | 63 /* Whether the Pepper 3D interfaces should be disabled in the NaCl PPAPI |
78 * proxy. This is so paranoid admins can effectively prevent untrusted shader | 64 * proxy. This is so paranoid admins can effectively prevent untrusted shader |
79 * code to be processed by the graphics stack. | 65 * code to be processed by the graphics stack. |
80 */ | 66 */ |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
139 | 125 |
140 /* Return true if we are off the record. | 126 /* Return true if we are off the record. |
141 */ | 127 */ |
142 PP_Bool IsOffTheRecord(); | 128 PP_Bool IsOffTheRecord(); |
143 | 129 |
144 /* Return true if PNaCl is turned on. | 130 /* Return true if PNaCl is turned on. |
145 */ | 131 */ |
146 PP_Bool IsPnaclEnabled(); | 132 PP_Bool IsPnaclEnabled(); |
147 | 133 |
148 /* Display a UI message to the user. */ | 134 /* Display a UI message to the user. */ |
149 PP_NaClResult ReportNaClError([in] PP_Instance instance, | 135 PP_ExternalPluginResult ReportNaClError([in] PP_Instance instance, |
150 [in] PP_NaClError message_id); | 136 [in] PP_NaClError message_id); |
151 | 137 |
152 /* Opens a NaCl executable file in the application's extension directory | 138 /* 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 | 139 * corresponding to the file URL and returns a file descriptor, or an invalid |
154 * handle on failure. |metadata| is left unchanged on failure. | 140 * handle on failure. |metadata| is left unchanged on failure. |
155 */ | 141 */ |
156 PP_FileHandle OpenNaClExecutable([in] PP_Instance instance, | 142 PP_FileHandle OpenNaClExecutable([in] PP_Instance instance, |
157 [in] str_t file_url, | 143 [in] str_t file_url, |
158 [out] uint64_t file_token_lo, | 144 [out] uint64_t file_token_lo, |
159 [out] uint64_t file_token_hi); | 145 [out] uint64_t file_token_hi); |
160 }; | 146 }; |
OLD | NEW |