| 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 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 133 ~Plugin(); | 133 ~Plugin(); |
| 134 | 134 |
| 135 // Shuts down socket connection, service runtime, and receive thread, | 135 // Shuts down socket connection, service runtime, and receive thread, |
| 136 // in this order, for the main nacl subprocess. | 136 // in this order, for the main nacl subprocess. |
| 137 void ShutDownSubprocesses(); | 137 void ShutDownSubprocesses(); |
| 138 | 138 |
| 139 // Histogram helper functions, internal to Plugin so they can use | 139 // Histogram helper functions, internal to Plugin so they can use |
| 140 // uma_interface_ normally. | 140 // uma_interface_ normally. |
| 141 void HistogramTimeSmall(const std::string& name, int64_t ms); | 141 void HistogramTimeSmall(const std::string& name, int64_t ms); |
| 142 | 142 |
| 143 // Load a nacl module from the file specified in file_handle. | 143 // Loads and starts a helper (e.g. llc, ld) NaCl module. |
| 144 // Only to be used from a background (non-main) thread for the PNaCl | 144 // Only to be used from a background (non-main) thread for the PNaCl |
| 145 // translator. This will fully initialize the |subprocess| if the load was | 145 // translator. This will fully initialize the |subprocess| if the load was |
| 146 // successful. | 146 // successful. |
| 147 bool LoadHelperNaClModule(PP_FileHandle file_handle, | 147 bool InternalLoadHelperNaClModule(NaClSubprocess* subprocess, |
| 148 NaClSubprocess* subprocess, | 148 const SelLdrStartParams& params); |
| 149 const SelLdrStartParams& params); | |
| 150 | 149 |
| 151 // Start sel_ldr from the main thread, given the start params. | 150 // Start sel_ldr from the main thread, given the start params. |
| 152 // |pp_error| is set by CallOnMainThread (should be PP_OK). | 151 // |pp_error| is set by CallOnMainThread (should be PP_OK). |
| 153 void StartSelLdrOnMainThread(int32_t pp_error, | 152 void StartSelLdrOnMainThread(int32_t pp_error, |
| 154 ServiceRuntime* service_runtime, | 153 ServiceRuntime* service_runtime, |
| 155 const SelLdrStartParams& params, | 154 const SelLdrStartParams& params, |
| 156 pp::CompletionCallback callback); | 155 pp::CompletionCallback callback); |
| 157 | 156 |
| 158 // Signals that StartSelLdr has finished. | 157 // Signals that StartSelLdr has finished. |
| 159 // This is invoked on the main thread. | 158 // This is invoked on the main thread. |
| 160 void SignalStartSelLdrDone(int32_t pp_error, | 159 void SignalStartSelLdrDone(int32_t pp_error, |
| 161 bool* started, | 160 bool* started, |
| 162 ServiceRuntime* service_runtime); | 161 ServiceRuntime* service_runtime); |
| 163 | 162 |
| 164 // This is invoked on the main thread. | 163 // This is invoked on the main thread. |
| 165 void LoadNexeAndStart(int32_t pp_error, | 164 void StartNexe(int32_t pp_error, ServiceRuntime* service_runtime); |
| 166 ServiceRuntime* service_runtime, | |
| 167 PP_NaClFileInfo file_info); | |
| 168 | 165 |
| 169 // Callback used when getting the URL for the .nexe file. If the URL loading | 166 // Callback used when getting the URL for the .nexe file. If the URL loading |
| 170 // is successful, the file descriptor is opened and can be passed to sel_ldr | 167 // is successful, the file descriptor is opened and can be passed to sel_ldr |
| 171 // with the sandbox on. | 168 // with the sandbox on. |
| 172 void NexeFileDidOpen(int32_t pp_error); | 169 void NexeFileDidOpen(int32_t pp_error); |
| 173 void NexeFileDidOpenContinuation(int32_t pp_error); | 170 void NexeFileDidOpenContinuation(int32_t pp_error); |
| 174 | 171 |
| 175 // Callback used when the reverse channel closes. This is an | 172 // Callback used when the reverse channel closes. This is an |
| 176 // asynchronous event that might turn into a JavaScript error or | 173 // asynchronous event that might turn into a JavaScript error or |
| 177 // crash event -- this is controlled by the two state variables | 174 // crash event -- this is controlled by the two state variables |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 222 | 219 |
| 223 PP_NaClFileInfo nexe_file_info_; | 220 PP_NaClFileInfo nexe_file_info_; |
| 224 | 221 |
| 225 const PPB_NaCl_Private* nacl_interface_; | 222 const PPB_NaCl_Private* nacl_interface_; |
| 226 pp::UMAPrivate uma_interface_; | 223 pp::UMAPrivate uma_interface_; |
| 227 }; | 224 }; |
| 228 | 225 |
| 229 } // namespace plugin | 226 } // namespace plugin |
| 230 | 227 |
| 231 #endif // NATIVE_CLIENT_SRC_TRUSTED_PLUGIN_PLUGIN_H_ | 228 #endif // NATIVE_CLIENT_SRC_TRUSTED_PLUGIN_PLUGIN_H_ |
| OLD | NEW |