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

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

Issue 2342133002: [sync] Verify existence of the root when loading DirectoryBackingStore (Closed)
Patch Set: [sync] Verify existence of the root when loading DirectoryBackingStore Created 4 years, 3 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 | « no previous file | 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 b17ff27522c08c7659bf0c44585193f1cd4dfe93..05414bf324ac6e0c93ff372c28c276c5c2690b81 100644
--- a/components/sync/syncable/directory_backing_store.cc
+++ b/components/sync/syncable/directory_backing_store.cc
@@ -1642,6 +1642,7 @@ bool DirectoryBackingStore::CreateShareInfoTableVersion71(
// This function checks to see if the given list of Metahandles has any nodes
// whose PARENT_ID values refer to ID values that do not actually exist.
+// This function also checks that the root node exists in the set.
pavely 2016/09/15 22:50:15 I would say "that root node with correct id exists
// Returns true on success.
bool DirectoryBackingStore::VerifyReferenceIntegrity(
const Directory::MetahandlesMap* handles_map) {
@@ -1667,6 +1668,9 @@ bool DirectoryBackingStore::VerifyReferenceIntegrity(
}
}
}
+ if (ids_set.find(Id::GetRoot().value()) == ids_set.end()) {
pavely 2016/09/15 22:50:15 nit: Since you are using Id class directly could y
+ return false;
+ }
return is_ok;
}
« no previous file with comments | « no previous file | components/sync/syncable/directory_backing_store_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698