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

Unified Diff: content/test/mock_platform_notification_service.cc

Issue 2941743002: Revert of Deprecate native and extension notification delegates. (Closed)
Patch Set: Created 3 years, 6 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 | « chrome/browser/notifications/web_notification_delegate.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/test/mock_platform_notification_service.cc
diff --git a/content/test/mock_platform_notification_service.cc b/content/test/mock_platform_notification_service.cc
index 03fbd7caffb2e08a96036e81b2fa13b8f8b8853f..58db6968fe6370e92f3b5b40d25727755656d135 100644
--- a/content/test/mock_platform_notification_service.cc
+++ b/content/test/mock_platform_notification_service.cc
@@ -164,9 +164,13 @@
void MockPlatformNotificationService::Close(
const std::string& notification_id) {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
- NotificationEventDispatcher::GetInstance()->DispatchNonPersistentCloseEvent(
- notification_id);
- non_persistent_notifications_.erase(notification_id);
+ const auto non_persistent_iter =
+ non_persistent_notifications_.find(notification_id);
+ if (non_persistent_iter == non_persistent_notifications_.end()) {
+ NotificationEventDispatcher::GetInstance()->DispatchNonPersistentCloseEvent(
+ notification_id);
+ non_persistent_notifications_.erase(non_persistent_iter);
+ }
}
void MockPlatformNotificationService::ReplaceNotificationIfNeeded(
« no previous file with comments | « chrome/browser/notifications/web_notification_delegate.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698