Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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_H_ | 5 #ifndef COMPONENTS_OFFLINE_PAGES_OFFLINE_PAGE_MODEL_H_ |
| 6 #define COMPONENTS_OFFLINE_PAGES_OFFLINE_PAGE_MODEL_H_ | 6 #define COMPONENTS_OFFLINE_PAGES_OFFLINE_PAGE_MODEL_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <map> | 10 #include <map> |
| (...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 169 const DeletePageCallback& callback); | 169 const DeletePageCallback& callback); |
| 170 | 170 |
| 171 // Marks pages for deletion. Actual delete is asynchronous. | 171 // Marks pages for deletion. Actual delete is asynchronous. |
| 172 // Works even if the model isn't loaded. | 172 // Works even if the model isn't loaded. |
| 173 void MarkPagesForDeletion(const std::vector<int64_t>& offline_ids, | 173 void MarkPagesForDeletion(const std::vector<int64_t>& offline_ids, |
| 174 const DeletePageCallback& callback); | 174 const DeletePageCallback& callback); |
| 175 | 175 |
| 176 // Wipes out all the data by deleting all saved files and clearing the store. | 176 // Wipes out all the data by deleting all saved files and clearing the store. |
| 177 void ClearAll(const base::Closure& callback); | 177 void ClearAll(const base::Closure& callback); |
| 178 | 178 |
| 179 // Wipes out data flagged by the predicate by deleting all saved files and | |
| 180 // clearing the store. | |
|
fgorski
2016/04/07 17:02:49
Deletes offline pages matching the URL predicate.
dmurph
2016/04/08 23:33:45
Done.
| |
| 181 void ClearWithURLPredicate(const base::Callback<bool(const GURL&)> predicate, | |
|
fgorski
2016/04/07 17:02:49
Rename: DeletePagesByURLPredicate
Add tests as we
dmurph
2016/04/08 23:33:45
Done.
| |
| 182 const base::Closure& callback); | |
| 183 | |
| 179 // Returns true if there're offline pages. | 184 // Returns true if there're offline pages. |
| 180 bool HasOfflinePages() const; | 185 bool HasOfflinePages() const; |
| 181 | 186 |
| 182 // Gets all available offline pages. Requires that the model is loaded. | 187 // Gets all available offline pages. Requires that the model is loaded. |
| 183 const std::vector<OfflinePageItem> GetAllPages() const; | 188 const std::vector<OfflinePageItem> GetAllPages() const; |
| 184 | 189 |
| 185 // Gets pages that should be removed to clean up storage. Requires that the | 190 // Gets pages that should be removed to clean up storage. Requires that the |
| 186 // model is loaded. | 191 // model is loaded. |
| 187 const std::vector<OfflinePageItem> GetPagesToCleanUp() const; | 192 const std::vector<OfflinePageItem> GetPagesToCleanUp() const; |
| 188 | 193 |
| (...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 330 std::vector<base::Closure> delayed_tasks_; | 335 std::vector<base::Closure> delayed_tasks_; |
| 331 | 336 |
| 332 base::WeakPtrFactory<OfflinePageModel> weak_ptr_factory_; | 337 base::WeakPtrFactory<OfflinePageModel> weak_ptr_factory_; |
| 333 | 338 |
| 334 DISALLOW_COPY_AND_ASSIGN(OfflinePageModel); | 339 DISALLOW_COPY_AND_ASSIGN(OfflinePageModel); |
| 335 }; | 340 }; |
| 336 | 341 |
| 337 } // namespace offline_pages | 342 } // namespace offline_pages |
| 338 | 343 |
| 339 #endif // COMPONENTS_OFFLINE_PAGES_OFFLINE_PAGE_MODEL_H_ | 344 #endif // COMPONENTS_OFFLINE_PAGES_OFFLINE_PAGE_MODEL_H_ |
| OLD | NEW |