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

Unified Diff: components/offline_pages/offline_page_model_impl.cc

Issue 2342443006: [Offline pages] Use the new policy bits (Closed)
Patch Set: i think i got it! Made sure it compiles Created 4 years, 2 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 | « components/offline_pages/offline_page_model_impl.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/offline_pages/offline_page_model_impl.cc
diff --git a/components/offline_pages/offline_page_model_impl.cc b/components/offline_pages/offline_page_model_impl.cc
index ce697958ec33545ca0a7f7cfafcfcdca441cddc1..37d89e35ac7a538faebceb1589ffa47b16adaee1 100644
--- a/components/offline_pages/offline_page_model_impl.cc
+++ b/components/offline_pages/offline_page_model_impl.cc
@@ -443,9 +443,10 @@ void OfflinePageModelImpl::DoDeleteCachedPagesByURLPredicate(
std::vector<int64_t> offline_ids;
for (const auto& id_page_pair : offline_pages_) {
- if (!IsUserRequestedPage(id_page_pair.second) &&
- predicate.Run(id_page_pair.second.url))
+ if (IsRemovedOnCacheReset(id_page_pair.second) &&
+ predicate.Run(id_page_pair.second.url)) {
offline_ids.push_back(id_page_pair.first);
+ }
}
DoDeletePagesByOfflineId(offline_ids, callback);
}
@@ -1058,10 +1059,10 @@ void OfflinePageModelImpl::PostClearStorageIfNeededTask() {
weak_ptr_factory_.GetWeakPtr())));
}
-bool OfflinePageModelImpl::IsUserRequestedPage(
+bool OfflinePageModelImpl::IsRemovedOnCacheReset(
const OfflinePageItem& offline_page) const {
- return (offline_page.client_id.name_space == kAsyncNamespace ||
- offline_page.client_id.name_space == kDownloadNamespace);
+ return policy_controller_->IsRemovedOnCacheReset(
+ offline_page.client_id.name_space);
}
void OfflinePageModelImpl::RunWhenLoaded(const base::Closure& task) {
« no previous file with comments | « components/offline_pages/offline_page_model_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698