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

Unified Diff: sync/syncable/on_disk_directory_backing_store.h

Issue 10821121: sync: Attempt to recover from directory corruption (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 5 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
Index: sync/syncable/on_disk_directory_backing_store.h
diff --git a/sync/syncable/on_disk_directory_backing_store.h b/sync/syncable/on_disk_directory_backing_store.h
index f722ef95877b03cb5ae0242391d247c42307bd26..2b21681f91fe771f08de74bea294713f1355a449 100644
--- a/sync/syncable/on_disk_directory_backing_store.h
+++ b/sync/syncable/on_disk_directory_backing_store.h
@@ -21,7 +21,19 @@ class OnDiskDirectoryBackingStore : public DirectoryBackingStore {
MetahandlesIndex* entry_bucket,
Directory::KernelLoadInfo* kernel_load_info) OVERRIDE;
+ // A helper function that will make one attempt to load the directory.
+ // Unlike Load(), it does not attempt to recover from failure.
+ DirOpenResult TryLoad(
+ MetahandlesIndex* entry_bucket,
+ Directory::KernelLoadInfo* kernel_load_info);
+
+ protected:
+ void AllowFailureForTest();
+
private:
+ FRIEND_TEST_ALL_PREFIXES(DirectoryBackingStoreTest, MinorCorruption);
+
+ bool allow_failure_for_test_;
FilePath backing_filepath_;
};

Powered by Google App Engine
This is Rietveld 408576698