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 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
60 // objects without the lock, other than InvokeSrpcMethod, which does not | 60 // objects without the lock, other than InvokeSrpcMethod, which does not |
61 // race with service runtime shutdown. | 61 // race with service runtime shutdown. |
62 void AbortSubprocesses(); | 62 void AbortSubprocesses(); |
63 | 63 |
64 // Send bitcode bytes to the translator. Called from the main thread. | 64 // Send bitcode bytes to the translator. Called from the main thread. |
65 void PutBytes(std::vector<char>* data, int count); | 65 void PutBytes(std::vector<char>* data, int count); |
66 | 66 |
67 int64_t GetCompileTime() const { return compile_time_; } | 67 int64_t GetCompileTime() const { return compile_time_; } |
68 | 68 |
69 private: | 69 private: |
70 // Starts an individual llc or ld subprocess used for translation. | |
71 NaClSubprocess* StartSubprocess(const nacl::string& url, | |
72 int32_t manifest_id, | |
73 ErrorInfo* error_info); | |
74 // Helper thread entry point for translation. Takes a pointer to | 70 // Helper thread entry point for translation. Takes a pointer to |
75 // PnaclTranslateThread and calls DoTranslate(). | 71 // PnaclTranslateThread and calls DoTranslate(). |
76 static void WINAPI DoTranslateThread(void* arg); | 72 static void WINAPI DoTranslateThread(void* arg); |
77 // Runs the streaming translation. Called from the helper thread. | 73 // Runs the streaming translation. Called from the helper thread. |
78 void DoTranslate() ; | 74 void DoTranslate() ; |
79 // Signal that Pnacl translation failed, from the translation thread only. | 75 // Signal that Pnacl translation failed, from the translation thread only. |
80 void TranslateFailed(PP_NaClError err_code, | 76 void TranslateFailed(PP_NaClError err_code, |
81 const nacl::string& error_string); | 77 const nacl::string& error_string); |
82 // Run the LD subprocess, returning true on success. | 78 // Run the LD subprocess, returning true on success. |
83 // On failure, it returns false and runs the callback. | 79 // On failure, it returns false and runs the callback. |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
123 PP_PNaClOptions* pnacl_options_; | 119 PP_PNaClOptions* pnacl_options_; |
124 nacl::string architecture_attributes_; | 120 nacl::string architecture_attributes_; |
125 PnaclCoordinator* coordinator_; | 121 PnaclCoordinator* coordinator_; |
126 Plugin* plugin_; | 122 Plugin* plugin_; |
127 private: | 123 private: |
128 NACL_DISALLOW_COPY_AND_ASSIGN(PnaclTranslateThread); | 124 NACL_DISALLOW_COPY_AND_ASSIGN(PnaclTranslateThread); |
129 }; | 125 }; |
130 | 126 |
131 } | 127 } |
132 #endif // NATIVE_CLIENT_SRC_TRUSTED_PLUGIN_PNACL_TRANSLATE_THREAD_H_ | 128 #endif // NATIVE_CLIENT_SRC_TRUSTED_PLUGIN_PNACL_TRANSLATE_THREAD_H_ |
OLD | NEW |