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

Unified Diff: components/sync/syncable/directory_backing_store.cc

Issue 2287783002: Remove stl_util's STLValueDeleter. (Closed)
Patch Set: rebase Created 4 years, 4 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 | « components/sync/syncable/directory.cc ('k') | components/sync/syncable/directory_backing_store_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/sync/syncable/directory_backing_store.cc
diff --git a/components/sync/syncable/directory_backing_store.cc b/components/sync/syncable/directory_backing_store.cc
index ac404ecc42c0019a76248d8382ca5512ee21cd92..f9d650a4533c66bc85bd741ef5873c4863f97e0f 100644
--- a/components/sync/syncable/directory_backing_store.cc
+++ b/components/sync/syncable/directory_backing_store.cc
@@ -681,7 +681,7 @@ bool DirectoryBackingStore::LoadEntries(Directory::MetahandlesMap* handles_map,
model_type = kernel->GetServerModelType();
}
++model_type_entry_count[model_type];
- (*handles_map)[handle] = kernel.release();
+ (*handles_map)[handle] = std::move(kernel);
}
}
@@ -1651,17 +1651,15 @@ bool DirectoryBackingStore::VerifyReferenceIntegrity(
IdsSet ids_set;
bool is_ok = true;
- for (Directory::MetahandlesMap::const_iterator it = handles_map->begin();
- it != handles_map->end(); ++it) {
- EntryKernel* entry = it->second;
+ for (auto it = handles_map->begin(); it != handles_map->end(); ++it) {
+ EntryKernel* entry = it->second.get();
bool is_duplicate_id = !(ids_set.insert(entry->ref(ID).value()).second);
is_ok = is_ok && !is_duplicate_id;
}
IdsSet::iterator end = ids_set.end();
- for (Directory::MetahandlesMap::const_iterator it = handles_map->begin();
- it != handles_map->end(); ++it) {
- EntryKernel* entry = it->second;
+ for (auto it = handles_map->begin(); it != handles_map->end(); ++it) {
+ EntryKernel* entry = it->second.get();
if (!entry->ref(PARENT_ID).IsNull()) {
bool parent_exists = (ids_set.find(entry->ref(PARENT_ID).value()) != end);
if (!parent_exists) {
« no previous file with comments | « components/sync/syncable/directory.cc ('k') | components/sync/syncable/directory_backing_store_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698