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

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

Issue 9418021: Clear statement before closing db in cookie code. (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
« no previous file with comments | « no previous file | sql/statement.h » ('j') | 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 de1b849c48dff3a161d36ce34603a2ae61ade501..7a6c41867c9b84a86d5bac8458928abc59b47b96 100644
--- a/chrome/browser/net/sqlite_persistent_cookie_store.cc
+++ b/chrome/browser/net/sqlite_persistent_cookie_store.cc
@@ -566,7 +566,7 @@ void SQLitePersistentCookieStore::Backend::ChainLoadCookies(
BrowserThread::IO, FROM_HERE,
base::Bind(&SQLitePersistentCookieStore::Backend::CompleteLoadOnIOThread,
this, loaded_callback, load_success));
- if (!restore_old_session_cookies_)
+ if (load_success && !restore_old_session_cookies_)
DeleteSessionCookies();
}
}
@@ -589,8 +589,9 @@ bool SQLitePersistentCookieStore::Backend::LoadCookiesForDomains(
"secure, httponly, last_access_utc, has_expires, persistent "
"FROM cookies WHERE host_key = ? AND persistent = 1"));
}
- if (!smt) {
+ if (!smt.is_valid()) {
NOTREACHED() << "select statement prep failed";
+ smt.Clear(); // Disconnect smt_ref from db_.
db_.reset();
return false;
}
« no previous file with comments | « no previous file | sql/statement.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698