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

Unified Diff: components/offline_pages/offline_page_model.h

Issue 1397233002: [Offline pages] Detecting missing offline copy (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Adding tests and fixing memory bots Created 5 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
Index: components/offline_pages/offline_page_model.h
diff --git a/components/offline_pages/offline_page_model.h b/components/offline_pages/offline_page_model.h
index 648a0f4002758696ef7cafbc70a3291bf15c0b16..24acf3c1d4c530bd20f5e5e0e6273040bceaca62 100644
--- a/components/offline_pages/offline_page_model.h
+++ b/components/offline_pages/offline_page_model.h
@@ -97,6 +97,7 @@ class OfflinePageModel : public KeyedService,
public:
// Invoked when the model has finished loading.
virtual void OfflinePageModelLoaded(OfflinePageModel* model) = 0;
+ virtual void OfflinePageDeleted(int64 bookmark_id) = 0;
jianli 2015/10/13 00:17:54 nit: please add comment
fgorski 2015/10/13 17:39:58 Done.
protected:
virtual ~Observer() {}
@@ -156,10 +157,13 @@ class OfflinePageModel : public KeyedService,
// is returned if not found.
const OfflinePageItem* GetPageByBookmarkId(int64 bookmark_id) const;
- // Returns an offline page that is stored as |offline_url|. nullptr is
+ // Returns an offline page that is stored as |offline_url|. A nullptr is
// returned if not found.
const OfflinePageItem* GetPageByOfflineURL(const GURL& offline_url) const;
+ // Checks that all of the offline pages have corresponding offline copies.
+ void CheckMetadataConsistency();
jianli 2015/10/13 00:17:54 Since we're only checking if the file is still the
fgorski 2015/10/13 17:39:58 I am ok with making that change in the model now,
+
// Methods for testing only:
OfflinePageMetadataStore* GetStoreForTesting();
@@ -211,6 +215,10 @@ class OfflinePageModel : public KeyedService,
void OnUpdateOfflinePageDone(const OfflinePageItem& offline_page_item,
bool success);
+ // Callback for check if offline pages missing offline files.
+ void OnListPagesMissingOfflineCopy(
jianli 2015/10/13 00:17:54 It would be consistent with the naming "archive fi
fgorski 2015/10/13 17:39:58 Done.
+ const std::vector<int64>* pages_missing_offline_copy);
+
// Persistent store for offline page metadata.
scoped_ptr<OfflinePageMetadataStore> store_;

Powered by Google App Engine
This is Rietveld 408576698