Chromium Code Reviews| Index: components/offline_pages/offline_page_model.cc |
| diff --git a/components/offline_pages/offline_page_model.cc b/components/offline_pages/offline_page_model.cc |
| index 1d7a60c664dc883e500fe75a4907ee73351faf31..d5e939bfc4434a1e0d6453b4c06bb8cd8820c6ae 100644 |
| --- a/components/offline_pages/offline_page_model.cc |
| +++ b/components/offline_pages/offline_page_model.cc |
| @@ -508,6 +508,34 @@ void OfflinePageModel::CheckForExternalFileDeletion() { |
| weak_ptr_factory_.GetWeakPtr())); |
| } |
| +void OfflinePageModel::ExpirePages(const std::vector<int64_t>& offline_ids, |
|
romax
2016/05/20 19:05:00
In .h you mentioned to clear files here but seems
fgorski
2016/05/20 20:54:54
Step by step. You'll be adding this code and it ma
|
| + const base::Time& expiration_time) { |
| + for (int64_t offline_id : offline_ids) { |
| + auto iter = offline_pages_.find(offline_id); |
| + if (iter == offline_pages_.end()) |
| + continue; |
| + |
| + OfflinePageItem offline_page = iter->second; |
| + offline_page.expiration_time = expiration_time; |
| + |
| + store_->AddOrUpdateOfflinePage( |
| + offline_page, base::Bind(&OfflinePageModel::OnExpirePageDone, |
| + weak_ptr_factory_.GetWeakPtr(), offline_id, |
|
bburns
2016/05/20 18:23:27
personally, I would place one parameter on each li
fgorski
2016/05/20 20:54:54
I am with you, it takes running git cl format once
|
| + expiration_time)); |
| + } |
| +} |
| + |
| +void OfflinePageModel::OnExpirePageDone(int64_t offline_id, |
| + const base::Time& expiration_time, |
| + bool success) { |
| + // TODO(romax): Report UMA about successful expiration. |
| + if (success) { |
| + auto iter = offline_pages_.find(offline_id); |
| + if (iter != offline_pages_.end()) |
| + iter->second.expiration_time = expiration_time; |
| + } |
| +} |
| + |
| ClientPolicyController* OfflinePageModel::GetPolicyController() { |
| return policy_controller_.get(); |
| } |