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

Unified Diff: components/precache/content/precache_manager.cc

Issue 1272443002: Only set precache.last_time when precache ran. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@filter_stats
Patch Set: Created 5 years, 4 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
Index: components/precache/content/precache_manager.cc
diff --git a/components/precache/content/precache_manager.cc b/components/precache/content/precache_manager.cc
index f3f2efce9ec60bbebe419290cb22d23426e1c935..60a2742efcc8609361949cc9303874cc6a082bd8 100644
--- a/components/precache/content/precache_manager.cc
+++ b/components/precache/content/precache_manager.cc
@@ -96,11 +96,11 @@ void PrecacheManager::StartPrecaching(
"in progress.";
return;
}
- is_precaching_ = true;
-
precache_completion_callback_ = precache_completion_callback;
if (ShouldRun()) {
+ is_precaching_ = true;
+
BrowserThread::PostTask(
BrowserThread::DB, FROM_HERE,
base::Bind(&PrecacheDatabase::DeleteExpiredPrecacheHistory,
@@ -187,15 +187,13 @@ void PrecacheManager::Shutdown() {
void PrecacheManager::OnDone() {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
- // If OnDone has been called, then we should just be finishing precaching.
- DCHECK(is_precaching_);
- is_precaching_ = false;
-
precache_fetcher_.reset();
- precache_completion_callback_.Run();
+ precache_completion_callback_.Run(is_precaching_);
// Uninitialize the callback so that any scoped_refptrs in it are released.
precache_completion_callback_.Reset();
+
+ is_precaching_ = false;
}
void PrecacheManager::OnHostsReceived(

Powered by Google App Engine
This is Rietveld 408576698