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_H_ | 5 #ifndef EXTENSIONS_BROWSER_CONTENT_VERIFIER_H_ |
6 #define EXTENSIONS_BROWSER_CONTENT_VERIFIER_H_ | 6 #define EXTENSIONS_BROWSER_CONTENT_VERIFIER_H_ |
7 | 7 |
8 #include <set> | 8 #include <set> |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
48 ContentVerifyJob* CreateJobFor(const std::string& extension_id, | 48 ContentVerifyJob* CreateJobFor(const std::string& extension_id, |
49 const base::FilePath& extension_root, | 49 const base::FilePath& extension_root, |
50 const base::FilePath& relative_path); | 50 const base::FilePath& relative_path); |
51 | 51 |
52 // Called (typically by a verification job) to indicate that verification | 52 // Called (typically by a verification job) to indicate that verification |
53 // failed while reading some file in |extension_id|. | 53 // failed while reading some file in |extension_id|. |
54 void VerifyFailed(const std::string& extension_id, | 54 void VerifyFailed(const std::string& extension_id, |
55 ContentVerifyJob::FailureReason reason); | 55 ContentVerifyJob::FailureReason reason); |
56 | 56 |
57 // ExtensionRegistryObserver interface | 57 // ExtensionRegistryObserver interface |
58 virtual void OnExtensionLoaded(content::BrowserContext* browser_context, | 58 void OnExtensionLoaded(content::BrowserContext* browser_context, |
59 const Extension* extension) override; | 59 const Extension* extension) override; |
60 virtual void OnExtensionUnloaded( | 60 void OnExtensionUnloaded(content::BrowserContext* browser_context, |
61 content::BrowserContext* browser_context, | 61 const Extension* extension, |
62 const Extension* extension, | 62 UnloadedExtensionInfo::Reason reason) override; |
63 UnloadedExtensionInfo::Reason reason) override; | |
64 | 63 |
65 private: | 64 private: |
66 DISALLOW_COPY_AND_ASSIGN(ContentVerifier); | 65 DISALLOW_COPY_AND_ASSIGN(ContentVerifier); |
67 | 66 |
68 friend class base::RefCountedThreadSafe<ContentVerifier>; | 67 friend class base::RefCountedThreadSafe<ContentVerifier>; |
69 virtual ~ContentVerifier(); | 68 ~ContentVerifier() override; |
70 | 69 |
71 void OnFetchComplete(const std::string& extension_id, | 70 void OnFetchComplete(const std::string& extension_id, |
72 bool success, | 71 bool success, |
73 bool was_force_check, | 72 bool was_force_check, |
74 const std::set<base::FilePath>& hash_mismatch_paths); | 73 const std::set<base::FilePath>& hash_mismatch_paths); |
75 | 74 |
76 void OnFetchCompleteHelper(const std::string& extension_id, | 75 void OnFetchCompleteHelper(const std::string& extension_id, |
77 bool shouldVerifyAnyPathsResult); | 76 bool shouldVerifyAnyPathsResult); |
78 | 77 |
79 // Returns true if any of the paths in |relative_paths| *should* have their | 78 // Returns true if any of the paths in |relative_paths| *should* have their |
(...skipping 17 matching lines...) Expand all Loading... |
97 // For observing the ExtensionRegistry. | 96 // For observing the ExtensionRegistry. |
98 ScopedObserver<ExtensionRegistry, ExtensionRegistryObserver> observer_; | 97 ScopedObserver<ExtensionRegistry, ExtensionRegistryObserver> observer_; |
99 | 98 |
100 // Data that should only be used on the IO thread. | 99 // Data that should only be used on the IO thread. |
101 scoped_refptr<ContentVerifierIOData> io_data_; | 100 scoped_refptr<ContentVerifierIOData> io_data_; |
102 }; | 101 }; |
103 | 102 |
104 } // namespace extensions | 103 } // namespace extensions |
105 | 104 |
106 #endif // EXTENSIONS_BROWSER_CONTENT_VERIFIER_H_ | 105 #endif // EXTENSIONS_BROWSER_CONTENT_VERIFIER_H_ |
OLD | NEW |