OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 EXTENSIONS_BROWSER_CONTENT_VERIFIER_DELEGATE_H_ | 5 #ifndef EXTENSIONS_BROWSER_CONTENT_VERIFIER_DELEGATE_H_ |
6 #define EXTENSIONS_BROWSER_CONTENT_VERIFIER_DELEGATE_H_ | 6 #define EXTENSIONS_BROWSER_CONTENT_VERIFIER_DELEGATE_H_ |
7 | 7 |
8 #include <set> | 8 #include <set> |
9 | 9 |
10 #include "url/gurl.h" | 10 #include "url/gurl.h" |
11 | 11 |
12 namespace base { | 12 namespace base { |
13 class FilePath; | 13 class FilePath; |
14 class Version; | 14 class Version; |
15 } | 15 } |
16 | 16 |
17 namespace extensions { | 17 namespace extensions { |
18 | 18 |
19 class Extension; | 19 class Extension; |
20 | 20 |
21 // A pointer to the bytes of a public key, and the number of bytes. | 21 // A pointer to the bytes of a public key, and the number of bytes. |
22 struct ContentVerifierKey { | 22 struct ContentVerifierKey { |
23 const uint8* data; | 23 const uint8* data; |
24 int size; | 24 int size; |
25 | 25 |
| 26 ContentVerifierKey() : data(NULL), size(0) {} |
| 27 |
26 ContentVerifierKey(const uint8* data, int size) { | 28 ContentVerifierKey(const uint8* data, int size) { |
27 this->data = data; | 29 this->data = data; |
28 this->size = size; | 30 this->size = size; |
29 } | 31 } |
30 }; | 32 }; |
31 | 33 |
32 // This is an interface for clients that want to use a ContentVerifier. | 34 // This is an interface for clients that want to use a ContentVerifier. |
33 class ContentVerifierDelegate { | 35 class ContentVerifierDelegate { |
34 public: | 36 public: |
35 virtual ~ContentVerifierDelegate() {} | 37 virtual ~ContentVerifierDelegate() {} |
(...skipping 19 matching lines...) Expand all Loading... |
55 const extensions::Extension* extension) = 0; | 57 const extensions::Extension* extension) = 0; |
56 | 58 |
57 // Called when the content verifier detects that a read of a file inside | 59 // Called when the content verifier detects that a read of a file inside |
58 // an extension did not match its expected hash. | 60 // an extension did not match its expected hash. |
59 virtual void VerifyFailed(const std::string& extension_id) = 0; | 61 virtual void VerifyFailed(const std::string& extension_id) = 0; |
60 }; | 62 }; |
61 | 63 |
62 } // namespace extensions | 64 } // namespace extensions |
63 | 65 |
64 #endif // EXTENSIONS_BROWSER_CONTENT_VERIFIER_DELEGATE_H_ | 66 #endif // EXTENSIONS_BROWSER_CONTENT_VERIFIER_DELEGATE_H_ |
OLD | NEW |