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

Unified Diff: ppapi/native_client/src/trusted/plugin/plugin.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/plugin.cc
diff --git a/ppapi/native_client/src/trusted/plugin/plugin.cc b/ppapi/native_client/src/trusted/plugin/plugin.cc
index f102fc7eb655cbc2e3464330f5a1771889807485..d87bbeb1ecdfee8c8cbe093c92d4a114626b4ebf 100644
--- a/ppapi/native_client/src/trusted/plugin/plugin.cc
+++ b/ppapi/native_client/src/trusted/plugin/plugin.cc
@@ -72,8 +72,7 @@ void Plugin::HistogramTimeSmall(const std::string& name,
kTimeSmallBuckets);
}
-bool Plugin::LoadHelperNaClModule(PP_FileHandle file_handle,
- NaClSubprocess* subprocess,
+bool Plugin::LoadHelperNaClModule(NaClSubprocess* subprocess,
const SelLdrStartParams& params) {
CHECK(!pp::Module::Get()->core()->IsMainThread());
ServiceRuntime* service_runtime =
@@ -108,12 +107,7 @@ bool Plugin::LoadHelperNaClModule(PP_FileHandle file_handle,
if (!service_runtime_started)
return false;
- PP_NaClFileInfo info;
- info.handle = file_handle;
- info.token_lo = 0;
- info.token_hi = 0;
-
- // Now actually load the nexe, which can happen on a background thread.
+ // Now actually load the nexe.
//
// We can't use pp::BlockUntilComplete() inside an in-process plugin, so we
// have to roll our own blocking logic, similar to WaitForSelLdrStart()
@@ -122,8 +116,7 @@ bool Plugin::LoadHelperNaClModule(PP_FileHandle file_handle,
0,
callback_factory_.NewCallback(
&Plugin::LoadNexeAndStart,
- service_runtime,
- info));
+ service_runtime));
return service_runtime->WaitForNexeStart();
}
@@ -176,7 +169,7 @@ void Plugin::LoadNaClModule(PP_NaClFileInfo file_info,
}
SelLdrStartParams params(manifest_base_url_str,
- file_info_for_ipc,
+ file_info,
true /* uses_irt */,
true /* uses_ppapi */,
enable_dyncode_syscalls,
@@ -199,18 +192,17 @@ void Plugin::LoadNaClModule(PP_NaClFileInfo file_info,
// We don't take any action once nexe loading has completed, so pass an empty
// callback here for |callback|.
pp::CompletionCallback callback = callback_factory_.NewCallback(
- &Plugin::LoadNexeAndStart, service_runtime, file_info_for_srpc);
+ &Plugin::LoadNexeAndStart, service_runtime);
StartSelLdrOnMainThread(
static_cast<int32_t>(PP_OK), service_runtime, params, callback);
}
void Plugin::LoadNexeAndStart(int32_t pp_error,
- ServiceRuntime* service_runtime,
- PP_NaClFileInfo file_info) {
+ ServiceRuntime* service_runtime) {
CHECK(pp::Module::Get()->core()->IsMainThread());
if (pp_error != PP_OK)
return;
- service_runtime->LoadNexeAndStart(file_info);
+ service_runtime->LoadNexeAndStart();
}
bool Plugin::LoadNaClModuleContinuationIntern() {
@@ -249,18 +241,17 @@ NaClSubprocess* Plugin::LoadHelperNaClModule(const nacl::string& helper_url,
return NULL;
}
+ PP_NaClFileInfo info;
+ info.handle = file_handle;
+ info.token_lo = 0;
+ info.token_hi = 0;
+
// Do not report UMA stats for translator-related nexes.
// TODO(sehr): define new UMA stats for translator related nexe events.
// NOTE: The PNaCl translator nexes are not built to use the IRT. This is
// done to save on address space and swap space.
- //
- // Currently, this works only in SFI-mode. So, LoadModule SRPC is still used.
- // So, pass kInvalidNaClFileInfo here, and instead |file_handle| is passed
- // to LoadNaClModuleFromBackgroundThread() below.
- // TODO(teravest, hidehiko): Pass file_handle to params, so that LaunchSelLdr
- // will look at the info.
SelLdrStartParams params(helper_url,
- kInvalidNaClFileInfo,
+ info,
false /* uses_irt */,
false /* uses_ppapi */,
false /* enable_dyncode_syscalls */,
@@ -269,7 +260,7 @@ NaClSubprocess* Plugin::LoadHelperNaClModule(const nacl::string& helper_url,
// Helper NaCl modules always use the PNaCl manifest, as there is no
// corresponding NMF.
- if (!LoadHelperNaClModule(file_handle, nacl_subprocess.get(), params)) {
+ if (!LoadHelperNaClModule(nacl_subprocess.get(), params)) {
return NULL;
}
// We need not wait for the init_done callback. We can block

Powered by Google App Engine
This is Rietveld 408576698