| 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_TRANSLATE_THREAD_H_ | 5 #ifndef NATIVE_CLIENT_SRC_TRUSTED_PLUGIN_PNACL_TRANSLATE_THREAD_H_ |
| 6 #define NATIVE_CLIENT_SRC_TRUSTED_PLUGIN_PNACL_TRANSLATE_THREAD_H_ | 6 #define NATIVE_CLIENT_SRC_TRUSTED_PLUGIN_PNACL_TRANSLATE_THREAD_H_ |
| 7 | 7 |
| 8 #include <deque> | 8 #include <deque> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 class DescWrapper; | 22 class DescWrapper; |
| 23 } | 23 } |
| 24 | 24 |
| 25 | 25 |
| 26 namespace plugin { | 26 namespace plugin { |
| 27 | 27 |
| 28 class Manifest; | 28 class Manifest; |
| 29 class NaClSubprocess; | 29 class NaClSubprocess; |
| 30 class Plugin; | 30 class Plugin; |
| 31 class PnaclCoordinator; | 31 class PnaclCoordinator; |
| 32 class PnaclOptions; |
| 32 class PnaclResources; | 33 class PnaclResources; |
| 33 class TempFile; | 34 class TempFile; |
| 34 | 35 |
| 35 struct PnaclTimeStats { | 36 struct PnaclTimeStats { |
| 36 int64_t pnacl_llc_load_time; | 37 int64_t pnacl_llc_load_time; |
| 37 int64_t pnacl_compile_time; | 38 int64_t pnacl_compile_time; |
| 38 int64_t pnacl_ld_load_time; | 39 int64_t pnacl_ld_load_time; |
| 39 int64_t pnacl_link_time; | 40 int64_t pnacl_link_time; |
| 40 }; | 41 }; |
| 41 | 42 |
| 42 class PnaclTranslateThread { | 43 class PnaclTranslateThread { |
| 43 public: | 44 public: |
| 44 PnaclTranslateThread(); | 45 PnaclTranslateThread(); |
| 45 ~PnaclTranslateThread(); | 46 ~PnaclTranslateThread(); |
| 46 | 47 |
| 47 // Start the translation process. It will continue to run and consume data | 48 // Start the translation process. It will continue to run and consume data |
| 48 // as it is passed in with PutBytes. | 49 // as it is passed in with PutBytes. |
| 49 void RunTranslate(const pp::CompletionCallback& finish_callback, | 50 void RunTranslate(const pp::CompletionCallback& finish_callback, |
| 50 const Manifest* manifest, | 51 const Manifest* manifest, |
| 51 const Manifest* ld_manifest, | 52 const Manifest* ld_manifest, |
| 52 TempFile* obj_file, | 53 TempFile* obj_file, |
| 53 TempFile* nexe_file, | 54 TempFile* nexe_file, |
| 54 ErrorInfo* error_info, | 55 ErrorInfo* error_info, |
| 55 PnaclResources* resources, | 56 PnaclResources* resources, |
| 57 PnaclOptions* pnacl_options, |
| 56 PnaclCoordinator* coordinator, | 58 PnaclCoordinator* coordinator, |
| 57 Plugin* plugin); | 59 Plugin* plugin); |
| 58 | 60 |
| 59 // Kill the llc and/or ld subprocesses. This happens by closing the command | 61 // Kill the llc and/or ld subprocesses. This happens by closing the command |
| 60 // channel on the plugin side, which causes the trusted code in the nexe to | 62 // channel on the plugin side, which causes the trusted code in the nexe to |
| 61 // exit, which will cause any pending SRPCs to error. Because this is called | 63 // exit, which will cause any pending SRPCs to error. Because this is called |
| 62 // on the main thread, the translation thread must not use the subprocess | 64 // on the main thread, the translation thread must not use the subprocess |
| 63 // objects without the lock, other than InvokeSrpcMethod, which does not | 65 // objects without the lock, other than InvokeSrpcMethod, which does not |
| 64 // race with service runtime shutdown. | 66 // race with service runtime shutdown. |
| 65 void AbortSubprocesses(); | 67 void AbortSubprocesses(); |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 117 | 119 |
| 118 PnaclTimeStats time_stats_; | 120 PnaclTimeStats time_stats_; |
| 119 | 121 |
| 120 // Data about the translation files, owned by the coordinator | 122 // Data about the translation files, owned by the coordinator |
| 121 const Manifest* manifest_; | 123 const Manifest* manifest_; |
| 122 const Manifest* ld_manifest_; | 124 const Manifest* ld_manifest_; |
| 123 TempFile* obj_file_; | 125 TempFile* obj_file_; |
| 124 TempFile* nexe_file_; | 126 TempFile* nexe_file_; |
| 125 ErrorInfo* coordinator_error_info_; | 127 ErrorInfo* coordinator_error_info_; |
| 126 PnaclResources* resources_; | 128 PnaclResources* resources_; |
| 129 PnaclOptions* pnacl_options_; |
| 127 PnaclCoordinator* coordinator_; | 130 PnaclCoordinator* coordinator_; |
| 128 Plugin* plugin_; | 131 Plugin* plugin_; |
| 129 private: | 132 private: |
| 130 NACL_DISALLOW_COPY_AND_ASSIGN(PnaclTranslateThread); | 133 NACL_DISALLOW_COPY_AND_ASSIGN(PnaclTranslateThread); |
| 131 }; | 134 }; |
| 132 | 135 |
| 133 } | 136 } |
| 134 #endif // NATIVE_CLIENT_SRC_TRUSTED_PLUGIN_PNACL_TRANSLATE_THREAD_H_ | 137 #endif // NATIVE_CLIENT_SRC_TRUSTED_PLUGIN_PNACL_TRANSLATE_THREAD_H_ |
| OLD | NEW |