diff options
author | shess@chromium.org <shess@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-07-12 01:38:56 +0000 |
---|---|---|
committer | shess@chromium.org <shess@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-07-12 01:38:56 +0000 |
commit | 98cf3002ce111ffce01bdc68f6a8b078abd2a77d (patch) | |
tree | 163daa4d84558802c0dad57b287cbea35a714a01 /sql/connection.cc | |
parent | 25ff086a748e9b399f8ca78cea3d2811a6545d9d (diff) | |
download | chromium_src-98cf3002ce111ffce01bdc68f6a8b078abd2a77d.zip chromium_src-98cf3002ce111ffce01bdc68f6a8b078abd2a77d.tar.gz chromium_src-98cf3002ce111ffce01bdc68f6a8b078abd2a77d.tar.bz2 |
[sql] Callback and scoped-ignore tests for sql::Statement.
Test error callback and ScopedErrorIgnorer for running statements.
Share error-callback test code between statement and connection tests.
Test additional error-callback edge cases.
Also fix callback use-after-free case.
BUG=254584
Review URL: https://chromiumcodereview.appspot.com/17726002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@211281 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'sql/connection.cc')
-rw-r--r-- | sql/connection.cc | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/sql/connection.cc b/sql/connection.cc index ac8c0cd..f2164ec3 100644 --- a/sql/connection.cc +++ b/sql/connection.cc @@ -860,7 +860,10 @@ int Connection::OnSqliteError(int err, sql::Statement *stmt) { << ": " << GetErrorMessage(); if (!error_callback_.is_null()) { - error_callback_.Run(err, stmt); + // Fire from a copy of the callback in case of reentry into + // re/set_error_callback(). + // TODO(shess): <http://crbug.com/254584> + ErrorCallback(error_callback_).Run(err, stmt); return err; } |