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..217460fe84ad85455b8b19089a68ebf1735ea98c 100644 |
--- a/src/trusted/service_runtime/sel_main_chrome.c |
+++ b/src/trusted/service_runtime/sel_main_chrome.c |
@@ -29,6 +29,7 @@ |
#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; |
@@ -73,6 +74,15 @@ static void NaClLoadIrt(struct NaClApp *nap) { |
(*NACL_VTBL(Gio, gio_desc)->Dtor)(gio_desc); |
} |
+static NaClValidationCache *g_validation_cache = NULL; |
+static void *g_validation_cache_context = NULL; |
+ |
+/* TODO(ncbray) consolidate Chrome's sel_ldr setup to a single function. */ |
+void NaClSetValidationCache(NaClValidationCache *cache, void *cache_context) { |
+ g_validation_cache = cache; |
+ g_validation_cache_context = cache_context; |
+} |
+ |
void NaClMainForChromium(int handle_count, const NaClHandle *handles, |
int debug) { |
char *av[1]; |
@@ -108,6 +118,10 @@ 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; |
+ nap->validation_cache_context = g_validation_cache_context; |
+ |
NaClAppInitialDescriptorHookup(nap); |
/* |