OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "app/sql/statement.h" | 5 #include "sql/statement.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "base/utf_string_conversions.h" | 8 #include "base/utf_string_conversions.h" |
9 #include "third_party/sqlite/sqlite3.h" | 9 #include "third_party/sqlite/sqlite3.h" |
10 | 10 |
11 namespace sql { | 11 namespace sql { |
12 | 12 |
13 // This empty constructor initializes our reference with an empty one so that | 13 // This empty constructor initializes our reference with an empty one so that |
14 // we don't have to NULL-check the ref_ to see if the statement is valid: we | 14 // we don't have to NULL-check the ref_ to see if the statement is valid: we |
15 // only have to check the ref's validity bit. | 15 // only have to check the ref's validity bit. |
(...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
261 | 261 |
262 int Statement::CheckError(int err) { | 262 int Statement::CheckError(int err) { |
263 // Please don't add DCHECKs here, OnSqliteError() already has them. | 263 // Please don't add DCHECKs here, OnSqliteError() already has them. |
264 succeeded_ = (err == SQLITE_OK || err == SQLITE_ROW || err == SQLITE_DONE); | 264 succeeded_ = (err == SQLITE_OK || err == SQLITE_ROW || err == SQLITE_DONE); |
265 if (!succeeded_ && is_valid()) | 265 if (!succeeded_ && is_valid()) |
266 return ref_->connection()->OnSqliteError(err, this); | 266 return ref_->connection()->OnSqliteError(err, this); |
267 return err; | 267 return err; |
268 } | 268 } |
269 | 269 |
270 } // namespace sql | 270 } // namespace sql |
OLD | NEW |