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_TEST_STORE_H_ | 5 #ifndef COMPONENTS_OFFLINE_PAGES_OFFLINE_PAGE_TEST_STORE_H_ |
6 #define COMPONENTS_OFFLINE_PAGES_OFFLINE_PAGE_TEST_STORE_H_ | 6 #define COMPONENTS_OFFLINE_PAGES_OFFLINE_PAGE_TEST_STORE_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <map> | 10 #include <map> |
(...skipping 19 matching lines...) Expand all Loading... |
30 REMOVE_FAILED, | 30 REMOVE_FAILED, |
31 }; | 31 }; |
32 | 32 |
33 explicit OfflinePageTestStore( | 33 explicit OfflinePageTestStore( |
34 const scoped_refptr<base::SingleThreadTaskRunner>& task_runner); | 34 const scoped_refptr<base::SingleThreadTaskRunner>& task_runner); |
35 explicit OfflinePageTestStore(const OfflinePageTestStore& other_store); | 35 explicit OfflinePageTestStore(const OfflinePageTestStore& other_store); |
36 ~OfflinePageTestStore() override; | 36 ~OfflinePageTestStore() override; |
37 | 37 |
38 // OfflinePageMetadataStore overrides: | 38 // OfflinePageMetadataStore overrides: |
39 void GetOfflinePages(const LoadCallback& callback) override; | 39 void GetOfflinePages(const LoadCallback& callback) override; |
40 void AddOrUpdateOfflinePage(const OfflinePageItem& offline_page, | 40 void AddOfflinePage(const OfflinePageItem& offline_page, |
41 const UpdateCallback& callback) override; | 41 const AddCallback& callback) override; |
| 42 void UpdateOfflinePages(const std::vector<OfflinePageItem>& pages, |
| 43 const UpdateCallback& callback) override; |
42 void RemoveOfflinePages(const std::vector<int64_t>& offline_ids, | 44 void RemoveOfflinePages(const std::vector<int64_t>& offline_ids, |
43 const UpdateCallback& callback) override; | 45 const UpdateCallback& callback) override; |
44 void Reset(const ResetCallback& callback) override; | 46 void Reset(const ResetCallback& callback) override; |
45 StoreState state() const override; | 47 StoreState state() const override; |
46 | 48 |
47 void UpdateLastAccessTime(int64_t offline_id, | 49 void UpdateLastAccessTime(int64_t offline_id, |
48 const base::Time& last_access_time); | 50 const base::Time& last_access_time); |
49 | 51 |
50 // Returns all pages, regardless their states. | 52 // Returns all pages, regardless their states. |
51 std::vector<OfflinePageItem> GetAllPages() const; | 53 std::vector<OfflinePageItem> GetAllPages() const; |
(...skipping 11 matching lines...) Expand all Loading... |
63 TestScenario scenario_; | 65 TestScenario scenario_; |
64 | 66 |
65 std::map<int64_t, OfflinePageItem> offline_pages_; | 67 std::map<int64_t, OfflinePageItem> offline_pages_; |
66 | 68 |
67 DISALLOW_ASSIGN(OfflinePageTestStore); | 69 DISALLOW_ASSIGN(OfflinePageTestStore); |
68 }; | 70 }; |
69 | 71 |
70 } // namespace offline_pages | 72 } // namespace offline_pages |
71 | 73 |
72 #endif // COMPONENTS_OFFLINE_PAGES_OFFLINE_PAGE_TEST_STORE_H_ | 74 #endif // COMPONENTS_OFFLINE_PAGES_OFFLINE_PAGE_TEST_STORE_H_ |
OLD | NEW |