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

Unified Diff: sync/test/fake_server/fake_server_verifier.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 | « services/catalog/instance.cc ('k') | tools/json_schema_compiler/util.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sync/test/fake_server/fake_server_verifier.cc
diff --git a/sync/test/fake_server/fake_server_verifier.cc b/sync/test/fake_server/fake_server_verifier.cc
index 614f42612c818770177814d28edc23f2a501cf10..20b71926cbc9db0c58c03418bdea9f4911427b03 100644
--- a/sync/test/fake_server/fake_server_verifier.cc
+++ b/sync/test/fake_server/fake_server_verifier.cc
@@ -110,12 +110,10 @@ AssertionResult FakeServerVerifier::VerifyEntityCountByTypeAndName(
base::ListValue* entity_list = NULL;
size_t actual_count = 0;
if (entities->GetList(model_type_string, &entity_list)) {
- std::unique_ptr<base::Value> name_value(new base::StringValue(name));
- for (base::ListValue::const_iterator it = entity_list->begin();
- it != entity_list->end(); ++it) {
- if (name_value->Equals(*it)) {
+ base::StringValue name_value(name);
+ for (const auto& entity : *entity_list) {
+ if (name_value.Equals(entity.get()))
actual_count++;
- }
}
}
« no previous file with comments | « services/catalog/instance.cc ('k') | tools/json_schema_compiler/util.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698