OLD | NEW |
1 // -*- c++ -*- | 1 // -*- c++ -*- |
2 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 2 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
3 // Use of this source code is governed by a BSD-style license that can be | 3 // Use of this source code is governed by a BSD-style license that can be |
4 // found in the LICENSE file. | 4 // found in the LICENSE file. |
5 | 5 |
6 // The portable representation of an instance and root scriptable object. | 6 // The portable representation of an instance and root scriptable object. |
7 // The PPAPI version of the plugin instantiates a subclass of this class. | 7 // The PPAPI version of the plugin instantiates a subclass of this class. |
8 | 8 |
9 #ifndef NATIVE_CLIENT_SRC_TRUSTED_PLUGIN_PLUGIN_H_ | 9 #ifndef NATIVE_CLIENT_SRC_TRUSTED_PLUGIN_PLUGIN_H_ |
10 #define NATIVE_CLIENT_SRC_TRUSTED_PLUGIN_PLUGIN_H_ | 10 #define NATIVE_CLIENT_SRC_TRUSTED_PLUGIN_PLUGIN_H_ |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
86 // does not signal that it is ready, then we will deadlock the main | 86 // does not signal that it is ready, then we will deadlock the main |
87 // thread of the renderer on this subsequent event delivery. We | 87 // thread of the renderer on this subsequent event delivery. We |
88 // should include a time-out at which point we declare the | 88 // should include a time-out at which point we declare the |
89 // nacl_ready_state to be done, and let the normal crash detection | 89 // nacl_ready_state to be done, and let the normal crash detection |
90 // mechanism(s) take over. | 90 // mechanism(s) take over. |
91 void LoadNaClModule(PP_NaClFileInfo file_info, | 91 void LoadNaClModule(PP_NaClFileInfo file_info, |
92 bool uses_nonsfi_mode, | 92 bool uses_nonsfi_mode, |
93 bool enable_dyncode_syscalls, | 93 bool enable_dyncode_syscalls, |
94 bool enable_exception_handling, | 94 bool enable_exception_handling, |
95 bool enable_crash_throttling, | 95 bool enable_crash_throttling, |
96 const pp::CompletionCallback& init_done_cb, | 96 const pp::CompletionCallback& init_done_cb); |
97 const pp::CompletionCallback& crash_cb); | |
98 | 97 |
99 // Finish hooking interfaces up, after low-level initialization is | 98 // Finish hooking interfaces up, after low-level initialization is |
100 // complete. | 99 // complete. |
101 bool LoadNaClModuleContinuationIntern(); | 100 bool LoadNaClModuleContinuationIntern(); |
102 | 101 |
103 // Continuation for starting SRPC/JSProxy services as appropriate. | 102 // Continuation for starting SRPC/JSProxy services as appropriate. |
104 // This is invoked as a callback when the NaCl module makes the | 103 // This is invoked as a callback when the NaCl module makes the |
105 // init_done reverse RPC to tell us that low-level initialization | 104 // init_done reverse RPC to tell us that low-level initialization |
106 // such as ld.so processing is done. That initialization requires | 105 // such as ld.so processing is done. That initialization requires |
107 // that the main thread be free in order to do Pepper | 106 // that the main thread be free in order to do Pepper |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
166 | 165 |
167 // This is invoked on the main thread. | 166 // This is invoked on the main thread. |
168 void StartNexe(int32_t pp_error, ServiceRuntime* service_runtime); | 167 void StartNexe(int32_t pp_error, ServiceRuntime* service_runtime); |
169 | 168 |
170 // Callback used when getting the URL for the .nexe file. If the URL loading | 169 // Callback used when getting the URL for the .nexe file. If the URL loading |
171 // is successful, the file descriptor is opened and can be passed to sel_ldr | 170 // is successful, the file descriptor is opened and can be passed to sel_ldr |
172 // with the sandbox on. | 171 // with the sandbox on. |
173 void NexeFileDidOpen(int32_t pp_error); | 172 void NexeFileDidOpen(int32_t pp_error); |
174 void NexeFileDidOpenContinuation(int32_t pp_error); | 173 void NexeFileDidOpenContinuation(int32_t pp_error); |
175 | 174 |
176 // Callback used when the reverse channel closes. This is an | |
177 // asynchronous event that might turn into a JavaScript error or | |
178 // crash event -- this is controlled by the two state variables | |
179 // nacl_ready_state_ and nexe_error_reported_: If an error or crash | |
180 // had already been reported, no additional crash event is | |
181 // generated. If no error has been reported but nacl_ready_state_ | |
182 // is not DONE, then the loadend event has not been reported, and we | |
183 // enqueue an error event followed by loadend. If nacl_ready_state_ | |
184 // is DONE, then we are in the post-loadend (we need temporal | |
185 // predicate symbols), and we enqueue a crash event. | |
186 void NexeDidCrash(int32_t pp_error); | |
187 | |
188 // Callback used when a .nexe is translated from bitcode. If the translation | 175 // Callback used when a .nexe is translated from bitcode. If the translation |
189 // is successful, the file descriptor is opened and can be passed to sel_ldr | 176 // is successful, the file descriptor is opened and can be passed to sel_ldr |
190 // with the sandbox on. | 177 // with the sandbox on. |
191 void BitcodeDidTranslate(int32_t pp_error); | 178 void BitcodeDidTranslate(int32_t pp_error); |
192 void BitcodeDidTranslateContinuation(int32_t pp_error); | 179 void BitcodeDidTranslateContinuation(int32_t pp_error); |
193 | 180 |
194 // NaCl ISA selection manifest file support. The manifest file is specified | 181 // NaCl ISA selection manifest file support. The manifest file is specified |
195 // using the "nacl" attribute in the <embed> tag. First, the manifest URL (or | 182 // using the "nacl" attribute in the <embed> tag. First, the manifest URL (or |
196 // data: URI) is fetched, then the JSON is parsed. Once a valid .nexe is | 183 // data: URI) is fetched, then the JSON is parsed. Once a valid .nexe is |
197 // chosen for the sandbox ISA, any current service runtime is shut down, the | 184 // chosen for the sandbox ISA, any current service runtime is shut down, the |
(...skipping 20 matching lines...) Expand all Loading... |
218 | 205 |
219 PP_NaClFileInfo nexe_file_info_; | 206 PP_NaClFileInfo nexe_file_info_; |
220 | 207 |
221 const PPB_NaCl_Private* nacl_interface_; | 208 const PPB_NaCl_Private* nacl_interface_; |
222 pp::UMAPrivate uma_interface_; | 209 pp::UMAPrivate uma_interface_; |
223 }; | 210 }; |
224 | 211 |
225 } // namespace plugin | 212 } // namespace plugin |
226 | 213 |
227 #endif // NATIVE_CLIENT_SRC_TRUSTED_PLUGIN_PLUGIN_H_ | 214 #endif // NATIVE_CLIENT_SRC_TRUSTED_PLUGIN_PLUGIN_H_ |
OLD | NEW |