summaryrefslogtreecommitdiffstats
path: root/sql/connection.h
diff options
context:
space:
mode:
authorshess@chromium.org <shess@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-06-14 04:09:12 +0000
committershess@chromium.org <shess@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-06-14 04:09:12 +0000
commit526b466671fc03ee6592c78a77f194c78122dcd2 (patch)
tree8e3c243c621a13aa59561681e8be7d5abe7c3326 /sql/connection.h
parentc090470d08860b16f56773c1b198e2ce24e6c907 (diff)
downloadchromium_src-526b466671fc03ee6592c78a77f194c78122dcd2.zip
chromium_src-526b466671fc03ee6592c78a77f194c78122dcd2.tar.gz
chromium_src-526b466671fc03ee6592c78a77f194c78122dcd2.tar.bz2
Remove sql::ErrorDelegate.
API cleanup. Replaced by ErrorCallback. BUG=none Review URL: https://chromiumcodereview.appspot.com/16788002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@206299 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'sql/connection.h')
-rw-r--r--sql/connection.h45
1 files changed, 0 insertions, 45 deletions
diff --git a/sql/connection.h b/sql/connection.h
index 049d7cf..8db794d 100644
--- a/sql/connection.h
+++ b/sql/connection.h
@@ -78,30 +78,6 @@ class StatementID {
class Connection;
-// ErrorDelegate defines the interface to implement error handling and recovery
-// for sqlite operations. This allows the rest of the classes to return true or
-// false while the actual error code and causing statement are delivered using
-// the OnError() callback.
-// The tipical usage is to centralize the code designed to handle database
-// corruption, low-level IO errors or locking violations.
-class SQL_EXPORT ErrorDelegate {
- public:
- virtual ~ErrorDelegate();
-
- // |error| is an sqlite result code as seen in sqlite3.h. |connection| is the
- // db connection where the error happened and |stmt| is our best guess at the
- // statement that triggered the error. Do not store these pointers.
- //
- // |stmt| MAY BE NULL if there is no statement causing the problem (i.e. on
- // initialization).
- //
- // If the error condition has been fixed and the original statement succesfuly
- // re-tried then returning SQLITE_OK is appropriate; otherwise it is
- // recommended that you return the original |error| or the appropriate error
- // code.
- virtual int OnError(int error, Connection* connection, Statement* stmt) = 0;
-};
-
class SQL_EXPORT Connection {
private:
class StatementRef; // Forward declaration, see real one below.
@@ -145,14 +121,6 @@ class SQL_EXPORT Connection {
//
// If no callback is set, the default action is to crash in debug
// mode or return failure in release mode.
- //
- // TODO(shess): ErrorDelegate allowed for returning a different
- // error. Determine if this is necessary for the callback. In my
- // experience, this is not well-tested and probably not safe, and
- // current clients always return the same error passed.
- // Additionally, most errors don't admit to a clean way to retry the
- // failed operation, so converting an error to SQLITE_OK is probably
- // not feasible.
typedef base::Callback<void(int, Statement*)> ErrorCallback;
void set_error_callback(const ErrorCallback& callback) {
error_callback_ = callback;
@@ -161,15 +129,6 @@ class SQL_EXPORT Connection {
error_callback_.Reset();
}
- // Sets the object that will handle errors. Recomended that it should be set
- // before calling Open(). If not set, the default is to ignore errors on
- // release and assert on debug builds.
- // Takes ownership of |delegate|.
- // NOTE(shess): Deprecated, use set_error_callback().
- void set_error_delegate(ErrorDelegate* delegate) {
- error_delegate_.reset(delegate);
- }
-
// Set this tag to enable additional connection-type histogramming
// for SQLite error codes and database version numbers.
void set_histogram_tag(const std::string& tag) {
@@ -529,10 +488,6 @@ class SQL_EXPORT Connection {
ErrorCallback error_callback_;
- // This object handles errors resulting from all forms of executing sqlite
- // commands or statements. It can be null which means default handling.
- scoped_ptr<ErrorDelegate> error_delegate_;
-
// Tag for auxiliary histograms.
std::string histogram_tag_;