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

Unified Diff: components/offline_pages/offline_page_model.h

Issue 1345043002: Update access info when an offline page is being visited (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address feedback Created 5 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.h
diff --git a/components/offline_pages/offline_page_model.h b/components/offline_pages/offline_page_model.h
index dd55a7e623af4c897380b82904d4cfcc84583e05..5fc03fb0632f48e65ffa6b6ca19ac6699814b9c6 100644
--- a/components/offline_pages/offline_page_model.h
+++ b/components/offline_pages/offline_page_model.h
@@ -103,6 +103,7 @@ class OfflinePageModel : public KeyedService,
};
typedef base::Callback<void(SavePageResult)> SavePageCallback;
+ typedef base::Callback<void(bool)> MarkPageAccessedCallback;
typedef base::Callback<void(DeletePageResult)> DeletePageCallback;
// All blocking calls/disk access will happen on the provided |task_runner|.
@@ -130,6 +131,12 @@ class OfflinePageModel : public KeyedService,
scoped_ptr<OfflinePageArchiver> archiver,
const SavePageCallback& callback);
+ // Marks that the offline page related to the passed |bookmark_id| has been
+ // accessed. Its access info, including last access time and access count,
+ // will be updated. Requires that the model is loaded.
+ void MarkPageAccessed(int64 bookmark_id,
+ const MarkPageAccessedCallback& callback);
+
// Deletes an offline page related to the passed |bookmark_id|. Requires that
// the model is loaded.
void DeletePageByBookmarkId(int64 bookmark_id,
@@ -203,6 +210,9 @@ class OfflinePageModel : public KeyedService,
void InformDeletePageDone(const DeletePageCallback& callback,
DeletePageResult result);
+ void OnUpdateOfflinePageDone(const MarkPageAccessedCallback& callback,
+ bool success);
+
// Persistent store for offline page metadata.
scoped_ptr<OfflinePageMetadataStore> store_;

Powered by Google App Engine
This is Rietveld 408576698