| 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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 void RemoveOfflinePages(const std::vector<int64_t>& offline_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 offline_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 // Clear all pages in the store. |
| 53 void ClearAllPages(); |
| 54 |
| 52 const OfflinePageItem& last_saved_page() const { return last_saved_page_; } | 55 const OfflinePageItem& last_saved_page() const { return last_saved_page_; } |
| 53 | 56 |
| 54 void set_test_scenario(TestScenario scenario) { scenario_ = scenario; }; | 57 void set_test_scenario(TestScenario scenario) { scenario_ = scenario; }; |
| 55 | 58 |
| 56 private: | 59 private: |
| 57 OfflinePageItem last_saved_page_; | 60 OfflinePageItem last_saved_page_; |
| 58 scoped_refptr<base::SingleThreadTaskRunner> task_runner_; | 61 scoped_refptr<base::SingleThreadTaskRunner> task_runner_; |
| 59 TestScenario scenario_; | 62 TestScenario scenario_; |
| 60 | 63 |
| 61 std::map<int64_t, OfflinePageItem> offline_pages_; | 64 std::map<int64_t, OfflinePageItem> offline_pages_; |
| 62 | 65 |
| 63 DISALLOW_ASSIGN(OfflinePageTestStore); | 66 DISALLOW_ASSIGN(OfflinePageTestStore); |
| 64 }; | 67 }; |
| 65 | 68 |
| 66 } // namespace offline_pages | 69 } // namespace offline_pages |
| 67 | 70 |
| 68 #endif // COMPONENTS_OFFLINE_PAGES_OFFLINE_PAGE_TEST_STORE_H_ | 71 #endif // COMPONENTS_OFFLINE_PAGES_OFFLINE_PAGE_TEST_STORE_H_ |
| OLD | NEW |