| 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 709 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 720 | 720 |
| 721 nacl::scoped_ptr<SelLdrLauncherChrome> | 721 nacl::scoped_ptr<SelLdrLauncherChrome> |
| 722 tmp_subprocess(new SelLdrLauncherChrome()); | 722 tmp_subprocess(new SelLdrLauncherChrome()); |
| 723 if (NULL == tmp_subprocess.get()) { | 723 if (NULL == tmp_subprocess.get()) { |
| 724 NaClLog(LOG_ERROR, "ServiceRuntime::Start (subprocess create failed)\n"); | 724 NaClLog(LOG_ERROR, "ServiceRuntime::Start (subprocess create failed)\n"); |
| 725 params.error_info->SetReport( | 725 params.error_info->SetReport( |
| 726 ERROR_SEL_LDR_CREATE_LAUNCHER, | 726 ERROR_SEL_LDR_CREATE_LAUNCHER, |
| 727 "ServiceRuntime: failed to create sel_ldr launcher"); | 727 "ServiceRuntime: failed to create sel_ldr launcher"); |
| 728 return false; | 728 return false; |
| 729 } | 729 } |
| 730 nacl::string error_message; |
| 730 bool started = tmp_subprocess->Start(plugin_->pp_instance(), | 731 bool started = tmp_subprocess->Start(plugin_->pp_instance(), |
| 731 params.url.c_str(), | 732 params.url.c_str(), |
| 732 params.uses_irt, | 733 params.uses_irt, |
| 733 params.uses_ppapi, | 734 params.uses_ppapi, |
| 734 params.enable_dev_interfaces, | 735 params.enable_dev_interfaces, |
| 735 params.enable_dyncode_syscalls, | 736 params.enable_dyncode_syscalls, |
| 736 params.enable_exception_handling); | 737 params.enable_exception_handling, |
| 738 &error_message); |
| 737 if (!started) { | 739 if (!started) { |
| 738 NaClLog(LOG_ERROR, "ServiceRuntime::Start (start failed)\n"); | 740 NaClLog(LOG_ERROR, "ServiceRuntime::Start (start failed)\n"); |
| 739 params.error_info->SetReport(ERROR_SEL_LDR_LAUNCH, | 741 if (error_message.empty()) { |
| 740 "ServiceRuntime: failed to start"); | 742 params.error_info->SetReport(ERROR_SEL_LDR_LAUNCH, |
| 743 "ServiceRuntime: failed to start"); |
| 744 } else { |
| 745 params.error_info->SetReport(ERROR_SEL_LDR_LAUNCH, |
| 746 "ServiceRuntime: failed to start", |
| 747 error_message); |
| 748 } |
| 741 return false; | 749 return false; |
| 742 } | 750 } |
| 743 | 751 |
| 744 subprocess_.reset(tmp_subprocess.release()); | 752 subprocess_.reset(tmp_subprocess.release()); |
| 745 NaClLog(4, "ServiceRuntime::StartSelLdr (return 1)\n"); | 753 NaClLog(4, "ServiceRuntime::StartSelLdr (return 1)\n"); |
| 746 return true; | 754 return true; |
| 747 } | 755 } |
| 748 | 756 |
| 749 void ServiceRuntime::WaitForSelLdrStart() { | 757 void ServiceRuntime::WaitForSelLdrStart() { |
| 750 nacl::MutexLocker take(&mu_); | 758 nacl::MutexLocker take(&mu_); |
| (...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 870 | 878 |
| 871 nacl::string ServiceRuntime::GetCrashLogOutput() { | 879 nacl::string ServiceRuntime::GetCrashLogOutput() { |
| 872 if (NULL != subprocess_.get()) { | 880 if (NULL != subprocess_.get()) { |
| 873 return subprocess_->GetCrashLogOutput(); | 881 return subprocess_->GetCrashLogOutput(); |
| 874 } else { | 882 } else { |
| 875 return std::string(); | 883 return std::string(); |
| 876 } | 884 } |
| 877 } | 885 } |
| 878 | 886 |
| 879 } // namespace plugin | 887 } // namespace plugin |
| OLD | NEW |