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

Unified Diff: components/signin/core/browser/about_signin_internals.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: components/signin/core/browser/about_signin_internals.cc
diff --git a/components/signin/core/browser/about_signin_internals.cc b/components/signin/core/browser/about_signin_internals.cc
index ec1595333f61bebd0c7f2e8aa3c648669c3bf053..e1ac32ceb97305da0bba8933d933d011ce668a93 100644
--- a/components/signin/core/browser/about_signin_internals.cc
+++ b/components/signin/core/browser/about_signin_internals.cc
@@ -664,15 +664,16 @@ AboutSigninInternals::SigninStatus::ToValue(
token_service->GetAccounts();
if(accounts_in_token_service.size() == 0) {
- base::DictionaryValue* no_token_entry = new base::DictionaryValue();
+ std::unique_ptr<base::DictionaryValue> no_token_entry(
+ new base::DictionaryValue());
no_token_entry->SetString("accountId", "No token in Token Service.");
- account_info->Append(no_token_entry);
+ account_info->Append(std::move(no_token_entry));
}
for(const std::string& account_id : accounts_in_token_service) {
- base::DictionaryValue* entry = new base::DictionaryValue();
+ std::unique_ptr<base::DictionaryValue> entry(new base::DictionaryValue());
entry->SetString("accountId", account_id);
- account_info->Append(entry);
+ account_info->Append(std::move(entry));
}
return signin_status;
« no previous file with comments | « components/search_engines/template_url_prepopulate_data_unittest.cc ('k') | components/sync_driver/about_sync_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698