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

Unified Diff: components/offline_pages/offline_page_model_impl.h

Issue 2041983006: [Offline Pages] Filtering expired pages and fix consistency check. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Comments and some naming changes. Created 4 years, 6 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.h
diff --git a/components/offline_pages/offline_page_model_impl.h b/components/offline_pages/offline_page_model_impl.h
index 34dc791d037ef563ea8491da5d7d75bb110309e2..c3bccf4c0c4cbb02fc50d5290c03b8cb8d8526b4 100644
--- a/components/offline_pages/offline_page_model_impl.h
+++ b/components/offline_pages/offline_page_model_impl.h
@@ -103,7 +103,7 @@ class OfflinePageModelImpl : public OfflinePageModel, public KeyedService {
const SingleOfflinePageItemCallback callback) override;
const OfflinePageItem* MaybeGetBestPageForOnlineURL(
const GURL& online_url) const override;
- void CheckForExternalFileDeletion() override;
+ void CheckMetadataConsistency() override;
void ExpirePages(const std::vector<int64_t>& offline_ids,
const base::Time& expiration_time,
const base::Callback<void(bool)>& callback) override;
@@ -193,12 +193,20 @@ class OfflinePageModelImpl : public OfflinePageModel, public KeyedService {
void OnMarkPageAccesseDone(const OfflinePageItem& offline_page_item,
bool success);
- // Callbacks for checking if offline pages are missing archive files.
- void ScanForMissingArchiveFiles(
+ // Callbacks for checking metadata consistency.
+ void DoCheckMetadataConsistency(
const std::set<base::FilePath>& archive_paths);
- void OnRemoveOfflinePagesMissingArchiveFileDone(
- const std::vector<std::pair<int64_t, ClientId>>& offline_client_id_pairs,
- DeletePageResult result);
+ // Callback called after headless archives deleted. Headless archives are
+ // archives files on disk which are not pointed to by any of the page items
+ // in metadata store.
+ void ExpirePagesMissingArchiveFile(
+ const std::set<base::FilePath>& archive_paths);
+ void OnExpirePagesMissingArchiveFileDone(
+ const std::vector<int64_t>& offline_ids,
+ bool success);
+ void DeleteHeadlessArchives(const std::set<base::FilePath>& archive_paths);
+ void OnDeleteHeadlessArchivesDone(const std::vector<base::FilePath>& archives,
+ bool success);
// Steps for clearing all.
void OnRemoveAllFilesDoneForClearAll(const base::Closure& callback,

Powered by Google App Engine
This is Rietveld 408576698