OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef COMPONENTS_NACL_LOADER_NACL_VALIDATION_QUERY_H_ | 5 #ifndef COMPONENTS_NACL_LOADER_NACL_VALIDATION_QUERY_H_ |
6 #define COMPONENTS_NACL_LOADER_NACL_VALIDATION_QUERY_H_ | 6 #define COMPONENTS_NACL_LOADER_NACL_VALIDATION_QUERY_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
11 #include "base/strings/string_piece.h" | 11 #include "base/strings/string_piece.h" |
12 #include "crypto/hmac.h" | 12 #include "crypto/hmac.h" |
13 | 13 |
14 struct NaClFileToken; | |
15 struct NaClValidationCache; | 14 struct NaClValidationCache; |
16 class NaClValidationDB; | 15 class NaClValidationDB; |
17 class NaClValidationQuery; | 16 class NaClValidationQuery; |
18 | 17 |
19 class NaClValidationQueryContext { | 18 class NaClValidationQueryContext { |
20 public: | 19 public: |
21 NaClValidationQueryContext(NaClValidationDB* db, | 20 NaClValidationQueryContext(NaClValidationDB* db, |
22 const std::string& profile_key, | 21 const std::string& profile_key, |
23 const std::string& nacl_version); | 22 const std::string& nacl_version); |
24 | 23 |
25 NaClValidationQuery* CreateQuery(); | 24 NaClValidationQuery* CreateQuery(); |
26 | 25 |
27 bool ResolveFileToken(struct NaClFileToken* file_token, int32* fd, | |
28 std::string* path); | |
29 | |
30 private: | 26 private: |
31 NaClValidationDB* db_; | 27 NaClValidationDB* db_; |
32 | 28 |
33 // A key used by HMAC that is specific to this installation of Chrome. | 29 // A key used by HMAC that is specific to this installation of Chrome. |
34 std::string profile_key_; | 30 std::string profile_key_; |
35 | 31 |
36 // Bytes indicating the "version" of the validator being used. This is used | 32 // Bytes indicating the "version" of the validator being used. This is used |
37 // to implicitly invalidate the cache - changing the version will change the | 33 // to implicitly invalidate the cache - changing the version will change the |
38 // hashes that are produced. | 34 // hashes that are produced. |
39 std::string nacl_version_; | 35 std::string nacl_version_; |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
85 | 81 |
86 DISALLOW_COPY_AND_ASSIGN(NaClValidationQuery); | 82 DISALLOW_COPY_AND_ASSIGN(NaClValidationQuery); |
87 }; | 83 }; |
88 | 84 |
89 // Create a validation cache interface for use by sel_ldr. | 85 // Create a validation cache interface for use by sel_ldr. |
90 struct NaClValidationCache* CreateValidationCache( | 86 struct NaClValidationCache* CreateValidationCache( |
91 NaClValidationDB* db, const std::string& profile_key, | 87 NaClValidationDB* db, const std::string& profile_key, |
92 const std::string& nacl_version); | 88 const std::string& nacl_version); |
93 | 89 |
94 #endif // COMPONENTS_NACL_LOADER_NACL_VALIDATION_QUERY_H_ | 90 #endif // COMPONENTS_NACL_LOADER_NACL_VALIDATION_QUERY_H_ |
OLD | NEW |