Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(342)

Side by Side Diff: components/offline_pages/offline_page_model_impl.h

Issue 2225213002: Make GetBestPageForOnlineURL async (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address feedback Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
94 const OfflinePageItem* MaybeGetPageByOfflineId( 94 const OfflinePageItem* MaybeGetPageByOfflineId(
95 int64_t offline_id) const override; 95 int64_t offline_id) const override;
96 void GetPageByOfflineURL( 96 void GetPageByOfflineURL(
97 const GURL& offline_url, 97 const GURL& offline_url,
98 const SingleOfflinePageItemCallback& callback) override; 98 const SingleOfflinePageItemCallback& callback) override;
99 const OfflinePageItem* MaybeGetPageByOfflineURL( 99 const OfflinePageItem* MaybeGetPageByOfflineURL(
100 const GURL& offline_url) const override; 100 const GURL& offline_url) const override;
101 void GetPagesByOnlineURL( 101 void GetPagesByOnlineURL(
102 const GURL& online_url, 102 const GURL& online_url,
103 const MultipleOfflinePageItemCallback& callback) override; 103 const MultipleOfflinePageItemCallback& callback) override;
104 void GetBestPageForOnlineURL(
105 const GURL& online_url,
106 const SingleOfflinePageItemCallback callback) override;
107 const OfflinePageItem* MaybeGetBestPageForOnlineURL( 104 const OfflinePageItem* MaybeGetBestPageForOnlineURL(
108 const GURL& online_url) const override; 105 const GURL& online_url) const override;
109 void CheckMetadataConsistency() override; 106 void CheckMetadataConsistency() override;
110 void ExpirePages(const std::vector<int64_t>& offline_ids, 107 void ExpirePages(const std::vector<int64_t>& offline_ids,
111 const base::Time& expiration_time, 108 const base::Time& expiration_time,
112 const base::Callback<void(bool)>& callback) override; 109 const base::Callback<void(bool)>& callback) override;
113 ClientPolicyController* GetPolicyController() override; 110 ClientPolicyController* GetPolicyController() override;
114 111
115 // Methods for testing only: 112 // Methods for testing only:
116 OfflinePageMetadataStore* GetStoreForTesting(); 113 OfflinePageMetadataStore* GetStoreForTesting();
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
150 const MultipleOfflineIdCallback& callback) const; 147 const MultipleOfflineIdCallback& callback) const;
151 void GetPageByOfflineIdWhenLoadDone( 148 void GetPageByOfflineIdWhenLoadDone(
152 int64_t offline_id, 149 int64_t offline_id,
153 const SingleOfflinePageItemCallback& callback) const; 150 const SingleOfflinePageItemCallback& callback) const;
154 void GetPagesByOnlineURLWhenLoadDone( 151 void GetPagesByOnlineURLWhenLoadDone(
155 const GURL& offline_url, 152 const GURL& offline_url,
156 const MultipleOfflinePageItemCallback& callback) const; 153 const MultipleOfflinePageItemCallback& callback) const;
157 void GetPageByOfflineURLWhenLoadDone( 154 void GetPageByOfflineURLWhenLoadDone(
158 const GURL& offline_url, 155 const GURL& offline_url,
159 const SingleOfflinePageItemCallback& callback) const; 156 const SingleOfflinePageItemCallback& callback) const;
160 void GetBestPageForOnlineURLWhenLoadDone(
161 const GURL& online_url,
162 const SingleOfflinePageItemCallback& callback) const;
163 void MarkPageAccessedWhenLoadDone(int64_t offline_id); 157 void MarkPageAccessedWhenLoadDone(int64_t offline_id);
164 void CheckMetadataConsistencyWhenLoadDone(); 158 void CheckMetadataConsistencyWhenLoadDone();
165 159
166 // Callback for checking whether we have offline pages. 160 // Callback for checking whether we have offline pages.
167 void HasPagesAfterLoadDone(const std::string& name_space, 161 void HasPagesAfterLoadDone(const std::string& name_space,
168 const HasPagesCallback& callback) const; 162 const HasPagesCallback& callback) const;
169 163
170 // Callback for loading pages from the offline page metadata store. 164 // Callback for loading pages from the offline page metadata store.
171 void OnLoadDone(const base::TimeTicks& start_time, 165 void OnLoadDone(const base::TimeTicks& start_time,
172 OfflinePageMetadataStore::LoadStatus load_status, 166 OfflinePageMetadataStore::LoadStatus load_status,
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
300 OfflinePageModelEventLogger offline_event_logger_; 294 OfflinePageModelEventLogger offline_event_logger_;
301 295
302 base::WeakPtrFactory<OfflinePageModelImpl> weak_ptr_factory_; 296 base::WeakPtrFactory<OfflinePageModelImpl> weak_ptr_factory_;
303 297
304 DISALLOW_COPY_AND_ASSIGN(OfflinePageModelImpl); 298 DISALLOW_COPY_AND_ASSIGN(OfflinePageModelImpl);
305 }; 299 };
306 300
307 } // namespace offline_pages 301 } // namespace offline_pages
308 302
309 #endif // COMPONENTS_OFFLINE_PAGES_OFFLINE_PAGE_MODEL_IMPL_H_ 303 #endif // COMPONENTS_OFFLINE_PAGES_OFFLINE_PAGE_MODEL_IMPL_H_
OLDNEW
« no previous file with comments | « components/offline_pages/offline_page_model.h ('k') | components/offline_pages/offline_page_model_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698