| 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 696 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 707 return false; | 707 return false; |
| 708 } | 708 } |
| 709 return true; | 709 return true; |
| 710 } | 710 } |
| 711 | 711 |
| 712 bool ServiceRuntime::Start(nacl::DescWrapper* nacl_desc, | 712 bool ServiceRuntime::Start(nacl::DescWrapper* nacl_desc, |
| 713 ErrorInfo* error_info, | 713 ErrorInfo* error_info, |
| 714 const nacl::string& url, | 714 const nacl::string& url, |
| 715 bool uses_ppapi, | 715 bool uses_ppapi, |
| 716 bool enable_ppapi_dev, | 716 bool enable_ppapi_dev, |
| 717 bool uses_irt, |
| 717 pp::CompletionCallback crash_cb) { | 718 pp::CompletionCallback crash_cb) { |
| 718 PLUGIN_PRINTF(("ServiceRuntime::Start (nacl_desc=%p)\n", | 719 PLUGIN_PRINTF(("ServiceRuntime::Start (nacl_desc=%p)\n", |
| 719 reinterpret_cast<void*>(nacl_desc))); | 720 reinterpret_cast<void*>(nacl_desc))); |
| 720 | 721 |
| 721 nacl::scoped_ptr<SelLdrLauncherChrome> | 722 nacl::scoped_ptr<SelLdrLauncherChrome> |
| 722 tmp_subprocess(new SelLdrLauncherChrome()); | 723 tmp_subprocess(new SelLdrLauncherChrome()); |
| 723 if (NULL == tmp_subprocess.get()) { | 724 if (NULL == tmp_subprocess.get()) { |
| 724 PLUGIN_PRINTF(("ServiceRuntime::Start (subprocess create failed)\n")); | 725 PLUGIN_PRINTF(("ServiceRuntime::Start (subprocess create failed)\n")); |
| 725 error_info->SetReport(ERROR_SEL_LDR_CREATE_LAUNCHER, | 726 error_info->SetReport(ERROR_SEL_LDR_CREATE_LAUNCHER, |
| 726 "ServiceRuntime: failed to create sel_ldr launcher"); | 727 "ServiceRuntime: failed to create sel_ldr launcher"); |
| 727 return false; | 728 return false; |
| 728 } | 729 } |
| 729 bool started = tmp_subprocess->Start(plugin_->pp_instance(), | 730 bool started = tmp_subprocess->Start(plugin_->pp_instance(), |
| 730 url.c_str(), | 731 url.c_str(), |
| 731 uses_ppapi, | 732 uses_ppapi, |
| 732 enable_ppapi_dev); | 733 enable_ppapi_dev, |
| 734 uses_irt); |
| 733 if (!started) { | 735 if (!started) { |
| 734 PLUGIN_PRINTF(("ServiceRuntime::Start (start failed)\n")); | 736 PLUGIN_PRINTF(("ServiceRuntime::Start (start failed)\n")); |
| 735 error_info->SetReport(ERROR_SEL_LDR_LAUNCH, | 737 error_info->SetReport(ERROR_SEL_LDR_LAUNCH, |
| 736 "ServiceRuntime: failed to start"); | 738 "ServiceRuntime: failed to start"); |
| 737 return false; | 739 return false; |
| 738 } | 740 } |
| 739 | 741 |
| 740 subprocess_.reset(tmp_subprocess.release()); | 742 subprocess_.reset(tmp_subprocess.release()); |
| 741 if (!InitCommunication(nacl_desc, error_info)) { | 743 if (!InitCommunication(nacl_desc, error_info)) { |
| 742 // On a load failure the service runtime does not crash itself to | 744 // On a load failure the service runtime does not crash itself to |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 843 | 845 |
| 844 nacl::string ServiceRuntime::GetCrashLogOutput() { | 846 nacl::string ServiceRuntime::GetCrashLogOutput() { |
| 845 if (NULL != subprocess_.get()) { | 847 if (NULL != subprocess_.get()) { |
| 846 return subprocess_->GetCrashLogOutput(); | 848 return subprocess_->GetCrashLogOutput(); |
| 847 } else { | 849 } else { |
| 848 return ""; | 850 return ""; |
| 849 } | 851 } |
| 850 } | 852 } |
| 851 | 853 |
| 852 } // namespace plugin | 854 } // namespace plugin |
| OLD | NEW |