| 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 <memory> | 8 #include <memory> |
| 9 #include <set> | 9 #include <set> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 79 | 79 |
| 80 friend class base::RefCountedThreadSafe<ContentVerifier>; | 80 friend class base::RefCountedThreadSafe<ContentVerifier>; |
| 81 ~ContentVerifier() override; | 81 ~ContentVerifier() override; |
| 82 | 82 |
| 83 void OnFetchComplete(const std::string& extension_id, | 83 void OnFetchComplete(const std::string& extension_id, |
| 84 bool success, | 84 bool success, |
| 85 bool was_force_check, | 85 bool was_force_check, |
| 86 const std::set<base::FilePath>& hash_mismatch_paths); | 86 const std::set<base::FilePath>& hash_mismatch_paths); |
| 87 | 87 |
| 88 void OnFetchCompleteHelper(const std::string& extension_id, | 88 void OnFetchCompleteHelper(const std::string& extension_id, |
| 89 bool shouldVerifyAnyPathsResult); | 89 bool should_verify_any_paths_result); |
| 90 | 90 |
| 91 // Returns true if any of the paths in |relative_paths| *should* have their | 91 // Returns true if any of the paths in |relative_paths| *should* have their |
| 92 // contents verified. (Some files get transcoded during the install process, | 92 // contents verified. (Some files get transcoded during the install process, |
| 93 // so we don't want to verify their contents because they are expected not | 93 // so we don't want to verify their contents because they are expected not |
| 94 // to match). | 94 // to match). |
| 95 bool ShouldVerifyAnyPaths(const std::string& extension_id, | 95 bool ShouldVerifyAnyPaths(const std::string& extension_id, |
| 96 const base::FilePath& extension_root, | 96 const base::FilePath& extension_root, |
| 97 const std::set<base::FilePath>& relative_paths); | 97 const std::set<base::FilePath>& relative_paths); |
| 98 | 98 |
| 99 // Set to true once we've begun shutting down. | 99 // Set to true once we've begun shutting down. |
| 100 bool shutdown_; | 100 bool shutdown_; |
| 101 | 101 |
| 102 content::BrowserContext* context_; | 102 content::BrowserContext* context_; |
| 103 | 103 |
| 104 std::unique_ptr<ContentVerifierDelegate> delegate_; | 104 std::unique_ptr<ContentVerifierDelegate> delegate_; |
| 105 | 105 |
| 106 // For fetching content hash signatures. | 106 // For fetching content hash signatures. |
| 107 std::unique_ptr<ContentHashFetcher> fetcher_; | 107 std::unique_ptr<ContentHashFetcher> fetcher_; |
| 108 | 108 |
| 109 // For observing the ExtensionRegistry. | 109 // For observing the ExtensionRegistry. |
| 110 ScopedObserver<ExtensionRegistry, ExtensionRegistryObserver> observer_; | 110 ScopedObserver<ExtensionRegistry, ExtensionRegistryObserver> observer_; |
| 111 | 111 |
| 112 // Data that should only be used on the IO thread. | 112 // Data that should only be used on the IO thread. |
| 113 scoped_refptr<ContentVerifierIOData> io_data_; | 113 scoped_refptr<ContentVerifierIOData> io_data_; |
| 114 }; | 114 }; |
| 115 | 115 |
| 116 } // namespace extensions | 116 } // namespace extensions |
| 117 | 117 |
| 118 #endif // EXTENSIONS_BROWSER_CONTENT_VERIFIER_H_ | 118 #endif // EXTENSIONS_BROWSER_CONTENT_VERIFIER_H_ |
| OLD | NEW |