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

Unified Diff: components/offline_pages/offline_page_model_impl.cc

Issue 2342443006: [Offline pages] Use the new policy bits (Closed)
Patch Set: fix download bridge and ntp suggestions to use correct policy controller Created 4 years, 3 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/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 df2e5ac6d2ce44c52244ae312100649101cc7f3b..d98cca7f4b3826ce8602f5f55632d1d2d6e60e78 100644
--- a/components/offline_pages/offline_page_model_impl.cc
+++ b/components/offline_pages/offline_page_model_impl.cc
@@ -466,7 +466,7 @@ void OfflinePageModelImpl::DoDeleteCachedPagesByURLPredicate(
std::vector<int64_t> offline_ids;
for (const auto& id_page_pair : offline_pages_) {
- if (!IsUserRequestedPage(id_page_pair.second) &&
+ if (IsRemovedOnCacheReset(id_page_pair.second) &&
predicate.Run(id_page_pair.second.url))
fgorski 2016/10/04 18:28:50 please add {}, because the condition of if spans m
chili 2016/10/04 20:20:25 Done.
offline_ids.push_back(id_page_pair.first);
}
@@ -1126,10 +1126,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) {

Powered by Google App Engine
This is Rietveld 408576698