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

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

Issue 337463002: Remove LoadModule SRPC for non-SFI mode. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase 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 7bb9cf884e6646bd9a45dc9519cf16efe8bbc0d6..a9969ce74457b11ae31ca258af6eedf5f7ea8890 100644
--- a/ppapi/native_client/src/trusted/plugin/plugin.cc
+++ b/ppapi/native_client/src/trusted/plugin/plugin.cc
@@ -41,6 +41,12 @@ const int64_t kTimeSmallMin = 1; // in ms
const int64_t kTimeSmallMax = 20000; // in ms
const uint32_t kTimeSmallBuckets = 100;
+const PP_NaClFileInfo kInvalidNaClFileInfo = {
+ PP_kInvalidFileHandle,
+ 0, // token_lo
+ 0, // token_hi
+};
+
} // namespace
void Plugin::ShutDownSubprocesses() {
@@ -167,7 +173,20 @@ void Plugin::LoadNaClModule(PP_NaClFileInfo file_info,
pp::Var manifest_base_url =
pp::Var(pp::PASS_REF, nacl_interface_->GetManifestBaseURL(pp_instance()));
std::string manifest_base_url_str = manifest_base_url.AsString();
+
+ PP_NaClFileInfo file_info_for_srpc = kInvalidNaClFileInfo;
+ PP_NaClFileInfo file_info_for_ipc = kInvalidNaClFileInfo;
+ if (uses_nonsfi_mode) {
+ // In non-SFI mode, LaunchSelLdr is used to pass the nexe file's descriptor
+ // to the NaCl loader process.
+ file_info_for_ipc = file_info;
+ } else {
+ // Otherwise (i.e. in SFI-mode), LoadModule SRPC is still being used.
+ file_info_for_srpc = file_info;
+ }
+
SelLdrStartParams params(manifest_base_url_str,
+ file_info_for_ipc,
true /* uses_irt */,
true /* uses_ppapi */,
enable_dyncode_syscalls,
@@ -191,7 +210,7 @@ void Plugin::LoadNaClModule(PP_NaClFileInfo file_info,
// callback here for |callback|.
pp::CompletionCallback callback = callback_factory_.NewCallback(
&Plugin::LoadNexeAndStart,
- service_runtime, file_info, pp::CompletionCallback());
+ service_runtime, file_info_for_srpc, pp::CompletionCallback());
StartSelLdrOnMainThread(
static_cast<int32_t>(PP_OK), service_runtime, params, callback);
}
@@ -246,7 +265,14 @@ NaClSubprocess* Plugin::LoadHelperNaClModule(const nacl::string& helper_url,
// 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,
false /* uses_irt */,
false /* uses_ppapi */,
false /* enable_dyncode_syscalls */,
« no previous file with comments | « ppapi/c/private/ppb_nacl_private.h ('k') | ppapi/native_client/src/trusted/plugin/sel_ldr_launcher_chrome.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698