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 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
217 core->CallOnMainThread( | 217 core->CallOnMainThread( |
218 0, | 218 0, |
219 coordinator_->GetCompileProgressCallback(data.size()), | 219 coordinator_->GetCompileProgressCallback(data.size()), |
220 PP_OK); | 220 PP_OK); |
221 } else { | 221 } else { |
222 NaClXMutexUnlock(&cond_mu_); | 222 NaClXMutexUnlock(&cond_mu_); |
223 } | 223 } |
224 } | 224 } |
225 PLUGIN_PRINTF(("PnaclTranslateThread done with chunks\n")); | 225 PLUGIN_PRINTF(("PnaclTranslateThread done with chunks\n")); |
226 // Finish llc. | 226 // Finish llc. |
227 if(!llc_subprocess_->InvokeSrpcMethod("StreamEnd", | 227 if (!llc_subprocess_->InvokeSrpcMethod("StreamEnd", std::string(), ¶ms)) { |
228 "", | |
229 ¶ms)) { | |
230 PLUGIN_PRINTF(("PnaclTranslateThread StreamEnd failed\n")); | 228 PLUGIN_PRINTF(("PnaclTranslateThread StreamEnd failed\n")); |
231 if (llc_subprocess_->srpc_client()->GetLastError() == | 229 if (llc_subprocess_->srpc_client()->GetLastError() == |
232 NACL_SRPC_RESULT_APP_ERROR) { | 230 NACL_SRPC_RESULT_APP_ERROR) { |
233 // The error string is only present if the error was sent back from llc. | 231 // The error string is only present if the error was sent back from llc. |
234 TranslateFailed(ERROR_PNACL_LLC_INTERNAL, | 232 TranslateFailed(ERROR_PNACL_LLC_INTERNAL, |
235 params.outs()[3]->arrays.str); | 233 params.outs()[3]->arrays.str); |
236 } else { | 234 } else { |
237 TranslateFailed(ERROR_PNACL_LLC_INTERNAL, | 235 TranslateFailed(ERROR_PNACL_LLC_INTERNAL, |
238 "Compile StreamEnd internal error"); | 236 "Compile StreamEnd internal error"); |
239 } | 237 } |
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
363 PLUGIN_PRINTF(("~PnaclTranslateThread (translate_thread=%p)\n", this)); | 361 PLUGIN_PRINTF(("~PnaclTranslateThread (translate_thread=%p)\n", this)); |
364 AbortSubprocesses(); | 362 AbortSubprocesses(); |
365 NaClThreadJoin(translate_thread_.get()); | 363 NaClThreadJoin(translate_thread_.get()); |
366 PLUGIN_PRINTF(("~PnaclTranslateThread joined\n")); | 364 PLUGIN_PRINTF(("~PnaclTranslateThread joined\n")); |
367 NaClCondVarDtor(&buffer_cond_); | 365 NaClCondVarDtor(&buffer_cond_); |
368 NaClMutexDtor(&cond_mu_); | 366 NaClMutexDtor(&cond_mu_); |
369 NaClMutexDtor(&subprocess_mu_); | 367 NaClMutexDtor(&subprocess_mu_); |
370 } | 368 } |
371 | 369 |
372 } // namespace plugin | 370 } // namespace plugin |
OLD | NEW |