OLD | NEW |
1 // Copyright (c) 2011 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 #ifndef PPAPI_C_PRIVATE_PPB_NACL_UTIL_PRIVATE_H_ | 5 #ifndef PPAPI_C_PRIVATE_PPB_NACL_UTIL_PRIVATE_H_ |
6 #define PPAPI_C_PRIVATE_PPB_NACL_UTIL_PRIVATE_H_ | 6 #define PPAPI_C_PRIVATE_PPB_NACL_UTIL_PRIVATE_H_ |
7 | 7 |
8 #include "ppapi/c/pp_resource.h" | 8 #include "ppapi/c/pp_resource.h" |
9 #include "ppapi/c/pp_stdint.h" | 9 #include "ppapi/c/pp_stdint.h" |
10 | 10 |
11 #define PPB_NACL_PRIVATE_INTERFACE "PPB_NaCl(Private);0.2" | 11 #define PPB_NACL_PRIVATE_INTERFACE "PPB_NaCl(Private);0.3" |
12 | 12 |
13 struct PPB_NaCl_Private { | 13 struct PPB_NaCl_Private { |
14 // This function launches NaCl's sel_ldr process. On success, the function | 14 // This function launches NaCl's sel_ldr process. On success, the function |
15 // returns true, otherwise it returns false. When it returns true, it will | 15 // returns true, otherwise it returns false. When it returns true, it will |
16 // write |socket_count| nacl::Handles to imc_handles and will write the | 16 // write |socket_count| nacl::Handles to imc_handles and will write the |
17 // nacl::Handle of the created process to |nacl_process_handle|. Finally, | 17 // nacl::Handle of the created process to |nacl_process_handle|. Finally, |
18 // the function will write the process ID of the created process to | 18 // the function will write the process ID of the created process to |
19 // |nacl_process_id|. Unless EnableBackgroundSelLdrLaunch is called, this | 19 // |nacl_process_id|. Unless EnableBackgroundSelLdrLaunch is called, this |
20 // method must be invoked from the main thread. | 20 // method must be invoked from the main thread. |
21 bool (*LaunchSelLdr)(const char* alleged_url, int socket_count, | 21 bool (*LaunchSelLdr)(const char* alleged_url, int socket_count, |
22 void* imc_handles, void* nacl_process_handle, | 22 void* imc_handles, void* nacl_process_handle, |
23 int* nacl_process_id); | 23 int* nacl_process_id); |
24 | 24 |
25 // On POSIX systems, this function returns the file descriptor of | 25 // On POSIX systems, this function returns the file descriptor of |
26 // /dev/urandom. On non-POSIX systems, this function returns 0. | 26 // /dev/urandom. On non-POSIX systems, this function returns 0. |
27 int (*UrandomFD)(void); | 27 int (*UrandomFD)(void); |
28 | 28 |
29 // Whether the Pepper 3D interfaces should be disabled in the NaCl PPAPI | 29 // Whether the Pepper 3D interfaces should be disabled in the NaCl PPAPI |
30 // proxy. This is so paranoid admins can effectively prevent untrusted shader | 30 // proxy. This is so paranoid admins can effectively prevent untrusted shader |
31 // code to be processed by the graphics stack. | 31 // code to be processed by the graphics stack. |
32 bool (*Are3DInterfacesDisabled)(); | 32 bool (*Are3DInterfacesDisabled)(); |
33 | 33 |
34 // Enables the creation of sel_ldr processes from other than the main thread. | 34 // Enables the creation of sel_ldr processes from other than the main thread. |
35 void (*EnableBackgroundSelLdrLaunch)(); | 35 void (*EnableBackgroundSelLdrLaunch)(); |
| 36 |
| 37 // This is Windows-specific. This is a replacement for |
| 38 // DuplicateHandle() for use inside the Windows sandbox. Note that |
| 39 // we provide this via dependency injection only to avoid the |
| 40 // linkage problems that occur because the NaCl plugin is built as a |
| 41 // separate DLL/DSO (see |
| 42 // http://code.google.com/p/chromium/issues/detail?id=114439#c8). |
| 43 // We use void* rather than the Windows HANDLE type to avoid an |
| 44 // #ifdef here. We use int rather than PP_Bool/bool so that this is |
| 45 // usable with NaClSetBrokerDuplicateHandleFunc() without further |
| 46 // wrapping. |
| 47 int (*BrokerDuplicateHandle)(void* source_handle, |
| 48 uint32_t process_id, |
| 49 void** target_handle, |
| 50 uint32_t desired_access, |
| 51 uint32_t options); |
36 }; | 52 }; |
37 | 53 |
38 #endif // PPAPI_C_PRIVATE_PPB_NACL_PRIVATE_H_ | 54 #endif // PPAPI_C_PRIVATE_PPB_NACL_PRIVATE_H_ |
OLD | NEW |