OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |