summaryrefslogtreecommitdiffstats
path: root/chrome/common/sqlite_compiled_statement.cc
diff options
context:
space:
mode:
authormaruel@google.com <maruel@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-08-12 15:22:13 +0000
committermaruel@google.com <maruel@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-08-12 15:22:13 +0000
commite1981f43505c69351e5786eac1bff1913f4c96db (patch)
tree9be2552eea732795716489cba689918dc5dd74a3 /chrome/common/sqlite_compiled_statement.cc
parent169da8f5bba74250fe73f708a1a3b666b4fb2431 (diff)
downloadchromium_src-e1981f43505c69351e5786eac1bff1913f4c96db.zip
chromium_src-e1981f43505c69351e5786eac1bff1913f4c96db.tar.gz
chromium_src-e1981f43505c69351e5786eac1bff1913f4c96db.tar.bz2
Cleanup a few files, reduce the number of includes.
Applied glint. No code change, just moving around. git-svn-id: svn://svn.chromium.org/chrome/trunk/src@713 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/common/sqlite_compiled_statement.cc')
-rw-r--r--chrome/common/sqlite_compiled_statement.cc22
1 files changed, 21 insertions, 1 deletions
diff --git a/chrome/common/sqlite_compiled_statement.cc b/chrome/common/sqlite_compiled_statement.cc
index 3916d14..a580a29 100644
--- a/chrome/common/sqlite_compiled_statement.cc
+++ b/chrome/common/sqlite_compiled_statement.cc
@@ -27,9 +27,11 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#include "chrome/common/stl_util-inl.h"
#include "chrome/common/sqlite_compiled_statement.h"
+#include "base/logging.h"
+#include "chrome/common/stl_util-inl.h"
+
// SqliteStatementCache -------------------------------------------------------
SqliteStatementCache::~SqliteStatementCache() {
@@ -38,6 +40,11 @@ SqliteStatementCache::~SqliteStatementCache() {
db_ = NULL;
}
+void SqliteStatementCache::set_db(sqlite3* db) {
+ DCHECK(!db_) << "Setting the database twice";
+ db_ = db;
+}
+
SQLStatement* SqliteStatementCache::InternalGetStatement(const char* func_name,
int func_number,
const char* sql) {
@@ -86,3 +93,16 @@ SqliteCompiledStatement::~SqliteCompiledStatement() {
if (statement_)
statement_->reset();
}
+
+SQLStatement& SqliteCompiledStatement::operator*() {
+ DCHECK(statement_) << "Should check is_valid() before using the statement.";
+ return *statement_;
+}
+SQLStatement* SqliteCompiledStatement::operator->() {
+ DCHECK(statement_) << "Should check is_valid() before using the statement.";
+ return statement_;
+}
+SQLStatement* SqliteCompiledStatement::statement() {
+ DCHECK(statement_) << "Should check is_valid() before using the statement.";
+ return statement_;
+}