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

Unified Diff: storage/browser/quota/quota_database.cc

Issue 1236583002: Try to reset quota database which is suspected to be corrupted (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Reworked in more logical way. Added unittest Created 5 years, 5 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: storage/browser/quota/quota_database.cc
diff --git a/storage/browser/quota/quota_database.cc b/storage/browser/quota/quota_database.cc
index 85e0000645c35c8d3dac722c82d997a69ebcb6c2..b2626c52b6901137994539573aa5e6bb88028915 100644
--- a/storage/browser/quota/quota_database.cc
+++ b/storage/browser/quota/quota_database.cc
@@ -459,11 +459,16 @@ bool QuotaDatabase::LazyOpen(bool create_if_needed) {
}
if (!opened || !EnsureDatabaseVersion()) {
- LOG(ERROR) << "Failed to open the quota database.";
- is_disabled_ = true;
- db_.reset();
- meta_table_.reset();
- return false;
+ LOG(ERROR) << "Could not open the quota database: "
+ << "probably database is currupted. "
+ << "Trying to reset...";
+ if (!ResetSchema()) {
+ LOG(ERROR) << "Failed to reset the quota database.";
+ is_disabled_ = true;
+ db_.reset();
+ meta_table_.reset();
+ return false;
+ }
}
// Start a long-running transaction.

Powered by Google App Engine
This is Rietveld 408576698