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

Side by Side Diff: src/trusted/validator/validation_cache.h

Issue 12600034: Provide metadata to validator to allow faster caching. (Closed) Base URL: svn://svn.chromium.org/native_client/trunk/src/native_client
Patch Set: First fixes Created 7 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2012 The Native Client Authors. All rights reserved. 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 3 * Use of this source code is governed by a BSD-style license that can be
4 * found in the LICENSE file. 4 * found in the LICENSE file.
5 */ 5 */
6 6
7 #ifndef NATIVE_CLIENT_SRC_TRUSTED_VALIDATOR_VALIDATION_CACHE_H_ 7 #ifndef NATIVE_CLIENT_SRC_TRUSTED_VALIDATOR_VALIDATION_CACHE_H_
8 #define NATIVE_CLIENT_SRC_TRUSTED_VALIDATOR_VALIDATION_CACHE_H_ 8 #define NATIVE_CLIENT_SRC_TRUSTED_VALIDATOR_VALIDATION_CACHE_H_
9 9
10 #include <stddef.h>
11
10 #include "native_client/src/include/nacl_base.h" 12 #include "native_client/src/include/nacl_base.h"
13 #include "native_client/src/include/portability.h"
11 14
12 EXTERN_C_BEGIN 15 EXTERN_C_BEGIN
13 16
17 struct NaClValidationMetadata;
18
14 /* 19 /*
15 * This interface allows the validator to query a database of validation results 20 * This interface allows the validator to query a database of validation results
16 * while hiding details of how the database is implemented. 21 * while hiding details of how the database is implemented.
17 * 22 *
18 * query = cache->CreateQuery(cache->handle); 23 * query = cache->CreateQuery(cache->handle);
19 * CreateQuery: create an opaque query object, given an opaque context object. 24 * CreateQuery: create an opaque query object, given an opaque context object.
20 * The context object contains persistent variables that will be used for all 25 * The context object contains persistent variables that will be used for all
21 * queries, whereas the query object contains information relevant to a single 26 * queries, whereas the query object contains information relevant to a single
22 * validation result. 27 * validation result.
23 * 28 *
(...skipping 22 matching lines...) Expand all
46 51
47 struct NaClValidationCache { 52 struct NaClValidationCache {
48 void *handle; 53 void *handle;
49 void *(*CreateQuery)(void *handle); 54 void *(*CreateQuery)(void *handle);
50 void (*AddData)(void *query, const unsigned char *data, size_t length); 55 void (*AddData)(void *query, const unsigned char *data, size_t length);
51 int (*QueryKnownToValidate)(void *query); 56 int (*QueryKnownToValidate)(void *query);
52 void (*SetKnownToValidate)(void *query); 57 void (*SetKnownToValidate)(void *query);
53 void (*DestroyQuery)(void *query); 58 void (*DestroyQuery)(void *query);
54 }; 59 };
55 60
61 /* Helper function for identifying the code being validated. */
62 extern void AddCodeIdentity(uint8_t *data,
63 size_t size,
64 const struct NaClValidationMetadata *metadata,
65 struct NaClValidationCache *cache,
66 void *query);
67
56 EXTERN_C_END 68 EXTERN_C_END
57 69
58 #endif /* NATIVE_CLIENT_SRC_TRUSTED_VALIDATOR_VALIDATION_CACHE_H_ */ 70 #endif /* NATIVE_CLIENT_SRC_TRUSTED_VALIDATOR_VALIDATION_CACHE_H_ */
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698