Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #include "sql/test/error_callback_support.h" | |
| 6 | |
| 7 namespace sql { | |
| 8 | |
| 9 void CaptureErrorCallback(int* error_pointer, int error, sql::Statement* stmt) { | |
| 10 *error_pointer = error; | |
| 11 } | |
| 12 | |
| 13 ScopedErrorCallback::ScopedErrorCallback( | |
| 14 sql::Connection* db, | |
| 15 const sql::Connection::ErrorCallback& cb) | |
| 16 : db_(db) { | |
|
Greg Billock
2013/06/27 20:27:26
Any need to check if one has already been set? Per
Scott Hess - ex-Googler
2013/06/27 20:59:45
Yeah, probably. I'm inclined towards a DCHECK for
Scott Hess - ex-Googler
2013/06/28 22:04:37
A DCHECK would result in moving set_error_callback
| |
| 17 db_->set_error_callback(cb); | |
| 18 } | |
| 19 | |
| 20 ScopedErrorCallback::~ScopedErrorCallback() { | |
| 21 db_->reset_error_callback(); | |
| 22 } | |
| 23 | |
| 24 } // namespace | |
| OLD | NEW |