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

Unified Diff: ui/arc/notification/arc_notification_manager.cc

Issue 1868363002: Replace scoped_ptr with std::unique_ptr in //ui (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@scopedptrcc
Patch Set: scopedptrui: rebase-make_scoped_ptr Created 4 years, 8 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: ui/arc/notification/arc_notification_manager.cc
diff --git a/ui/arc/notification/arc_notification_manager.cc b/ui/arc/notification/arc_notification_manager.cc
index 77869328be3679c77e8f57f84c58a099ef84634f..032ec75e43fea6b0a424aa2374fa833158ec489d 100644
--- a/ui/arc/notification/arc_notification_manager.cc
+++ b/ui/arc/notification/arc_notification_manager.cc
@@ -6,6 +6,7 @@
#include "ash/shell.h"
#include "ash/system/toast/toast_manager.h"
+#include "base/memory/ptr_util.h"
#include "base/stl_util.h"
#include "ui/arc/notification/arc_notification_item.h"
@@ -49,7 +50,7 @@ void ArcNotificationManager::OnNotificationsInstanceClosed() {
DCHECK(ready_);
while (!items_.empty()) {
auto it = items_.begin();
- scoped_ptr<ArcNotificationItem> item = std::move(it->second);
+ std::unique_ptr<ArcNotificationItem> item = std::move(it->second);
items_.erase(it);
item->OnClosedFromAndroid(false /* by_user */);
}
@@ -65,7 +66,7 @@ void ArcNotificationManager::OnNotificationPosted(ArcNotificationDataPtr data) {
ArcNotificationItem* item =
new ArcNotificationItem(this, message_center_, key, main_profile_id_);
// TODO(yoshiki): Use emplacement for performance when it's available.
- auto result = items_.insert(std::make_pair(key, make_scoped_ptr(item)));
+ auto result = items_.insert(std::make_pair(key, base::WrapUnique(item)));
DCHECK(result.second);
it = result.first;
}
@@ -80,7 +81,7 @@ void ArcNotificationManager::OnNotificationRemoved(const mojo::String& key) {
return;
}
- scoped_ptr<ArcNotificationItem> item = std::move(it->second);
+ std::unique_ptr<ArcNotificationItem> item = std::move(it->second);
items_.erase(it);
item->OnClosedFromAndroid(true /* by_user */);
}
@@ -96,7 +97,7 @@ void ArcNotificationManager::SendNotificationRemovedFromChrome(
// The removed ArcNotificationItem needs to live in this scope, since the
// given argument |key| may be a part of the removed item.
- scoped_ptr<ArcNotificationItem> item = std::move(it->second);
+ std::unique_ptr<ArcNotificationItem> item = std::move(it->second);
items_.erase(it);
auto notifications_instance = arc_bridge_service()->notifications_instance();
« no previous file with comments | « ui/arc/notification/arc_notification_manager.h ('k') | ui/arc/notification/arc_notification_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698