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

Unified Diff: extensions/browser/content_verify_job.cc

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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « extensions/browser/content_verify_job.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: extensions/browser/content_verify_job.cc
diff --git a/extensions/browser/content_verify_job.cc b/extensions/browser/content_verify_job.cc
index e7e8cab9dd69a7bdf4298876a6f8966138e167a6..651dcae47b62ddd974d73527a253426996de5db3 100644
--- a/extensions/browser/content_verify_job.cc
+++ b/extensions/browser/content_verify_job.cc
@@ -20,6 +20,7 @@ namespace extensions {
namespace {
ContentVerifyJob::TestDelegate* g_test_delegate = NULL;
+ContentVerifyJob::TestObserver* g_test_observer = NULL;
class ScopedElapsedTimer {
public:
@@ -60,6 +61,9 @@ ContentVerifyJob::~ContentVerifyJob() {
void ContentVerifyJob::Start() {
DCHECK(thread_checker_.CalledOnValidThread());
+ if (g_test_observer)
+ g_test_observer->JobStarted(hash_reader_->extension_id(),
+ hash_reader_->relative_path());
base::PostTaskAndReplyWithResult(
content::BrowserThread::GetBlockingPool(),
FROM_HERE,
@@ -130,6 +134,10 @@ void ContentVerifyJob::DoneReading() {
done_reading_ = true;
if (hashes_ready_ && !FinishBlock())
DispatchFailureCallback(HASH_MISMATCH);
+
+ if (!failed_ && g_test_observer)
+ g_test_observer->JobFinished(
+ hash_reader_->extension_id(), hash_reader_->relative_path(), failed_);
}
bool ContentVerifyJob::FinishBlock() {
@@ -182,6 +190,11 @@ void ContentVerifyJob::SetDelegateForTests(TestDelegate* delegate) {
g_test_delegate = delegate;
}
+// static
+void ContentVerifyJob::SetObserverForTests(TestObserver* observer) {
+ g_test_observer = observer;
+}
+
void ContentVerifyJob::DispatchFailureCallback(FailureReason reason) {
DCHECK(!failed_);
failed_ = true;
@@ -192,6 +205,9 @@ void ContentVerifyJob::DispatchFailureCallback(FailureReason reason) {
failure_callback_.Run(reason);
failure_callback_.Reset();
}
+ if (g_test_observer)
+ g_test_observer->JobFinished(
+ hash_reader_->extension_id(), hash_reader_->relative_path(), failed_);
}
} // namespace extensions
« no previous file with comments | « extensions/browser/content_verify_job.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698