Chromium Code Reviews| 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_) { |