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

Unified Diff: content/browser/notifications/platform_notification_context_impl.cc

Issue 2742973002: Migrate two std::remove_if usages to use base::EraseIf instead (Closed)
Patch Set: Merge thing 2742973002 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 | « chrome/browser/notifications/notification_permission_context.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/notifications/platform_notification_context_impl.cc
diff --git a/content/browser/notifications/platform_notification_context_impl.cc b/content/browser/notifications/platform_notification_context_impl.cc
index b2b372fadc86a15294efc4bb012e3bd7ceef2c06..4445cbc500cd8210a268d86147dc3fe94d1d6b29 100644
--- a/content/browser/notifications/platform_notification_context_impl.cc
+++ b/content/browser/notifications/platform_notification_context_impl.cc
@@ -8,6 +8,7 @@
#include "base/files/file_util.h"
#include "base/memory/ptr_util.h"
#include "base/metrics/histogram_macros.h"
+#include "base/stl_util.h"
#include "base/threading/sequenced_worker_pool.h"
#include "content/browser/notifications/blink_notification_service_impl.h"
#include "content/browser/notifications/notification_database.h"
@@ -131,13 +132,11 @@ void PlatformNotificationContextImpl::CreateServiceOnIO(
void PlatformNotificationContextImpl::RemoveService(
BlinkNotificationServiceImpl* service) {
DCHECK_CURRENTLY_ON(BrowserThread::IO);
- auto services_to_remove = std::remove_if(
- services_.begin(), services_.end(),
+ base::EraseIf(
+ services_,
[service](const std::unique_ptr<BlinkNotificationServiceImpl>& ptr) {
return ptr.get() == service;
});
-
- services_.erase(services_to_remove, services_.end());
}
void PlatformNotificationContextImpl::ReadNotificationData(
« no previous file with comments | « chrome/browser/notifications/notification_permission_context.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698