OLD | NEW |
1 /* -*- c++ -*- */ | 1 /* -*- c++ -*- */ |
2 /* | 2 /* |
3 * Copyright (c) 2012 The Chromium Authors. All rights reserved. | 3 * Copyright (c) 2012 The Chromium Authors. All rights reserved. |
4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
6 */ | 6 */ |
7 | 7 |
8 // A class containing information regarding a socket connection to a | 8 // A class containing information regarding a socket connection to a |
9 // service runtime instance. | 9 // service runtime instance. |
10 | 10 |
11 #ifndef COMPONENTS_NACL_RENDERER_PLUGIN_SERVICE_RUNTIME_H_ | 11 #ifndef COMPONENTS_NACL_RENDERER_PLUGIN_SERVICE_RUNTIME_H_ |
12 #define COMPONENTS_NACL_RENDERER_PLUGIN_SERVICE_RUNTIME_H_ | 12 #define COMPONENTS_NACL_RENDERER_PLUGIN_SERVICE_RUNTIME_H_ |
13 | 13 |
14 #include "base/macros.h" | 14 #include "base/macros.h" |
| 15 #include "base/memory/scoped_ptr.h" |
| 16 #include "base/process/process_handle.h" |
15 #include "components/nacl/renderer/plugin/utility.h" | 17 #include "components/nacl/renderer/plugin/utility.h" |
| 18 #include "ipc/ipc_sync_channel.h" |
16 #include "native_client/src/include/nacl_macros.h" | 19 #include "native_client/src/include/nacl_macros.h" |
17 #include "native_client/src/include/nacl_scoped_ptr.h" | 20 #include "native_client/src/include/nacl_scoped_ptr.h" |
18 #include "native_client/src/public/imc_types.h" | 21 #include "native_client/src/public/imc_types.h" |
19 #include "native_client/src/shared/platform/nacl_sync.h" | 22 #include "native_client/src/shared/platform/nacl_sync.h" |
20 #include "native_client/src/shared/srpc/nacl_srpc.h" | 23 #include "native_client/src/shared/srpc/nacl_srpc.h" |
21 #include "ppapi/cpp/completion_callback.h" | 24 #include "ppapi/cpp/completion_callback.h" |
22 | 25 |
23 namespace plugin { | 26 namespace plugin { |
24 | 27 |
25 class ErrorInfo; | 28 class ErrorInfo; |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
63 void StartNexe(); | 66 void StartNexe(); |
64 | 67 |
65 // Starts the application channel to the nexe. | 68 // Starts the application channel to the nexe. |
66 SrpcClient* SetupAppChannel(); | 69 SrpcClient* SetupAppChannel(); |
67 | 70 |
68 Plugin* plugin() const { return plugin_; } | 71 Plugin* plugin() const { return plugin_; } |
69 void Shutdown(); | 72 void Shutdown(); |
70 | 73 |
71 bool main_service_runtime() const { return main_service_runtime_; } | 74 bool main_service_runtime() const { return main_service_runtime_; } |
72 | 75 |
| 76 scoped_ptr<IPC::SyncChannel> TakeTranslatorChannel() { |
| 77 return scoped_ptr<IPC::SyncChannel>(translator_channel_.release()); |
| 78 } |
| 79 |
| 80 // Returns the PID of the subprocess. This PID is needed for copying |
| 81 // handles to the subprocess on Windows. |
| 82 base::ProcessId get_process_id() { return process_id_; } |
| 83 |
73 private: | 84 private: |
74 NACL_DISALLOW_COPY_AND_ASSIGN(ServiceRuntime); | 85 NACL_DISALLOW_COPY_AND_ASSIGN(ServiceRuntime); |
75 | 86 |
76 bool SetupCommandChannel(); | 87 bool SetupCommandChannel(); |
77 | 88 |
78 void ReportLoadError(const ErrorInfo& error_info); | 89 void ReportLoadError(const ErrorInfo& error_info); |
79 | 90 |
80 Plugin* plugin_; | 91 Plugin* plugin_; |
81 PP_Instance pp_instance_; | 92 PP_Instance pp_instance_; |
82 bool main_service_runtime_; | 93 bool main_service_runtime_; |
83 bool uses_nonsfi_mode_; | 94 bool uses_nonsfi_mode_; |
84 nacl::scoped_ptr<SelLdrLauncherChrome> subprocess_; | 95 nacl::scoped_ptr<SelLdrLauncherChrome> subprocess_; |
85 | 96 |
86 NaClHandle bootstrap_channel_; | 97 NaClHandle bootstrap_channel_; |
| 98 |
| 99 scoped_ptr<IPC::SyncChannel> translator_channel_; |
| 100 base::ProcessId process_id_; |
87 }; | 101 }; |
88 | 102 |
89 } // namespace plugin | 103 } // namespace plugin |
90 | 104 |
91 #endif // COMPONENTS_NACL_RENDERER_PLUGIN_SERVICE_RUNTIME_H_ | 105 #endif // COMPONENTS_NACL_RENDERER_PLUGIN_SERVICE_RUNTIME_H_ |
OLD | NEW |