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

Unified Diff: chrome/browser/notifications/message_center_notification_manager.cc

Issue 2118473002: 😴 Skip some KeepAlive registrations on shutdown. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: address comments Created 4 years, 5 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: chrome/browser/notifications/message_center_notification_manager.cc
diff --git a/chrome/browser/notifications/message_center_notification_manager.cc b/chrome/browser/notifications/message_center_notification_manager.cc
index 7b991f039890df7414e93dc747987769897d9d13..b032ec2ee8639f90e1f1edf1db2922e3d6bb84eb 100644
--- a/chrome/browser/notifications/message_center_notification_manager.cc
+++ b/chrome/browser/notifications/message_center_notification_manager.cc
@@ -145,10 +145,12 @@ bool MessageCenterNotificationManager::Update(const Notification& notification,
// Add/remove notification in the local list but just update the same
// one in MessageCenter.
- delete old_notification;
- profile_notifications_.erase(old_id);
ProfileNotification* new_notification =
new ProfileNotification(profile, notification);
+ // Delete the old one after the new one is created to ensure we don't run
+ // out of KeepAlives.
+ delete old_notification;
+ profile_notifications_.erase(old_id);
profile_notifications_[new_notification->notification().id()] =
new_notification;
« no previous file with comments | « chrome/browser/lifetime/scoped_keep_alive.h ('k') | chrome/browser/push_messaging/push_messaging_service_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698