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

Unified Diff: webkit/fileapi/file_system_directory_database.h

Issue 9663021: Add database recovery for FileSystemOriginDatabase (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 8 years, 9 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 | webkit/fileapi/file_system_directory_database.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 dae587a496a841bc3fd8b328e6c37b42742219c6..47ac60aa05d43a1672279393f06a1298aa9df180 100644
--- a/webkit/fileapi/file_system_directory_database.h
+++ b/webkit/fileapi/file_system_directory_database.h
@@ -56,7 +56,8 @@ class FileSystemDirectoryDatabase {
base::Time modification_time;
};
- explicit FileSystemDirectoryDatabase(const FilePath& path);
+ explicit FileSystemDirectoryDatabase(
+ const FilePath& filesystem_data_directory);
~FileSystemDirectoryDatabase();
bool GetChildWithName(
@@ -88,7 +89,12 @@ class FileSystemDirectoryDatabase {
static bool DestroyDatabase(const FilePath& path);
private:
- bool Init();
+ enum RecoveryOption {
+ DELETE_ON_CORRUPTION,
+ FAIL_ON_CORRUPTION,
+ };
+
+ bool Init(RecoveryOption recovery_option);
void ReportInitStatus(const leveldb::Status& status);
bool StoreDefaultValues();
bool GetLastFileId(FileId* file_id);
@@ -99,7 +105,7 @@ class FileSystemDirectoryDatabase {
void HandleError(const tracked_objects::Location& from_here,
const leveldb::Status& status);
- std::string path_;
+ FilePath filesystem_data_directory_;
scoped_ptr<leveldb::DB> db_;
base::Time last_reported_time_;
DISALLOW_COPY_AND_ASSIGN(FileSystemDirectoryDatabase);
« no previous file with comments | « no previous file | webkit/fileapi/file_system_directory_database.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698