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

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

Issue 2100663002: Fix a few bugs when closing mac notifications (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: add balnk lines Created 4 years, 6 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 | « chrome/browser/notifications/notification_platform_bridge_mac.mm ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/notifications/platform_notification_service_impl.cc
diff --git a/chrome/browser/notifications/platform_notification_service_impl.cc b/chrome/browser/notifications/platform_notification_service_impl.cc
index e8a668d30dfa1c77c4041830b5fcf9f3aca3ab3b..255ab55b9a4685b6283cd6235a07c0c94da2a17f 100644
--- a/chrome/browser/notifications/platform_notification_service_impl.cc
+++ b/chrome/browser/notifications/platform_notification_service_impl.cc
@@ -416,15 +416,14 @@ void PlatformNotificationServiceImpl::ClosePersistentNotification(
// generated by the caller of this method.
GetNotificationDisplayService(profile)->Close(
base::Int64ToString(persistent_notification_id));
+ } else {
+ auto iter = persistent_notifications_.find(persistent_notification_id);
+ if (iter == persistent_notifications_.end())
+ return;
+ GetNotificationDisplayService(profile)->Close(iter->second);
}
- auto iter = persistent_notifications_.find(persistent_notification_id);
- if (iter == persistent_notifications_.end())
- return;
-
- GetNotificationDisplayService(profile)->Close(iter->second);
-
- persistent_notifications_.erase(iter);
+ persistent_notifications_.erase(persistent_notification_id);
}
bool PlatformNotificationServiceImpl::GetDisplayedPersistentNotifications(
« no previous file with comments | « chrome/browser/notifications/notification_platform_bridge_mac.mm ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698