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

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

Issue 332463003: Pepper: Remove LOAD_MODULE SRPC call in SFI mode. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fixes for bbudge Created 6 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 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 12ab43122bf1e9397aa92f1b9ef88a0796489aa5..a5035f50938258d98da3e354c04251b76adcc946 100644
--- a/ppapi/native_client/src/trusted/plugin/service_runtime.cc
+++ b/ppapi/native_client/src/trusted/plugin/service_runtime.cc
@@ -459,14 +459,8 @@ void ServiceRuntime::SignalNexeStarted(bool ok) {
NaClXCondVarSignal(&cond_);
}
-void ServiceRuntime::LoadNexeAndStart(PP_NaClFileInfo file_info) {
- NaClLog(4, "ServiceRuntime::LoadNexeAndStart (handle_valid=%d "
- "token_lo=%" NACL_PRIu64 " token_hi=%" NACL_PRIu64 ")\n",
- file_info.handle != PP_kInvalidFileHandle,
- file_info.token_lo,
- file_info.token_hi);
-
- bool ok = LoadNexeAndStartInternal(file_info);
+void ServiceRuntime::LoadNexeAndStart() {
+ bool ok = LoadNexeAndStartInternal();
if (ok) {
NaClLog(4, "ServiceRuntime::LoadNexeAndStart (success)\n");
} else {
@@ -477,47 +471,14 @@ void ServiceRuntime::LoadNexeAndStart(PP_NaClFileInfo file_info) {
SignalNexeStarted(ok);
}
-bool ServiceRuntime::LoadNexeAndStartInternal(
- const PP_NaClFileInfo& file_info) {
+bool ServiceRuntime::LoadNexeAndStartInternal() {
if(!SetupCommandChannel()) {
return false;
}
if (!InitReverseService()) {
return false;
}
- if (!LoadModule(file_info)) {
- ErrorInfo error_info;
- error_info.SetReport(PP_NACL_ERROR_SEL_LDR_COMMUNICATION_CMD_CHANNEL,
- "ServiceRuntime: load module failed");
- ReportLoadError(error_info);
- return false;
- }
- if (!StartModule()) {
- return false;
- }
- return true;
-}
-
-bool ServiceRuntime::LoadModule(const PP_NaClFileInfo& file_info) {
- if (uses_nonsfi_mode_) {
- // In non-SFI mode, loading is done a part of LaunchSelLdr.
- return true;
- }
-
- NaClFileInfo nacl_file_info;
- nacl_file_info.desc = ConvertFileDescriptor(file_info.handle, true);
- nacl_file_info.file_token.lo = file_info.token_lo;
- nacl_file_info.file_token.hi = file_info.token_hi;
- NaClDesc* desc = NaClDescIoFromFileInfo(nacl_file_info, O_RDONLY);
- if (desc == NULL) {
- return false;
- }
- // We don't use a scoped_ptr here since we would immediately release the
- // DescWrapper to LoadModule().
- nacl::DescWrapper* wrapper =
- plugin_->wrapper_factory()->MakeGenericCleanup(desc);
- // TODO(teravest, hidehiko): Replace this by Chrome IPC.
- return subprocess_->LoadModule(&command_channel_, wrapper);
+ return StartModule();
}
void ServiceRuntime::ReapLogs() {

Powered by Google App Engine
This is Rietveld 408576698