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 #include "native_client/src/trusted/plugin/pnacl_translate_thread.h" | 5 #include "native_client/src/trusted/plugin/pnacl_translate_thread.h" |
6 | 6 |
7 #include "native_client/src/trusted/desc/nacl_desc_wrapper.h" | 7 #include "native_client/src/trusted/desc/nacl_desc_wrapper.h" |
8 #include "native_client/src/trusted/plugin/plugin.h" | 8 #include "native_client/src/trusted/plugin/plugin.h" |
9 #include "native_client/src/trusted/plugin/pnacl_resources.h" | 9 #include "native_client/src/trusted/plugin/pnacl_resources.h" |
10 #include "native_client/src/trusted/plugin/srpc_params.h" | 10 #include "native_client/src/trusted/plugin/srpc_params.h" |
11 #include "native_client/src/trusted/plugin/utility.h" | 11 #include "native_client/src/trusted/plugin/utility.h" |
12 | 12 |
13 namespace plugin { | 13 namespace plugin { |
14 | 14 |
15 PnaclTranslateThread::PnaclTranslateThread() : subprocesses_should_die_(false), | 15 PnaclTranslateThread::PnaclTranslateThread() : subprocesses_should_die_(false), |
16 manifest_(NULL), | 16 manifest_(NULL), |
| 17 ld_manifest_(NULL), |
17 obj_file_(NULL), | 18 obj_file_(NULL), |
18 nexe_file_(NULL), | 19 nexe_file_(NULL), |
19 pexe_wrapper_(NULL), | 20 pexe_wrapper_(NULL), |
20 error_info_(NULL), | 21 error_info_(NULL), |
21 resources_(NULL), | 22 resources_(NULL), |
22 plugin_(NULL) { | 23 plugin_(NULL) { |
23 NaClXMutexCtor(&subprocess_mu_); | 24 NaClXMutexCtor(&subprocess_mu_); |
24 } | 25 } |
25 | 26 |
26 void PnaclTranslateThread::RunTranslate(pp::CompletionCallback finish_callback, | 27 void PnaclTranslateThread::RunTranslate( |
27 const Manifest* manifest, | 28 const pp::CompletionCallback& finish_callback, |
28 const Manifest* ld_manifest, | 29 const Manifest* manifest, |
29 LocalTempFile* obj_file, | 30 const Manifest* ld_manifest, |
30 LocalTempFile* nexe_file, | 31 LocalTempFile* obj_file, |
31 nacl::DescWrapper* pexe_wrapper, | 32 LocalTempFile* nexe_file, |
32 ErrorInfo* error_info, | 33 nacl::DescWrapper* pexe_wrapper, |
33 PnaclResources* resources, | 34 ErrorInfo* error_info, |
34 Plugin* plugin) { | 35 PnaclResources* resources, |
| 36 Plugin* plugin) { |
35 PLUGIN_PRINTF(("PnaclTranslateThread::RunTranslate)\n")); | 37 PLUGIN_PRINTF(("PnaclTranslateThread::RunTranslate)\n")); |
36 manifest_ = manifest; | 38 manifest_ = manifest; |
37 ld_manifest_ = ld_manifest; | 39 ld_manifest_ = ld_manifest; |
38 obj_file_ = obj_file; | 40 obj_file_ = obj_file; |
39 nexe_file_ = nexe_file; | 41 nexe_file_ = nexe_file; |
40 pexe_wrapper_ = pexe_wrapper; | 42 pexe_wrapper_ = pexe_wrapper; |
41 error_info_ = error_info; | 43 error_info_ = error_info; |
42 resources_ = resources; | 44 resources_ = resources; |
43 plugin_ = plugin; | 45 plugin_ = plugin; |
44 | 46 |
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
168 bool subprocesses_should_die) { | 170 bool subprocesses_should_die) { |
169 nacl::MutexLocker ml(&subprocess_mu_); | 171 nacl::MutexLocker ml(&subprocess_mu_); |
170 subprocesses_should_die_ = subprocesses_should_die; | 172 subprocesses_should_die_ = subprocesses_should_die; |
171 } | 173 } |
172 | 174 |
173 PnaclTranslateThread::~PnaclTranslateThread() { | 175 PnaclTranslateThread::~PnaclTranslateThread() { |
174 NaClMutexDtor(&subprocess_mu_); | 176 NaClMutexDtor(&subprocess_mu_); |
175 } | 177 } |
176 | 178 |
177 } // namespace plugin | 179 } // namespace plugin |
OLD | NEW |