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 "ppapi/native_client/src/trusted/plugin/pnacl_translate_thread.h" | 5 #include "ppapi/native_client/src/trusted/plugin/pnacl_translate_thread.h" |
6 | 6 |
7 #include <iterator> | 7 #include <iterator> |
8 | 8 |
9 #include "native_client/src/trusted/desc/nacl_desc_wrapper.h" | 9 #include "native_client/src/trusted/desc/nacl_desc_wrapper.h" |
10 #include "ppapi/cpp/var.h" | 10 #include "ppapi/cpp/var.h" |
(...skipping 319 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
330 ld_in_files.push_back((*obj_files_)[i]->read_wrapper()); | 330 ld_in_files.push_back((*obj_files_)[i]->read_wrapper()); |
331 } | 331 } |
332 for (; i < PnaclCoordinator::kMaxTranslatorObjectFiles; i++) | 332 for (; i < PnaclCoordinator::kMaxTranslatorObjectFiles; i++) |
333 ld_in_files.push_back(invalid_desc_wrapper_); | 333 ld_in_files.push_back(invalid_desc_wrapper_); |
334 | 334 |
335 nacl::DescWrapper* ld_out_file = nexe_file_->write_wrapper(); | 335 nacl::DescWrapper* ld_out_file = nexe_file_->write_wrapper(); |
336 int64_t ld_start_time = NaClGetTimeOfDayMicroseconds(); | 336 int64_t ld_start_time = NaClGetTimeOfDayMicroseconds(); |
337 PP_NaClFileInfo ld_file_info = resources_->TakeLdFileInfo(); | 337 PP_NaClFileInfo ld_file_info = resources_->TakeLdFileInfo(); |
338 // On success, ownership of ld_file_info is transferred. | 338 // On success, ownership of ld_file_info is transferred. |
339 nacl::scoped_ptr<NaClSubprocess> ld_subprocess( | 339 nacl::scoped_ptr<NaClSubprocess> ld_subprocess( |
340 plugin_->LoadHelperNaClModule(resources_->GetLlcUrl(), | 340 plugin_->LoadHelperNaClModule(resources_->GetLdUrl(), |
341 ld_file_info, | 341 ld_file_info, |
342 &error_info)); | 342 &error_info)); |
343 if (ld_subprocess.get() == NULL) { | 343 if (ld_subprocess.get() == NULL) { |
344 if (ld_file_info.handle != PP_kInvalidFileHandle) | 344 if (ld_file_info.handle != PP_kInvalidFileHandle) |
345 CloseFileHandle(ld_file_info.handle); | 345 CloseFileHandle(ld_file_info.handle); |
346 TranslateFailed(PP_NACL_ERROR_PNACL_LD_SETUP, | 346 TranslateFailed(PP_NACL_ERROR_PNACL_LD_SETUP, |
347 "Link process could not be created: " + | 347 "Link process could not be created: " + |
348 error_info.message()); | 348 error_info.message()); |
349 return false; | 349 return false; |
350 } | 350 } |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
447 AbortSubprocesses(); | 447 AbortSubprocesses(); |
448 if (translate_thread_ != NULL) | 448 if (translate_thread_ != NULL) |
449 NaClThreadJoin(translate_thread_.get()); | 449 NaClThreadJoin(translate_thread_.get()); |
450 PLUGIN_PRINTF(("~PnaclTranslateThread joined\n")); | 450 PLUGIN_PRINTF(("~PnaclTranslateThread joined\n")); |
451 NaClCondVarDtor(&buffer_cond_); | 451 NaClCondVarDtor(&buffer_cond_); |
452 NaClMutexDtor(&cond_mu_); | 452 NaClMutexDtor(&cond_mu_); |
453 NaClMutexDtor(&subprocess_mu_); | 453 NaClMutexDtor(&subprocess_mu_); |
454 } | 454 } |
455 | 455 |
456 } // namespace plugin | 456 } // namespace plugin |
OLD | NEW |