Refactor android test results logging.
[chromium-blink-merge.git] / ppapi / api / private / ppb_nacl_private.idl
blobaa65b97f18d89efc6ab8ec22c5927d416d716366
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
3 * found in the LICENSE file.
4 */
6 /* This file contains NaCl private interfaces. */
8 #inline c
9 #include "ppapi/c/private/pp_file_handle.h"
10 #endinl
12 /**
13 * The <code>PP_NaClResult</code> enum contains NaCl result codes.
15 [assert_size(4)]
16 enum PP_NaClResult {
17 /** Successful NaCl call */
18 PP_NACL_OK = 0,
19 /** Unspecified NaCl error */
20 PP_NACL_FAILED = 1,
21 /** Error creating the module */
22 PP_NACL_ERROR_MODULE = 2,
23 /** Error creating and initializing the instance */
24 PP_NACL_ERROR_INSTANCE = 3,
25 /** SRPC proxy should be used instead */
26 PP_NACL_USE_SRPC = 128
29 /** NaCl-specific errors that should be reported to the user */
30 enum PP_NaClError {
31 /**
32 * The manifest program element does not contain a program usable on the
33 * user's architecture
35 PP_NACL_MANIFEST_MISSING_ARCH = 0
38 /* PPB_NaCl_Private */
39 interface PPB_NaCl_Private {
40 /* Launches NaCl's sel_ldr process. Returns PP_NACL_OK on success and writes
41 * |socket_count| nacl::Handles to imc_handles. Returns PP_NACL_FAILED on
42 * failure. The |enable_ppapi_dev| parameter controls whether GetInterface
43 * returns 'Dev' interfaces to the NaCl plugin. The |uses_ppapi| flag
44 * indicates that the nexe run by sel_ldr will use the PPAPI APIs.
45 * This implies that LaunchSelLdr is run from the main thread. If a nexe
46 * does not need PPAPI, then it can run off the main thread.
48 PP_NaClResult LaunchSelLdr([in] PP_Instance instance,
49 [in] str_t alleged_url,
50 [in] PP_Bool uses_ppapi,
51 [in] PP_Bool enable_ppapi_dev,
52 [in] int32_t socket_count,
53 [out] mem_t imc_handles);
55 /* This function starts the IPC proxy so the nexe can communicate with the
56 * browser. Returns PP_NACL_OK on success, otherwise a result code indicating
57 * the failure. PP_NACL_FAILED is returned if LaunchSelLdr wasn't called with
58 * the instance. PP_NACL_ERROR_MODULE is returned if the module can't be
59 * initialized. PP_NACL_ERROR_INSTANCE is returned if the instance can't be
60 * initialized. PP_NACL_USE_SRPC is returned if the plugin should use SRPC.
62 PP_NaClResult StartPpapiProxy(PP_Instance instance);
64 /* On POSIX systems, this function returns the file descriptor of
65 * /dev/urandom. On non-POSIX systems, this function returns 0.
67 int32_t UrandomFD();
69 /* Whether the Pepper 3D interfaces should be disabled in the NaCl PPAPI
70 * proxy. This is so paranoid admins can effectively prevent untrusted shader
71 * code to be processed by the graphics stack.
73 PP_Bool Are3DInterfacesDisabled();
75 /* Enables the creation of sel_ldr processes off of the main thread.
77 void EnableBackgroundSelLdrLaunch();
79 /* This is Windows-specific. This is a replacement for DuplicateHandle() for
80 * use inside the Windows sandbox. Note that we provide this via dependency
81 * injection only to avoid the linkage problems that occur because the NaCl
82 * plugin is built as a separate DLL/DSO
83 * (see http://code.google.com/p/chromium/issues/detail?id=114439#c8).
85 int32_t BrokerDuplicateHandle([in] PP_FileHandle source_handle,
86 [in] uint32_t process_id,
87 [out] PP_FileHandle target_handle,
88 [in] uint32_t desired_access,
89 [in] uint32_t options);
91 /* Returns a read-only file descriptor of a file rooted in the Pnacl
92 * component directory, or -1 on error.
93 * Do we want this to take a completion callback and be async, or
94 * could we make this happen on another thread?
96 PP_FileHandle GetReadonlyPnaclFd([in] str_t filename);
98 /* This creates a temporary file that will be deleted by the time
99 * the last handle is closed (or earlier on POSIX systems), and
100 * returns a posix handle to that temporary file.
102 PP_FileHandle CreateTemporaryFile([in] PP_Instance instance);
104 /* Return true if we are off the record.
106 PP_Bool IsOffTheRecord();
108 /* Return true if PNaCl is turned on.
110 PP_Bool IsPnaclEnabled();
112 /* Display a UI message to the user. */
113 PP_NaClResult ReportNaClError([in] PP_Instance instance,
114 [in] PP_NaClError message_id);