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

Unified Diff: chrome/browser/history/thumbnail_database.cc

Issue 83323005: [sql] Annotate sql::Recovery failure cases. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 7 years, 1 month 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
« no previous file with comments | « no previous file | sql/recovery.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/history/thumbnail_database.cc
diff --git a/chrome/browser/history/thumbnail_database.cc b/chrome/browser/history/thumbnail_database.cc
index 080db559dc9052bd0c8aaa3c1374001c4c79a6b2..91253e3e3883754bff756552f583e9eb22ea351d 100644
--- a/chrome/browser/history/thumbnail_database.cc
+++ b/chrome/browser/history/thumbnail_database.cc
@@ -421,6 +421,7 @@ enum RecoveryEventType {
RECOVERY_EVENT_FAILED_AUTORECOVER_FAVICONS,
RECOVERY_EVENT_FAILED_AUTORECOVER_FAVICON_BITMAPS,
RECOVERY_EVENT_FAILED_AUTORECOVER_ICON_MAPPING,
+ RECOVERY_EVENT_FAILED_COMMIT,
// Always keep this at the end.
RECOVERY_EVENT_MAX,
@@ -615,7 +616,10 @@ void RecoverDatabaseOrRaze(sql::Connection* db, const base::FilePath& db_path) {
// and sequence the statements, as it is basically a form of garbage
// collection.
- ignore_result(sql::Recovery::Recovered(recovery.Pass()));
+ if (!sql::Recovery::Recovered(recovery.Pass())) {
+ RecordRecoveryEvent(RECOVERY_EVENT_FAILED_COMMIT);
+ return;
+ }
// Track the size of the recovered database relative to the size of
// the input database. The size should almost always be smaller,
« no previous file with comments | « no previous file | sql/recovery.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698