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

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

Issue 9005036: [sql] WARN_UNUSED_RESULT on Execute(). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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 | « chrome/browser/history/visitsegment_database.cc ('k') | sql/connection.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 875b37f412ede00812dd3c904c52e06d547f7649..50ca24f337589fb8ecb9995d96852454593c0987 100644
--- a/chrome/browser/net/sqlite_persistent_cookie_store.cc
+++ b/chrome/browser/net/sqlite_persistent_cookie_store.cc
@@ -294,11 +294,13 @@ bool InitTable(sql::Connection* db) {
}
// Try to create the index every time. Older versions did not have this index,
- // so we want those people to get it. Ignore errors, since it may exist.
wtc 2011/12/21 01:16:17 shess: please confirm that you want this function
Scott Hess - ex-Googler 2011/12/21 02:41:01 Yeah, the "CREATE INDEX IF NOT EXISTS" will succee
- db->Execute("CREATE INDEX IF NOT EXISTS cookie_times ON cookies"
- " (creation_utc)");
+ // so we want those people to get it.
+ if (!db->Execute("CREATE INDEX IF NOT EXISTS cookie_times ON cookies"
+ " (creation_utc)"))
+ return false;
- db->Execute("CREATE INDEX IF NOT EXISTS domain ON cookies(host_key)");
+ if (!db->Execute("CREATE INDEX IF NOT EXISTS domain ON cookies(host_key)"))
+ return false;
return true;
}
@@ -671,24 +673,24 @@ bool SQLitePersistentCookieStore::Backend::EnsureDatabaseVersion() {
sql::Transaction transaction(db_.get());
transaction.Begin();
#if !defined(OS_WIN)
- db_->Execute(
+ ignore_result(db_->Execute(
"UPDATE cookies "
"SET creation_utc = creation_utc + 11644473600000000 "
"WHERE rowid IN "
"(SELECT rowid FROM cookies WHERE "
- "creation_utc > 0 AND creation_utc < 11644473600000000)");
- db_->Execute(
+ "creation_utc > 0 AND creation_utc < 11644473600000000)"));
+ ignore_result(db_->Execute(
"UPDATE cookies "
"SET expires_utc = expires_utc + 11644473600000000 "
"WHERE rowid IN "
"(SELECT rowid FROM cookies WHERE "
- "expires_utc > 0 AND expires_utc < 11644473600000000)");
- db_->Execute(
+ "expires_utc > 0 AND expires_utc < 11644473600000000)"));
+ ignore_result(db_->Execute(
"UPDATE cookies "
"SET last_access_utc = last_access_utc + 11644473600000000 "
"WHERE rowid IN "
"(SELECT rowid FROM cookies WHERE "
- "last_access_utc > 0 AND last_access_utc < 11644473600000000)");
+ "last_access_utc > 0 AND last_access_utc < 11644473600000000)"));
#endif
++cur_version;
meta_table_.SetVersionNumber(cur_version);
« no previous file with comments | « chrome/browser/history/visitsegment_database.cc ('k') | sql/connection.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698