OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef COMPONENTS_OFFLINE_PAGES_OFFLINE_PAGE_MODEL_IMPL_H_ | 5 #ifndef COMPONENTS_OFFLINE_PAGES_OFFLINE_PAGE_MODEL_IMPL_H_ |
6 #define COMPONENTS_OFFLINE_PAGES_OFFLINE_PAGE_MODEL_IMPL_H_ | 6 #define COMPONENTS_OFFLINE_PAGES_OFFLINE_PAGE_MODEL_IMPL_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <map> | 10 #include <map> |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
74 void DeletePagesByOfflineId(const std::vector<int64_t>& offline_ids, | 74 void DeletePagesByOfflineId(const std::vector<int64_t>& offline_ids, |
75 const DeletePageCallback& callback) override; | 75 const DeletePageCallback& callback) override; |
76 void DeletePagesByURLPredicate(const UrlPredicate& predicate, | 76 void DeletePagesByURLPredicate(const UrlPredicate& predicate, |
77 const DeletePageCallback& callback) override; | 77 const DeletePageCallback& callback) override; |
78 void HasPages(const std::string& name_space, | 78 void HasPages(const std::string& name_space, |
79 const HasPagesCallback& callback) override; | 79 const HasPagesCallback& callback) override; |
80 void CheckPagesExistOffline( | 80 void CheckPagesExistOffline( |
81 const std::set<GURL>& urls, | 81 const std::set<GURL>& urls, |
82 const CheckPagesExistOfflineCallback& callback) override; | 82 const CheckPagesExistOfflineCallback& callback) override; |
83 void GetAllPages(const MultipleOfflinePageItemCallback& callback) override; | 83 void GetAllPages(const MultipleOfflinePageItemCallback& callback) override; |
| 84 void GetAllPagesWithExpired( |
| 85 const MultipleOfflinePageItemCallback& callback) override; |
84 void GetOfflineIdsForClientId( | 86 void GetOfflineIdsForClientId( |
85 const ClientId& client_id, | 87 const ClientId& client_id, |
86 const MultipleOfflineIdCallback& callback) override; | 88 const MultipleOfflineIdCallback& callback) override; |
87 const std::vector<int64_t> MaybeGetOfflineIdsForClientId( | 89 const std::vector<int64_t> MaybeGetOfflineIdsForClientId( |
88 const ClientId& client_id) const override; | 90 const ClientId& client_id) const override; |
89 void GetPageByOfflineId( | 91 void GetPageByOfflineId( |
90 int64_t offline_id, | 92 int64_t offline_id, |
91 const SingleOfflinePageItemCallback& callback) override; | 93 const SingleOfflinePageItemCallback& callback) override; |
92 const OfflinePageItem* MaybeGetPageByOfflineId( | 94 const OfflinePageItem* MaybeGetPageByOfflineId( |
93 int64_t offline_id) const override; | 95 int64_t offline_id) const override; |
(...skipping 26 matching lines...) Expand all Loading... |
120 OfflineEventLogger* GetLogger() override; | 122 OfflineEventLogger* GetLogger() override; |
121 | 123 |
122 protected: | 124 protected: |
123 // Adding a protected constructor for testing-only purposes in | 125 // Adding a protected constructor for testing-only purposes in |
124 // offline_page_storage_manager_unittest.cc | 126 // offline_page_storage_manager_unittest.cc |
125 OfflinePageModelImpl(); | 127 OfflinePageModelImpl(); |
126 | 128 |
127 private: | 129 private: |
128 FRIEND_TEST_ALL_PREFIXES(OfflinePageModelImplTest, MarkPageForDeletion); | 130 FRIEND_TEST_ALL_PREFIXES(OfflinePageModelImplTest, MarkPageForDeletion); |
129 | 131 |
| 132 enum class GetAllPageMode { |
| 133 ALL, // Get all active page entries. |
| 134 ALL_WITH_EXPIRED, // Get all pages entries including expired ones. |
| 135 }; |
| 136 |
130 typedef ScopedVector<OfflinePageArchiver> PendingArchivers; | 137 typedef ScopedVector<OfflinePageArchiver> PendingArchivers; |
131 | 138 |
132 // Callback for ensuring archive directory is created. | 139 // Callback for ensuring archive directory is created. |
133 void OnEnsureArchivesDirCreatedDone(const base::TimeTicks& start_time); | 140 void OnEnsureArchivesDirCreatedDone(const base::TimeTicks& start_time); |
134 | 141 |
135 void GetAllPagesAfterLoadDone( | 142 void GetAllPagesAfterLoadDone( |
| 143 GetAllPageMode mode, |
136 const MultipleOfflinePageItemCallback& callback) const; | 144 const MultipleOfflinePageItemCallback& callback) const; |
137 void CheckPagesExistOfflineAfterLoadDone( | 145 void CheckPagesExistOfflineAfterLoadDone( |
138 const std::set<GURL>& urls, | 146 const std::set<GURL>& urls, |
139 const CheckPagesExistOfflineCallback& callback); | 147 const CheckPagesExistOfflineCallback& callback); |
140 void GetOfflineIdsForClientIdWhenLoadDone( | 148 void GetOfflineIdsForClientIdWhenLoadDone( |
141 const ClientId& client_id, | 149 const ClientId& client_id, |
142 const MultipleOfflineIdCallback& callback) const; | 150 const MultipleOfflineIdCallback& callback) const; |
143 void GetPageByOfflineIdWhenLoadDone( | 151 void GetPageByOfflineIdWhenLoadDone( |
144 int64_t offline_id, | 152 int64_t offline_id, |
145 const SingleOfflinePageItemCallback& callback) const; | 153 const SingleOfflinePageItemCallback& callback) const; |
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
292 OfflinePageModelEventLogger offline_event_logger_; | 300 OfflinePageModelEventLogger offline_event_logger_; |
293 | 301 |
294 base::WeakPtrFactory<OfflinePageModelImpl> weak_ptr_factory_; | 302 base::WeakPtrFactory<OfflinePageModelImpl> weak_ptr_factory_; |
295 | 303 |
296 DISALLOW_COPY_AND_ASSIGN(OfflinePageModelImpl); | 304 DISALLOW_COPY_AND_ASSIGN(OfflinePageModelImpl); |
297 }; | 305 }; |
298 | 306 |
299 } // namespace offline_pages | 307 } // namespace offline_pages |
300 | 308 |
301 #endif // COMPONENTS_OFFLINE_PAGES_OFFLINE_PAGE_MODEL_IMPL_H_ | 309 #endif // COMPONENTS_OFFLINE_PAGES_OFFLINE_PAGE_MODEL_IMPL_H_ |
OLD | NEW |