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

Unified Diff: webkit/fileapi/file_system_origin_database.h

Issue 9663021: Add database recovery for FileSystemOriginDatabase (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: build fix 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
Index: webkit/fileapi/file_system_origin_database.h
diff --git a/webkit/fileapi/file_system_origin_database.h b/webkit/fileapi/file_system_origin_database.h
index ac729dfbf50d9433fb64328a4409510987fd96ce..b68be46e357ac457919f82b2e40e574566cd1347 100644
--- a/webkit/fileapi/file_system_origin_database.h
+++ b/webkit/fileapi/file_system_origin_database.h
@@ -34,7 +34,7 @@ class FileSystemOriginDatabase {
// Only one instance of FileSystemOriginDatabase should exist for a given path
// at a given time.
- explicit FileSystemOriginDatabase(const FilePath& path);
+ explicit FileSystemOriginDatabase(const FilePath& file_system_directory);
~FileSystemOriginDatabase();
bool HasOriginPath(const std::string& origin);
@@ -52,12 +52,19 @@ class FileSystemOriginDatabase {
void DropDatabase();
private:
- bool Init();
+ enum RecoveryOption {
+ REPAIR_ON_CORRUPTION,
+ DELETE_ON_CORRUPTION,
+ FAIL_ON_CORRUPTION,
+ };
+
+ bool Init(RecoveryOption recovery_option);
+ bool RepairDB(const std::string& db_path);
kinuko 2012/03/23 04:01:33 LevelDB's method name is RepairDB but in this clas
tzik 2012/03/23 07:09:00 Done.
void HandleError(const tracked_objects::Location& from_here,
leveldb::Status status);
bool GetLastPathNumber(int* number);
- std::string path_;
+ FilePath file_system_directory_;
scoped_ptr<leveldb::DB> db_;
DISALLOW_COPY_AND_ASSIGN(FileSystemOriginDatabase);
};

Powered by Google App Engine
This is Rietveld 408576698