diff options
author | maruel@google.com <maruel@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-08-12 15:22:13 +0000 |
---|---|---|
committer | maruel@google.com <maruel@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-08-12 15:22:13 +0000 |
commit | e1981f43505c69351e5786eac1bff1913f4c96db (patch) | |
tree | 9be2552eea732795716489cba689918dc5dd74a3 /chrome/common/sqlite_compiled_statement.h | |
parent | 169da8f5bba74250fe73f708a1a3b666b4fb2431 (diff) | |
download | chromium_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.h')
-rw-r--r-- | chrome/common/sqlite_compiled_statement.h | 29 |
1 files changed, 8 insertions, 21 deletions
diff --git a/chrome/common/sqlite_compiled_statement.h b/chrome/common/sqlite_compiled_statement.h index ad12b45..376e991 100644 --- a/chrome/common/sqlite_compiled_statement.h +++ b/chrome/common/sqlite_compiled_statement.h @@ -27,13 +27,12 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#ifndef CHROME_COMMON_SQLITE_COMPILED_STATEMENT__ -#define CHROME_COMMON_SQLITE_COMPILED_STATEMENT__ +#ifndef CHROME_COMMON_SQLITE_COMPILED_STATEMENT_ +#define CHROME_COMMON_SQLITE_COMPILED_STATEMENT_ #include <map> #include <string> -#include "base/logging.h" #include "chrome/common/sqlite_utils.h" #include "chrome/third_party/sqlite/sqlite3.h" @@ -47,7 +46,7 @@ class SqliteStatementCache { SqliteStatementCache() : db_(NULL) { } - SqliteStatementCache(sqlite3* db) : db_(db) { + explicit SqliteStatementCache(sqlite3* db) : db_(db) { } // This object must be deleted before the sqlite connection it is associated @@ -55,10 +54,7 @@ class SqliteStatementCache { // statements. ~SqliteStatementCache(); - void set_db(sqlite3* db) { - DCHECK(!db_) << "Setting the database twice"; - db_ = db; - } + void set_db(sqlite3* db); // Creates or retrieves a cached SQL statement identified by the given // (name, number) pair. @@ -135,18 +131,9 @@ class SqliteCompiledStatement { // Allow accessing this object to be like accessing a statement for // convenience. The caller must ensure the statement is_valid() before using // these two functions. - SQLStatement& operator*() { - DCHECK(statement_) << "Should check is_valid() before using the statement."; - return *statement_; - } - SQLStatement* operator->() { - DCHECK(statement_) << "Should check is_valid() before using the statement."; - return statement_; - } - SQLStatement* statement() { - DCHECK(statement_) << "Should check is_valid() before using the statement."; - return statement_; - } + SQLStatement& operator*(); + SQLStatement* operator->(); + SQLStatement* statement(); private: // The sql statement if valid, NULL if not valid. This pointer is NOT owned @@ -168,4 +155,4 @@ class SqliteCompiledStatement { #define SQLITE_UNIQUE_STATEMENT(var_name, cache, sql) \ SqliteCompiledStatement var_name(__FILE__, __LINE__, cache, sql) -#endif // CHROME_COMMON_SQLITE_COMPILED_STATEMENT__ +#endif // CHROME_COMMON_SQLITE_COMPILED_STATEMENT_ |