| Index: content/browser/notifications/notification_event_dispatcher_impl.cc
|
| diff --git a/content/browser/notifications/notification_event_dispatcher_impl.cc b/content/browser/notifications/notification_event_dispatcher_impl.cc
|
| index 47779cfe660c259a18820b5b7e469975679d9d59..843c77a8fadfaee7845968926503d508c7a828c1 100644
|
| --- a/content/browser/notifications/notification_event_dispatcher_impl.cc
|
| +++ b/content/browser/notifications/notification_event_dispatcher_impl.cc
|
| @@ -394,6 +394,15 @@ void NotificationEventDispatcherImpl::RegisterNonPersistentNotification(
|
| const std::string& notification_id,
|
| int renderer_id,
|
| int non_persistent_id) {
|
| + if (non_persistent_ids_.count(notification_id) &&
|
| + non_persistent_ids_[notification_id] != non_persistent_id) {
|
| + // Notify close for a previously displayed notification with the same id,
|
| + // this can happen when replacing a non-persistent notification with the
|
| + // same tag since from the JS point of view there will be two notification
|
| + // objects and the old one needs to receive the close event.
|
| + DCHECK(renderer_ids_[notification_id] == renderer_id);
|
| + DispatchNonPersistentCloseEvent(notification_id);
|
| + }
|
| renderer_ids_[notification_id] = renderer_id;
|
| non_persistent_ids_[notification_id] = non_persistent_id;
|
| }
|
|
|