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

Unified Diff: sql/connection.h

Issue 10736042: [sql] Refactor to remove use of const_cast<>. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Remove accidentally-remaining change. Created 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | sql/connection.cc » ('j') | sql/connection.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sql/connection.h
diff --git a/sql/connection.h b/sql/connection.h
index 1e3414f40ca72912b0b8e0b64af1fa37d5e78a1f..c58aeb6ea6bf1641ab39cf41a795895e7c3e72c6 100644
--- a/sql/connection.h
+++ b/sql/connection.h
@@ -339,6 +339,7 @@ class SQL_EXPORT Connection {
public:
// Default constructor initializes to an invalid statement.
StatementRef();
+ explicit StatementRef(sqlite3_stmt* stmt);
StatementRef(Connection* connection, sqlite3_stmt* stmt);
// When true, the statement can be used.
@@ -388,6 +389,12 @@ class SQL_EXPORT Connection {
bool ExecuteWithTimeout(const char* sql, base::TimeDelta ms_timeout)
WARN_UNUSED_RESULT;
+ // Like GetUniqueStatement(), except the statement is not entered
+ // into open_statements_, allowing this to be const. Open
+ // statements can block closing the database, so only use in cases
+ // where the last ref is released before close could be called.
+ scoped_refptr<StatementRef> GetUntrackedStatement(const char* sql) const;
Greg Billock 2012/07/12 21:08:17 I am reading this as being private, right? It look
Scott Hess - ex-Googler 2012/07/12 21:53:08 Yeah, it's private. Looks to me like pulling it i
+
// The actual sqlite database. Will be NULL before Init has been called or if
// Init resulted in an error.
sqlite3* db_;
« no previous file with comments | « no previous file | sql/connection.cc » ('j') | sql/connection.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698