| 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 716 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 727 reinterpret_cast<void*>(nacl_desc)); | 727 reinterpret_cast<void*>(nacl_desc)); |
| 728 | 728 |
| 729 nacl::scoped_ptr<SelLdrLauncherChrome> | 729 nacl::scoped_ptr<SelLdrLauncherChrome> |
| 730 tmp_subprocess(new SelLdrLauncherChrome()); | 730 tmp_subprocess(new SelLdrLauncherChrome()); |
| 731 if (NULL == tmp_subprocess.get()) { | 731 if (NULL == tmp_subprocess.get()) { |
| 732 NaClLog(LOG_ERROR, "ServiceRuntime::Start (subprocess create failed)\n"); | 732 NaClLog(LOG_ERROR, "ServiceRuntime::Start (subprocess create failed)\n"); |
| 733 error_info->SetReport(ERROR_SEL_LDR_CREATE_LAUNCHER, | 733 error_info->SetReport(ERROR_SEL_LDR_CREATE_LAUNCHER, |
| 734 "ServiceRuntime: failed to create sel_ldr launcher"); | 734 "ServiceRuntime: failed to create sel_ldr launcher"); |
| 735 return false; | 735 return false; |
| 736 } | 736 } |
| 737 nacl::string error_message; |
| 737 bool started = tmp_subprocess->Start(plugin_->pp_instance(), | 738 bool started = tmp_subprocess->Start(plugin_->pp_instance(), |
| 738 url.c_str(), | 739 url.c_str(), |
| 739 uses_irt, | 740 uses_irt, |
| 740 uses_ppapi, | 741 uses_ppapi, |
| 741 enable_ppapi_dev, | 742 enable_ppapi_dev, |
| 742 enable_dyncode_syscalls, | 743 enable_dyncode_syscalls, |
| 743 enable_exception_handling); | 744 enable_exception_handling, |
| 745 &error_message); |
| 744 if (!started) { | 746 if (!started) { |
| 745 NaClLog(LOG_ERROR, "ServiceRuntime::Start (start failed)\n"); | 747 NaClLog(LOG_ERROR, "ServiceRuntime::Start (start failed)\n"); |
| 746 error_info->SetReport(ERROR_SEL_LDR_LAUNCH, | 748 if (error_message.empty()) { |
| 747 "ServiceRuntime: failed to start"); | 749 error_info->SetReport(ERROR_SEL_LDR_LAUNCH, |
| 750 "ServiceRuntime: failed to start"); |
| 751 } else { |
| 752 error_info->SetReport(ERROR_SEL_LDR_LAUNCH, error_message); |
| 753 } |
| 748 return false; | 754 return false; |
| 749 } | 755 } |
| 750 | 756 |
| 751 subprocess_.reset(tmp_subprocess.release()); | 757 subprocess_.reset(tmp_subprocess.release()); |
| 752 if (!InitCommunication(nacl_desc, error_info)) { | 758 if (!InitCommunication(nacl_desc, error_info)) { |
| 753 // On a load failure the service runtime does not crash itself to | 759 // On a load failure the service runtime does not crash itself to |
| 754 // avoid a race where the no-more-senders error on the reverse | 760 // avoid a race where the no-more-senders error on the reverse |
| 755 // channel esrvice thread might cause the crash-detection logic to | 761 // channel esrvice thread might cause the crash-detection logic to |
| 756 // kick in before the start_module RPC reply has been received. So | 762 // kick in before the start_module RPC reply has been received. So |
| 757 // we induce a service runtime crash here. We do not release | 763 // we induce a service runtime crash here. We do not release |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 854 | 860 |
| 855 nacl::string ServiceRuntime::GetCrashLogOutput() { | 861 nacl::string ServiceRuntime::GetCrashLogOutput() { |
| 856 if (NULL != subprocess_.get()) { | 862 if (NULL != subprocess_.get()) { |
| 857 return subprocess_->GetCrashLogOutput(); | 863 return subprocess_->GetCrashLogOutput(); |
| 858 } else { | 864 } else { |
| 859 return std::string(); | 865 return std::string(); |
| 860 } | 866 } |
| 861 } | 867 } |
| 862 | 868 |
| 863 } // namespace plugin | 869 } // namespace plugin |
| OLD | NEW |