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

Unified Diff: components/offline_pages/offline_page_model.h

Issue 2026843003: [Offline Pages] Removing client in storage manager. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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/offline_page_model.h
diff --git a/components/offline_pages/offline_page_model.h b/components/offline_pages/offline_page_model.h
index 29107e0ac8135d1672cea86259277206246fe1a6..34d70c378b7459a8630e7caac07cc972bddfce6f 100644
--- a/components/offline_pages/offline_page_model.h
+++ b/components/offline_pages/offline_page_model.h
@@ -25,6 +25,7 @@ class Time;
namespace offline_pages {
static const char* const kBookmarkNamespace = "bookmark";
+static const char* const kLastNNamespace = "last_n";
dougarnett 2016/06/01 01:41:11 Btw, i was hoping we could get these constants out
chili 2016/06/01 03:54:37 Jian's CL (https://codereview.chromium.org/2022283
jianli 2016/06/01 20:41:21 Yes, please wait and sync after my patch (need to
romax 2016/06/01 20:58:43 Is this the one to wait for? Or what's the CL numb
static const int64_t kInvalidOfflineId = 0;
struct ClientId;
@@ -47,8 +48,7 @@ struct OfflinePageItem;
//
// TODO(fgorski): Things to describe:
// * how to cancel requests and what to expect
-class OfflinePageModel : public base::SupportsUserData,
- public OfflinePageStorageManager::Client {
+class OfflinePageModel : public base::SupportsUserData {
public:
// Observer of the OfflinePageModel.
class Observer {
@@ -101,13 +101,13 @@ class OfflinePageModel : public base::SupportsUserData,
// will be updated. Requires that the model is loaded.
virtual void MarkPageAccessed(int64_t offline_id) = 0;
- // TODO(romax): Pull this interface up from OfflinePageStorageManager::Client
- // void DeletePagesByOfflineId(const std::vector<int64_t>& offline_ids,
- // const DeletePageCallback& callback);
-
// Wipes out all the data by deleting all saved files and clearing the store.
virtual void ClearAll(const base::Closure& callback) = 0;
+ // Deletes pages based on |ofline_ids|.
+ virtual void DeletePagesByOfflineId(const std::vector<int64_t>& offline_ids,
+ const DeletePageCallback& callback) = 0;
+
// Deletes offline pages matching the URL predicate.
virtual void DeletePagesByURLPredicate(
const UrlPredicate& predicate,
@@ -124,6 +124,9 @@ class OfflinePageModel : public base::SupportsUserData,
const std::set<GURL>& urls,
const CheckPagesExistOfflineCallback& callback) = 0;
+ // Gets all offline pages.
+ virtual void GetAllPages(const MultipleOfflinePageItemCallback& callback) = 0;
jianli 2016/06/01 20:41:21 Please add const modifier.
romax 2016/06/01 20:58:44 i'm not sure where to add a const?
jianli 2016/06/01 20:59:37 virtual void GetAllPages(const MultipleOfflinePage
+
// Gets all offline ids where the offline page has the matching client id.
virtual void GetOfflineIdsForClientId(
const ClientId& client_id,
@@ -187,6 +190,12 @@ class OfflinePageModel : public base::SupportsUserData,
// observers.
virtual void CheckForExternalFileDeletion() = 0;
+ // Marks pages with |offline_ids| as expired and delete the associated archive
jianli 2016/06/01 20:41:21 nit: deletes
romax 2016/06/01 20:58:43 Done.
+ // files.
+ virtual void ExpirePages(const std::vector<int64_t>& offline_ids,
+ const base::Time& expiration_time,
+ const base::Callback<void(bool)>& callback) = 0;
+
// Returns the policy controller.
virtual ClientPolicyController* GetPolicyController() = 0;
« no previous file with comments | « components/offline_pages/client_policy_controller.cc ('k') | components/offline_pages/offline_page_model_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698