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

Side by Side Diff: sql/connection.h

Issue 17726002: [sql] Callback and scoped-ignore tests for sql::Statement. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: prevent nesting, TODO. Created 7 years, 5 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | sql/connection.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef SQL_CONNECTION_H_ 5 #ifndef SQL_CONNECTION_H_
6 #define SQL_CONNECTION_H_ 6 #define SQL_CONNECTION_H_
7 7
8 #include <map> 8 #include <map>
9 #include <set> 9 #include <set>
10 #include <string> 10 #include <string>
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
118 118
119 // Set an error-handling callback. On errors, the error number (and 119 // Set an error-handling callback. On errors, the error number (and
120 // statement, if available) will be passed to the callback. 120 // statement, if available) will be passed to the callback.
121 // 121 //
122 // If no callback is set, the default action is to crash in debug 122 // If no callback is set, the default action is to crash in debug
123 // mode or return failure in release mode. 123 // mode or return failure in release mode.
124 typedef base::Callback<void(int, Statement*)> ErrorCallback; 124 typedef base::Callback<void(int, Statement*)> ErrorCallback;
125 void set_error_callback(const ErrorCallback& callback) { 125 void set_error_callback(const ErrorCallback& callback) {
126 error_callback_ = callback; 126 error_callback_ = callback;
127 } 127 }
128 bool has_error_callback() const {
129 return !error_callback_.is_null();
130 }
128 void reset_error_callback() { 131 void reset_error_callback() {
129 error_callback_.Reset(); 132 error_callback_.Reset();
130 } 133 }
131 134
132 // Set this tag to enable additional connection-type histogramming 135 // Set this tag to enable additional connection-type histogramming
133 // for SQLite error codes and database version numbers. 136 // for SQLite error codes and database version numbers.
134 void set_histogram_tag(const std::string& tag) { 137 void set_histogram_tag(const std::string& tag) {
135 histogram_tag_ = tag; 138 histogram_tag_ = tag;
136 } 139 }
137 140
(...skipping 375 matching lines...) Expand 10 before | Expand all | Expand 10 after
513 516
514 // Tag for auxiliary histograms. 517 // Tag for auxiliary histograms.
515 std::string histogram_tag_; 518 std::string histogram_tag_;
516 519
517 DISALLOW_COPY_AND_ASSIGN(Connection); 520 DISALLOW_COPY_AND_ASSIGN(Connection);
518 }; 521 };
519 522
520 } // namespace sql 523 } // namespace sql
521 524
522 #endif // SQL_CONNECTION_H_ 525 #endif // SQL_CONNECTION_H_
OLDNEW
« no previous file with comments | « no previous file | sql/connection.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698