OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 module nacl.mojom; | 5 module nacl.mojom; |
6 | 6 |
| 7 import "mojo/common/file.mojom"; |
| 8 import "url/mojo/url.mojom"; |
| 9 |
7 [Native] | 10 [Native] |
8 enum NaClErrorCode; | 11 enum NaClErrorCode; |
9 | 12 |
| 13 [Native] |
| 14 enum NaClAppProcessType; |
| 15 |
| 16 [Native] |
| 17 struct NaClResourcePrefetchRequest; |
| 18 |
| 19 struct NaClLaunchResult { |
| 20 // For plugin <-> renderer PPAPI communication. |
| 21 handle<message_pipe> ppapi_ipc_channel_handle; |
| 22 |
| 23 // For plugin loader <-> renderer control communication (loading and |
| 24 // starting nexe). |
| 25 NaClRendererHost& trusted_ipc_channel_handle; |
| 26 |
| 27 // For plugin <-> renderer ManifestService communication. |
| 28 handle<message_pipe> manifest_service_ipc_channel_handle; |
| 29 |
| 30 int32 plugin_pid; |
| 31 int32 plugin_child_id; |
| 32 |
| 33 // For NaCl <-> renderer crash information reporting. |
| 34 handle<shared_buffer> crash_info_shmem_handle; |
| 35 }; |
| 36 |
| 37 struct NaClLaunchParams { |
| 38 url.mojom.Url manifest_url; |
| 39 mojo.common.mojom.File nexe_file; |
| 40 uint64 nexe_token_lo; |
| 41 uint64 nexe_token_hi; |
| 42 array<NaClResourcePrefetchRequest> resource_prefetch_request_list; |
| 43 int32 render_view_id; |
| 44 uint32 permission_bits; |
| 45 bool uses_nonsfi_mode; |
| 46 NaClAppProcessType process_type; |
| 47 }; |
| 48 |
| 49 [Native] |
| 50 struct PnaclCacheInfo; |
| 51 |
10 interface NaClRendererHost { | 52 interface NaClRendererHost { |
11 // This message must be synchronous to ensure that the exit status is sent | 53 // This message must be synchronous to ensure that the exit status is sent |
12 // from NaCl to the renderer before the NaCl process exits very soon after. | 54 // from NaCl to the renderer before the NaCl process exits very soon after. |
13 [Sync] | 55 [Sync] |
14 ReportExitStatus(int32 exit_status) => (); | 56 ReportExitStatus(int32 exit_status) => (); |
15 | 57 |
16 // This message must be synchronous to ensure that the load status is sent | 58 // This message must be synchronous to ensure that the load status is sent |
17 // from NaCl to the renderer before the NaCl process exits very soon after. | 59 // from NaCl to the renderer before the NaCl process exits very soon after. |
18 [Sync] | 60 [Sync] |
19 ReportLoadStatus(NaClErrorCode load_status) => (); | 61 ReportLoadStatus(NaClErrorCode load_status) => (); |
20 | 62 |
21 ProvideExitControl(NaClExitControl exit_control); | 63 ProvideExitControl(NaClExitControl exit_control); |
22 }; | 64 }; |
23 | 65 |
24 // When this interface is closed, it indicates that the NaCl loader process | 66 // When this interface is closed, it indicates that the NaCl loader process |
25 // should exit. | 67 // should exit. |
26 interface NaClExitControl {}; | 68 interface NaClExitControl {}; |
| 69 |
| 70 interface NaClHost { |
| 71 // A renderer sends this to the browser process when it wants to start |
| 72 // a new instance of the Native Client process. |
| 73 [Sync] |
| 74 LaunchNaCl(NaClLaunchParams launch_params) => ( |
| 75 NaClLaunchResult? result, |
| 76 string error_message); |
| 77 |
| 78 // A renderer sends this to the browser process when it wants to |
| 79 // open a file for from the Pnacl component directory. |
| 80 [Sync] |
| 81 GetReadonlyPnaclFd( |
| 82 string name_of_requested_pnacl_file, |
| 83 bool is_executable) => ( |
| 84 mojo.common.mojom.File? output_file, |
| 85 uint64 file_token_lo, |
| 86 uint64 file_token_hi); |
| 87 |
| 88 // A renderer sends this to the browser process when it wants to |
| 89 // create a temporary file. |
| 90 [Sync] |
| 91 NaClCreateTemporaryFile() => (mojo.common.mojom.File? out_file); |
| 92 |
| 93 // A renderer sends this to the browser to request a file descriptor for |
| 94 // a translated nexe. |
| 95 NexeTempFileRequest( |
| 96 int32 render_view_id, |
| 97 int32 instance, |
| 98 PnaclCacheInfo cache_info) => ( |
| 99 int32 instance, |
| 100 mojo.common.mojom.File? output_file, |
| 101 bool is_cache_hit); |
| 102 |
| 103 |
| 104 // A renderer sends this to the browser to report that its translation has |
| 105 // finished and its temp file contains the translated nexe. |
| 106 ReportTranslationFinished(int32 instance, bool success); |
| 107 |
| 108 // A renderer sends this to the browser process to report when the client |
| 109 // architecture is not listed in the manifest. |
| 110 MissingArchError(int32 render_view_id); |
| 111 |
| 112 // A renderer sends this to the browser process when it wants to |
| 113 // open a NaCl executable file from an installed application directory. |
| 114 [Sync] |
| 115 OpenNaClExecutable( |
| 116 int32 render_view_id, |
| 117 url.mojom.Url url_of_nacl_executable_file, |
| 118 bool enable_validation_caching) => ( |
| 119 mojo.common.mojom.File? output_file, |
| 120 uint64 file_token_lo, |
| 121 uint64 file_token_hi); |
| 122 |
| 123 // A renderer sends this to the browser process to determine how many |
| 124 // processors are online. |
| 125 [Sync] |
| 126 NaClGetNumProcessors() => (int32 number_of_processors); |
| 127 |
| 128 // A renderer sends this to the browser process to determine if the |
| 129 // NaCl application started from the given NMF URL will be debugged. |
| 130 // If not (filtered out by commandline flags), it sets should_debug to false. |
| 131 [Sync] |
| 132 NaClDebugEnabledForURL(url.mojom.Url alleged_url_of_nmf_file) => ( |
| 133 bool should_debug); |
| 134 }; |
OLD | NEW |