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/plugin_error.h" | 9 #include "native_client/src/trusted/plugin/plugin_error.h" |
10 #include "native_client/src/trusted/plugin/pnacl_resources.h" | 10 #include "native_client/src/trusted/plugin/pnacl_resources.h" |
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
193 } | 193 } |
194 } | 194 } |
195 PLUGIN_PRINTF(("PnaclTranslateThread done with chunks\n")); | 195 PLUGIN_PRINTF(("PnaclTranslateThread done with chunks\n")); |
196 // Finish llc. | 196 // Finish llc. |
197 if(!llc_subprocess_->InvokeSrpcMethod("StreamEnd", | 197 if(!llc_subprocess_->InvokeSrpcMethod("StreamEnd", |
198 "", | 198 "", |
199 ¶ms)) { | 199 ¶ms)) { |
200 PLUGIN_PRINTF(("PnaclTranslateThread StreamEnd failed\n")); | 200 PLUGIN_PRINTF(("PnaclTranslateThread StreamEnd failed\n")); |
201 if (llc_subprocess_->srpc_client()->GetLastError() == | 201 if (llc_subprocess_->srpc_client()->GetLastError() == |
202 NACL_SRPC_RESULT_APP_ERROR) { | 202 NACL_SRPC_RESULT_APP_ERROR) { |
203 // The error string is only present if the error was sent back from llc | 203 // The error string is only present if the error was sent back from llc. |
204 TranslateFailed(ERROR_PNACL_LLC_INTERNAL, | 204 TranslateFailed(ERROR_PNACL_LLC_INTERNAL, |
205 params.outs()[3]->arrays.str); | 205 params.outs()[3]->arrays.str); |
206 } else { | 206 } else { |
207 TranslateFailed(ERROR_PNACL_LLC_INTERNAL, | 207 TranslateFailed(ERROR_PNACL_LLC_INTERNAL, |
208 "Compile StreamEnd internal error"); | 208 "Compile StreamEnd internal error"); |
209 } | 209 } |
210 return; | 210 return; |
211 } | 211 } |
212 // LLC returns values that are used to determine how linking is done. | 212 // LLC returns values that are used to determine how linking is done. |
213 int is_shared_library = (params.outs()[0]->u.ival != 0); | 213 int is_shared_library = (params.outs()[0]->u.ival != 0); |
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
324 PLUGIN_PRINTF(("~PnaclTranslateThread (translate_thread=%p)\n", this)); | 324 PLUGIN_PRINTF(("~PnaclTranslateThread (translate_thread=%p)\n", this)); |
325 AbortSubprocesses(); | 325 AbortSubprocesses(); |
326 NaClThreadJoin(translate_thread_.get()); | 326 NaClThreadJoin(translate_thread_.get()); |
327 PLUGIN_PRINTF(("~PnaclTranslateThread joined\n")); | 327 PLUGIN_PRINTF(("~PnaclTranslateThread joined\n")); |
328 NaClCondVarDtor(&buffer_cond_); | 328 NaClCondVarDtor(&buffer_cond_); |
329 NaClMutexDtor(&cond_mu_); | 329 NaClMutexDtor(&cond_mu_); |
330 NaClMutexDtor(&subprocess_mu_); | 330 NaClMutexDtor(&subprocess_mu_); |
331 } | 331 } |
332 | 332 |
333 } // namespace plugin | 333 } // namespace plugin |
OLD | NEW |