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

Side by Side Diff: components/precache/content/precache_manager.cc

Issue 2123813002: Report Precache.TimeSinceLastPrecache (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: gclient sync Created 4 years, 5 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
« no previous file with comments | « components/precache.gypi ('k') | components/precache/content/precache_manager_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 #include "components/precache/content/precache_manager.h" 5 #include "components/precache/content/precache_manager.h"
6 6
7 #include <string> 7 #include <string>
8 #include <utility> 8 #include <utility>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
116 DCHECK_CURRENTLY_ON(BrowserThread::UI); 116 DCHECK_CURRENTLY_ON(BrowserThread::UI);
117 117
118 if (is_precaching_) { 118 if (is_precaching_) {
119 DLOG(WARNING) << "Cannot start precaching because precaching is already " 119 DLOG(WARNING) << "Cannot start precaching because precaching is already "
120 "in progress."; 120 "in progress.";
121 return; 121 return;
122 } 122 }
123 precache_completion_callback_ = precache_completion_callback; 123 precache_completion_callback_ = precache_completion_callback;
124 124
125 is_precaching_ = true; 125 is_precaching_ = true;
126 BrowserThread::PostTask(
127 BrowserThread::DB, FROM_HERE,
128 base::Bind(&PrecacheDatabase::SetLastPrecacheTimestamp,
129 base::Unretained(precache_database_.get()),
130 base::Time::Now()));
126 BrowserThread::PostTaskAndReplyWithResult( 131 BrowserThread::PostTaskAndReplyWithResult(
127 BrowserThread::DB, 132 BrowserThread::DB,
128 FROM_HERE, 133 FROM_HERE,
129 base::Bind(&PrecacheDatabase::GetUnfinishedWork, 134 base::Bind(&PrecacheDatabase::GetUnfinishedWork,
130 base::Unretained(precache_database_.get())), 135 base::Unretained(precache_database_.get())),
131 base::Bind(&PrecacheManager::OnGetUnfinishedWorkDone, AsWeakPtr())); 136 base::Bind(&PrecacheManager::OnGetUnfinishedWorkDone, AsWeakPtr()));
132 } 137 }
133 138
134 void PrecacheManager::OnGetUnfinishedWorkDone( 139 void PrecacheManager::OnGetUnfinishedWorkDone(
135 std::unique_ptr<PrecacheUnfinishedWork> unfinished_work) { 140 std::unique_ptr<PrecacheUnfinishedWork> unfinished_work) {
(...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after
343 this)); 348 this));
344 precache_fetcher_->Start(); 349 precache_fetcher_->Start();
345 } 350 }
346 351
347 void PrecacheManager::OnHostsReceivedThenDone( 352 void PrecacheManager::OnHostsReceivedThenDone(
348 const history::TopHostsList& host_counts) { 353 const history::TopHostsList& host_counts) {
349 OnDone(); 354 OnDone();
350 } 355 }
351 356
352 } // namespace precache 357 } // namespace precache
OLDNEW
« no previous file with comments | « components/precache.gypi ('k') | components/precache/content/precache_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698