| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 #include "chrome/common/sqlite_compiled_statement.h" | 5 #include "chrome/common/sqlite_compiled_statement.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "chrome/common/stl_util-inl.h" | 8 #include "base/stl_util-inl.h" |
| 9 | 9 |
| 10 // SqliteStatementCache ------------------------------------------------------- | 10 // SqliteStatementCache ------------------------------------------------------- |
| 11 | 11 |
| 12 SqliteStatementCache::~SqliteStatementCache() { | 12 SqliteStatementCache::~SqliteStatementCache() { |
| 13 STLDeleteContainerPairSecondPointers(statements_.begin(), statements_.end()); | 13 STLDeleteContainerPairSecondPointers(statements_.begin(), statements_.end()); |
| 14 statements_.clear(); | 14 statements_.clear(); |
| 15 db_ = NULL; | 15 db_ = NULL; |
| 16 } | 16 } |
| 17 | 17 |
| 18 void SqliteStatementCache::set_db(sqlite3* db) { | 18 void SqliteStatementCache::set_db(sqlite3* db) { |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 74 return *statement_; | 74 return *statement_; |
| 75 } | 75 } |
| 76 SQLStatement* SqliteCompiledStatement::operator->() { | 76 SQLStatement* SqliteCompiledStatement::operator->() { |
| 77 DCHECK(statement_) << "Should check is_valid() before using the statement."; | 77 DCHECK(statement_) << "Should check is_valid() before using the statement."; |
| 78 return statement_; | 78 return statement_; |
| 79 } | 79 } |
| 80 SQLStatement* SqliteCompiledStatement::statement() { | 80 SQLStatement* SqliteCompiledStatement::statement() { |
| 81 DCHECK(statement_) << "Should check is_valid() before using the statement."; | 81 DCHECK(statement_) << "Should check is_valid() before using the statement."; |
| 82 return statement_; | 82 return statement_; |
| 83 } | 83 } |
| OLD | NEW |