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

Unified Diff: sql/connection.cc

Issue 11112020: Allow multiple sql::Connection error delegates. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 2 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
« no previous file with comments | « sql/connection.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sql/connection.cc
diff --git a/sql/connection.cc b/sql/connection.cc
index ea3dacbb6ba025dc248590a40031cc4a508541f4..55d2929e32f9c7a56c619c926ca928d5588bd8d1 100644
--- a/sql/connection.cc
+++ b/sql/connection.cc
@@ -604,8 +604,13 @@ void Connection::ClearCache() {
}
int Connection::OnSqliteError(int err, sql::Statement *stmt) {
- if (error_delegate_.get())
- return error_delegate_->OnError(err, this, stmt);
+ if (!error_delegates_.empty()) {
+ std::vector<scoped_refptr<ErrorDelegate> > delegates = error_delegates_;
+ for (size_t i = 0; err != SQLITE_OK && i < delegates.size(); ++i) {
+ err = delegates[i]->OnError(err, this, stmt);
+ }
+ return err;
+ }
// The default handling is to assert on debug and to ignore on release.
DLOG(FATAL) << GetErrorMessage();
return err;
« no previous file with comments | « sql/connection.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698