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

Unified Diff: content/browser/indexed_db/indexed_db_backing_store.cc

Issue 17033004: Tell IDB frontend about data loss (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: ToT Created 7 years, 6 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: content/browser/indexed_db/indexed_db_backing_store.cc
diff --git a/content/browser/indexed_db/indexed_db_backing_store.cc b/content/browser/indexed_db/indexed_db_backing_store.cc
index 21b26fea27c084955e30c41159791abccedad3f5..74065388544250906ff138593d2e6a10828a1c6f 100644
--- a/content/browser/indexed_db/indexed_db_backing_store.cc
+++ b/content/browser/indexed_db/indexed_db_backing_store.cc
@@ -421,19 +421,26 @@ enum IndexedDBLevelDBBackingStoreOpenResult {
scoped_refptr<IndexedDBBackingStore> IndexedDBBackingStore::Open(
const string16& database_identifier,
const base::FilePath& path_base,
- const string16& file_identifier) {
+ const string16& file_identifier,
+ WebKit::WebIDBCallbacks::DataLoss* data_loss) {
+ *data_loss = WebKit::WebIDBCallbacks::DataLossNone;
DefaultLevelDBFactory leveldb_factory;
- return IndexedDBBackingStore::Open(
- database_identifier, path_base, file_identifier, &leveldb_factory);
+ return IndexedDBBackingStore::Open(database_identifier,
+ path_base,
+ file_identifier,
+ data_loss,
+ &leveldb_factory);
}
scoped_refptr<IndexedDBBackingStore> IndexedDBBackingStore::Open(
const string16& database_identifier,
const base::FilePath& path_base,
const string16& file_identifier,
+ WebKit::WebIDBCallbacks::DataLoss* data_loss,
LevelDBFactory* leveldb_factory) {
IDB_TRACE("IndexedDBBackingStore::Open");
DCHECK(!path_base.empty());
+ *data_loss = WebKit::WebIDBCallbacks::DataLossNone;
scoped_ptr<LevelDBComparator> comparator(new Comparator());
scoped_ptr<LevelDBDatabase> db;
@@ -548,6 +555,7 @@ scoped_refptr<IndexedDBBackingStore> IndexedDBBackingStore::Open(
return scoped_refptr<IndexedDBBackingStore>();
} else {
LOG(ERROR) << "IndexedDB backing store open failed, attempting cleanup";
+ *data_loss = WebKit::WebIDBCallbacks::DataLossTotal;
bool success = leveldb_factory->DestroyLevelDB(file_path);
if (!success) {
LOG(ERROR) << "IndexedDB backing store cleanup failed";
« no previous file with comments | « content/browser/indexed_db/indexed_db_backing_store.h ('k') | content/browser/indexed_db/indexed_db_backing_store_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698