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

Unified Diff: components/offline_pages/core/offline_page_storage_manager.cc

Issue 2889663004: [DO NOT COMMIT][Offline Pages] Moving Offline Page Cache to cache directory.
Patch Set: again? Created 3 years, 7 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/core/offline_page_storage_manager.cc
diff --git a/components/offline_pages/core/offline_page_storage_manager.cc b/components/offline_pages/core/offline_page_storage_manager.cc
index 1c17729f768a8a9ef7f47b617f86d169f46fe9b6..260bc798867ef6b75b7df07794227530fe0f41d3 100644
--- a/components/offline_pages/core/offline_page_storage_manager.cc
+++ b/components/offline_pages/core/offline_page_storage_manager.cc
@@ -14,10 +14,10 @@
#include "components/offline_pages/core/offline_page_item.h"
#include "components/offline_pages/core/offline_page_model.h"
-using LifetimeType = offline_pages::LifetimePolicy::LifetimeType;
-
namespace offline_pages {
+using LifetimeType = LifetimePolicy::LifetimeType;
+
constexpr double constants::kOfflinePageStorageLimit;
constexpr double constants::kOfflinePageStorageClearThreshold;
constexpr base::TimeDelta constants::kClearStorageInterval;
@@ -40,9 +40,12 @@ void OfflinePageStorageManager::ClearPagesIfNeeded(
if (IsInProgress())
return;
clear_time_ = clock_->Now();
- archive_manager_->GetStorageStats(base::Bind(
- &OfflinePageStorageManager::OnGetStorageStatsDoneForClearingPages,
- weak_ptr_factory_.GetWeakPtr(), callback));
+ // We only clear temporary offline pages in storage manager.
+ archive_manager_->GetStorageStats(
+ std::set<LifetimeType>({LifetimeType::TEMPORARY}),
+ base::Bind(
+ &OfflinePageStorageManager::OnGetStorageStatsDoneForClearingPages,
+ weak_ptr_factory_.GetWeakPtr(), callback));
}
void OfflinePageStorageManager::SetClockForTesting(

Powered by Google App Engine
This is Rietveld 408576698