| 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 #ifndef CHROME_COMMON_SQLITE_COMPILED_STATEMENT_ | 5 #ifndef CHROME_COMMON_SQLITE_COMPILED_STATEMENT_ |
| 6 #define CHROME_COMMON_SQLITE_COMPILED_STATEMENT_ | 6 #define CHROME_COMMON_SQLITE_COMPILED_STATEMENT_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| 11 #include "chrome/common/sqlite_utils.h" | 11 #include "chrome/common/sqlite_utils.h" |
| 12 | 12 |
| 13 #include "third_party/sqlite/sqlite3.h" | 13 #include "third_party/sqlite/preprocessed/sqlite3.h" |
| 14 | 14 |
| 15 // Stores a list of precompiled sql statements for a database. Each statement | 15 // Stores a list of precompiled sql statements for a database. Each statement |
| 16 // is given a unique name by the caller. | 16 // is given a unique name by the caller. |
| 17 // | 17 // |
| 18 // Note: see comments on descructor. | 18 // Note: see comments on descructor. |
| 19 class SqliteStatementCache { | 19 class SqliteStatementCache { |
| 20 public: | 20 public: |
| 21 // You must call set_db before anything else if you use this constructor. | 21 // You must call set_db before anything else if you use this constructor. |
| 22 SqliteStatementCache() : db_(NULL) { | 22 SqliteStatementCache() : db_(NULL) { |
| 23 } | 23 } |
| (...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 126 // if (!var_name.is_valid()) | 126 // if (!var_name.is_valid()) |
| 127 // return oops; | 127 // return oops; |
| 128 // var_name->bind_XXX( | 128 // var_name->bind_XXX( |
| 129 // var_name->step(); | 129 // var_name->step(); |
| 130 // ... | 130 // ... |
| 131 #define SQLITE_UNIQUE_STATEMENT(var_name, cache, sql) \ | 131 #define SQLITE_UNIQUE_STATEMENT(var_name, cache, sql) \ |
| 132 SqliteCompiledStatement var_name(__FILE__, __LINE__, cache, sql) | 132 SqliteCompiledStatement var_name(__FILE__, __LINE__, cache, sql) |
| 133 | 133 |
| 134 #endif // CHROME_COMMON_SQLITE_COMPILED_STATEMENT_ | 134 #endif // CHROME_COMMON_SQLITE_COMPILED_STATEMENT_ |
| 135 | 135 |
| OLD | NEW |