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

Unified Diff: chrome/browser/history/download_database.cc

Issue 9365030: More SQL statement usage regularization. Back-touch some (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 10 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/history/download_database.cc
diff --git a/chrome/browser/history/download_database.cc b/chrome/browser/history/download_database.cc
index 5508796d4c911888aed3c9db5dd66c5ab68bf971..f56cff7042a82c74d8cb31289c5842fe4214c421 100644
--- a/chrome/browser/history/download_database.cc
+++ b/chrome/browser/history/download_database.cc
@@ -59,10 +59,10 @@ FilePath ColumnFilePath(sql::Statement& statement, int col) {
// See above.
void BindFilePath(sql::Statement& statement, const FilePath& path, int col) {
- statement.BindString(col, UTF16ToUTF8(path.value()));
+ statement.BindString16(col, path.value());
}
FilePath ColumnFilePath(sql::Statement& statement, int col) {
- return FilePath(UTF8ToUTF16(statement.ColumnString(col)));
+ return FilePath(statement.ColumnString16(col));
}
#endif
@@ -225,9 +225,11 @@ int64 DownloadDatabase::CreateDownload(
void DownloadDatabase::RemoveDownload(DownloadID db_handle) {
CheckThread();
+
sql::Statement statement(GetDB().GetCachedStatement(SQL_FROM_HERE,
"DELETE FROM downloads WHERE id=?"));
statement.BindInt64(0, db_handle);
+
statement.Run();
}

Powered by Google App Engine
This is Rietveld 408576698