Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(150)

Side by Side Diff: ppapi/native_client/src/trusted/plugin/service_runtime.cc

Issue 10635014: Revert 143483 - Add an IPC channel between the NaCl loader process and the renderer. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 605 matching lines...) Expand 10 before | Expand all | Expand 10 after
616 if (LOAD_OK != load_status) { 616 if (LOAD_OK != load_status) {
617 error_info->SetReport( 617 error_info->SetReport(
618 ERROR_SEL_LDR_START_STATUS, 618 ERROR_SEL_LDR_START_STATUS,
619 NaClErrorString(static_cast<NaClErrorCode>(load_status))); 619 NaClErrorString(static_cast<NaClErrorCode>(load_status)));
620 return false; 620 return false;
621 } 621 }
622 return true; 622 return true;
623 } 623 }
624 624
625 bool ServiceRuntime::Start(nacl::DescWrapper* nacl_desc, 625 bool ServiceRuntime::Start(nacl::DescWrapper* nacl_desc,
626 ErrorInfo* error_info, 626 ErrorInfo* error_info, const nacl::string& url) {
627 const nacl::string& url,
628 void** ipc_channel_handle) {
629 PLUGIN_PRINTF(("ServiceRuntime::Start (nacl_desc=%p)\n", 627 PLUGIN_PRINTF(("ServiceRuntime::Start (nacl_desc=%p)\n",
630 reinterpret_cast<void*>(nacl_desc))); 628 reinterpret_cast<void*>(nacl_desc)));
631 629
632 #ifdef NACL_STANDALONE 630 #ifdef NACL_STANDALONE
633 nacl::scoped_ptr<nacl::SelLdrLauncherStandalone> 631 nacl::scoped_ptr<nacl::SelLdrLauncherStandalone>
634 tmp_subprocess(new nacl::SelLdrLauncherStandalone()); 632 tmp_subprocess(new nacl::SelLdrLauncherStandalone());
635 #else 633 #else
636 nacl::scoped_ptr<SelLdrLauncherChrome> 634 nacl::scoped_ptr<SelLdrLauncherChrome>
637 tmp_subprocess(new SelLdrLauncherChrome()); 635 tmp_subprocess(new SelLdrLauncherChrome());
638 #endif 636 #endif
639 if (NULL == tmp_subprocess.get()) { 637 if (NULL == tmp_subprocess.get()) {
640 PLUGIN_PRINTF(("ServiceRuntime::Start (subprocess create failed)\n")); 638 PLUGIN_PRINTF(("ServiceRuntime::Start (subprocess create failed)\n"));
641 error_info->SetReport(ERROR_SEL_LDR_CREATE_LAUNCHER, 639 error_info->SetReport(ERROR_SEL_LDR_CREATE_LAUNCHER,
642 "ServiceRuntime: failed to create sel_ldr launcher"); 640 "ServiceRuntime: failed to create sel_ldr launcher");
643 return false; 641 return false;
644 } 642 }
645 #ifdef NACL_STANDALONE 643 #ifdef NACL_STANDALONE
646 bool started = tmp_subprocess->Start(url.c_str()); 644 bool started = tmp_subprocess->Start(url.c_str());
647 #else 645 #else
648 bool started = tmp_subprocess->Start(plugin_->pp_instance(), 646 bool started = tmp_subprocess->Start(plugin_->pp_instance(), url.c_str());
649 url.c_str(),
650 ipc_channel_handle);
651 #endif 647 #endif
652 if (!started) { 648 if (!started) {
653 PLUGIN_PRINTF(("ServiceRuntime::Start (start failed)\n")); 649 PLUGIN_PRINTF(("ServiceRuntime::Start (start failed)\n"));
654 error_info->SetReport(ERROR_SEL_LDR_LAUNCH, 650 error_info->SetReport(ERROR_SEL_LDR_LAUNCH,
655 "ServiceRuntime: failed to start"); 651 "ServiceRuntime: failed to start");
656 return false; 652 return false;
657 } 653 }
658 654
659 subprocess_.reset(tmp_subprocess.release()); 655 subprocess_.reset(tmp_subprocess.release());
660 if (!InitCommunication(nacl_desc, error_info)) { 656 if (!InitCommunication(nacl_desc, error_info)) {
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
739 nacl::MutexLocker take(&mu_); 735 nacl::MutexLocker take(&mu_);
740 return exit_status_; 736 return exit_status_;
741 } 737 }
742 738
743 void ServiceRuntime::set_exit_status(int exit_status) { 739 void ServiceRuntime::set_exit_status(int exit_status) {
744 nacl::MutexLocker take(&mu_); 740 nacl::MutexLocker take(&mu_);
745 exit_status_ = exit_status & 0xff; 741 exit_status_ = exit_status & 0xff;
746 } 742 }
747 743
748 } // namespace plugin 744 } // namespace plugin
OLDNEW
« no previous file with comments | « ppapi/native_client/src/trusted/plugin/service_runtime.h ('k') | webkit/plugins/ppapi/plugin_module.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698