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 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
98 | 98 |
99 // Continuation for starting SRPC/JSProxy services as appropriate. | 99 // Continuation for starting SRPC/JSProxy services as appropriate. |
100 // This is invoked as a callback when the NaCl module makes the | 100 // This is invoked as a callback when the NaCl module makes the |
101 // init_done reverse RPC to tell us that low-level initialization | 101 // init_done reverse RPC to tell us that low-level initialization |
102 // such as ld.so processing is done. That initialization requires | 102 // such as ld.so processing is done. That initialization requires |
103 // that the main thread be free in order to do Pepper | 103 // that the main thread be free in order to do Pepper |
104 // main-thread-only operations such as file processing. | 104 // main-thread-only operations such as file processing. |
105 bool LoadNaClModuleContinuation(int32_t pp_error); | 105 bool LoadNaClModuleContinuation(int32_t pp_error); |
106 | 106 |
107 // Load support. | 107 // Load support. |
108 // A helper SRPC NaCl module can be loaded given a DescWrapper. | 108 // A helper SRPC NaCl module can be loaded given a PP_FileHandle. |
109 // Blocks until the helper module signals initialization is done. | 109 // Blocks until the helper module signals initialization is done. |
110 // Does not update nacl_module_origin(). | 110 // Does not update nacl_module_origin(). |
111 // Returns NULL or the NaClSubprocess of the new helper NaCl module. | 111 // Returns NULL or the NaClSubprocess of the new helper NaCl module. |
112 NaClSubprocess* LoadHelperNaClModule(const nacl::string& helper_url, | 112 NaClSubprocess* LoadHelperNaClModule(const nacl::string& helper_url, |
113 nacl::DescWrapper* wrapper, | 113 PP_FileHandle file_handle, |
114 int32_t manifest_id, | 114 int32_t manifest_id, |
115 ErrorInfo* error_info); | 115 ErrorInfo* error_info); |
116 | 116 |
117 enum LengthComputable { | 117 enum LengthComputable { |
118 LENGTH_IS_NOT_COMPUTABLE = 0, | 118 LENGTH_IS_NOT_COMPUTABLE = 0, |
119 LENGTH_IS_COMPUTABLE = 1 | 119 LENGTH_IS_COMPUTABLE = 1 |
120 }; | 120 }; |
121 // Report successful loading of a module. | 121 // Report successful loading of a module. |
122 void ReportLoadSuccess(uint64_t loaded_bytes, uint64_t total_bytes); | 122 void ReportLoadSuccess(uint64_t loaded_bytes, uint64_t total_bytes); |
123 // Report an error that was encountered while loading a module. | 123 // Report an error that was encountered while loading a module. |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
179 // Shuts down socket connection, service runtime, and receive thread, | 179 // Shuts down socket connection, service runtime, and receive thread, |
180 // in this order, for the main nacl subprocess. | 180 // in this order, for the main nacl subprocess. |
181 void ShutDownSubprocesses(); | 181 void ShutDownSubprocesses(); |
182 | 182 |
183 // Histogram helper functions, internal to Plugin so they can use | 183 // Histogram helper functions, internal to Plugin so they can use |
184 // uma_interface_ normally. | 184 // uma_interface_ normally. |
185 void HistogramTimeSmall(const std::string& name, int64_t ms); | 185 void HistogramTimeSmall(const std::string& name, int64_t ms); |
186 void HistogramEnumerateLoadStatus(PP_NaClError error_code); | 186 void HistogramEnumerateLoadStatus(PP_NaClError error_code); |
187 void HistogramEnumerateSelLdrLoadStatus(NaClErrorCode error_code); | 187 void HistogramEnumerateSelLdrLoadStatus(NaClErrorCode error_code); |
188 | 188 |
189 // Load a nacl module from the file specified in wrapper. | 189 // Load a nacl module from the file specified in file_handle. |
190 // Only to be used from a background (non-main) thread. | 190 // Only to be used from a background (non-main) thread. |
191 // This will fully initialize the |subprocess| if the load was successful. | 191 // This will fully initialize the |subprocess| if the load was successful. |
192 bool LoadNaClModuleFromBackgroundThread(nacl::DescWrapper* wrapper, | 192 bool LoadNaClModuleFromBackgroundThread(PP_FileHandle file_handle, |
193 NaClSubprocess* subprocess, | 193 NaClSubprocess* subprocess, |
194 int32_t manifest_id, | 194 int32_t manifest_id, |
195 const SelLdrStartParams& params); | 195 const SelLdrStartParams& params); |
196 | 196 |
197 // Start sel_ldr from the main thread, given the start params. | 197 // Start sel_ldr from the main thread, given the start params. |
198 // |pp_error| is set by CallOnMainThread (should be PP_OK). | 198 // |pp_error| is set by CallOnMainThread (should be PP_OK). |
199 void StartSelLdrOnMainThread(int32_t pp_error, | 199 void StartSelLdrOnMainThread(int32_t pp_error, |
200 ServiceRuntime* service_runtime, | 200 ServiceRuntime* service_runtime, |
201 const SelLdrStartParams& params, | 201 const SelLdrStartParams& params, |
202 pp::CompletionCallback callback); | 202 pp::CompletionCallback callback); |
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
305 | 305 |
306 PP_FileHandle nexe_handle_; | 306 PP_FileHandle nexe_handle_; |
307 | 307 |
308 const PPB_NaCl_Private* nacl_interface_; | 308 const PPB_NaCl_Private* nacl_interface_; |
309 pp::UMAPrivate uma_interface_; | 309 pp::UMAPrivate uma_interface_; |
310 }; | 310 }; |
311 | 311 |
312 } // namespace plugin | 312 } // namespace plugin |
313 | 313 |
314 #endif // NATIVE_CLIENT_SRC_TRUSTED_PLUGIN_PLUGIN_H_ | 314 #endif // NATIVE_CLIENT_SRC_TRUSTED_PLUGIN_PLUGIN_H_ |
OLD | NEW |