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

Unified Diff: chrome/browser/ui/webui/signin/user_manager_screen_handler.cc

Issue 2058233002: Rewrite simple uses of base::ListValue::Append() taking a raw pointer var. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: less comments more ownership Created 4 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
Index: chrome/browser/ui/webui/signin/user_manager_screen_handler.cc
diff --git a/chrome/browser/ui/webui/signin/user_manager_screen_handler.cc b/chrome/browser/ui/webui/signin/user_manager_screen_handler.cc
index 0fb2f071ac82ba61dd407a402f6868fbe02a529c..3bb6039a2f000e0e4038246dd2103de5e93d06eb 100644
--- a/chrome/browser/ui/webui/signin/user_manager_screen_handler.cc
+++ b/chrome/browser/ui/webui/signin/user_manager_screen_handler.cc
@@ -5,6 +5,7 @@
#include "chrome/browser/ui/webui/signin/user_manager_screen_handler.h"
#include <stddef.h>
+
#include <utility>
#include <vector>
@@ -889,7 +890,8 @@ void UserManagerScreenHandler::SendUserList() {
if (entry->IsOmitted())
continue;
- base::DictionaryValue* profile_value = new base::DictionaryValue();
+ std::unique_ptr<base::DictionaryValue> profile_value(
+ new base::DictionaryValue());
base::FilePath profile_path = entry->GetPath();
profile_value->SetString(kKeyUsername, entry->GetUserName());
@@ -930,7 +932,7 @@ void UserManagerScreenHandler::SendUserList() {
g_browser_process->profile_manager()->GetProfileByPath(profile_path);
profile_value->SetBoolean(kKeyIsProfileLoaded, profile != nullptr);
- users_list.Append(profile_value);
+ users_list.Append(std::move(profile_value));
}
web_ui()->CallJavascriptFunctionUnsafe(

Powered by Google App Engine
This is Rietveld 408576698