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

Unified Diff: components/offline_pages/offline_page_model_impl.h

Issue 2415473003: Query API: Introduces an OfflinePageModelQuery object. (Closed)
Patch Set: Address more comments. Created 4 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_impl.h
diff --git a/components/offline_pages/offline_page_model_impl.h b/components/offline_pages/offline_page_model_impl.h
index 85c58e6466a3b451a10ebd095bdeaf129ebc545b..c0e76e5a8d6efe9fa7708bf43e35dc312ea7cbbb 100644
--- a/components/offline_pages/offline_page_model_impl.h
+++ b/components/offline_pages/offline_page_model_impl.h
@@ -49,6 +49,7 @@ struct OfflinePageItem;
class ArchiveManager;
class ClientPolicyController;
+class OfflinePageModelQuery;
class OfflinePageStorageManager;
// Implementation of service for saving pages offline, storing the offline
@@ -120,19 +121,14 @@ class OfflinePageModelImpl : public OfflinePageModel, public KeyedService {
private:
FRIEND_TEST_ALL_PREFIXES(OfflinePageModelImplTest, MarkPageForDeletion);
- enum class GetAllPageMode {
- ALL, // Get all active page entries.
- ALL_WITH_EXPIRED, // Get all pages entries including expired ones.
- };
-
typedef ScopedVector<OfflinePageArchiver> PendingArchivers;
+ void ExecuteQuery(std::unique_ptr<OfflinePageModelQuery> query,
+ const MultipleOfflinePageItemCallback& callback);
+
// Callback for ensuring archive directory is created.
void OnEnsureArchivesDirCreatedDone(const base::TimeTicks& start_time);
- void GetAllPagesAfterLoadDone(
- GetAllPageMode mode,
- const MultipleOfflinePageItemCallback& callback) const;
void CheckPagesExistOfflineAfterLoadDone(
const std::set<GURL>& urls,
const CheckPagesExistOfflineCallback& callback);
@@ -144,7 +140,6 @@ class OfflinePageModelImpl : public OfflinePageModel, public KeyedService {
const SingleOfflinePageItemCallback& callback) const;
const std::vector<int64_t> MaybeGetOfflineIdsForClientId(
const ClientId& client_id) const;
- const OfflinePageItem* MaybeGetPageByOfflineId(int64_t offline_id) const;
void GetPagesByOnlineURLWhenLoadDone(
const GURL& online_url,
const MultipleOfflinePageItemCallback& callback) const;
@@ -221,8 +216,8 @@ class OfflinePageModelImpl : public OfflinePageModel, public KeyedService {
const DeletePageCallback& callback);
// Actually does the work of deleting, requires the model is loaded.
- void DoDeletePagesByClientIds(const std::vector<ClientId>& client_ids,
- const DeletePageCallback& callback);
+ void DeletePages(const DeletePageCallback& callback,
+ const MultipleOfflinePageItemResult& items);
void DoGetPagesByClientIds(const std::vector<ClientId>& client_ids,
const MultipleOfflinePageItemCallback& callback);
« no previous file with comments | « components/offline_pages/client_policy_controller.cc ('k') | components/offline_pages/offline_page_model_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698