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 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
98 void GetPageByOfflineURL( | 98 void GetPageByOfflineURL( |
99 const GURL& offline_url, | 99 const GURL& offline_url, |
100 const SingleOfflinePageItemCallback& callback) override; | 100 const SingleOfflinePageItemCallback& callback) override; |
101 const OfflinePageItem* MaybeGetPageByOfflineURL( | 101 const OfflinePageItem* MaybeGetPageByOfflineURL( |
102 const GURL& offline_url) const override; | 102 const GURL& offline_url) const override; |
103 void GetPagesByOnlineURL( | 103 void GetPagesByOnlineURL( |
104 const GURL& online_url, | 104 const GURL& online_url, |
105 const MultipleOfflinePageItemCallback& callback) override; | 105 const MultipleOfflinePageItemCallback& callback) override; |
106 const OfflinePageItem* MaybeGetBestPageForOnlineURL( | 106 const OfflinePageItem* MaybeGetBestPageForOnlineURL( |
107 const GURL& online_url) const override; | 107 const GURL& online_url) const override; |
108 void CheckMetadataConsistency() override; | |
109 void ExpirePages(const std::vector<int64_t>& offline_ids, | 108 void ExpirePages(const std::vector<int64_t>& offline_ids, |
110 const base::Time& expiration_time, | 109 const base::Time& expiration_time, |
111 const base::Callback<void(bool)>& callback) override; | 110 const base::Callback<void(bool)>& callback) override; |
112 ClientPolicyController* GetPolicyController() override; | 111 ClientPolicyController* GetPolicyController() override; |
113 | 112 |
114 // Methods for testing only: | 113 // Methods for testing only: |
115 OfflinePageMetadataStore* GetStoreForTesting(); | 114 OfflinePageMetadataStore* GetStoreForTesting(); |
116 void set_testing_clock(base::Clock* clock) { testing_clock_ = clock; } | 115 void set_testing_clock(base::Clock* clock) { testing_clock_ = clock; } |
117 | 116 |
118 OfflinePageStorageManager* GetStorageManager(); | 117 OfflinePageStorageManager* GetStorageManager(); |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
151 void GetPageByOfflineIdWhenLoadDone( | 150 void GetPageByOfflineIdWhenLoadDone( |
152 int64_t offline_id, | 151 int64_t offline_id, |
153 const SingleOfflinePageItemCallback& callback) const; | 152 const SingleOfflinePageItemCallback& callback) const; |
154 void GetPagesByOnlineURLWhenLoadDone( | 153 void GetPagesByOnlineURLWhenLoadDone( |
155 const GURL& offline_url, | 154 const GURL& offline_url, |
156 const MultipleOfflinePageItemCallback& callback) const; | 155 const MultipleOfflinePageItemCallback& callback) const; |
157 void GetPageByOfflineURLWhenLoadDone( | 156 void GetPageByOfflineURLWhenLoadDone( |
158 const GURL& offline_url, | 157 const GURL& offline_url, |
159 const SingleOfflinePageItemCallback& callback) const; | 158 const SingleOfflinePageItemCallback& callback) const; |
160 void MarkPageAccessedWhenLoadDone(int64_t offline_id); | 159 void MarkPageAccessedWhenLoadDone(int64_t offline_id); |
161 void CheckMetadataConsistencyWhenLoadDone(); | 160 |
| 161 void CheckMetadataConsistency(); |
162 | 162 |
163 // Callback for loading pages from the offline page metadata store. | 163 // Callback for loading pages from the offline page metadata store. |
164 void OnLoadDone(const base::TimeTicks& start_time, | 164 void OnLoadDone(const base::TimeTicks& start_time, |
165 OfflinePageMetadataStore::LoadStatus load_status, | 165 OfflinePageMetadataStore::LoadStatus load_status, |
166 const std::vector<OfflinePageItem>& offline_pages); | 166 const std::vector<OfflinePageItem>& offline_pages); |
167 | 167 |
168 // Steps for saving a page offline. | 168 // Steps for saving a page offline. |
169 void OnCreateArchiveDone(const GURL& requested_url, | 169 void OnCreateArchiveDone(const GURL& requested_url, |
170 int64_t offline_id, | 170 int64_t offline_id, |
171 const ClientId& client_id, | 171 const ClientId& client_id, |
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
302 base::Clock* testing_clock_; | 302 base::Clock* testing_clock_; |
303 | 303 |
304 base::WeakPtrFactory<OfflinePageModelImpl> weak_ptr_factory_; | 304 base::WeakPtrFactory<OfflinePageModelImpl> weak_ptr_factory_; |
305 | 305 |
306 DISALLOW_COPY_AND_ASSIGN(OfflinePageModelImpl); | 306 DISALLOW_COPY_AND_ASSIGN(OfflinePageModelImpl); |
307 }; | 307 }; |
308 | 308 |
309 } // namespace offline_pages | 309 } // namespace offline_pages |
310 | 310 |
311 #endif // COMPONENTS_OFFLINE_PAGES_OFFLINE_PAGE_MODEL_IMPL_H_ | 311 #endif // COMPONENTS_OFFLINE_PAGES_OFFLINE_PAGE_MODEL_IMPL_H_ |
OLD | NEW |