| 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 21 matching lines...) Expand all Loading... |
| 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 Load(const LoadCallback& callback) override; | 39 void Load(const LoadCallback& callback) override; |
| 40 void AddOrUpdateOfflinePage(const OfflinePageItem& offline_page, | 40 void AddOrUpdateOfflinePage(const OfflinePageItem& offline_page, |
| 41 const UpdateCallback& callback) override; | 41 const UpdateCallback& callback) override; |
| 42 void RemoveOfflinePages(const std::vector<int64_t>& bookmark_ids, | 42 void RemoveOfflinePages(const std::vector<int64_t>& offline_ids, |
| 43 const UpdateCallback& callback) override; | 43 const UpdateCallback& callback) override; |
| 44 void Reset(const ResetCallback& callback) override; | 44 void Reset(const ResetCallback& callback) override; |
| 45 | 45 |
| 46 void UpdateLastAccessTime(int64_t bookmark_id, | 46 void UpdateLastAccessTime(int64_t offline_id, |
| 47 const base::Time& last_access_time); | 47 const base::Time& last_access_time); |
| 48 | 48 |
| 49 // Returns all pages, regardless their states. | 49 // Returns all pages, regardless their states. |
| 50 std::vector<OfflinePageItem> GetAllPages() const; | 50 std::vector<OfflinePageItem> GetAllPages() const; |
| 51 | 51 |
| 52 const OfflinePageItem& last_saved_page() const { return last_saved_page_; } | 52 const OfflinePageItem& last_saved_page() const { return last_saved_page_; } |
| 53 | 53 |
| 54 void set_test_scenario(TestScenario scenario) { scenario_ = scenario; }; | 54 void set_test_scenario(TestScenario scenario) { scenario_ = scenario; }; |
| 55 | 55 |
| 56 private: | 56 private: |
| 57 OfflinePageItem last_saved_page_; | 57 OfflinePageItem last_saved_page_; |
| 58 scoped_refptr<base::SingleThreadTaskRunner> task_runner_; | 58 scoped_refptr<base::SingleThreadTaskRunner> task_runner_; |
| 59 TestScenario scenario_; | 59 TestScenario scenario_; |
| 60 | 60 |
| 61 std::map<int64_t, OfflinePageItem> offline_pages_; | 61 std::map<int64_t, OfflinePageItem> offline_pages_; |
| 62 | 62 |
| 63 DISALLOW_ASSIGN(OfflinePageTestStore); | 63 DISALLOW_ASSIGN(OfflinePageTestStore); |
| 64 }; | 64 }; |
| 65 | 65 |
| 66 } // namespace offline_pages | 66 } // namespace offline_pages |
| 67 | 67 |
| 68 #endif // COMPONENTS_OFFLINE_PAGES_OFFLINE_PAGE_TEST_STORE_H_ | 68 #endif // COMPONENTS_OFFLINE_PAGES_OFFLINE_PAGE_TEST_STORE_H_ |
| OLD | NEW |