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

Unified Diff: src/trusted/validator_x86/ncenuminsts_x86_32.c

Issue 10134056: Refactor the process of choosing validators. (Closed) Base URL: svn://svn.chromium.org/native_client/trunk/src/native_client
Patch Set: gyp, extern, formatting Created 8 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
Index: src/trusted/validator_x86/ncenuminsts_x86_32.c
diff --git a/src/trusted/validator_x86/ncenuminsts_x86_32.c b/src/trusted/validator_x86/ncenuminsts_x86_32.c
index bf0b1f7e0aad02d37b74f1b9b5bd7e1f170f243b..544c21f1108f07e64c3a2932a6f44d38fc762dfd 100644
--- a/src/trusted/validator_x86/ncenuminsts_x86_32.c
+++ b/src/trusted/validator_x86/ncenuminsts_x86_32.c
@@ -100,10 +100,13 @@ Bool NaClSegmentValidates(uint8_t* mbase,
NaClPcAddress vbase) {
NaClCPUFeaturesX86 cpu_features;
NaClValidationStatus status;
+ /* TODO(pasko): Validator initialization can be slow, make it run only once.
+ */
+ const struct NaClValidatorInterface *validator = NaClCreateValidator();
/* check if NaCl thinks the given code segment is valid. */
NaClSetAllCPUFeatures(&cpu_features);
- status = NaCl_ApplyValidator_x86_32(
+ status = validator->Validate(
vbase, mbase, size,
/* stubout_mode= */ FALSE, /* readonly_text= */ FALSE, &cpu_features,
NULL);

Powered by Google App Engine
This is Rietveld 408576698