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

Unified Diff: chrome/browser/push_messaging/push_messaging_service_impl.cc

Issue 2749823002: Restore KeyedServiceFactory diagnostics for context use-after-destroy. (Closed)
Patch Set: Refactor SiteEngagementService tests. 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/push_messaging/push_messaging_service_impl.cc
diff --git a/chrome/browser/push_messaging/push_messaging_service_impl.cc b/chrome/browser/push_messaging/push_messaging_service_impl.cc
index 9c7e3835dd752423334e73e042da91065536777a..d90b5bd45f0c4340dfee977c126d8d401928e56a 100644
--- a/chrome/browser/push_messaging/push_messaging_service_impl.cc
+++ b/chrome/browser/push_messaging/push_messaging_service_impl.cc
@@ -163,9 +163,7 @@ PushMessagingServiceImpl::PushMessagingServiceImpl(Profile* profile)
HostContentSettingsMapFactory::GetForProfile(profile_)->AddObserver(this);
}
-PushMessagingServiceImpl::~PushMessagingServiceImpl() {
- HostContentSettingsMapFactory::GetForProfile(profile_)->RemoveObserver(this);
-}
+PushMessagingServiceImpl::~PushMessagingServiceImpl() = default;
void PushMessagingServiceImpl::IncreasePushSubscriptionCount(int add,
bool is_pending) {
@@ -926,6 +924,7 @@ void PushMessagingServiceImpl::SetContentSettingChangedCallbackForTesting(
void PushMessagingServiceImpl::Shutdown() {
GetGCMDriver()->RemoveAppHandler(kPushMessagingAppIdentifierPrefix);
+ HostContentSettingsMapFactory::GetForProfile(profile_)->RemoveObserver(this);
}
// BackgroundTrigger methods ---------------------------------------------------
« no previous file with comments | « chrome/browser/password_manager/password_manager_internals_service_unittest.cc ('k') | chrome/test/base/testing_profile.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698