| 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_STORAGE_MANAGER_H_ | 5 #ifndef COMPONENTS_OFFLINE_PAGES_OFFLINE_PAGE_STORAGE_MANAGER_H_ |
| 6 #define COMPONENTS_OFFLINE_PAGES_OFFLINE_PAGE_STORAGE_MANAGER_H_ | 6 #define COMPONENTS_OFFLINE_PAGES_OFFLINE_PAGE_STORAGE_MANAGER_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 18 matching lines...) Expand all Loading... |
| 29 // guaranteed to clear the pages immediately. | 29 // guaranteed to clear the pages immediately. |
| 30 // | 30 // |
| 31 // OfflinePageModel should own and control the lifecycle of this manager. | 31 // OfflinePageModel should own and control the lifecycle of this manager. |
| 32 // And this manager would use OfflinePageModel to get/remove pages. | 32 // And this manager would use OfflinePageModel to get/remove pages. |
| 33 class OfflinePageStorageManager { | 33 class OfflinePageStorageManager { |
| 34 public: | 34 public: |
| 35 // This interface should have no knowledge of offline page model. | 35 // This interface should have no knowledge of offline page model. |
| 36 // This interface should be implemented by clients managed by storage manager. | 36 // This interface should be implemented by clients managed by storage manager. |
| 37 class Client { | 37 class Client { |
| 38 public: | 38 public: |
| 39 virtual ~Client() {} |
| 40 |
| 39 // Asks the client to get all offline pages and invoke |callback|. | 41 // Asks the client to get all offline pages and invoke |callback|. |
| 40 virtual void GetAllPages( | 42 virtual void GetAllPages( |
| 41 const MultipleOfflinePageItemCallback& callback) = 0; | 43 const MultipleOfflinePageItemCallback& callback) = 0; |
| 42 | 44 |
| 43 // Asks the client to delete pages based on |offline_ids| and invoke | 45 // Asks the client to delete pages based on |offline_ids| and invoke |
| 44 // |callback|. | 46 // |callback|. |
| 45 virtual void DeletePagesByOfflineId(const std::vector<int64_t>& offline_ids, | 47 virtual void DeletePagesByOfflineId(const std::vector<int64_t>& offline_ids, |
| 46 const DeletePageCallback& callback) = 0; | 48 const DeletePageCallback& callback) = 0; |
| 47 }; | 49 }; |
| 48 | 50 |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 96 std::unique_ptr<base::Clock> clock_; | 98 std::unique_ptr<base::Clock> clock_; |
| 97 | 99 |
| 98 base::WeakPtrFactory<OfflinePageStorageManager> weak_ptr_factory_; | 100 base::WeakPtrFactory<OfflinePageStorageManager> weak_ptr_factory_; |
| 99 | 101 |
| 100 DISALLOW_COPY_AND_ASSIGN(OfflinePageStorageManager); | 102 DISALLOW_COPY_AND_ASSIGN(OfflinePageStorageManager); |
| 101 }; | 103 }; |
| 102 | 104 |
| 103 } // namespace offline_pages | 105 } // namespace offline_pages |
| 104 | 106 |
| 105 #endif // COMPONENTS_OFFLINE_PAGES_OFFLINE_PAGE_STORAGE_MANAGER_H_ | 107 #endif // COMPONENTS_OFFLINE_PAGES_OFFLINE_PAGE_STORAGE_MANAGER_H_ |
| OLD | NEW |