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 #ifndef NATIVE_CLIENT_SRC_TRUSTED_PLUGIN_PNACL_COORDINATOR_H_ | 5 #ifndef NATIVE_CLIENT_SRC_TRUSTED_PLUGIN_PNACL_COORDINATOR_H_ |
6 #define NATIVE_CLIENT_SRC_TRUSTED_PLUGIN_PNACL_COORDINATOR_H_ | 6 #define NATIVE_CLIENT_SRC_TRUSTED_PLUGIN_PNACL_COORDINATOR_H_ |
7 | 7 |
8 #include <set> | 8 #include <set> |
9 #include <map> | 9 #include <map> |
10 #include <vector> | 10 #include <vector> |
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
145 // Invoked when the temporary file system is successfully opened in PPAPI. | 145 // Invoked when the temporary file system is successfully opened in PPAPI. |
146 void FileSystemDidOpen(int32_t pp_error); | 146 void FileSystemDidOpen(int32_t pp_error); |
147 // Invoked after we are sure the PNaCl temporary directory exists. | 147 // Invoked after we are sure the PNaCl temporary directory exists. |
148 void DirectoryWasCreated(int32_t pp_error); | 148 void DirectoryWasCreated(int32_t pp_error); |
149 // Invoked after we have checked the PNaCl cache for a translated version. | 149 // Invoked after we have checked the PNaCl cache for a translated version. |
150 void CachedFileDidOpen(int32_t pp_error); | 150 void CachedFileDidOpen(int32_t pp_error); |
151 // Invoked when a pexe data chunk arrives (when using streaming translation) | 151 // Invoked when a pexe data chunk arrives (when using streaming translation) |
152 void BitcodeStreamGotData(int32_t pp_error, FileStreamData data); | 152 void BitcodeStreamGotData(int32_t pp_error, FileStreamData data); |
153 // Invoked when the pexe download finishes (using streaming translation) | 153 // Invoked when the pexe download finishes (using streaming translation) |
154 void BitcodeStreamDidFinish(int32_t pp_error); | 154 void BitcodeStreamDidFinish(int32_t pp_error); |
155 // Invoked after we have started pulling down the bitcode file. | |
156 void BitcodeFileDidOpen(int32_t pp_error); | |
157 // Invoked when the write descriptor for obj_file_ is created. | 155 // Invoked when the write descriptor for obj_file_ is created. |
158 void ObjectWriteDidOpen(int32_t pp_error); | 156 void ObjectWriteDidOpen(int32_t pp_error); |
159 // Invoked when the read descriptor for obj_file_ is created. | 157 // Invoked when the read descriptor for obj_file_ is created. |
160 void ObjectReadDidOpen(int32_t pp_error); | 158 void ObjectReadDidOpen(int32_t pp_error); |
161 // Invoked when the descriptors for obj_file_ have been closed. | 159 // Invoked when the descriptors for obj_file_ have been closed. |
162 void ObjectFileWasClosed(int32_t pp_error); | 160 void ObjectFileWasClosed(int32_t pp_error); |
163 // Invoked when the obj_file_ temporary has been deleted. | 161 // Invoked when the obj_file_ temporary has been deleted. |
164 void ObjectFileWasDeleted(int32_t pp_error); | 162 void ObjectFileWasDeleted(int32_t pp_error); |
165 // Invoked when the descriptors for nexe_file_ have been closed. | 163 // Invoked when the descriptors for nexe_file_ have been closed. |
166 void NexeFileWasClosed(int32_t pp_error); | 164 void NexeFileWasClosed(int32_t pp_error); |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
207 // An auxiliary class that manages downloaded resources (llc and ld nexes). | 205 // An auxiliary class that manages downloaded resources (llc and ld nexes). |
208 nacl::scoped_ptr<PnaclResources> resources_; | 206 nacl::scoped_ptr<PnaclResources> resources_; |
209 | 207 |
210 // State used for querying the temporary directory. | 208 // State used for querying the temporary directory. |
211 nacl::scoped_ptr<pp::FileRef> dir_ref_; | 209 nacl::scoped_ptr<pp::FileRef> dir_ref_; |
212 | 210 |
213 // The URL for the pexe file. | 211 // The URL for the pexe file. |
214 nacl::string pexe_url_; | 212 nacl::string pexe_url_; |
215 // Optional cache identity for translation caching. | 213 // Optional cache identity for translation caching. |
216 nacl::string cache_identity_; | 214 nacl::string cache_identity_; |
217 // Borrowed reference which must outlive the thread. | |
218 nacl::scoped_ptr<nacl::DescWrapper> pexe_wrapper_; | |
219 // Object file, produced by the translator and consumed by the linker. | 215 // Object file, produced by the translator and consumed by the linker. |
220 nacl::scoped_ptr<LocalTempFile> obj_file_; | 216 nacl::scoped_ptr<LocalTempFile> obj_file_; |
221 // Translated nexe file, produced by the linker and consumed by sel_ldr. | 217 // Translated nexe file, produced by the linker and consumed by sel_ldr. |
222 nacl::scoped_ptr<LocalTempFile> nexe_file_; | 218 nacl::scoped_ptr<LocalTempFile> nexe_file_; |
223 | 219 |
224 // Downloader for streaming translation | 220 // Downloader for streaming translation |
225 nacl::scoped_ptr<FileDownloader> streaming_downloader_; | 221 nacl::scoped_ptr<FileDownloader> streaming_downloader_; |
226 bool do_streaming_translation_; | |
227 | 222 |
228 // Used to report information when errors (PPAPI or otherwise) are reported. | 223 // Used to report information when errors (PPAPI or otherwise) are reported. |
229 ErrorInfo error_info_; | 224 ErrorInfo error_info_; |
230 // True if an error was already reported, and translate_notify_callback_ | 225 // True if an error was already reported, and translate_notify_callback_ |
231 // was already run/consumed. | 226 // was already run/consumed. |
232 bool error_already_reported_; | 227 bool error_already_reported_; |
233 | 228 |
234 // The helper thread used to do translations via SRPC. | 229 // The helper thread used to do translations via SRPC. |
235 // Keep this last in declaration order to ensure the other variables | 230 // Keep this last in declaration order to ensure the other variables |
236 // haven't been destroyed yet when its destructor runs. | 231 // haven't been destroyed yet when its destructor runs. |
237 nacl::scoped_ptr<PnaclTranslateThread> translate_thread_; | 232 nacl::scoped_ptr<PnaclTranslateThread> translate_thread_; |
238 | 233 |
239 }; | 234 }; |
240 | 235 |
241 //---------------------------------------------------------------------- | 236 //---------------------------------------------------------------------- |
242 | 237 |
243 } // namespace plugin; | 238 } // namespace plugin; |
244 #endif // NATIVE_CLIENT_SRC_TRUSTED_PLUGIN_PNACL_COORDINATOR_H_ | 239 #endif // NATIVE_CLIENT_SRC_TRUSTED_PLUGIN_PNACL_COORDINATOR_H_ |
OLD | NEW |