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

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

Issue 8856005: SQLitePersistentCookieStore fix: Don't abuse SQL_FROM_HERE. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Simplifying. Created 9 years 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
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();
« 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