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

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

Issue 224803002: Enable mmap and identity-based validation caching on pnacl-{llc,ld}.nexe (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix token handover for main nexe Created 6 years, 8 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 d0ac72dfe1cb6981f628ee83ab601b07100b705d..e3b286cdfcc986b8d1dd2ef427d8bd7c0d5607c2 100644
--- a/ppapi/native_client/src/trusted/plugin/plugin.cc
+++ b/ppapi/native_client/src/trusted/plugin/plugin.cc
@@ -26,6 +26,7 @@
#include "native_client/src/include/portability_string.h"
#include "native_client/src/shared/platform/nacl_check.h"
#include "native_client/src/trusted/desc/nacl_desc_wrapper.h"
+#include "native_client/src/trusted/desc_cacheability/desc_cacheability.h"
#include "native_client/src/trusted/nonnacl_util/sel_ldr_launcher.h"
#include "native_client/src/trusted/service_runtime/nacl_error_code.h"
@@ -604,9 +605,24 @@ void Plugin::NexeFileDidOpen(int32_t pp_error) {
if (nexe_bytes_read == -1)
return;
+ // Handing desc ownership to the wrapper.
+ // However, we still need the tokens so keep that in the tmp_info.
+ tmp_info = info.Release();
nacl::scoped_ptr<nacl::DescWrapper>
- wrapper(wrapper_factory()->MakeFileDesc(info.Release().desc, O_RDONLY));
- NaClLog(4, "NexeFileDidOpen: invoking LoadNaClModule\n");
+ wrapper(wrapper_factory()->MakeFileDesc(tmp_info.desc, O_RDONLY));
+ tmp_info.desc = -1;
+ if (tmp_info.file_token.lo != 0 && tmp_info.file_token.hi != 0) {
+ if (!NaClDescSetFileToken(wrapper->desc(), &tmp_info.file_token)) {
+ PLUGIN_PRINTF((
+ "NexeFileDidOpen: NaClDescSetFileToken failed\n"));
+ } else {
+ PLUGIN_PRINTF((
+ "NexeFileDidOpen: NaClDescSetFileToken success\n"));
+ }
+ } else {
+ PLUGIN_PRINTF(("NexeFileDidOpen: No file tokens for NaCl main nexe\n"));
+ }
+ PLUGIN_PRINTF(("NexeFileDidOpen: invoking LoadNaClModule\n"));
LoadNaClModule(
wrapper.release(),
uses_nonsfi_mode_,
« no previous file with comments | « ppapi/native_client/src/trusted/plugin/file_utils.cc ('k') | ppapi/native_client/src/trusted/plugin/plugin.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698