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 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
179 const SavePageCallback& callback, | 179 const SavePageCallback& callback, |
180 OfflinePageArchiver* archiver, | 180 OfflinePageArchiver* archiver, |
181 OfflinePageArchiver::ArchiverResult result, | 181 OfflinePageArchiver::ArchiverResult result, |
182 const GURL& url, | 182 const GURL& url, |
183 const base::FilePath& file_path, | 183 const base::FilePath& file_path, |
184 const base::string16& title, | 184 const base::string16& title, |
185 int64_t file_size); | 185 int64_t file_size); |
186 void OnAddOfflinePageDone(OfflinePageArchiver* archiver, | 186 void OnAddOfflinePageDone(OfflinePageArchiver* archiver, |
187 const SavePageCallback& callback, | 187 const SavePageCallback& callback, |
188 const OfflinePageItem& offline_page, | 188 const OfflinePageItem& offline_page, |
189 bool success); | 189 OfflinePageMetadataStore::ItemActionStatus status); |
190 void InformSavePageDone(const SavePageCallback& callback, | 190 void InformSavePageDone(const SavePageCallback& callback, |
191 SavePageResult result, | 191 SavePageResult result, |
192 const ClientId& client_id, | 192 const ClientId& client_id, |
193 int64_t offline_id); | 193 int64_t offline_id); |
194 void DeletePendingArchiver(OfflinePageArchiver* archiver); | 194 void DeletePendingArchiver(OfflinePageArchiver* archiver); |
195 | 195 |
196 // Steps for deleting files and data for an offline page. | 196 // Steps for deleting files and data for an offline page. |
197 void OnDeleteArchiveFilesDone(const std::vector<int64_t>& offline_ids, | 197 void OnDeleteArchiveFilesDone(const std::vector<int64_t>& offline_ids, |
198 const DeletePageCallback& callback, | 198 const DeletePageCallback& callback, |
199 bool success); | 199 bool success); |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
242 // Actually does the work of deleting, requires the model is loaded. | 242 // Actually does the work of deleting, requires the model is loaded. |
243 void DoDeletePagesByOfflineId(const std::vector<int64_t>& offline_ids, | 243 void DoDeletePagesByOfflineId(const std::vector<int64_t>& offline_ids, |
244 const DeletePageCallback& callback); | 244 const DeletePageCallback& callback); |
245 | 245 |
246 // Similar to DoDeletePagesByOfflineId, does actual work of deleting, and | 246 // Similar to DoDeletePagesByOfflineId, does actual work of deleting, and |
247 // requires that the model is loaded. | 247 // requires that the model is loaded. |
248 void DoDeleteCachedPagesByURLPredicate(const UrlPredicate& predicate, | 248 void DoDeleteCachedPagesByURLPredicate(const UrlPredicate& predicate, |
249 const DeletePageCallback& callback); | 249 const DeletePageCallback& callback); |
250 | 250 |
251 // Callback completing page expiration. | 251 // Callback completing page expiration. |
252 void OnExpirePageDone(int64_t offline_id, | 252 void OnExpirePageDone(const std::vector<OfflinePageItem>& expired_pages, |
253 const base::Time& expiration_time, | 253 const base::Time& expiration_time, |
254 bool success); | 254 bool success); |
255 | 255 |
256 // Clears expired pages if there are any. | 256 // Clears expired pages if there are any. |
257 void ClearStorageIfNeeded( | 257 void ClearStorageIfNeeded( |
258 const OfflinePageStorageManager::ClearStorageCallback& callback); | 258 const OfflinePageStorageManager::ClearStorageCallback& callback); |
259 | 259 |
260 // Callback completing storage clearing. | 260 // Callback completing storage clearing. |
261 void OnStorageCleared(size_t expired_page_count, | 261 void OnStorageCleared(size_t expired_page_count, |
262 OfflinePageStorageManager::ClearStorageResult result); | 262 OfflinePageStorageManager::ClearStorageResult result); |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
309 base::Clock* testing_clock_; | 309 base::Clock* testing_clock_; |
310 | 310 |
311 base::WeakPtrFactory<OfflinePageModelImpl> weak_ptr_factory_; | 311 base::WeakPtrFactory<OfflinePageModelImpl> weak_ptr_factory_; |
312 | 312 |
313 DISALLOW_COPY_AND_ASSIGN(OfflinePageModelImpl); | 313 DISALLOW_COPY_AND_ASSIGN(OfflinePageModelImpl); |
314 }; | 314 }; |
315 | 315 |
316 } // namespace offline_pages | 316 } // namespace offline_pages |
317 | 317 |
318 #endif // COMPONENTS_OFFLINE_PAGES_OFFLINE_PAGE_MODEL_IMPL_H_ | 318 #endif // COMPONENTS_OFFLINE_PAGES_OFFLINE_PAGE_MODEL_IMPL_H_ |
OLD | NEW |