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

Unified Diff: src/trusted/validator/x86/32/ncvalidate.c

Issue 10024039: Replace kind variable from validator API with Boolean stubout parameter. (Closed) Base URL: svn://svn.chromium.org/native_client/trunk/src/native_client
Patch Set: Final edits Created 8 years, 8 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
« no previous file with comments | « src/trusted/validator/validation_cache_test.cc ('k') | src/trusted/validator/x86/32/ncvalidate_verbose.c » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/trusted/validator/x86/32/ncvalidate.c
diff --git a/src/trusted/validator/x86/32/ncvalidate.c b/src/trusted/validator/x86/32/ncvalidate.c
index 36d9a5063c4f0b567ad281cd6d86fe9059e76d88..8f1d8881c8d521f1b9d8275b1981003f057e910f 100644
--- a/src/trusted/validator/x86/32/ncvalidate.c
+++ b/src/trusted/validator/x86/32/ncvalidate.c
@@ -90,11 +90,11 @@ NaClValidationStatus NCApplyValidatorStubout_x86_32(
NaClValidationStatus NACL_SUBARCH_NAME(ApplyValidator, NACL_TARGET_ARCH, 32) (
enum NaClSBKind sb_kind,
- NaClApplyValidationKind kind,
uintptr_t guest_addr,
uint8_t *data,
size_t size,
int bundle_size,
+ int stubout_mode,
int readonly_text,
const NaClCPUFeaturesX86 *cpu_features,
struct NaClValidationCache *cache) {
@@ -103,19 +103,13 @@ NaClValidationStatus NACL_SUBARCH_NAME(ApplyValidator, NACL_TARGET_ARCH, 32) (
if (bundle_size == 16 || bundle_size == 32) {
if (!NaClArchSupported(cpu_features))
return NaClValidationFailedCpuNotSupported;
- switch (kind) {
- case NaClApplyCodeValidation:
- status = NCApplyValidatorSilently_x86_32(
- guest_addr, data, size, bundle_size,
- readonly_text, cpu_features, cache);
- break;
- case NaClApplyValidationDoStubout:
- status = NCApplyValidatorStubout_x86_32(
- guest_addr, data, size, bundle_size, cpu_features);
- break;
- default:
- /* If reached, it isn't implemented (yet). */
- break;
+ if (stubout_mode) {
+ status = NCApplyValidatorStubout_x86_32(
+ guest_addr, data, size, bundle_size, cpu_features);
+ } else {
+ status = NCApplyValidatorSilently_x86_32(
+ guest_addr, data, size, bundle_size,
+ readonly_text, cpu_features, cache);
}
}
return status;
« no previous file with comments | « src/trusted/validator/validation_cache_test.cc ('k') | src/trusted/validator/x86/32/ncvalidate_verbose.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698