| 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 26 matching lines...) Expand all Loading... |
| 37 class ContentVerifier : public base::RefCountedThreadSafe<ContentVerifier>, | 37 class ContentVerifier : public base::RefCountedThreadSafe<ContentVerifier>, |
| 38 public ExtensionRegistryObserver { | 38 public ExtensionRegistryObserver { |
| 39 public: | 39 public: |
| 40 class TestObserver { | 40 class TestObserver { |
| 41 public: | 41 public: |
| 42 virtual void OnFetchComplete(const std::string& extension_id, | 42 virtual void OnFetchComplete(const std::string& extension_id, |
| 43 bool success) = 0; | 43 bool success) = 0; |
| 44 }; | 44 }; |
| 45 static void SetObserverForTests(TestObserver* observer); | 45 static void SetObserverForTests(TestObserver* observer); |
| 46 | 46 |
| 47 // Takes ownership of |delegate|. | |
| 48 ContentVerifier(content::BrowserContext* context, | 47 ContentVerifier(content::BrowserContext* context, |
| 49 ContentVerifierDelegate* delegate); | 48 std::unique_ptr<ContentVerifierDelegate> delegate); |
| 50 void Start(); | 49 void Start(); |
| 51 void Shutdown(); | 50 void Shutdown(); |
| 52 | 51 |
| 53 // Call this before reading a file within an extension. The caller owns the | 52 // Call this before reading a file within an extension. The caller owns the |
| 54 // returned job. | 53 // returned job. |
| 55 ContentVerifyJob* CreateJobFor(const std::string& extension_id, | 54 ContentVerifyJob* CreateJobFor(const std::string& extension_id, |
| 56 const base::FilePath& extension_root, | 55 const base::FilePath& extension_root, |
| 57 const base::FilePath& relative_path); | 56 const base::FilePath& relative_path); |
| 58 | 57 |
| 59 // Called (typically by a verification job) to indicate that verification | 58 // Called (typically by a verification job) to indicate that verification |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 103 // For observing the ExtensionRegistry. | 102 // For observing the ExtensionRegistry. |
| 104 ScopedObserver<ExtensionRegistry, ExtensionRegistryObserver> observer_; | 103 ScopedObserver<ExtensionRegistry, ExtensionRegistryObserver> observer_; |
| 105 | 104 |
| 106 // Data that should only be used on the IO thread. | 105 // Data that should only be used on the IO thread. |
| 107 scoped_refptr<ContentVerifierIOData> io_data_; | 106 scoped_refptr<ContentVerifierIOData> io_data_; |
| 108 }; | 107 }; |
| 109 | 108 |
| 110 } // namespace extensions | 109 } // namespace extensions |
| 111 | 110 |
| 112 #endif // EXTENSIONS_BROWSER_CONTENT_VERIFIER_H_ | 111 #endif // EXTENSIONS_BROWSER_CONTENT_VERIFIER_H_ |
| OLD | NEW |