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

Unified Diff: chrome/browser/ui/webui/settings/certificates_handler.cc

Issue 2000803003: Use std::unique_ptr for base::DictionaryValue and base::ListValue's internal store. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: More fixes Created 4 years, 7 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/settings/certificates_handler.cc
diff --git a/chrome/browser/ui/webui/settings/certificates_handler.cc b/chrome/browser/ui/webui/settings/certificates_handler.cc
index 53119399ac8958829645715a5c000652337e53b0..405b95973927e2b3265b87b64ea8e03182929c97 100644
--- a/chrome/browser/ui/webui/settings/certificates_handler.cc
+++ b/chrome/browser/ui/webui/settings/certificates_handler.cc
@@ -88,13 +88,16 @@ struct DictionaryIdComparator {
explicit DictionaryIdComparator(icu::Collator* collator)
: collator_(collator) {}
- bool operator()(const base::Value* a, const base::Value* b) const {
+ bool operator()(const std::unique_ptr<base::Value>& a,
+ const std::unique_ptr<base::Value>& b) const {
DCHECK(a->GetType() == base::Value::TYPE_DICTIONARY);
DCHECK(b->GetType() == base::Value::TYPE_DICTIONARY);
- const base::DictionaryValue* a_dict =
- reinterpret_cast<const base::DictionaryValue*>(a);
- const base::DictionaryValue* b_dict =
- reinterpret_cast<const base::DictionaryValue*>(b);
+ const base::DictionaryValue* a_dict;
+ bool a_is_dictionary = a->GetAsDictionary(&a_dict);
+ DCHECK(a_is_dictionary);
+ const base::DictionaryValue* b_dict;
+ bool b_is_dictionary = b->GetAsDictionary(&b_dict);
+ DCHECK(b_is_dictionary);
base::string16 a_str;
base::string16 b_str;
a_dict->GetString(kNameField, &a_str);
« no previous file with comments | « chrome/browser/ui/webui/options/chromeos/display_options_handler.cc ('k') | chrome/browser/ui/webui/site_settings_helper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698