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

Unified Diff: webkit/browser/appcache/appcache_database.cc

Issue 104593010: AppCache: Run a quick integrity check on the sqlite database when opening. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years 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: webkit/browser/appcache/appcache_database.cc
diff --git a/webkit/browser/appcache/appcache_database.cc b/webkit/browser/appcache/appcache_database.cc
index a3dadd9eaf5515cc1f90381f636c5de6e645bfba..0980973d49ef04a31b20c2ff15ee8401571552b2 100644
--- a/webkit/browser/appcache/appcache_database.cc
+++ b/webkit/browser/appcache/appcache_database.cc
@@ -1019,7 +1019,7 @@ bool AppCacheDatabase::LazyOpen(bool create_if_needed) {
db_->Preload();
}
- if (!opened || !EnsureDatabaseVersion()) {
+ if (!opened || !db_->QuickIntegrityCheck() || !EnsureDatabaseVersion()) {
LOG(ERROR) << "Failed to open the appcache database.";
AppCacheHistograms::CountInitResult(
AppCacheHistograms::SQL_DATABASE_ERROR);

Powered by Google App Engine
This is Rietveld 408576698