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

Unified Diff: components/offline_pages/offline_page_model.cc

Issue 1764843003: Enable offline pages feature on trunk by default (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 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_feature.cc ('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 7f4b60c139732de21e127b328f02147cd22f4c43..bdb61e316fe1dbdeed5685480421d8e95d43d878 100644
--- a/components/offline_pages/offline_page_model.cc
+++ b/components/offline_pages/offline_page_model.cc
@@ -284,7 +284,12 @@ void OfflinePageModel::ClearAll(const base::Closure& callback) {
}
bool OfflinePageModel::HasOfflinePages() const {
- DCHECK(is_loaded_);
+ // Since offline pages feature is enabled by default,
+ // NetErrorTabHelper::SetHasOfflinePages might call this before the model is
+ // fully loaded. If so, just bail out since this is most likely due to tests.
Dmitry Titov 2016/03/04 01:33:10 lets change the comment as discussed.
jianli 2016/03/04 02:01:07 Done.
+ if (!is_loaded_)
+ return false;
+
// Check that at least one page is not marked for deletion. Because we have
// pages marked for deletion, we cannot simply invert result of |empty()|.
for (const auto& id_page_pair : offline_pages_) {
« no previous file with comments | « components/offline_pages/offline_page_feature.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698