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 e3b6a43369b235807614276dd7c349a372e01ed1..ecf43be64490aca34ddb411a85e1a7cc17b595d8 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, |
+ bool* data_loss) { |
+ *data_loss = false; |
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, |
+ bool* data_loss, |
LevelDBFactory* leveldb_factory) { |
IDB_TRACE("IndexedDBBackingStore::open"); |
DCHECK(!path_base.empty()); |
+ *data_loss = false; |
scoped_ptr<LevelDBComparator> comparator(new Comparator()); |
scoped_ptr<LevelDBDatabase> db; |
@@ -549,6 +556,7 @@ scoped_refptr<IndexedDBBackingStore> IndexedDBBackingStore::Open( |
return scoped_refptr<IndexedDBBackingStore>(); |
} else { |
LOG(ERROR) << "IndexedDB backing store open failed, attempting cleanup"; |
+ *data_loss = true; |
bool success = leveldb_factory->DestroyLevelDB(file_path); |
if (!success) { |
LOG(ERROR) << "IndexedDB backing store cleanup failed"; |