| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2012 The Chromium Authors. All rights reserved. | 2 * Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 3 * Use of this source code is governed by a BSD-style license that can be | 3 * Use of this source code is governed by a BSD-style license that can be |
| 4 * found in the LICENSE file. | 4 * found in the LICENSE file. |
| 5 */ | 5 */ |
| 6 | 6 |
| 7 #define NACL_LOG_MODULE_NAME "Plugin::ServiceRuntime" | 7 #define NACL_LOG_MODULE_NAME "Plugin::ServiceRuntime" |
| 8 | 8 |
| 9 #include "native_client/src/trusted/plugin/service_runtime.h" | 9 #include "native_client/src/trusted/plugin/service_runtime.h" |
| 10 | 10 |
| (...skipping 617 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 628 reinterpret_cast<void*>(nacl_desc))); | 628 reinterpret_cast<void*>(nacl_desc))); |
| 629 | 629 |
| 630 nacl::scoped_ptr<nacl::SelLdrLauncher> | 630 nacl::scoped_ptr<nacl::SelLdrLauncher> |
| 631 tmp_subprocess(new nacl::SelLdrLauncher()); | 631 tmp_subprocess(new nacl::SelLdrLauncher()); |
| 632 if (NULL == tmp_subprocess.get()) { | 632 if (NULL == tmp_subprocess.get()) { |
| 633 PLUGIN_PRINTF(("ServiceRuntime::Start (subprocess create failed)\n")); | 633 PLUGIN_PRINTF(("ServiceRuntime::Start (subprocess create failed)\n")); |
| 634 error_info->SetReport(ERROR_SEL_LDR_CREATE_LAUNCHER, | 634 error_info->SetReport(ERROR_SEL_LDR_CREATE_LAUNCHER, |
| 635 "ServiceRuntime: failed to create sel_ldr launcher"); | 635 "ServiceRuntime: failed to create sel_ldr launcher"); |
| 636 return false; | 636 return false; |
| 637 } | 637 } |
| 638 if (!tmp_subprocess->Start(url.c_str())) { | 638 PP_Instance instance = plugin_->pp_instance(); |
| 639 if (!tmp_subprocess->Start(instance, url.c_str())) { |
| 639 PLUGIN_PRINTF(("ServiceRuntime::Start (start failed)\n")); | 640 PLUGIN_PRINTF(("ServiceRuntime::Start (start failed)\n")); |
| 640 error_info->SetReport(ERROR_SEL_LDR_LAUNCH, | 641 error_info->SetReport(ERROR_SEL_LDR_LAUNCH, |
| 641 "ServiceRuntime: failed to start"); | 642 "ServiceRuntime: failed to start"); |
| 642 return false; | 643 return false; |
| 643 } | 644 } |
| 644 | 645 |
| 645 subprocess_.reset(tmp_subprocess.release()); | 646 subprocess_.reset(tmp_subprocess.release()); |
| 646 if (!InitCommunication(nacl_desc, error_info)) { | 647 if (!InitCommunication(nacl_desc, error_info)) { |
| 647 subprocess_.reset(NULL); | 648 subprocess_.reset(NULL); |
| 648 return false; | 649 return false; |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 725 nacl::MutexLocker take(&mu_); | 726 nacl::MutexLocker take(&mu_); |
| 726 return exit_status_; | 727 return exit_status_; |
| 727 } | 728 } |
| 728 | 729 |
| 729 void ServiceRuntime::set_exit_status(int exit_status) { | 730 void ServiceRuntime::set_exit_status(int exit_status) { |
| 730 nacl::MutexLocker take(&mu_); | 731 nacl::MutexLocker take(&mu_); |
| 731 exit_status_ = exit_status & 0xff; | 732 exit_status_ = exit_status & 0xff; |
| 732 } | 733 } |
| 733 | 734 |
| 734 } // namespace plugin | 735 } // namespace plugin |
| OLD | NEW |