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

Unified Diff: components/offline_pages/offline_page_model.cc

Issue 1460413002: [Offline pages] Properly informing observers when offline page is deleted (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 1 month 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 | « no previous file | components/offline_pages/offline_page_model_unittest.cc » ('j') | 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 7b0922eb5c8272de21ff62e74309f2e0500b5d7a..3ea2d6ef8e183a03edbee896cd2aeb7182948e76 100644
--- a/components/offline_pages/offline_page_model.cc
+++ b/components/offline_pages/offline_page_model.cc
@@ -569,6 +569,12 @@ void OfflinePageModel::OnRemoveOfflinePagesDone(
"OfflinePages.DeletePage.PageSize", iter->second.file_size / 1024);
UMA_HISTOGRAM_COUNTS(
"OfflinePages.DeletePage.AccessCount", iter->second.access_count);
+ // If the page is not marked for deletion at this point, the model has not
+ // yet informed the observer that the offline page is deleted.
+ if (!iter->second.IsMarkedForDeletion()) {
+ FOR_EACH_OBSERVER(Observer, observers_,
+ OfflinePageDeleted(iter->second.bookmark_id));
+ }
offline_pages_.erase(iter);
}
if (bookmark_ids.size() > 1) {
« no previous file with comments | « no previous file | components/offline_pages/offline_page_model_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698