Index: content/browser/notifications/notification_message_filter.cc |
diff --git a/content/browser/notifications/notification_message_filter.cc b/content/browser/notifications/notification_message_filter.cc |
index 56064347d26ab470e7c5aa4d74596e7273e25d19..998d2bd586fdad80adefe781fe8440931d942056 100644 |
--- a/content/browser/notifications/notification_message_filter.cc |
+++ b/content/browser/notifications/notification_message_filter.cc |
@@ -10,6 +10,7 @@ |
#include "base/command_line.h" |
#include "base/feature_list.h" |
#include "content/browser/bad_message.h" |
+#include "content/browser/notifications/notification_event_dispatcher_impl.h" |
#include "content/browser/notifications/notification_id_generator.h" |
#include "content/browser/notifications/page_notification_delegate.h" |
#include "content/browser/notifications/platform_notification_context_impl.h" |
@@ -96,7 +97,7 @@ NotificationMessageFilter::NotificationMessageFilter( |
browser_context_(browser_context), |
weak_factory_io_(this) {} |
-NotificationMessageFilter::~NotificationMessageFilter() {} |
+NotificationMessageFilter::~NotificationMessageFilter() = default; |
void NotificationMessageFilter::DidCloseNotification( |
const std::string& notification_id) { |
@@ -105,6 +106,10 @@ void NotificationMessageFilter::DidCloseNotification( |
} |
void NotificationMessageFilter::OnDestruct() const { |
+ NotificationEventDispatcherImpl* event_dispatcher = |
+ content::NotificationEventDispatcherImpl::GetInstance(); |
+ DCHECK(event_dispatcher); |
+ event_dispatcher->RendererGone(process_id_); |
BrowserThread::DeleteOnIOThread::Destruct(this); |
} |
@@ -161,6 +166,11 @@ void NotificationMessageFilter::OnShowPlatformNotification( |
origin, notification_data.tag, non_persistent_notification_id, |
process_id_); |
+ NotificationEventDispatcherImpl* event_dispatcher = |
+ content::NotificationEventDispatcherImpl::GetInstance(); |
+ event_dispatcher->RegisterNonPersistentNotification( |
+ notification_id, process_id_, non_persistent_notification_id); |
+ |
std::unique_ptr<DesktopNotificationDelegate> delegate( |
new PageNotificationDelegate(process_id_, non_persistent_notification_id, |
notification_id)); |