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_MODEL_IMPL_H_ | 5 #ifndef COMPONENTS_OFFLINE_PAGES_OFFLINE_PAGE_MODEL_IMPL_H_ |
6 #define COMPONENTS_OFFLINE_PAGES_OFFLINE_PAGE_MODEL_IMPL_H_ | 6 #define COMPONENTS_OFFLINE_PAGES_OFFLINE_PAGE_MODEL_IMPL_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <map> | 10 #include <map> |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
72 int64_t proposed_offline_id, | 72 int64_t proposed_offline_id, |
73 std::unique_ptr<OfflinePageArchiver> archiver, | 73 std::unique_ptr<OfflinePageArchiver> archiver, |
74 const SavePageCallback& callback) override; | 74 const SavePageCallback& callback) override; |
75 void MarkPageAccessed(int64_t offline_id) override; | 75 void MarkPageAccessed(int64_t offline_id) override; |
76 void ClearAll(const base::Closure& callback) override; | 76 void ClearAll(const base::Closure& callback) override; |
77 void DeletePagesByOfflineId(const std::vector<int64_t>& offline_ids, | 77 void DeletePagesByOfflineId(const std::vector<int64_t>& offline_ids, |
78 const DeletePageCallback& callback) override; | 78 const DeletePageCallback& callback) override; |
79 void DeleteCachedPagesByURLPredicate( | 79 void DeleteCachedPagesByURLPredicate( |
80 const UrlPredicate& predicate, | 80 const UrlPredicate& predicate, |
81 const DeletePageCallback& callback) override; | 81 const DeletePageCallback& callback) override; |
82 void HasPages(const std::string& name_space, | |
83 const HasPagesCallback& callback) override; | |
84 void CheckPagesExistOffline( | 82 void CheckPagesExistOffline( |
85 const std::set<GURL>& urls, | 83 const std::set<GURL>& urls, |
86 const CheckPagesExistOfflineCallback& callback) override; | 84 const CheckPagesExistOfflineCallback& callback) override; |
87 void GetAllPages(const MultipleOfflinePageItemCallback& callback) override; | 85 void GetAllPages(const MultipleOfflinePageItemCallback& callback) override; |
88 void GetAllPagesWithExpired( | 86 void GetAllPagesWithExpired( |
89 const MultipleOfflinePageItemCallback& callback) override; | 87 const MultipleOfflinePageItemCallback& callback) override; |
90 void GetOfflineIdsForClientId( | 88 void GetOfflineIdsForClientId( |
91 const ClientId& client_id, | 89 const ClientId& client_id, |
92 const MultipleOfflineIdCallback& callback) override; | 90 const MultipleOfflineIdCallback& callback) override; |
93 const std::vector<int64_t> MaybeGetOfflineIdsForClientId( | 91 const std::vector<int64_t> MaybeGetOfflineIdsForClientId( |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
155 const SingleOfflinePageItemCallback& callback) const; | 153 const SingleOfflinePageItemCallback& callback) const; |
156 void GetPagesByOnlineURLWhenLoadDone( | 154 void GetPagesByOnlineURLWhenLoadDone( |
157 const GURL& offline_url, | 155 const GURL& offline_url, |
158 const MultipleOfflinePageItemCallback& callback) const; | 156 const MultipleOfflinePageItemCallback& callback) const; |
159 void GetPageByOfflineURLWhenLoadDone( | 157 void GetPageByOfflineURLWhenLoadDone( |
160 const GURL& offline_url, | 158 const GURL& offline_url, |
161 const SingleOfflinePageItemCallback& callback) const; | 159 const SingleOfflinePageItemCallback& callback) const; |
162 void MarkPageAccessedWhenLoadDone(int64_t offline_id); | 160 void MarkPageAccessedWhenLoadDone(int64_t offline_id); |
163 void CheckMetadataConsistencyWhenLoadDone(); | 161 void CheckMetadataConsistencyWhenLoadDone(); |
164 | 162 |
165 // Callback for checking whether we have offline pages. | |
166 void HasPagesAfterLoadDone(const std::string& name_space, | |
167 const HasPagesCallback& callback) const; | |
168 | |
169 // Callback for loading pages from the offline page metadata store. | 163 // Callback for loading pages from the offline page metadata store. |
170 void OnLoadDone(const base::TimeTicks& start_time, | 164 void OnLoadDone(const base::TimeTicks& start_time, |
171 OfflinePageMetadataStore::LoadStatus load_status, | 165 OfflinePageMetadataStore::LoadStatus load_status, |
172 const std::vector<OfflinePageItem>& offline_pages); | 166 const std::vector<OfflinePageItem>& offline_pages); |
173 | 167 |
174 // Steps for saving a page offline. | 168 // Steps for saving a page offline. |
175 void OnCreateArchiveDone(const GURL& requested_url, | 169 void OnCreateArchiveDone(const GURL& requested_url, |
176 int64_t offline_id, | 170 int64_t offline_id, |
177 const ClientId& client_id, | 171 const ClientId& client_id, |
178 const base::Time& start_time, | 172 const base::Time& start_time, |
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
309 base::Clock* testing_clock_; | 303 base::Clock* testing_clock_; |
310 | 304 |
311 base::WeakPtrFactory<OfflinePageModelImpl> weak_ptr_factory_; | 305 base::WeakPtrFactory<OfflinePageModelImpl> weak_ptr_factory_; |
312 | 306 |
313 DISALLOW_COPY_AND_ASSIGN(OfflinePageModelImpl); | 307 DISALLOW_COPY_AND_ASSIGN(OfflinePageModelImpl); |
314 }; | 308 }; |
315 | 309 |
316 } // namespace offline_pages | 310 } // namespace offline_pages |
317 | 311 |
318 #endif // COMPONENTS_OFFLINE_PAGES_OFFLINE_PAGE_MODEL_IMPL_H_ | 312 #endif // COMPONENTS_OFFLINE_PAGES_OFFLINE_PAGE_MODEL_IMPL_H_ |
OLD | NEW |