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

Side by Side Diff: src/trusted/validator/validator_init.c

Issue 10134056: Refactor the process of choosing validators. (Closed) Base URL: svn://svn.chromium.org/native_client/trunk/src/native_client
Patch Set: portability.h instead of NACL_WINDOWS 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 /*
2 * Copyright (c) 2012 The Native Client Authors. All rights reserved.
3 * Use of this source code is governed by a BSD-style license that can be
4 * found in the LICENSE file.
5 */
6
7 #include <stdio.h>
8 #include <stdlib.h>
9
10 #include "native_client/src/trusted/validator/ncvalidate.h"
11
12 int NaClUseDfaValidator() {
13 if (getenv("NACL_DANGEROUS_USE_DFA_VALIDATOR") != NULL) {
14 return 1;
15 }
16 return 0;
17 }
18
19 const struct NaClValidatorInterface* NaClCreateValidator() {
Nick Bray 2012/05/22 23:46:31 Name: NaClGetValidatorInterface? "Create" seems w
pasko-google - do not use 2012/05/23 14:28:11 I want to emphasize that this needs to be called o
20 #if defined(__arm__)
21 return NaClValidatorCreateArm();
22 #elif NACL_ARCH(NACL_TARGET_ARCH) != NACL_x86
23 #error("No validator available for this architecture!")
24 #elif NACL_TARGET_SUBARCH == 32 && defined(NACL_STANDALONE)
25 if (NaClUseDfaValidator()) {
26 fprintf(stderr, "DANGER! USING THE EXPERIMENTAL DFA VALIDATOR!\n");
27 return NaClDfaValidatorCreate_x86_32();
28 } else {
29 return NaClValidatorCreate_x86_32();
30 }
31 #elif NACL_TARGET_SUBARCH == 32
32 return NaClValidatorCreate_x86_32();
33 #elif NACL_TARGET_SUBARCH == 64 && defined(NACL_STANDALONE)
34 if (NaClUseDfaValidator()) {
35 fprintf(stderr, "DANGER! USING THE EXPERIMENTAL DFA VALIDATOR!\n");
36 return NaClDfaValidatorCreate_x86_64();
37 } else {
38 return NaClValidatorCreate_x86_64();
39 }
40 #elif NACL_TARGET_SUBARCH == 64
41 return NaClValidatorCreate_x86_64();
42 #endif
43 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698