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

Unified Diff: components/user_manager/user_manager_base.cc

Issue 2336863003: Change more base::ListValue methods to use std::unique_ptr. (Closed)
Patch Set: CrOS fixes + address danakj comment Created 4 years, 3 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: components/user_manager/user_manager_base.cc
diff --git a/components/user_manager/user_manager_base.cc b/components/user_manager/user_manager_base.cc
index 444bb3487009ab59264ffc68418a94396306dd2e..8cd5d50b9c150a4d705c8c92d5ce25fb12fdb9e8 100644
--- a/components/user_manager/user_manager_base.cc
+++ b/components/user_manager/user_manager_base.cc
@@ -16,6 +16,7 @@
#include "base/location.h"
#include "base/logging.h"
#include "base/macros.h"
+#include "base/memory/ptr_util.h"
#include "base/metrics/histogram.h"
#include "base/strings/string_util.h"
#include "base/strings/stringprintf.h"
@@ -851,7 +852,8 @@ void UserManagerBase::GuestUserLoggedIn() {
void UserManagerBase::AddUserRecord(User* user) {
// Add the user to the front of the user list.
ListPrefUpdate prefs_users_update(GetLocalState(), kRegularUsers);
- prefs_users_update->Insert(0, new base::StringValue(user->email()));
+ prefs_users_update->Insert(
+ 0, base::MakeUnique<base::StringValue>(user->email()));
users_.insert(users_.begin(), user);
}

Powered by Google App Engine
This is Rietveld 408576698