Chromium Code Reviews| Index: chrome/browser/ui/webui/options/certificate_manager_handler.cc |
| diff --git a/chrome/browser/ui/webui/options/certificate_manager_handler.cc b/chrome/browser/ui/webui/options/certificate_manager_handler.cc |
| index bc53b77092f01499824b0e2f5f68fc046e989553..3b04414b20c1ebf60e04c15b2e0a88cb6399afd3 100644 |
| --- a/chrome/browser/ui/webui/options/certificate_manager_handler.cc |
| +++ b/chrome/browser/ui/webui/options/certificate_manager_handler.cc |
| @@ -87,14 +87,14 @@ struct DictionaryIdComparator { |
| : collator_(collator) { |
| } |
| - bool operator()(const base::Value* a, |
| - const 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); |
| + bool operator()(const std::unique_ptr<base::Value>& a, |
| + const std::unique_ptr<base::Value>& b) const { |
| + const base::DictionaryValue* a_dict; |
| + if (!a->GetAsDictionary(&a_dict)) |
| + NOTREACHED(); |
|
danakj
2016/05/24 20:08:34
nit: I a lil bit prefer
bool a_is_dictionary = a-
dcheng
2016/05/24 20:39:02
Done. I don't feel super strongly, but I actually
|
| + const base::DictionaryValue* b_dict; |
| + if (!b->GetAsDictionary(&b_dict)) |
| + NOTREACHED(); |
| base::string16 a_str; |
| base::string16 b_str; |
| a_dict->GetString(kNameId, &a_str); |