summaryrefslogtreecommitdiffstats
path: root/chromium/content/browser/dom_storage/session_storage_database.h
diff options
context:
space:
mode:
Diffstat (limited to 'chromium/content/browser/dom_storage/session_storage_database.h')
-rw-r--r--chromium/content/browser/dom_storage/session_storage_database.h11
1 files changed, 10 insertions, 1 deletions
diff --git a/chromium/content/browser/dom_storage/session_storage_database.h b/chromium/content/browser/dom_storage/session_storage_database.h
index 09d4773fea1..4260e4adb56 100644
--- a/chromium/content/browser/dom_storage/session_storage_database.h
+++ b/chromium/content/browser/dom_storage/session_storage_database.h
@@ -74,6 +74,8 @@ class CONTENT_EXPORT SessionStorageDatabase :
private:
friend class base::RefCountedThreadSafe<SessionStorageDatabase>;
+ class DBOperation;
+ friend class SessionStorageDatabase::DBOperation;
friend class SessionStorageDatabaseTest;
~SessionStorageDatabase();
@@ -189,13 +191,20 @@ class CONTENT_EXPORT SessionStorageDatabase :
scoped_ptr<leveldb::DB> db_;
base::FilePath file_path_;
- // For protecting the database opening code.
+ // For protecting the database opening code. Also guards the variables below.
base::Lock db_lock_;
// True if a database error has occurred (e.g., cannot read data).
bool db_error_;
// True if the database is in an inconsistent state.
bool is_inconsistent_;
+ // True if the database is in a failed or inconsistent state, and we have
+ // already deleted it (as an attempt to recover later).
+ bool invalid_db_deleted_;
+
+ // The number of database operations in progress. We need this so that we can
+ // delete an inconsistent database at the right moment.
+ int operation_count_;
DISALLOW_COPY_AND_ASSIGN(SessionStorageDatabase);
};