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

Unified Diff: ppapi/native_client/src/trusted/plugin/service_runtime.cc

Issue 177113009: Support non-SFI mode in NaCl manifest file. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 10 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 side-by-side diff with in-line comments
Download patch
Index: ppapi/native_client/src/trusted/plugin/service_runtime.cc
diff --git a/ppapi/native_client/src/trusted/plugin/service_runtime.cc b/ppapi/native_client/src/trusted/plugin/service_runtime.cc
index 5a18f5af94cfa640c13c9c5245227014cd1b0a5d..d41e58e2341eb614c73360f8d1491955ee963ee1 100644
--- a/ppapi/native_client/src/trusted/plugin/service_runtime.cc
+++ b/ppapi/native_client/src/trusted/plugin/service_runtime.cc
@@ -451,10 +451,12 @@ void PluginReverseInterface::AddTempQuotaManagedFile(
ServiceRuntime::ServiceRuntime(Plugin* plugin,
const Manifest* manifest,
bool main_service_runtime,
+ bool nonsfi_enabled,
pp::CompletionCallback init_done_cb,
pp::CompletionCallback crash_cb)
: plugin_(plugin),
main_service_runtime_(main_service_runtime),
+ nonsfi_enabled_(nonsfi_enabled),
reverse_service_(NULL),
anchor_(new nacl::WeakRefAnchor()),
rev_interface_(new PluginReverseInterface(anchor_, plugin,
@@ -492,6 +494,17 @@ bool ServiceRuntime::LoadModule(nacl::DescWrapper* nacl_desc,
}
bool ServiceRuntime::InitReverseService(ErrorInfo* error_info) {
+ if (nonsfi_enabled_) {
+ // In non-SFI mode, open_resource() has not yet been supported, so we
Mark Seaborn 2014/02/27 17:10:22 "is not yet supported"
hidehiko 2014/02/28 06:41:54 Done.
+ // do not need the reverse service. So, skip the initialization (with
+ // calling the completion callback).
+ // Note that there is on going work to replace SRPC by Chrome IPC (not only
Mark Seaborn 2014/02/27 17:10:22 You might link to the issue here...
hidehiko 2014/02/28 06:41:54 Done.
+ // for non-SFI mode, but also for SFI mode), and non-SFI mode will use
+ // Chrome IPC for open_resource() after the refacrogin is done.
Mark Seaborn 2014/02/27 17:10:22 "refactoring"
hidehiko 2014/02/28 06:41:54 Oops. Done.
+ rev_interface_->StartupInitializationComplete();
+ return true;
+ }
+
// Hook up the reverse service channel. We are the IMC client, but
// provide SRPC service.
NaClDesc* out_conn_cap;
@@ -532,18 +545,24 @@ bool ServiceRuntime::StartModule(ErrorInfo* error_info) {
// subsystem since that is handled by user-level code (not secure!)
// in libsrpc.
int load_status = -1;
- NaClSrpcResultCodes rpc_result =
- NaClSrpcInvokeBySignature(&command_channel_,
- "start_module::i",
- &load_status);
-
- if (NACL_SRPC_RESULT_OK != rpc_result) {
- error_info->SetReport(PP_NACL_ERROR_SEL_LDR_START_MODULE,
- "ServiceRuntime: could not start nacl module");
- return false;
+ if (nonsfi_enabled_) {
+ // In non-SFI mode, we don't need to call start_module SRPC to launch
+ // the plugin.
+ load_status = LOAD_OK;
+ } else {
+ NaClSrpcResultCodes rpc_result =
+ NaClSrpcInvokeBySignature(&command_channel_,
+ "start_module::i",
+ &load_status);
+
+ if (NACL_SRPC_RESULT_OK != rpc_result) {
+ error_info->SetReport(PP_NACL_ERROR_SEL_LDR_START_MODULE,
+ "ServiceRuntime: could not start nacl module");
+ return false;
+ }
}
- NaClLog(4, "ServiceRuntime::StartModule (load_status=%d)\n",
- load_status);
+
+ NaClLog(4, "ServiceRuntime::StartModule (load_status=%d)\n", load_status);
if (main_service_runtime_) {
plugin_->ReportSelLdrLoadStatus(load_status);
}
@@ -586,6 +605,7 @@ void ServiceRuntime::StartSelLdr(const SelLdrStartParams& params,
params.enable_dyncode_syscalls,
params.enable_exception_handling,
params.enable_crash_throttling,
+ params.enable_nonsfi,
&start_sel_ldr_error_message_,
internal_callback);
subprocess_.reset(tmp_subprocess.release());

Powered by Google App Engine
This is Rietveld 408576698