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

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

Issue 2503853004: Support getting offline pages also by original URL (Closed)
Patch Set: Make NTP redirect work per comment Created 4 years, 1 month 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 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
91 const CheckPagesExistOfflineCallback& callback) override; 91 const CheckPagesExistOfflineCallback& callback) override;
92 void GetAllPages(const MultipleOfflinePageItemCallback& callback) override; 92 void GetAllPages(const MultipleOfflinePageItemCallback& callback) override;
93 void GetAllPagesWithExpired( 93 void GetAllPagesWithExpired(
94 const MultipleOfflinePageItemCallback& callback) override; 94 const MultipleOfflinePageItemCallback& callback) override;
95 void GetOfflineIdsForClientId( 95 void GetOfflineIdsForClientId(
96 const ClientId& client_id, 96 const ClientId& client_id,
97 const MultipleOfflineIdCallback& callback) override; 97 const MultipleOfflineIdCallback& callback) override;
98 void GetPageByOfflineId( 98 void GetPageByOfflineId(
99 int64_t offline_id, 99 int64_t offline_id,
100 const SingleOfflinePageItemCallback& callback) override; 100 const SingleOfflinePageItemCallback& callback) override;
101 void GetPagesByOnlineURL( 101 void GetPagesByURL(
102 const GURL& online_url, 102 const GURL& url,
103 URLSearchMode url_search_mode,
103 const MultipleOfflinePageItemCallback& callback) override; 104 const MultipleOfflinePageItemCallback& callback) override;
104 void ExpirePages(const std::vector<int64_t>& offline_ids, 105 void ExpirePages(const std::vector<int64_t>& offline_ids,
105 const base::Time& expiration_time, 106 const base::Time& expiration_time,
106 const base::Callback<void(bool)>& callback) override; 107 const base::Callback<void(bool)>& callback) override;
107 ClientPolicyController* GetPolicyController() override; 108 ClientPolicyController* GetPolicyController() override;
108 109
109 // Methods for testing only: 110 // Methods for testing only:
110 OfflinePageMetadataStore* GetStoreForTesting(); 111 OfflinePageMetadataStore* GetStoreForTesting();
111 void set_testing_clock(base::Clock* clock) { testing_clock_ = clock; } 112 void set_testing_clock(base::Clock* clock) { testing_clock_ = clock; }
112 113
(...skipping 20 matching lines...) Expand all
133 const std::set<GURL>& urls, 134 const std::set<GURL>& urls,
134 const CheckPagesExistOfflineCallback& callback); 135 const CheckPagesExistOfflineCallback& callback);
135 void GetOfflineIdsForClientIdWhenLoadDone( 136 void GetOfflineIdsForClientIdWhenLoadDone(
136 const ClientId& client_id, 137 const ClientId& client_id,
137 const MultipleOfflineIdCallback& callback) const; 138 const MultipleOfflineIdCallback& callback) const;
138 void GetPageByOfflineIdWhenLoadDone( 139 void GetPageByOfflineIdWhenLoadDone(
139 int64_t offline_id, 140 int64_t offline_id,
140 const SingleOfflinePageItemCallback& callback) const; 141 const SingleOfflinePageItemCallback& callback) const;
141 const std::vector<int64_t> MaybeGetOfflineIdsForClientId( 142 const std::vector<int64_t> MaybeGetOfflineIdsForClientId(
142 const ClientId& client_id) const; 143 const ClientId& client_id) const;
143 void GetPagesByOnlineURLWhenLoadDone( 144 void GetPagesByURLWhenLoadDone(
144 const GURL& online_url, 145 const GURL& url,
146 URLSearchMode url_search_mode,
145 const MultipleOfflinePageItemCallback& callback) const; 147 const MultipleOfflinePageItemCallback& callback) const;
146 void MarkPageAccessedWhenLoadDone(int64_t offline_id); 148 void MarkPageAccessedWhenLoadDone(int64_t offline_id);
147 149
148 void CheckMetadataConsistency(); 150 void CheckMetadataConsistency();
149 151
150 // Callback for loading pages from the offline page metadata store. 152 // Callback for loading pages from the offline page metadata store.
151 void OnLoadDone(const base::TimeTicks& start_time, 153 void OnLoadDone(const base::TimeTicks& start_time,
152 OfflinePageMetadataStore::LoadStatus load_status, 154 OfflinePageMetadataStore::LoadStatus load_status,
153 const std::vector<OfflinePageItem>& offline_pages); 155 const std::vector<OfflinePageItem>& offline_pages);
154 156
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after
286 base::Clock* testing_clock_; 288 base::Clock* testing_clock_;
287 289
288 base::WeakPtrFactory<OfflinePageModelImpl> weak_ptr_factory_; 290 base::WeakPtrFactory<OfflinePageModelImpl> weak_ptr_factory_;
289 291
290 DISALLOW_COPY_AND_ASSIGN(OfflinePageModelImpl); 292 DISALLOW_COPY_AND_ASSIGN(OfflinePageModelImpl);
291 }; 293 };
292 294
293 } // namespace offline_pages 295 } // namespace offline_pages
294 296
295 #endif // COMPONENTS_OFFLINE_PAGES_OFFLINE_PAGE_MODEL_IMPL_H_ 297 #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