Index: storage/browser/quota/quota_database.cc |
diff --git a/storage/browser/quota/quota_database.cc b/storage/browser/quota/quota_database.cc |
index 85e0000645c35c8d3dac722c82d997a69ebcb6c2..f91ca23cfae24f536cf6b15d95161a73fb4f5f19 100644 |
--- a/storage/browser/quota/quota_database.cc |
+++ b/storage/browser/quota/quota_database.cc |
@@ -475,11 +475,16 @@ bool QuotaDatabase::LazyOpen(bool create_if_needed) { |
bool QuotaDatabase::EnsureDatabaseVersion() { |
static const size_t kTableCount = arraysize(kTables); |
static const size_t kIndexCount = arraysize(kIndexes); |
- if (!sql::MetaTable::DoesTableExist(db_.get())) |
- return CreateSchema(db_.get(), meta_table_.get(), |
+ if (!sql::MetaTable::DoesTableExist(db_.get())) { |
+ if (CreateSchema(db_.get(), meta_table_.get(), |
kCurrentVersion, kCompatibleVersion, |
kTables, kTableCount, |
- kIndexes, kIndexCount); |
+ kIndexes, kIndexCount)) |
+ return true; |
+ |
+ LOG(ERROR) << "Failed to create schema: probably database is currupted."; |
+ return ResetSchema(); |
michaeln
2015/07/23 19:54:18
I was wondering how this fixed a crash? Its not re
|
+ } |
if (!meta_table_->Init(db_.get(), kCurrentVersion, kCompatibleVersion)) |
return false; |