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

Unified Diff: components/offline_pages/offline_page_model.cc

Issue 1921563005: [Offline Pages] Remove obsolete synchronous API methods. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add todo Created 4 years, 8 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
« no previous file with comments | « components/offline_pages/offline_page_model.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/offline_pages/offline_page_model.cc
diff --git a/components/offline_pages/offline_page_model.cc b/components/offline_pages/offline_page_model.cc
index 702aa097e63e7ef13a5e60339c727f149debf4ed..f7260a6c06f5cd65e64751624572d947dceacd87 100644
--- a/components/offline_pages/offline_page_model.cc
+++ b/components/offline_pages/offline_page_model.cc
@@ -280,19 +280,18 @@ void OfflinePageModel::HasPages(const std::string& name_space,
void OfflinePageModel::HasPagesAfterLoadDone(
const std::string& name_space,
const HasPagesCallback& callback) const {
- callback.Run(MaybeHasPages(name_space));
-}
+ DCHECK(is_loaded_);
-bool OfflinePageModel::MaybeHasPages(const std::string& name_space) const {
- if (!is_loaded_)
- return false;
+ bool has_pages = false;
for (const auto& id_page_pair : offline_pages_) {
- if (id_page_pair.second.client_id.name_space == name_space)
- return true;
+ if (id_page_pair.second.client_id.name_space == name_space) {
+ has_pages = true;
+ break;
+ }
}
- return false;
+ callback.Run(has_pages);
}
void OfflinePageModel::GetAllPages(const GetAllPagesCallback& callback) {
« no previous file with comments | « components/offline_pages/offline_page_model.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698