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

Unified Diff: components/offline_pages/offline_page_model_impl.cc

Issue 2284933002: Remove OfflineURL from offline page (Closed)
Patch Set: Add comment per feedback Created 4 years, 2 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 side-by-side diff with in-line comments
Download patch
Index: components/offline_pages/offline_page_model_impl.cc
diff --git a/components/offline_pages/offline_page_model_impl.cc b/components/offline_pages/offline_page_model_impl.cc
index ce697958ec33545ca0a7f7cfafcfcdca441cddc1..09a681f4219b2b5326147ea038630ef6353d6082 100644
--- a/components/offline_pages/offline_page_model_impl.cc
+++ b/components/offline_pages/offline_page_model_impl.cc
@@ -557,44 +557,6 @@ const OfflinePageItem* OfflinePageModelImpl::MaybeGetPageByOfflineId(
: nullptr;
}
-void OfflinePageModelImpl::GetPageByOfflineURL(
- const GURL& offline_url,
- const SingleOfflinePageItemCallback& callback) {
- RunWhenLoaded(
- base::Bind(&OfflinePageModelImpl::GetPageByOfflineURLWhenLoadDone,
- weak_ptr_factory_.GetWeakPtr(), offline_url, callback));
-}
-
-void OfflinePageModelImpl::GetPageByOfflineURLWhenLoadDone(
- const GURL& offline_url,
- const SingleOfflinePageItemCallback& callback) const {
- // Getting pages by offline URL does not exclude expired pages, as the caller
- // already holds the offline URL and simply needs to look up a corresponding
- // online URL.
- const OfflinePageItem* result = nullptr;
-
- for (const auto& id_page_pair : offline_pages_) {
- if (id_page_pair.second.GetOfflineURL() == offline_url) {
- result = &id_page_pair.second;
- break;
- }
- }
-
- callback.Run(result);
-}
-
-const OfflinePageItem* OfflinePageModelImpl::MaybeGetPageByOfflineURL(
- const GURL& offline_url) const {
- // Getting pages by offline URL does not exclude expired pages, as the caller
- // already holds the offline URL and simply needs to look up a corresponding
- // online URL.
- for (const auto& id_page_pair : offline_pages_) {
- if (id_page_pair.second.GetOfflineURL() == offline_url)
- return &(id_page_pair.second);
- }
- return nullptr;
-}
-
void OfflinePageModelImpl::GetPagesByOnlineURL(
const GURL& online_url,
const MultipleOfflinePageItemCallback& callback) {
« no previous file with comments | « components/offline_pages/offline_page_model_impl.h ('k') | components/offline_pages/offline_page_model_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698