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 |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
78 void SignalNexeStarted(bool ok); | 78 void SignalNexeStarted(bool ok); |
79 | 79 |
80 // Establish an SrpcClient to the sel_ldr instance and start the nexe. | 80 // Establish an SrpcClient to the sel_ldr instance and start the nexe. |
81 // This function must be called on the main thread. | 81 // This function must be called on the main thread. |
82 // This function must only be called once. | 82 // This function must only be called once. |
83 void StartNexe(); | 83 void StartNexe(); |
84 | 84 |
85 // Starts the application channel to the nexe. | 85 // Starts the application channel to the nexe. |
86 SrpcClient* SetupAppChannel(); | 86 SrpcClient* SetupAppChannel(); |
87 | 87 |
88 bool RemoteLog(int severity, const std::string& msg); | |
89 Plugin* plugin() const { return plugin_; } | 88 Plugin* plugin() const { return plugin_; } |
90 void Shutdown(); | 89 void Shutdown(); |
91 | 90 |
92 bool main_service_runtime() const { return main_service_runtime_; } | 91 bool main_service_runtime() const { return main_service_runtime_; } |
93 | 92 |
94 private: | 93 private: |
95 NACL_DISALLOW_COPY_AND_ASSIGN(ServiceRuntime); | 94 NACL_DISALLOW_COPY_AND_ASSIGN(ServiceRuntime); |
96 bool StartNexeInternal(); | 95 bool StartNexeInternal(); |
97 | 96 |
98 bool SetupCommandChannel(); | 97 bool SetupCommandChannel(); |
99 bool StartModule(); | 98 bool StartModule(); |
100 void ReapLogs(); | |
101 | 99 |
102 void ReportLoadError(const ErrorInfo& error_info); | 100 void ReportLoadError(const ErrorInfo& error_info); |
103 | 101 |
104 NaClSrpcChannel command_channel_; | 102 NaClSrpcChannel command_channel_; |
105 Plugin* plugin_; | 103 Plugin* plugin_; |
106 PP_Instance pp_instance_; | 104 PP_Instance pp_instance_; |
107 bool main_service_runtime_; | 105 bool main_service_runtime_; |
108 bool uses_nonsfi_mode_; | 106 bool uses_nonsfi_mode_; |
109 nacl::scoped_ptr<SelLdrLauncherChrome> subprocess_; | 107 nacl::scoped_ptr<SelLdrLauncherChrome> subprocess_; |
110 | 108 |
111 // Mutex and CondVar to protect start_sel_ldr_done_ and nexe_started_. | 109 // Mutex and CondVar to protect start_sel_ldr_done_ and nexe_started_. |
112 NaClMutex mu_; | 110 NaClMutex mu_; |
113 NaClCondVar cond_; | 111 NaClCondVar cond_; |
114 bool start_sel_ldr_done_; | 112 bool start_sel_ldr_done_; |
115 bool sel_ldr_wait_timed_out_; | 113 bool sel_ldr_wait_timed_out_; |
116 bool start_nexe_done_; | 114 bool start_nexe_done_; |
117 bool nexe_started_ok_; | 115 bool nexe_started_ok_; |
118 | 116 |
119 NaClHandle bootstrap_channel_; | 117 NaClHandle bootstrap_channel_; |
120 }; | 118 }; |
121 | 119 |
122 } // namespace plugin | 120 } // namespace plugin |
123 | 121 |
124 #endif // COMPONENTS_NACL_RENDERER_PLUGIN_SERVICE_RUNTIME_H_ | 122 #endif // COMPONENTS_NACL_RENDERER_PLUGIN_SERVICE_RUNTIME_H_ |
OLD | NEW |