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 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
173 private: | 173 private: |
174 NACL_DISALLOW_COPY_AND_ASSIGN(Plugin); | 174 NACL_DISALLOW_COPY_AND_ASSIGN(Plugin); |
175 // The browser will invoke the destructor via the pp::Instance | 175 // The browser will invoke the destructor via the pp::Instance |
176 // pointer to this object, not from base's Delete(). | 176 // pointer to this object, not from base's Delete(). |
177 ~Plugin(); | 177 ~Plugin(); |
178 | 178 |
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 // Access the service runtime for the main NaCl subprocess. | |
184 ServiceRuntime* main_service_runtime() const { | |
185 return main_subprocess_.service_runtime(); | |
186 } | |
187 | |
188 // Histogram helper functions, internal to Plugin so they can use | 183 // Histogram helper functions, internal to Plugin so they can use |
189 // uma_interface_ normally. | 184 // uma_interface_ normally. |
190 void HistogramTimeSmall(const std::string& name, int64_t ms); | 185 void HistogramTimeSmall(const std::string& name, int64_t ms); |
191 void HistogramTimeMedium(const std::string& name, int64_t ms); | 186 void HistogramTimeMedium(const std::string& name, int64_t ms); |
192 void HistogramTimeLarge(const std::string& name, int64_t ms); | 187 void HistogramTimeLarge(const std::string& name, int64_t ms); |
193 void HistogramSizeKB(const std::string& name, int32_t sample); | 188 void HistogramSizeKB(const std::string& name, int32_t sample); |
194 void HistogramEnumerate(const std::string& name, | |
195 int sample, | |
196 int maximum, | |
197 int out_of_range_replacement); | |
198 void HistogramEnumerateLoadStatus(PP_NaClError error_code); | 189 void HistogramEnumerateLoadStatus(PP_NaClError error_code); |
199 void HistogramEnumerateSelLdrLoadStatus(NaClErrorCode error_code); | 190 void HistogramEnumerateSelLdrLoadStatus(NaClErrorCode error_code); |
200 void HistogramHTTPStatusCode(const std::string& name, int status); | |
201 | 191 |
202 // Load a nacl module from the file specified in wrapper. | 192 // Load a nacl module from the file specified in wrapper. |
203 // Only to be used from a background (non-main) thread. | 193 // Only to be used from a background (non-main) thread. |
204 // This will fully initialize the |subprocess| if the load was successful. | 194 // This will fully initialize the |subprocess| if the load was successful. |
205 bool LoadNaClModuleFromBackgroundThread(nacl::DescWrapper* wrapper, | 195 bool LoadNaClModuleFromBackgroundThread(nacl::DescWrapper* wrapper, |
206 NaClSubprocess* subprocess, | 196 NaClSubprocess* subprocess, |
207 int32_t manifest_id, | 197 int32_t manifest_id, |
208 const SelLdrStartParams& params); | 198 const SelLdrStartParams& params); |
209 | 199 |
210 // Start sel_ldr from the main thread, given the start params. | 200 // Start sel_ldr from the main thread, given the start params. |
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
331 PP_Var manifest_data_var_; | 321 PP_Var manifest_data_var_; |
332 int32_t manifest_id_; | 322 int32_t manifest_id_; |
333 | 323 |
334 const PPB_NaCl_Private* nacl_interface_; | 324 const PPB_NaCl_Private* nacl_interface_; |
335 pp::UMAPrivate uma_interface_; | 325 pp::UMAPrivate uma_interface_; |
336 }; | 326 }; |
337 | 327 |
338 } // namespace plugin | 328 } // namespace plugin |
339 | 329 |
340 #endif // NATIVE_CLIENT_SRC_TRUSTED_PLUGIN_PLUGIN_H_ | 330 #endif // NATIVE_CLIENT_SRC_TRUSTED_PLUGIN_PLUGIN_H_ |
OLD | NEW |