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_STREAMING_TRANSLATE_THREAD_H_ | 5 #ifndef NATIVE_CLIENT_SRC_TRUSTED_PLUGIN_PNACL_STREAMING_TRANSLATE_THREAD_H_ |
6 #define NATIVE_CLIENT_SRC_TRUSTED_PLUGIN_PNACL_STREAMING_TRANSLATE_THREAD_H_ | 6 #define NATIVE_CLIENT_SRC_TRUSTED_PLUGIN_PNACL_STREAMING_TRANSLATE_THREAD_H_ |
7 | 7 |
8 #include <deque> | 8 #include <deque> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
11 #include "native_client/src/include/nacl_macros.h" | 11 #include "native_client/src/include/nacl_macros.h" |
12 #include "native_client/src/shared/platform/nacl_sync_checked.h" | 12 #include "native_client/src/shared/platform/nacl_sync_checked.h" |
13 #include "native_client/src/trusted/plugin/pnacl_translate_thread.h" | 13 #include "native_client/src/trusted/plugin/pnacl_translate_thread.h" |
14 | 14 |
15 namespace plugin { | 15 namespace plugin { |
16 | 16 |
17 class PnaclStreamingTranslateThread : public PnaclTranslateThread { | 17 class PnaclStreamingTranslateThread : public PnaclTranslateThread { |
18 public: | 18 public: |
19 PnaclStreamingTranslateThread(); | 19 PnaclStreamingTranslateThread(); |
20 virtual ~PnaclStreamingTranslateThread(); | 20 virtual ~PnaclStreamingTranslateThread(); |
21 | 21 |
22 // Start the translation process. It will continue to run and consume data | 22 // Start the translation process. It will continue to run and consume data |
23 // as it is passed in with PutBytes. | 23 // as it is passed in with PutBytes. |
24 virtual void RunTranslate(const pp::CompletionCallback& finish_callback, | 24 virtual void RunTranslate(const pp::CompletionCallback& finish_callback, |
25 const Manifest* manifest, | 25 const Manifest* manifest, |
26 const Manifest* ld_manifest, | 26 const Manifest* ld_manifest, |
27 LocalTempFile* obj_file, | 27 TempFile* obj_file, |
28 LocalTempFile* nexe_file, | 28 LocalTempFile* nexe_file, |
29 ErrorInfo* error_info, | 29 ErrorInfo* error_info, |
30 PnaclResources* resources, | 30 PnaclResources* resources, |
31 Plugin* plugin); | 31 Plugin* plugin); |
32 | 32 |
33 // Kill the translation and/or linking processes. | 33 // Kill the translation and/or linking processes. |
34 virtual void SetSubprocessesShouldDie(); | 34 virtual void SetSubprocessesShouldDie(); |
35 | 35 |
36 // Send bitcode bytes to the translator. Called from the main thread. | 36 // Send bitcode bytes to the translator. Called from the main thread. |
37 void PutBytes(std::vector<char>* data, int count); | 37 void PutBytes(std::vector<char>* data, int count); |
(...skipping 11 matching lines...) Expand all Loading... |
49 struct NaClCondVar buffer_cond_; | 49 struct NaClCondVar buffer_cond_; |
50 // Mutex for buffer_cond_. | 50 // Mutex for buffer_cond_. |
51 struct NaClMutex cond_mu_; | 51 struct NaClMutex cond_mu_; |
52 // Data buffers from FileDownloader are enqueued here to pass from the | 52 // Data buffers from FileDownloader are enqueued here to pass from the |
53 // main thread to the SRPC thread. Protected by cond_mu_ | 53 // main thread to the SRPC thread. Protected by cond_mu_ |
54 std::deque<std::vector<char> > data_buffers_; | 54 std::deque<std::vector<char> > data_buffers_; |
55 }; | 55 }; |
56 | 56 |
57 } // namespace plugin | 57 } // namespace plugin |
58 #endif // NATIVE_CLIENT_SRC_TRUSTED_PLUGIN_PNACL_STREAMING_TRANSLATE_THREAD_H_ | 58 #endif // NATIVE_CLIENT_SRC_TRUSTED_PLUGIN_PNACL_STREAMING_TRANSLATE_THREAD_H_ |
OLD | NEW |