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

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: Fix other win compile warning Created 8 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
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..0bf720bf540a2eb85d05189734c74d828ff457f9 100644
--- a/sync/syncable/on_disk_directory_backing_store.h
+++ b/sync/syncable/on_disk_directory_backing_store.h
@@ -17,11 +17,25 @@ class OnDiskDirectoryBackingStore : public DirectoryBackingStore {
public:
OnDiskDirectoryBackingStore(const std::string& dir_name,
const FilePath& backing_filepath);
+ virtual ~OnDiskDirectoryBackingStore();
virtual DirOpenResult Load(
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:
+ // Subclasses may override this to avoid a possible DCHECK.
+ virtual void ReportFirstTryOpenFailure();
+
private:
+ FRIEND_TEST_ALL_PREFIXES(DirectoryBackingStoreTest, MinorCorruption);
+
+ bool allow_failure_for_test_;
FilePath backing_filepath_;
};
« no previous file with comments | « sync/syncable/in_memory_directory_backing_store.cc ('k') | sync/syncable/on_disk_directory_backing_store.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698