| 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 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 120 // Report an error that was encountered while loading a module. | 120 // Report an error that was encountered while loading a module. |
| 121 void ReportLoadError(const ErrorInfo& error_info); | 121 void ReportLoadError(const ErrorInfo& error_info); |
| 122 | 122 |
| 123 nacl::DescWrapperFactory* wrapper_factory() const { return wrapper_factory_; } | 123 nacl::DescWrapperFactory* wrapper_factory() const { return wrapper_factory_; } |
| 124 | 124 |
| 125 // A helper function that indicates if |url| can be requested by the document | 125 // A helper function that indicates if |url| can be requested by the document |
| 126 // under the same-origin policy. Strictly speaking, it may be possible for the | 126 // under the same-origin policy. Strictly speaking, it may be possible for the |
| 127 // document to request the URL using CORS even if this function returns false. | 127 // document to request the URL using CORS even if this function returns false. |
| 128 bool DocumentCanRequest(const std::string& url); | 128 bool DocumentCanRequest(const std::string& url); |
| 129 | 129 |
| 130 // set_exit_status may be called off the main thread. | |
| 131 void set_exit_status(int exit_status); | |
| 132 | |
| 133 const PPB_NaCl_Private* nacl_interface() const { return nacl_interface_; } | 130 const PPB_NaCl_Private* nacl_interface() const { return nacl_interface_; } |
| 134 pp::UMAPrivate& uma_interface() { return uma_interface_; } | 131 pp::UMAPrivate& uma_interface() { return uma_interface_; } |
| 135 | 132 |
| 136 private: | 133 private: |
| 137 NACL_DISALLOW_COPY_AND_ASSIGN(Plugin); | 134 NACL_DISALLOW_COPY_AND_ASSIGN(Plugin); |
| 138 // The browser will invoke the destructor via the pp::Instance | 135 // The browser will invoke the destructor via the pp::Instance |
| 139 // pointer to this object, not from base's Delete(). | 136 // pointer to this object, not from base's Delete(). |
| 140 ~Plugin(); | 137 ~Plugin(); |
| 141 | 138 |
| 142 // Shuts down socket connection, service runtime, and receive thread, | 139 // Shuts down socket connection, service runtime, and receive thread, |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 199 // data: URI) is fetched, then the JSON is parsed. Once a valid .nexe is | 196 // data: URI) is fetched, then the JSON is parsed. Once a valid .nexe is |
| 200 // chosen for the sandbox ISA, any current service runtime is shut down, the | 197 // chosen for the sandbox ISA, any current service runtime is shut down, the |
| 201 // .nexe is loaded and run. | 198 // .nexe is loaded and run. |
| 202 | 199 |
| 203 // Callback used when getting the manifest file as a local file descriptor. | 200 // Callback used when getting the manifest file as a local file descriptor. |
| 204 void NaClManifestFileDidOpen(int32_t pp_error); | 201 void NaClManifestFileDidOpen(int32_t pp_error); |
| 205 | 202 |
| 206 // Processes the JSON manifest string and starts loading the nexe. | 203 // Processes the JSON manifest string and starts loading the nexe. |
| 207 void ProcessNaClManifest(const nacl::string& manifest_json); | 204 void ProcessNaClManifest(const nacl::string& manifest_json); |
| 208 | 205 |
| 209 void SetExitStatusOnMainThread(int32_t pp_error, int exit_status); | |
| 210 | |
| 211 // Keep track of the NaCl module subprocess that was spun up in the plugin. | 206 // Keep track of the NaCl module subprocess that was spun up in the plugin. |
| 212 NaClSubprocess main_subprocess_; | 207 NaClSubprocess main_subprocess_; |
| 213 | 208 |
| 214 bool uses_nonsfi_mode_; | 209 bool uses_nonsfi_mode_; |
| 215 | 210 |
| 216 nacl::DescWrapperFactory* wrapper_factory_; | 211 nacl::DescWrapperFactory* wrapper_factory_; |
| 217 | 212 |
| 218 pp::CompletionCallbackFactory<Plugin> callback_factory_; | 213 pp::CompletionCallbackFactory<Plugin> callback_factory_; |
| 219 | 214 |
| 220 nacl::scoped_ptr<PnaclCoordinator> pnacl_coordinator_; | 215 nacl::scoped_ptr<PnaclCoordinator> pnacl_coordinator_; |
| 221 | 216 |
| 222 int exit_status_; | 217 int exit_status_; |
| 223 | 218 |
| 224 PP_NaClFileInfo nexe_file_info_; | 219 PP_NaClFileInfo nexe_file_info_; |
| 225 | 220 |
| 226 const PPB_NaCl_Private* nacl_interface_; | 221 const PPB_NaCl_Private* nacl_interface_; |
| 227 pp::UMAPrivate uma_interface_; | 222 pp::UMAPrivate uma_interface_; |
| 228 }; | 223 }; |
| 229 | 224 |
| 230 } // namespace plugin | 225 } // namespace plugin |
| 231 | 226 |
| 232 #endif // NATIVE_CLIENT_SRC_TRUSTED_PLUGIN_PLUGIN_H_ | 227 #endif // NATIVE_CLIENT_SRC_TRUSTED_PLUGIN_PLUGIN_H_ |
| OLD | NEW |