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

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

Issue 630243002: Fix extension content verification handling of ./ in icon paths (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: added copyright headers to .js files to fix presubmit error Created 6 years, 2 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 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 <string> 8 #include <string>
9 9
10 #include "base/callback.h" 10 #include "base/callback.h"
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 public: 69 public:
70 // These methods will be called inside BytesRead/DoneReading respectively. 70 // These methods will be called inside BytesRead/DoneReading respectively.
71 // If either return something other than NONE, then the failure callback 71 // If either return something other than NONE, then the failure callback
72 // will be dispatched with that reason. 72 // will be dispatched with that reason.
73 virtual FailureReason BytesRead(const std::string& extension_id, 73 virtual FailureReason BytesRead(const std::string& extension_id,
74 int count, 74 int count,
75 const char* data) = 0; 75 const char* data) = 0;
76 virtual FailureReason DoneReading(const std::string& extension_id) = 0; 76 virtual FailureReason DoneReading(const std::string& extension_id) = 0;
77 }; 77 };
78 78
79 class TestObserver {
80 public:
81 virtual void JobStarted(const std::string& extension_id,
82 const base::FilePath& relative_path) = 0;
83
84 virtual void JobFinished(const std::string& extension_id,
85 const base::FilePath& relative_path,
86 bool failed) = 0;
87 };
88
79 static void SetDelegateForTests(TestDelegate* delegate); 89 static void SetDelegateForTests(TestDelegate* delegate);
90 static void SetObserverForTests(TestObserver* observer);
80 91
81 private: 92 private:
82 DISALLOW_COPY_AND_ASSIGN(ContentVerifyJob); 93 DISALLOW_COPY_AND_ASSIGN(ContentVerifyJob);
83 94
84 virtual ~ContentVerifyJob(); 95 virtual ~ContentVerifyJob();
85 friend class base::RefCountedThreadSafe<ContentVerifyJob>; 96 friend class base::RefCountedThreadSafe<ContentVerifyJob>;
86 97
87 // Called each time we're done adding bytes for the current block, and are 98 // Called each time we're done adding bytes for the current block, and are
88 // ready to finish the hash operation for those bytes and make sure it 99 // ready to finish the hash operation for those bytes and make sure it
89 // matches what was expected for that block. Returns true if everything is 100 // matches what was expected for that block. Returns true if everything is
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
128 // Set to true if we detected a mismatch and called the failure callback. 139 // Set to true if we detected a mismatch and called the failure callback.
129 bool failed_; 140 bool failed_;
130 141
131 // For ensuring methods on called on the right thread. 142 // For ensuring methods on called on the right thread.
132 base::ThreadChecker thread_checker_; 143 base::ThreadChecker thread_checker_;
133 }; 144 };
134 145
135 } // namespace extensions 146 } // namespace extensions
136 147
137 #endif // EXTENSIONS_BROWSER_CONTENT_VERIFY_JOB_H_ 148 #endif // EXTENSIONS_BROWSER_CONTENT_VERIFY_JOB_H_
OLDNEW
« no previous file with comments | « extensions/browser/content_verifier_io_data.cc ('k') | extensions/browser/content_verify_job.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698