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

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

Issue 2776933006: CrOS: Do not allow notifications to be added during shutdown. (Closed)
Patch Set: Created 3 years, 9 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 | « no previous file | chrome/browser/notifications/message_center_notifications_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 e60cdd6f8c11a0a9b8e80ab4bde751eb77425501..42313f9ea4a1b5c010f6f5071eebb5393f55e817 100644
--- a/chrome/browser/notifications/message_center_notification_manager.cc
+++ b/chrome/browser/notifications/message_center_notification_manager.cc
@@ -10,6 +10,7 @@
#include "base/logging.h"
#include "base/memory/ptr_util.h"
#include "build/build_config.h"
+#include "chrome/browser/browser_process.h"
#include "chrome/browser/notifications/extension_welcome_notification.h"
#include "chrome/browser/notifications/extension_welcome_notification_factory.h"
#include "chrome/browser/notifications/fullscreen_notification_blocker.h"
@@ -80,6 +81,10 @@ MessageCenterNotificationManager::~MessageCenterNotificationManager() {
void MessageCenterNotificationManager::Add(const Notification& notification,
sky 2017/03/28 22:00:34 Would it make more sense for this class to be dest
sammiequon 2017/03/28 23:12:08 It would, but would this cause a bunch of other bu
stevenjb 2017/03/29 00:21:33 I would also be worried about dereferencing errors
Profile* profile) {
+ // We won't have time to process and act on this notification.
+ if (g_browser_process->IsShuttingDown())
+ return;
+
if (Update(notification, profile))
return;
« no previous file with comments | « no previous file | chrome/browser/notifications/message_center_notifications_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698