Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(304)

Side by Side Diff: sql/statement.cc

Issue 2133173003: Minor fixes in login_database.* and sql/statement.* (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix typos Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « sql/statement.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "sql/statement.h" 5 #include "sql/statement.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 276 matching lines...) Expand 10 before | Expand all | Expand 10 after
287 return sqlite3_column_bytes(ref_->stmt(), col); 287 return sqlite3_column_bytes(ref_->stmt(), col);
288 } 288 }
289 289
290 const void* Statement::ColumnBlob(int col) const { 290 const void* Statement::ColumnBlob(int col) const {
291 if (!CheckValid()) 291 if (!CheckValid())
292 return NULL; 292 return NULL;
293 293
294 return sqlite3_column_blob(ref_->stmt(), col); 294 return sqlite3_column_blob(ref_->stmt(), col);
295 } 295 }
296 296
297 bool Statement::ColumnBlobAsString(int col, std::string* blob) { 297 bool Statement::ColumnBlobAsString(int col, std::string* blob) const {
298 if (!CheckValid()) 298 if (!CheckValid())
299 return false; 299 return false;
300 300
301 const void* p = ColumnBlob(col); 301 const void* p = ColumnBlob(col);
302 size_t len = ColumnByteLength(col); 302 size_t len = ColumnByteLength(col);
303 blob->resize(len); 303 blob->resize(len);
304 if (blob->size() != len) { 304 if (blob->size() != len) {
305 return false; 305 return false;
306 } 306 }
307 blob->assign(reinterpret_cast<const char*>(p), len); 307 blob->assign(reinterpret_cast<const char*>(p), len);
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
357 357
358 int Statement::CheckError(int err) { 358 int Statement::CheckError(int err) {
359 // Please don't add DCHECKs here, OnSqliteError() already has them. 359 // Please don't add DCHECKs here, OnSqliteError() already has them.
360 succeeded_ = (err == SQLITE_OK || err == SQLITE_ROW || err == SQLITE_DONE); 360 succeeded_ = (err == SQLITE_OK || err == SQLITE_ROW || err == SQLITE_DONE);
361 if (!succeeded_ && ref_.get() && ref_->connection()) 361 if (!succeeded_ && ref_.get() && ref_->connection())
362 return ref_->connection()->OnSqliteError(err, this, NULL); 362 return ref_->connection()->OnSqliteError(err, this, NULL);
363 return err; 363 return err;
364 } 364 }
365 365
366 } // namespace sql 366 } // namespace sql
OLDNEW
« no previous file with comments | « sql/statement.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698