Index: sql/connection.h |
diff --git a/sql/connection.h b/sql/connection.h |
index 1e3414f40ca72912b0b8e0b64af1fa37d5e78a1f..c51a28ca14596b5d3d36ea45bc7a555d5aa69436 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,14 @@ class SQL_EXPORT Connection { |
bool ExecuteWithTimeout(const char* sql, base::TimeDelta ms_timeout) |
WARN_UNUSED_RESULT; |
+ // Internal helper for const functions. Like GetUniqueStatement(), |
+ // except the statement is not entered into open_statements_, |
+ // allowing this function 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 (which should always be the |
+ // case for const functions). |
+ scoped_refptr<StatementRef> GetUntrackedStatement(const char* sql) const; |
+ |
// The actual sqlite database. Will be NULL before Init has been called or if |
// Init resulted in an error. |
sqlite3* db_; |