Index: src/trusted/service_runtime/sel_main_chrome.c |
diff --git a/src/trusted/service_runtime/sel_main_chrome.c b/src/trusted/service_runtime/sel_main_chrome.c |
index 198fe8893974e76be60dbe5ff5439cbcfc956ddb..33c863474895551535c22414af0d299695fde7d6 100644 |
--- a/src/trusted/service_runtime/sel_main_chrome.c |
+++ b/src/trusted/service_runtime/sel_main_chrome.c |
@@ -29,11 +29,13 @@ |
#include "native_client/src/trusted/service_runtime/sel_ldr.h" |
#include "native_client/src/trusted/service_runtime/sel_qualify.h" |
#include "native_client/src/trusted/service_runtime/win/exception_patch/ntdll_patch.h" |
+#include "native_client/src/trusted/validator/validation_cache.h" |
int verbosity = 0; |
static int g_irt_file_desc = -1; |
+static NaClValidationCache *g_validation_cache = NULL; |
void NaClSetIrtFileDesc(int fd) { |
CHECK(g_irt_file_desc == -1); |
@@ -73,6 +75,11 @@ static void NaClLoadIrt(struct NaClApp *nap) { |
(*NACL_VTBL(Gio, gio_desc)->Dtor)(gio_desc); |
} |
+/* TODO(ncbray) consolidate Chrome's sel_ldr setup to a single function. */ |
+void NaClSetValidationCache(NaClValidationCache *cache) { |
+ g_validation_cache = cache; |
+} |
+ |
void NaClMainForChromium(int handle_count, const NaClHandle *handles, |
int debug) { |
char *av[1]; |
@@ -108,6 +115,9 @@ void NaClMainForChromium(int handle_count, const NaClHandle *handles, |
errcode = LOAD_OK; |
+ /* Inject the validation caching interface, if it exists. */ |
+ nap->validation_cache = g_validation_cache; |
+ |
NaClAppInitialDescriptorHookup(nap); |
/* |