Index: webkit/fileapi/file_system_directory_database.h |
diff --git a/webkit/fileapi/file_system_directory_database.h b/webkit/fileapi/file_system_directory_database.h |
index 47ac60aa05d43a1672279393f06a1298aa9df180..fb51f0dc97290cebbb37569f62e74c65e03e340e 100644 |
--- a/webkit/fileapi/file_system_directory_database.h |
+++ b/webkit/fileapi/file_system_directory_database.h |
@@ -32,8 +32,6 @@ namespace fileapi { |
// TODO(ericu): Safe mode, which does more checks such as the above on debug |
// builds. |
-// TODO(ericu): FSCK, for a full-database check [data file validation possibly |
-// done elsewhere]. |
// TODO(ericu): Add a method that will give a unique filename for a data file. |
class FileSystemDirectoryDatabase { |
public: |
@@ -86,15 +84,22 @@ class FileSystemDirectoryDatabase { |
// creation/destruction of FileSystemDirectoryDatabase objects. |
bool GetNextInteger(int64* next); |
+ // Returns true if the database looks consistent with local filesystem. |
+ bool IsFileSystemConsistent(); |
+ |
static bool DestroyDatabase(const FilePath& path); |
private: |
enum RecoveryOption { |
DELETE_ON_CORRUPTION, |
+ REPAIR_ON_CORRUPTION, |
FAIL_ON_CORRUPTION, |
}; |
+ friend class FileSystemDirectoryDatabaseTest; |
+ |
bool Init(RecoveryOption recovery_option); |
+ bool RepairDatabase(const std::string& db_path); |
void ReportInitStatus(const leveldb::Status& status); |
bool StoreDefaultValues(); |
bool GetLastFileId(FileId* file_id); |