Index: chrome/browser/net/sqlite_persistent_cookie_store.cc |
diff --git a/chrome/browser/net/sqlite_persistent_cookie_store.cc b/chrome/browser/net/sqlite_persistent_cookie_store.cc |
index c4cb43a62c0fd3cc9bb7e3f1a638b65457355551..3d3b6bf59a74df12dd42232800d099300483ce51 100644 |
--- a/chrome/browser/net/sqlite_persistent_cookie_store.cc |
+++ b/chrome/browser/net/sqlite_persistent_cookie_store.cc |
@@ -569,19 +569,20 @@ bool SQLitePersistentCookieStore::Backend::LoadCookiesForDomains( |
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(); |