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

Unified Diff: components/history/core/browser/history_database.cc

Issue 2107493002: Offer user to send feedback from profile error dialog (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: pkasting's & droger's Created 4 years, 4 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: components/history/core/browser/history_database.cc
diff --git a/components/history/core/browser/history_database.cc b/components/history/core/browser/history_database.cc
index a11edafc1465c8d448e3b7ae7075bb98527fee2d..0c0859d0da22863989db42298e6f40d6c04c4b8f 100644
--- a/components/history/core/browser/history_database.cc
+++ b/components/history/core/browser/history_database.cc
@@ -56,9 +56,6 @@ HistoryDatabase::~HistoryDatabase() {
sql::InitStatus HistoryDatabase::Init(const base::FilePath& history_name) {
db_.set_histogram_tag("History");
- // Set the exceptional sqlite error handler.
- db_.set_error_callback(error_callback_);
-
// Set the database page size to something a little larger to give us
// better performance (we're typically seek rather than bandwidth limited).
// This only has an effect before any tables have been created, otherwise
@@ -259,7 +256,13 @@ void HistoryDatabase::CommitTransaction() {
}
void HistoryDatabase::RollbackTransaction() {
- db_.RollbackTransaction();
+ // If Init() returns with a failure status, the Transaction created there will
+ // be destructed and rolled back. HistoryBackend might try to kill the
+ // database after that, at which point it will try to roll back a non-existing
+ // transaction. This will crash on a DCHECK. So transaction_nesting() is
+ // checked first.
+ if (db_.transaction_nesting())
+ db_.RollbackTransaction();
}
bool HistoryDatabase::RecreateAllTablesButURL() {
@@ -296,6 +299,11 @@ bool HistoryDatabase::Raze() {
return db_.Raze();
}
+std::string HistoryDatabase::GetDiagnosticInfo(int extended_error,
+ sql::Statement* statement) {
+ return db_.GetDiagnosticInfo(extended_error, statement);
+}
+
bool HistoryDatabase::SetSegmentID(VisitID visit_id, SegmentID segment_id) {
sql::Statement s(db_.GetCachedStatement(SQL_FROM_HERE,
"UPDATE visits SET segment_id = ? WHERE id = ?"));
« no previous file with comments | « components/history/core/browser/history_database.h ('k') | components/history/core/browser/history_service.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698