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

Unified Diff: components/webdata/common/web_database_backend.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: Yet more compile errors Created 4 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: components/webdata/common/web_database_backend.cc
diff --git a/components/webdata/common/web_database_backend.cc b/components/webdata/common/web_database_backend.cc
index 7cb343e62f02e5a76ba03a4fff2f999a07a33491..c761ada6e775ea2082ff0ef92a8b108579db685b 100644
--- a/components/webdata/common/web_database_backend.cc
+++ b/components/webdata/common/web_database_backend.cc
@@ -35,7 +35,7 @@ void WebDatabaseBackend::AddTable(std::unique_ptr<WebDatabaseTable> table) {
void WebDatabaseBackend::InitDatabase() {
LoadDatabaseIfNecessary();
if (delegate_) {
- delegate_->DBLoaded(init_status_);
+ delegate_->DBLoaded(init_status_, db_diagnostics_);
}
}
@@ -46,14 +46,14 @@ sql::InitStatus WebDatabaseBackend::LoadDatabaseIfNecessary() {
init_complete_ = true;
db_.reset(new WebDatabase());
- for (ScopedVector<WebDatabaseTable>::iterator it = tables_.begin();
- it != tables_.end(); ++it) {
- db_->AddTable(*it);
- }
+ for (const auto& table : tables_)
+ db_->AddTable(table);
init_status_ = db_->Init(db_path_);
if (init_status_ != sql::INIT_OK) {
LOG(ERROR) << "Cannot initialize the web database: " << init_status_;
+ db_diagnostics_ = db_->GetDiagnosticMap();
+ db_diagnostics_["Corrupted file"] = db_path_.AsUTF8Unsafe();
michaeln 2016/07/09 03:00:38 we don't want to send the full path as part of a b
Scott Hess - ex-Googler 2016/07/10 05:16:52 I think I had earlier comments about this - we sho
afakhry 2016/07/11 16:47:45 Done.
afakhry 2016/07/11 16:47:45 Yes, I needed to think about a way to distinguish
db_.reset(NULL);
return init_status_;
}

Powered by Google App Engine
This is Rietveld 408576698