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

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: more aesthetics Created 8 years, 6 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
« no previous file with comments | « src/trusted/validator/validator.gyp ('k') | src/trusted/validator/x86/32/ncvalidate.c » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "native_client/src/shared/platform/nacl_log.h"
8 #include "native_client/src/trusted/validator/ncvalidate.h"
9
10 int NaClUseDfaValidator() {
11 if (getenv("NACL_DANGEROUS_USE_DFA_VALIDATOR") != NULL) {
12 return 1;
13 }
14 return 0;
15 }
16
17 const struct NaClValidatorInterface *NaClCreateValidator() {
18 #if NACL_ARCH(NACL_BUILD_ARCH) == NACL_arm
19 return NaClValidatorCreateArm();
20 #elif NACL_ARCH(NACL_TARGET_ARCH) != NACL_x86
21 #error "No validator available for this architecture!"
22 #elif NACL_TARGET_SUBARCH == 32 && defined(NACL_STANDALONE)
23 if (NaClUseDfaValidator()) {
24 NaClLog(LOG_WARNING, "DANGER! USING THE EXPERIMENTAL DFA VALIDATOR!\n");
25 return NaClDfaValidatorCreate_x86_32();
26 } else {
27 return NaClValidatorCreate_x86_32();
28 }
29 #elif NACL_TARGET_SUBARCH == 32
30 return NaClValidatorCreate_x86_32();
31 #elif NACL_TARGET_SUBARCH == 64 && defined(NACL_STANDALONE)
32 if (NaClUseDfaValidator()) {
33 NaClLog(LOG_WARNING, "DANGER! USING THE EXPERIMENTAL DFA VALIDATOR!\n");
34 return NaClDfaValidatorCreate_x86_64();
35 } else {
36 return NaClValidatorCreate_x86_64();
37 }
38 #elif NACL_TARGET_SUBARCH == 64
39 return NaClValidatorCreate_x86_64();
40 #endif
41 }
OLDNEW
« no previous file with comments | « src/trusted/validator/validator.gyp ('k') | src/trusted/validator/x86/32/ncvalidate.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698