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

Unified Diff: extensions/browser/content_verify_job.cc

Issue 2824333003: Bind ContentVerifer::VerifyFailed as OnceCallback. (Closed)
Patch Set: Only ContentVerifyJob::FailureCallback 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 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 211f5b5dfea56b160a75ba7b43c0ed9d2df86de6..237dab68bc3abbde87f691bf81543cb07ddbe9dc 100644
--- a/extensions/browser/content_verify_job.cc
+++ b/extensions/browser/content_verify_job.cc
@@ -41,14 +41,14 @@ class ScopedElapsedTimer {
} // namespace
ContentVerifyJob::ContentVerifyJob(ContentHashReader* hash_reader,
- const FailureCallback& failure_callback)
+ FailureCallback failure_callback)
: done_reading_(false),
hashes_ready_(false),
total_bytes_read_(0),
current_block_(0),
current_hash_byte_count_(0),
hash_reader_(hash_reader),
- failure_callback_(failure_callback),
+ failure_callback_(std::move(failure_callback)),
failed_(false) {
// It's ok for this object to be constructed on a different thread from where
// it's used.
@@ -227,8 +227,7 @@ void ContentVerifyJob::DispatchFailureCallback(FailureReason reason) {
VLOG(1) << "job failed for " << hash_reader_->extension_id() << " "
<< hash_reader_->relative_path().MaybeAsASCII()
<< " reason:" << reason;
- failure_callback_.Run(reason);
- failure_callback_.Reset();
+ std::move(failure_callback_).Run(reason);
}
if (g_test_observer) {
g_test_observer->JobFinished(hash_reader_->extension_id(),
« 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