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

Unified Diff: chromeos/network/network_util.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
« no previous file with comments | « chromecast/crash/linux/synchronized_minidump_manager.cc ('k') | chromeos/network/onc/onc_mapper.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chromeos/network/network_util.cc
diff --git a/chromeos/network/network_util.cc b/chromeos/network/network_util.cc
index 00efbff75e6a1433b8a715d221adb24630b28494..a8c83d86372b234659522d70c63053c226a99148 100644
--- a/chromeos/network/network_util.cc
+++ b/chromeos/network/network_util.cc
@@ -127,13 +127,11 @@ bool ParseCellularScanResults(const base::ListValue& list,
std::vector<CellularScanResult>* scan_results) {
scan_results->clear();
scan_results->reserve(list.GetSize());
- for (base::ListValue::const_iterator it = list.begin();
- it != list.end(); ++it) {
- if (!(*it)->IsType(base::Value::TYPE_DICTIONARY))
+ for (const auto& value : list) {
+ const base::DictionaryValue* dict;
+ if (!value->GetAsDictionary(&dict))
return false;
CellularScanResult scan_result;
- const base::DictionaryValue* dict =
- static_cast<const base::DictionaryValue*>(*it);
// If the network id property is not present then this network cannot be
// connected to so don't include it in the results.
if (!dict->GetStringWithoutPathExpansion(shill::kNetworkIdProperty,
« no previous file with comments | « chromecast/crash/linux/synchronized_minidump_manager.cc ('k') | chromeos/network/onc/onc_mapper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698