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

Unified Diff: chrome/browser/notifications/profile_notification.h

Issue 2719813005: CrOS: Add print statements to help debug BrowserProcessImpl::Unpin crash. (Closed)
Patch Set: Use DVLOG instead. 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
Index: chrome/browser/notifications/profile_notification.h
diff --git a/chrome/browser/notifications/profile_notification.h b/chrome/browser/notifications/profile_notification.h
index 527ece367b9ec4f3ed000d32c7bdba5c1aef4959..786f6aa01afaa3412ac178edd96f74d1eaade837 100644
--- a/chrome/browser/notifications/profile_notification.h
+++ b/chrome/browser/notifications/profile_notification.h
@@ -9,13 +9,15 @@
#include "chrome/browser/notifications/notification.h"
#include "chrome/browser/notifications/notification_ui_manager.h"
+#include "content/public/browser/notification_observer.h"
+#include "content/public/browser/notification_registrar.h"
class ScopedKeepAlive;
// This class keeps a Notification objects and its corresponding Profile, so
// that when the Notification UI manager needs to return or cancel all
// notifications for a given Profile we have the ability to do this.
-class ProfileNotification {
+class ProfileNotification : public content::NotificationObserver {
public:
// Returns a string that uniquely identifies a profile + delegate_id pair.
// The profile_id is used as an identifier to identify a profile instance; it
@@ -24,11 +26,19 @@ class ProfileNotification {
ProfileID profile_id);
ProfileNotification(Profile* profile, const Notification& notification);
- ~ProfileNotification();
+ ~ProfileNotification() override;
ProfileID profile_id() const { return profile_id_; }
const Notification& notification() const { return notification_; }
+ // content::NotificationObserver:
+ // TODO(sammiequon): This is used to help debug the crash in crbug.com/660962.
+ // Remove this when the crash is fixed or if verified to not be related to
+ // this.
+ void Observe(int type,
+ const content::NotificationSource& source,
+ const content::NotificationDetails& details) override;
+
private:
// Used for equality comparision in notification maps.
ProfileID profile_id_;
@@ -37,6 +47,8 @@ class ProfileNotification {
std::unique_ptr<ScopedKeepAlive> keep_alive_;
+ content::NotificationRegistrar registrar_;
+
DISALLOW_COPY_AND_ASSIGN(ProfileNotification);
};

Powered by Google App Engine
This is Rietveld 408576698