| 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 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 56 // channel on the plugin side, which causes the trusted code in the nexe to | 56 // channel on the plugin side, which causes the trusted code in the nexe to |
| 57 // exit, which will cause any pending SRPCs to error. Because this is called | 57 // exit, which will cause any pending SRPCs to error. Because this is called |
| 58 // on the main thread, the translation thread must not use the subprocess | 58 // on the main thread, the translation thread must not use the subprocess |
| 59 // objects without the lock, other than InvokeSrpcMethod, which does not | 59 // objects without the lock, other than InvokeSrpcMethod, which does not |
| 60 // race with service runtime shutdown. | 60 // race with service runtime shutdown. |
| 61 void AbortSubprocesses(); | 61 void AbortSubprocesses(); |
| 62 | 62 |
| 63 // Send bitcode bytes to the translator. Called from the main thread. | 63 // Send bitcode bytes to the translator. Called from the main thread. |
| 64 void PutBytes(std::vector<char>* data, int count); | 64 void PutBytes(std::vector<char>* data, int count); |
| 65 | 65 |
| 66 // Notify the translator that the end of the bitcode stream has been reached. |
| 67 // Called from the main thread. |
| 68 void EndStream(); |
| 69 |
| 66 int64_t GetCompileTime() const { return compile_time_; } | 70 int64_t GetCompileTime() const { return compile_time_; } |
| 67 | 71 |
| 68 private: | 72 private: |
| 69 // Helper thread entry point for translation. Takes a pointer to | 73 // Helper thread entry point for translation. Takes a pointer to |
| 70 // PnaclTranslateThread and calls DoTranslate(). | 74 // PnaclTranslateThread and calls DoTranslate(). |
| 71 static void WINAPI DoTranslateThread(void* arg); | 75 static void WINAPI DoTranslateThread(void* arg); |
| 72 // Runs the streaming translation. Called from the helper thread. | 76 // Runs the streaming translation. Called from the helper thread. |
| 73 void DoTranslate() ; | 77 void DoTranslate() ; |
| 74 // Signal that Pnacl translation failed, from the translation thread only. | 78 // Signal that Pnacl translation failed, from the translation thread only. |
| 75 void TranslateFailed(PP_NaClError err_code, | 79 void TranslateFailed(PP_NaClError err_code, |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 119 PP_PNaClOptions* pnacl_options_; | 123 PP_PNaClOptions* pnacl_options_; |
| 120 nacl::string architecture_attributes_; | 124 nacl::string architecture_attributes_; |
| 121 PnaclCoordinator* coordinator_; | 125 PnaclCoordinator* coordinator_; |
| 122 Plugin* plugin_; | 126 Plugin* plugin_; |
| 123 private: | 127 private: |
| 124 NACL_DISALLOW_COPY_AND_ASSIGN(PnaclTranslateThread); | 128 NACL_DISALLOW_COPY_AND_ASSIGN(PnaclTranslateThread); |
| 125 }; | 129 }; |
| 126 | 130 |
| 127 } | 131 } |
| 128 #endif // NATIVE_CLIENT_SRC_TRUSTED_PLUGIN_PNACL_TRANSLATE_THREAD_H_ | 132 #endif // NATIVE_CLIENT_SRC_TRUSTED_PLUGIN_PNACL_TRANSLATE_THREAD_H_ |
| OLD | NEW |