| 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 "ppapi/native_client/src/trusted/plugin/service_runtime.h" | 9 #include "ppapi/native_client/src/trusted/plugin/service_runtime.h" |
| 10 | 10 |
| (...skipping 495 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 506 | 506 |
| 507 if (!subprocess_->LoadModule(&command_channel_, nacl_desc)) { | 507 if (!subprocess_->LoadModule(&command_channel_, nacl_desc)) { |
| 508 error_info->SetReport(ERROR_SEL_LDR_COMMUNICATION_CMD_CHANNEL, | 508 error_info->SetReport(ERROR_SEL_LDR_COMMUNICATION_CMD_CHANNEL, |
| 509 "ServiceRuntime: load module failed"); | 509 "ServiceRuntime: load module failed"); |
| 510 return false; | 510 return false; |
| 511 } | 511 } |
| 512 return true; | 512 return true; |
| 513 } | 513 } |
| 514 | 514 |
| 515 bool ServiceRuntime::InitReverseService(ErrorInfo* error_info) { | 515 bool ServiceRuntime::InitReverseService(ErrorInfo* error_info) { |
| 516 #if 0 |
| 516 // Hook up the reverse service channel. We are the IMC client, but | 517 // Hook up the reverse service channel. We are the IMC client, but |
| 517 // provide SRPC service. | 518 // provide SRPC service. |
| 518 NaClDesc* out_conn_cap; | 519 NaClDesc* out_conn_cap; |
| 519 NaClSrpcResultCodes rpc_result = | 520 NaClSrpcResultCodes rpc_result = |
| 520 NaClSrpcInvokeBySignature(&command_channel_, | 521 NaClSrpcInvokeBySignature(&command_channel_, |
| 521 "reverse_setup::h", | 522 "reverse_setup::h", |
| 522 &out_conn_cap); | 523 &out_conn_cap); |
| 523 | 524 |
| 524 if (NACL_SRPC_RESULT_OK != rpc_result) { | 525 if (NACL_SRPC_RESULT_OK != rpc_result) { |
| 525 error_info->SetReport(ERROR_SEL_LDR_COMMUNICATION_REV_SETUP, | 526 error_info->SetReport(ERROR_SEL_LDR_COMMUNICATION_REV_SETUP, |
| (...skipping 12 matching lines...) Expand all Loading... |
| 538 return false; | 539 return false; |
| 539 } | 540 } |
| 540 out_conn_cap = NULL; // ownership passed | 541 out_conn_cap = NULL; // ownership passed |
| 541 NaClLog(4, "ServiceRuntime::InitReverseService: starting reverse service\n"); | 542 NaClLog(4, "ServiceRuntime::InitReverseService: starting reverse service\n"); |
| 542 reverse_service_ = new nacl::ReverseService(conn_cap, rev_interface_->Ref()); | 543 reverse_service_ = new nacl::ReverseService(conn_cap, rev_interface_->Ref()); |
| 543 if (!reverse_service_->Start()) { | 544 if (!reverse_service_->Start()) { |
| 544 error_info->SetReport(ERROR_SEL_LDR_COMMUNICATION_REV_SERVICE, | 545 error_info->SetReport(ERROR_SEL_LDR_COMMUNICATION_REV_SERVICE, |
| 545 "ServiceRuntime: starting reverse services failed"); | 546 "ServiceRuntime: starting reverse services failed"); |
| 546 return false; | 547 return false; |
| 547 } | 548 } |
| 549 #else |
| 550 rev_interface_->StartupInitializationComplete(); |
| 551 #endif |
| 548 return true; | 552 return true; |
| 549 } | 553 } |
| 550 | 554 |
| 551 bool ServiceRuntime::StartModule(ErrorInfo* error_info) { | 555 bool ServiceRuntime::StartModule(ErrorInfo* error_info) { |
| 556 #if 0 |
| 552 // start the module. otherwise we cannot connect for multimedia | 557 // start the module. otherwise we cannot connect for multimedia |
| 553 // subsystem since that is handled by user-level code (not secure!) | 558 // subsystem since that is handled by user-level code (not secure!) |
| 554 // in libsrpc. | 559 // in libsrpc. |
| 555 int load_status = -1; | 560 int load_status = -1; |
| 556 NaClSrpcResultCodes rpc_result = | 561 NaClSrpcResultCodes rpc_result = |
| 557 NaClSrpcInvokeBySignature(&command_channel_, | 562 NaClSrpcInvokeBySignature(&command_channel_, |
| 558 "start_module::i", | 563 "start_module::i", |
| 559 &load_status); | 564 &load_status); |
| 560 | 565 |
| 561 if (NACL_SRPC_RESULT_OK != rpc_result) { | 566 if (NACL_SRPC_RESULT_OK != rpc_result) { |
| 562 error_info->SetReport(ERROR_SEL_LDR_START_MODULE, | 567 error_info->SetReport(ERROR_SEL_LDR_START_MODULE, |
| 563 "ServiceRuntime: could not start nacl module"); | 568 "ServiceRuntime: could not start nacl module"); |
| 564 return false; | 569 return false; |
| 565 } | 570 } |
| 571 #else |
| 572 int load_status = LOAD_OK; |
| 573 #endif |
| 566 NaClLog(4, "ServiceRuntime::StartModule (load_status=%d)\n", | 574 NaClLog(4, "ServiceRuntime::StartModule (load_status=%d)\n", |
| 567 load_status); | 575 load_status); |
| 568 if (main_service_runtime_) { | 576 if (main_service_runtime_) { |
| 569 plugin_->ReportSelLdrLoadStatus(load_status); | 577 plugin_->ReportSelLdrLoadStatus(load_status); |
| 570 } | 578 } |
| 571 if (LOAD_OK != load_status) { | 579 if (LOAD_OK != load_status) { |
| 572 error_info->SetReport( | 580 error_info->SetReport( |
| 573 ERROR_SEL_LDR_START_STATUS, | 581 ERROR_SEL_LDR_START_STATUS, |
| 574 NaClErrorString(static_cast<NaClErrorCode>(load_status))); | 582 NaClErrorString(static_cast<NaClErrorCode>(load_status))); |
| 575 return false; | 583 return false; |
| (...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 736 | 744 |
| 737 nacl::string ServiceRuntime::GetCrashLogOutput() { | 745 nacl::string ServiceRuntime::GetCrashLogOutput() { |
| 738 if (NULL != subprocess_.get()) { | 746 if (NULL != subprocess_.get()) { |
| 739 return subprocess_->GetCrashLogOutput(); | 747 return subprocess_->GetCrashLogOutput(); |
| 740 } else { | 748 } else { |
| 741 return std::string(); | 749 return std::string(); |
| 742 } | 750 } |
| 743 } | 751 } |
| 744 | 752 |
| 745 } // namespace plugin | 753 } // namespace plugin |
| OLD | NEW |