OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // Instances of NaCl modules spun up within the plugin as a subprocess. | 5 // Instances of NaCl modules spun up within the plugin as a subprocess. |
6 // This may represent the "main" nacl module, or it may represent helpers | 6 // This may represent the "main" nacl module, or it may represent helpers |
7 // that perform various tasks within the plugin, for example, | 7 // that perform various tasks within the plugin, for example, |
8 // a NaCl module for a compiler could be loaded to translate LLVM bitcode | 8 // a NaCl module for a compiler could be loaded to translate LLVM bitcode |
9 // into native code. | 9 // into native code. |
10 | 10 |
(...skipping 13 matching lines...) Expand all Loading... |
24 class Plugin; | 24 class Plugin; |
25 class ServiceRuntime; | 25 class ServiceRuntime; |
26 class SrpcParams; | 26 class SrpcParams; |
27 | 27 |
28 | 28 |
29 // A class representing an instance of a NaCl module, loaded by the plugin. | 29 // A class representing an instance of a NaCl module, loaded by the plugin. |
30 class NaClSubprocess { | 30 class NaClSubprocess { |
31 public: | 31 public: |
32 NaClSubprocess(const std::string& description, | 32 NaClSubprocess(const std::string& description, |
33 ServiceRuntime* service_runtime, | 33 ServiceRuntime* service_runtime, |
34 SrpcClient* srpc_client) | 34 SrpcClient* srpc_client); |
35 : description_(description), | |
36 service_runtime_(service_runtime), | |
37 srpc_client_(srpc_client) { | |
38 } | |
39 virtual ~NaClSubprocess(); | 35 virtual ~NaClSubprocess(); |
40 | 36 |
41 ServiceRuntime* service_runtime() const { return service_runtime_.get(); } | 37 ServiceRuntime* service_runtime() const { return service_runtime_.get(); } |
42 void set_service_runtime(ServiceRuntime* service_runtime) { | 38 void set_service_runtime(ServiceRuntime* service_runtime) { |
43 service_runtime_.reset(service_runtime); | 39 service_runtime_.reset(service_runtime); |
44 } | 40 } |
45 | 41 |
46 // The socket used for communicating w/ the NaCl module. | 42 // The socket used for communicating w/ the NaCl module. |
47 SrpcClient* srpc_client() const { return srpc_client_.get(); } | 43 SrpcClient* srpc_client() const { return srpc_client_.get(); } |
48 | 44 |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
81 | 77 |
82 // The service runtime representing the NaCl module instance. | 78 // The service runtime representing the NaCl module instance. |
83 nacl::scoped_ptr<ServiceRuntime> service_runtime_; | 79 nacl::scoped_ptr<ServiceRuntime> service_runtime_; |
84 // Ownership of srpc_client taken from the service runtime. | 80 // Ownership of srpc_client taken from the service runtime. |
85 nacl::scoped_ptr<SrpcClient> srpc_client_; | 81 nacl::scoped_ptr<SrpcClient> srpc_client_; |
86 }; | 82 }; |
87 | 83 |
88 } // namespace plugin | 84 } // namespace plugin |
89 | 85 |
90 #endif // NATIVE_CLIENT_SRC_TRUSTED_PLUGIN_NACL_SUBPROCESS_H_ | 86 #endif // NATIVE_CLIENT_SRC_TRUSTED_PLUGIN_NACL_SUBPROCESS_H_ |
OLD | NEW |