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

Side by Side 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "components/signin/core/browser/about_signin_internals.h" 5 #include "components/signin/core/browser/about_signin_internals.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <utility> 9 #include <utility>
10 10
(...skipping 646 matching lines...) Expand 10 before | Expand all | Expand 10 after
657 token_details->Append(token_info); 657 token_details->Append(token_info);
658 } 658 }
659 } 659 }
660 660
661 base::ListValue* account_info = new base::ListValue(); 661 base::ListValue* account_info = new base::ListValue();
662 signin_status->Set("accountInfo", account_info); 662 signin_status->Set("accountInfo", account_info);
663 const std::vector<std::string>& accounts_in_token_service = 663 const std::vector<std::string>& accounts_in_token_service =
664 token_service->GetAccounts(); 664 token_service->GetAccounts();
665 665
666 if(accounts_in_token_service.size() == 0) { 666 if(accounts_in_token_service.size() == 0) {
667 base::DictionaryValue* no_token_entry = new base::DictionaryValue(); 667 std::unique_ptr<base::DictionaryValue> no_token_entry(
668 new base::DictionaryValue());
668 no_token_entry->SetString("accountId", "No token in Token Service."); 669 no_token_entry->SetString("accountId", "No token in Token Service.");
669 account_info->Append(no_token_entry); 670 account_info->Append(std::move(no_token_entry));
670 } 671 }
671 672
672 for(const std::string& account_id : accounts_in_token_service) { 673 for(const std::string& account_id : accounts_in_token_service) {
673 base::DictionaryValue* entry = new base::DictionaryValue(); 674 std::unique_ptr<base::DictionaryValue> entry(new base::DictionaryValue());
674 entry->SetString("accountId", account_id); 675 entry->SetString("accountId", account_id);
675 account_info->Append(entry); 676 account_info->Append(std::move(entry));
676 } 677 }
677 678
678 return signin_status; 679 return signin_status;
679 } 680 }
OLDNEW
« 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