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

Unified Diff: components/offline_pages/offline_page_model_impl.cc

Issue 2284933002: Remove OfflineURL from offline page (Closed)
Patch Set: Fix trybot 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 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 806d4f0c7f803b5948766ff896c99496a2a843de..9b747dff6762aa4cd2afbfb1fec4ccba0bd88851 100644
--- a/components/offline_pages/offline_page_model_impl.cc
+++ b/components/offline_pages/offline_page_model_impl.cc
@@ -533,44 +533,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) {

Powered by Google App Engine
This is Rietveld 408576698