Chromium Code Reviews| Index: components/webdata/common/web_database_backend.h |
| diff --git a/components/webdata/common/web_database_backend.h b/components/webdata/common/web_database_backend.h |
| index 341bb76d7ac5a095943fcd281970fc7316083309..2103e87fa5b81fd9454f6094295ac6787221d058 100644 |
| --- a/components/webdata/common/web_database_backend.h |
| +++ b/components/webdata/common/web_database_backend.h |
| @@ -39,7 +39,11 @@ class WEBDATA_EXPORT WebDatabaseBackend |
| virtual ~Delegate() {} |
| // Invoked when the backend has finished loading the db. |
| - virtual void DBLoaded(sql::InitStatus status) = 0; |
| + // |status| is the result of initializing the db. |
| + // |diagnostics| contains diagnostic information about the db, and it will |
| + // only be populated when an error occurs. |
| + virtual void DBLoaded(sql::InitStatus status, |
| + const std::string& diagnostics) = 0; |
| }; |
| WebDatabaseBackend( |
| @@ -90,6 +94,9 @@ class WEBDATA_EXPORT WebDatabaseBackend |
| virtual ~WebDatabaseBackend(); |
| private: |
| + // Invoked on a db error. |
| + void DatabaseErrorCallback(int error, sql::Statement* stmt); |
|
Peter Kasting
2016/08/05 00:20:45
Nit: Prefer to spell out "statement" rather than a
afakhry
2016/08/05 16:13:22
Done.
|
| + |
| // Commit the current transaction. |
| void Commit(); |
| @@ -115,10 +122,18 @@ class WEBDATA_EXPORT WebDatabaseBackend |
| // before the db is ready. |
| sql::InitStatus init_status_; |
| + // Contains diagnostic information about the database that is non-empty when |
| + // a catastrophic error occurs. |
|
Peter Kasting
2016/08/05 00:20:45
Nit: Confusing antecedent; how about "If a catastr
afakhry
2016/08/05 16:13:22
Done.
|
| + std::string db_diagnostics_; |
|
Peter Kasting
2016/08/05 00:20:45
Nit: Dunno that the "db_" part of this is really n
afakhry
2016/08/05 16:13:22
Done.
|
| + |
| // True if an attempt has been made to load the database (even if the attempt |
| // fails), used to avoid continually trying to reinit if the db init fails. |
| bool init_complete_; |
| + // True if a catastrophic database error occurs and further error callbacks |
| + // from the database should be ignored. |
|
Peter Kasting
2016/08/05 00:20:44
Since both this comment and the one above talk abo
afakhry
2016/08/05 16:13:22
Done.
|
| + bool should_ignore_db_errors_; |
| + |
| // Delegate. See the class definition above for more information. |
| std::unique_ptr<Delegate> delegate_; |