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

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

Issue 10214007: 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, const nacl::string& url) { 626 ErrorInfo* error_info,
627 const nacl::string& url,
628 void** ipc_channel_handle) {
627 PLUGIN_PRINTF(("ServiceRuntime::Start (nacl_desc=%p)\n", 629 PLUGIN_PRINTF(("ServiceRuntime::Start (nacl_desc=%p)\n",
628 reinterpret_cast<void*>(nacl_desc))); 630 reinterpret_cast<void*>(nacl_desc)));
629 631
630 #ifdef NACL_STANDALONE 632 #ifdef NACL_STANDALONE
631 nacl::scoped_ptr<nacl::SelLdrLauncherStandalone> 633 nacl::scoped_ptr<nacl::SelLdrLauncherStandalone>
632 tmp_subprocess(new nacl::SelLdrLauncherStandalone()); 634 tmp_subprocess(new nacl::SelLdrLauncherStandalone());
633 #else 635 #else
634 nacl::scoped_ptr<SelLdrLauncherChrome> 636 nacl::scoped_ptr<SelLdrLauncherChrome>
635 tmp_subprocess(new SelLdrLauncherChrome()); 637 tmp_subprocess(new SelLdrLauncherChrome());
636 #endif 638 #endif
637 if (NULL == tmp_subprocess.get()) { 639 if (NULL == tmp_subprocess.get()) {
638 PLUGIN_PRINTF(("ServiceRuntime::Start (subprocess create failed)\n")); 640 PLUGIN_PRINTF(("ServiceRuntime::Start (subprocess create failed)\n"));
639 error_info->SetReport(ERROR_SEL_LDR_CREATE_LAUNCHER, 641 error_info->SetReport(ERROR_SEL_LDR_CREATE_LAUNCHER,
640 "ServiceRuntime: failed to create sel_ldr launcher"); 642 "ServiceRuntime: failed to create sel_ldr launcher");
641 return false; 643 return false;
642 } 644 }
643 #ifdef NACL_STANDALONE 645 #ifdef NACL_STANDALONE
644 bool started = tmp_subprocess->Start(url.c_str()); 646 bool started = tmp_subprocess->Start(url.c_str());
645 #else 647 #else
646 bool started = tmp_subprocess->Start(plugin_->pp_instance(), url.c_str()); 648 bool started = tmp_subprocess->Start(plugin_->pp_instance(),
649 url.c_str(),
650 ipc_channel_handle);
647 #endif 651 #endif
648 if (!started) { 652 if (!started) {
649 PLUGIN_PRINTF(("ServiceRuntime::Start (start failed)\n")); 653 PLUGIN_PRINTF(("ServiceRuntime::Start (start failed)\n"));
650 error_info->SetReport(ERROR_SEL_LDR_LAUNCH, 654 error_info->SetReport(ERROR_SEL_LDR_LAUNCH,
651 "ServiceRuntime: failed to start"); 655 "ServiceRuntime: failed to start");
652 return false; 656 return false;
653 } 657 }
654 658
655 subprocess_.reset(tmp_subprocess.release()); 659 subprocess_.reset(tmp_subprocess.release());
656 if (!InitCommunication(nacl_desc, error_info)) { 660 if (!InitCommunication(nacl_desc, error_info)) {
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
735 nacl::MutexLocker take(&mu_); 739 nacl::MutexLocker take(&mu_);
736 return exit_status_; 740 return exit_status_;
737 } 741 }
738 742
739 void ServiceRuntime::set_exit_status(int exit_status) { 743 void ServiceRuntime::set_exit_status(int exit_status) {
740 nacl::MutexLocker take(&mu_); 744 nacl::MutexLocker take(&mu_);
741 exit_status_ = exit_status & 0xff; 745 exit_status_ = exit_status & 0xff;
742 } 746 }
743 747
744 } // namespace plugin 748 } // namespace plugin
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698