| 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 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 87 void GetOfflineIdsForClientId( | 87 void GetOfflineIdsForClientId( |
| 88 const ClientId& client_id, | 88 const ClientId& client_id, |
| 89 const MultipleOfflineIdCallback& callback) override; | 89 const MultipleOfflineIdCallback& callback) override; |
| 90 const std::vector<int64_t> MaybeGetOfflineIdsForClientId( | 90 const std::vector<int64_t> MaybeGetOfflineIdsForClientId( |
| 91 const ClientId& client_id) const override; | 91 const ClientId& client_id) const override; |
| 92 void GetPageByOfflineId( | 92 void GetPageByOfflineId( |
| 93 int64_t offline_id, | 93 int64_t offline_id, |
| 94 const SingleOfflinePageItemCallback& callback) override; | 94 const SingleOfflinePageItemCallback& callback) override; |
| 95 const OfflinePageItem* MaybeGetPageByOfflineId( | 95 const OfflinePageItem* MaybeGetPageByOfflineId( |
| 96 int64_t offline_id) const override; | 96 int64_t offline_id) const override; |
| 97 void GetPageByOfflineURL( | |
| 98 const GURL& offline_url, | |
| 99 const SingleOfflinePageItemCallback& callback) override; | |
| 100 const OfflinePageItem* MaybeGetPageByOfflineURL( | |
| 101 const GURL& offline_url) const override; | |
| 102 void GetPagesByOnlineURL( | 97 void GetPagesByOnlineURL( |
| 103 const GURL& online_url, | 98 const GURL& online_url, |
| 104 const MultipleOfflinePageItemCallback& callback) override; | 99 const MultipleOfflinePageItemCallback& callback) override; |
| 105 const OfflinePageItem* MaybeGetBestPageForOnlineURL( | 100 const OfflinePageItem* MaybeGetBestPageForOnlineURL( |
| 106 const GURL& online_url) const override; | 101 const GURL& online_url) const override; |
| 107 void ExpirePages(const std::vector<int64_t>& offline_ids, | 102 void ExpirePages(const std::vector<int64_t>& offline_ids, |
| 108 const base::Time& expiration_time, | 103 const base::Time& expiration_time, |
| 109 const base::Callback<void(bool)>& callback) override; | 104 const base::Callback<void(bool)>& callback) override; |
| 110 ClientPolicyController* GetPolicyController() override; | 105 ClientPolicyController* GetPolicyController() override; |
| 111 | 106 |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 143 void CheckPagesExistOfflineAfterLoadDone( | 138 void CheckPagesExistOfflineAfterLoadDone( |
| 144 const std::set<GURL>& urls, | 139 const std::set<GURL>& urls, |
| 145 const CheckPagesExistOfflineCallback& callback); | 140 const CheckPagesExistOfflineCallback& callback); |
| 146 void GetOfflineIdsForClientIdWhenLoadDone( | 141 void GetOfflineIdsForClientIdWhenLoadDone( |
| 147 const ClientId& client_id, | 142 const ClientId& client_id, |
| 148 const MultipleOfflineIdCallback& callback) const; | 143 const MultipleOfflineIdCallback& callback) const; |
| 149 void GetPageByOfflineIdWhenLoadDone( | 144 void GetPageByOfflineIdWhenLoadDone( |
| 150 int64_t offline_id, | 145 int64_t offline_id, |
| 151 const SingleOfflinePageItemCallback& callback) const; | 146 const SingleOfflinePageItemCallback& callback) const; |
| 152 void GetPagesByOnlineURLWhenLoadDone( | 147 void GetPagesByOnlineURLWhenLoadDone( |
| 153 const GURL& offline_url, | 148 const GURL& online_url, |
| 154 const MultipleOfflinePageItemCallback& callback) const; | 149 const MultipleOfflinePageItemCallback& callback) const; |
| 155 void GetPageByOfflineURLWhenLoadDone( | |
| 156 const GURL& offline_url, | |
| 157 const SingleOfflinePageItemCallback& callback) const; | |
| 158 void MarkPageAccessedWhenLoadDone(int64_t offline_id); | 150 void MarkPageAccessedWhenLoadDone(int64_t offline_id); |
| 159 | 151 |
| 160 void CheckMetadataConsistency(); | 152 void CheckMetadataConsistency(); |
| 161 | 153 |
| 162 // Callback for loading pages from the offline page metadata store. | 154 // Callback for loading pages from the offline page metadata store. |
| 163 void OnLoadDone(const base::TimeTicks& start_time, | 155 void OnLoadDone(const base::TimeTicks& start_time, |
| 164 OfflinePageMetadataStore::LoadStatus load_status, | 156 OfflinePageMetadataStore::LoadStatus load_status, |
| 165 const std::vector<OfflinePageItem>& offline_pages); | 157 const std::vector<OfflinePageItem>& offline_pages); |
| 166 | 158 |
| 167 // Steps for saving a page offline. | 159 // Steps for saving a page offline. |
| (...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 292 base::Clock* testing_clock_; | 284 base::Clock* testing_clock_; |
| 293 | 285 |
| 294 base::WeakPtrFactory<OfflinePageModelImpl> weak_ptr_factory_; | 286 base::WeakPtrFactory<OfflinePageModelImpl> weak_ptr_factory_; |
| 295 | 287 |
| 296 DISALLOW_COPY_AND_ASSIGN(OfflinePageModelImpl); | 288 DISALLOW_COPY_AND_ASSIGN(OfflinePageModelImpl); |
| 297 }; | 289 }; |
| 298 | 290 |
| 299 } // namespace offline_pages | 291 } // namespace offline_pages |
| 300 | 292 |
| 301 #endif // COMPONENTS_OFFLINE_PAGES_OFFLINE_PAGE_MODEL_IMPL_H_ | 293 #endif // COMPONENTS_OFFLINE_PAGES_OFFLINE_PAGE_MODEL_IMPL_H_ |
| OLD | NEW |