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

Unified Diff: src/trusted/sel_universal/reverse_emulate.cc

Issue 15039022: Enable meta-based validation for shared libraries. (Closed) Base URL: svn://svn.chromium.org/native_client/trunk/src/native_client
Patch Set: Style Created 7 years, 7 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
« no previous file with comments | « src/trusted/reverse_service/reverse_service_c.c ('k') | src/trusted/service_runtime/nacl_syscall_common.c » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/trusted/sel_universal/reverse_emulate.cc
diff --git a/src/trusted/sel_universal/reverse_emulate.cc b/src/trusted/sel_universal/reverse_emulate.cc
index cccf29570179f6f9c2049937bdbe78977afd0009..ad20da94d483eeaea7a328eb9cb61c195798b56b 100644
--- a/src/trusted/sel_universal/reverse_emulate.cc
+++ b/src/trusted/sel_universal/reverse_emulate.cc
@@ -22,6 +22,7 @@
#include "native_client/src/shared/srpc/nacl_srpc.h"
#include "native_client/src/trusted/desc/nacl_desc_wrapper.h"
#include "native_client/src/trusted/nonnacl_util/sel_ldr_launcher.h"
+#include "native_client/src/trusted/reverse_service/nacl_file_info.h"
#include "native_client/src/trusted/reverse_service/reverse_service.h"
#include "native_client/src/trusted/sel_universal/rpc_universal.h"
#include "native_client/src/trusted/sel_universal/srpc_helper.h"
@@ -41,7 +42,8 @@ class ReverseEmulate : public nacl::ReverseInterface {
// Name service use.
virtual bool EnumerateManifestKeys(std::set<nacl::string>* keys);
- virtual bool OpenManifestEntry(nacl::string url_key, int32_t* out_desc);
+ virtual bool OpenManifestEntry(nacl::string url_key,
+ struct NaClFileInfo* info);
virtual bool CloseManifestEntry(int32_t desc);
virtual void ReportCrash();
@@ -240,10 +242,10 @@ bool ReverseEmulate::EnumerateManifestKeys(std::set<nacl::string>* keys) {
}
bool ReverseEmulate::OpenManifestEntry(nacl::string url_key,
- int32_t* out_desc) {
+ struct NaClFileInfo* info) {
NaClLog(1, "ReverseEmulate::OpenManifestEntry (url_key=%s)\n",
url_key.c_str());
- *out_desc = -1;
+ info->desc = -1;
// Find the pathname for the key.
if (g_key_to_file.find(url_key) == g_key_to_file.end()) {
NaClLog(1, "ReverseEmulate::OpenManifestEntry: no pathname for key.\n");
@@ -252,8 +254,11 @@ bool ReverseEmulate::OpenManifestEntry(nacl::string url_key,
nacl::string pathname = g_key_to_file[url_key];
NaClLog(1, "ReverseEmulate::OpenManifestEntry: pathname is %s.\n",
pathname.c_str());
- *out_desc = OPEN(pathname.c_str(), O_RDONLY);
- return *out_desc >= 0;
+ // TODO(ncbray): provide more information so that fast validation caching and
+ // mmaping can be enabled.
+ info->desc = OPEN(pathname.c_str(), O_RDONLY);
+ info->nonce = 0;
+ return info->desc >= 0;
}
bool ReverseEmulate::CloseManifestEntry(int32_t desc) {
« no previous file with comments | « src/trusted/reverse_service/reverse_service_c.c ('k') | src/trusted/service_runtime/nacl_syscall_common.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698