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 |
11 #ifndef COMPONENTS_NACL_RENDERER_PLUGIN_NACL_SUBPROCESS_H_ | 11 #ifndef COMPONENTS_NACL_RENDERER_PLUGIN_NACL_SUBPROCESS_H_ |
12 #define COMPONENTS_NACL_RENDERER_PLUGIN_NACL_SUBPROCESS_H_ | 12 #define COMPONENTS_NACL_RENDERER_PLUGIN_NACL_SUBPROCESS_H_ |
13 | 13 |
14 #include <stdarg.h> | 14 #include <stdarg.h> |
15 | 15 |
16 #include <memory> | 16 #include <memory> |
17 | 17 |
18 #include "base/macros.h" | 18 #include "base/macros.h" |
19 #include "components/nacl/renderer/plugin/service_runtime.h" | 19 #include "components/nacl/renderer/plugin/service_runtime.h" |
20 | 20 |
21 namespace plugin { | 21 namespace plugin { |
22 | 22 |
23 class Plugin; | |
24 class ServiceRuntime; | 23 class ServiceRuntime; |
25 | 24 |
26 | 25 |
27 // A class representing an instance of a NaCl module, loaded by the plugin. | 26 // A class representing an instance of a NaCl module, loaded by the plugin. |
28 class NaClSubprocess { | 27 class NaClSubprocess { |
29 public: | 28 public: |
30 NaClSubprocess(); | 29 NaClSubprocess(); |
31 virtual ~NaClSubprocess(); | 30 virtual ~NaClSubprocess(); |
32 | 31 |
33 ServiceRuntime* service_runtime() const { return service_runtime_.get(); } | 32 ServiceRuntime* service_runtime() const { return service_runtime_.get(); } |
34 void set_service_runtime(ServiceRuntime* service_runtime) { | 33 void set_service_runtime(ServiceRuntime* service_runtime) { |
35 service_runtime_.reset(service_runtime); | 34 service_runtime_.reset(service_runtime); |
36 } | 35 } |
37 | 36 |
38 // Fully shut down the subprocess. | 37 // Fully shut down the subprocess. |
39 void Shutdown(); | 38 void Shutdown(); |
40 | 39 |
41 private: | 40 private: |
42 // The service runtime representing the NaCl module instance. | 41 // The service runtime representing the NaCl module instance. |
43 std::unique_ptr<ServiceRuntime> service_runtime_; | 42 std::unique_ptr<ServiceRuntime> service_runtime_; |
44 | 43 |
45 DISALLOW_COPY_AND_ASSIGN(NaClSubprocess); | 44 DISALLOW_COPY_AND_ASSIGN(NaClSubprocess); |
46 }; | 45 }; |
47 | 46 |
48 } // namespace plugin | 47 } // namespace plugin |
49 | 48 |
50 #endif // COMPONENTS_NACL_RENDERER_PLUGIN_NACL_SUBPROCESS_H_ | 49 #endif // COMPONENTS_NACL_RENDERER_PLUGIN_NACL_SUBPROCESS_H_ |
OLD | NEW |