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

Side by Side Diff: extensions/browser/content_verifier_delegate.h

Issue 329303007: Fix several problems with the content verification code (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: ready Created 6 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
OLDNEW
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
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_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698