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

Unified Diff: chrome/browser/net/sqlite_persistent_cookie_store.cc

Issue 9125017: Merge 113575 - SQLitePersistentCookieStore fix: Don't abuse SQL_FROM_HERE. (Closed) Base URL: svn://svn.chromium.org/chrome/branches/963/src/
Patch Set: Created 8 years, 11 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/net/sqlite_persistent_cookie_store.cc
===================================================================
--- chrome/browser/net/sqlite_persistent_cookie_store.cc (revision 116773)
+++ chrome/browser/net/sqlite_persistent_cookie_store.cc (working copy)
@@ -526,19 +526,20 @@
const std::set<std::string>& domains) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::DB));
- const char* sql;
+ sql::Statement smt;
if (restore_old_session_cookies_) {
- sql =
- "SELECT creation_utc, host_key, name, value, path, expires_utc, "
- "secure, httponly, last_access_utc, has_expires, persistent "
- "FROM cookies WHERE host_key = ?";
+ smt.Assign(db_->GetCachedStatement(
+ SQL_FROM_HERE,
+ "SELECT creation_utc, host_key, name, value, path, expires_utc, "
+ "secure, httponly, last_access_utc, has_expires, persistent "
+ "FROM cookies WHERE host_key = ?"));
} else {
- sql =
- "SELECT creation_utc, host_key, name, value, path, expires_utc, "
- "secure, httponly, last_access_utc, has_expires, persistent "
- "FROM cookies WHERE host_key = ? AND persistent == 1";
+ smt.Assign(db_->GetCachedStatement(
+ SQL_FROM_HERE,
+ "SELECT creation_utc, host_key, name, value, path, expires_utc, "
+ "secure, httponly, last_access_utc, has_expires, persistent "
+ "FROM cookies WHERE host_key = ? AND persistent = 1"));
}
- sql::Statement smt(db_->GetCachedStatement(SQL_FROM_HERE, sql));
if (!smt) {
NOTREACHED() << "select statement prep failed";
db_.reset();
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698