| 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_VERIFY_JOB_H_ | 5 #ifndef EXTENSIONS_BROWSER_CONTENT_VERIFY_JOB_H_ |
| 6 #define EXTENSIONS_BROWSER_CONTENT_VERIFY_JOB_H_ | 6 #define EXTENSIONS_BROWSER_CONTENT_VERIFY_JOB_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <memory> | 10 #include <memory> |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 65 // are read. Make sure to call DoneReading so that any final bytes that were | 65 // are read. Make sure to call DoneReading so that any final bytes that were |
| 66 // read that didn't align exactly on a block size boundary get their hash | 66 // read that didn't align exactly on a block size boundary get their hash |
| 67 // checked as well. | 67 // checked as well. |
| 68 void BytesRead(int count, const char* data); | 68 void BytesRead(int count, const char* data); |
| 69 | 69 |
| 70 // Call once when finished adding bytes via BytesRead. | 70 // Call once when finished adding bytes via BytesRead. |
| 71 void DoneReading(); | 71 void DoneReading(); |
| 72 | 72 |
| 73 class TestDelegate { | 73 class TestDelegate { |
| 74 public: | 74 public: |
| 75 virtual ~TestDelegate() {} |
| 76 |
| 75 // These methods will be called inside BytesRead/DoneReading respectively. | 77 // These methods will be called inside BytesRead/DoneReading respectively. |
| 76 // If either return something other than NONE, then the failure callback | 78 // If either return something other than NONE, then the failure callback |
| 77 // will be dispatched with that reason. | 79 // will be dispatched with that reason. |
| 78 virtual FailureReason BytesRead(const std::string& extension_id, | 80 virtual FailureReason BytesRead(const std::string& extension_id, |
| 79 int count, | 81 int count, |
| 80 const char* data) = 0; | 82 const char* data) = 0; |
| 81 virtual FailureReason DoneReading(const std::string& extension_id) = 0; | 83 virtual FailureReason DoneReading(const std::string& extension_id) = 0; |
| 82 }; | 84 }; |
| 83 | 85 |
| 84 class TestObserver { | 86 class TestObserver { |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 146 | 148 |
| 147 // For ensuring methods on called on the right thread. | 149 // For ensuring methods on called on the right thread. |
| 148 base::ThreadChecker thread_checker_; | 150 base::ThreadChecker thread_checker_; |
| 149 | 151 |
| 150 DISALLOW_COPY_AND_ASSIGN(ContentVerifyJob); | 152 DISALLOW_COPY_AND_ASSIGN(ContentVerifyJob); |
| 151 }; | 153 }; |
| 152 | 154 |
| 153 } // namespace extensions | 155 } // namespace extensions |
| 154 | 156 |
| 155 #endif // EXTENSIONS_BROWSER_CONTENT_VERIFY_JOB_H_ | 157 #endif // EXTENSIONS_BROWSER_CONTENT_VERIFY_JOB_H_ |
| OLD | NEW |