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

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

Issue 2771953003: Fix content verification code for undreadable and deleted files. (Closed)
Patch Set: address comments change DCHECK Created 3 years, 8 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
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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_SCOPED_IGNORE_CONTENT_VERIFIER_FOR_TEST_H_ 5 #ifndef EXTENSIONS_BROWSER_SCOPED_IGNORE_CONTENT_VERIFIER_FOR_TEST_H_
6 #define EXTENSIONS_BROWSER_SCOPED_IGNORE_CONTENT_VERIFIER_FOR_TEST_H_ 6 #define EXTENSIONS_BROWSER_SCOPED_IGNORE_CONTENT_VERIFIER_FOR_TEST_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "extensions/browser/content_verify_job.h" 10 #include "extensions/browser/content_verify_job.h"
11 11
12 namespace extensions { 12 namespace extensions {
13 13
14 // A class for use in tests to make content verification failures be ignored 14 // A class for use in tests to make content verification failures be ignored
15 // during the lifetime of an instance of it. Note that only one instance should 15 // during the lifetime of an instance of it. Note that only one instance should
16 // be alive at any given time, and that it is not compatible with other 16 // be alive at any given time, and that it is not compatible with other
17 // concurrent objects using the ContentVerifyJob::TestDelegate interface. 17 // concurrent objects using the ContentVerifyJob::TestDelegate interface.
18 class ScopedIgnoreContentVerifierForTest 18 class ScopedIgnoreContentVerifierForTest
19 : public ContentVerifyJob::TestDelegate { 19 : public ContentVerifyJob::TestDelegate {
20 public: 20 public:
21 ScopedIgnoreContentVerifierForTest(); 21 ScopedIgnoreContentVerifierForTest();
22 ~ScopedIgnoreContentVerifierForTest(); 22 ~ScopedIgnoreContentVerifierForTest() override;
23 23
24 // ContentVerifyJob::TestDelegate interface 24 // ContentVerifyJob::TestDelegate interface
25 ContentVerifyJob::FailureReason BytesRead(const std::string& extension_id, 25 ContentVerifyJob::FailureReason BytesRead(const std::string& extension_id,
26 int count, 26 int count,
27 const char* data) override; 27 const char* data) override;
28 ContentVerifyJob::FailureReason DoneReading( 28 ContentVerifyJob::FailureReason DoneReading(
29 const std::string& extension_id) override; 29 const std::string& extension_id) override;
30 30
31 private: 31 private:
32 DISALLOW_COPY_AND_ASSIGN(ScopedIgnoreContentVerifierForTest); 32 DISALLOW_COPY_AND_ASSIGN(ScopedIgnoreContentVerifierForTest);
33 }; 33 };
34 34
35 } // namespace extensions 35 } // namespace extensions
36 36
37 #endif // EXTENSIONS_BROWSER_SCOPED_IGNORE_CONTENT_VERIFIER_FOR_TEST_H_ 37 #endif // EXTENSIONS_BROWSER_SCOPED_IGNORE_CONTENT_VERIFIER_FOR_TEST_H_
OLDNEW
« no previous file with comments | « extensions/browser/extension_protocols.cc ('k') | extensions/test/data/content_hash_fetcher/with_verified_contents/README.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698