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

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

Issue 1098883005: The SQLitePersistentCookieStore should use a non-partial index on iOS. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Comments from rohit round two. Created 5 years, 8 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: content/browser/net/sqlite_persistent_cookie_store.cc
diff --git a/content/browser/net/sqlite_persistent_cookie_store.cc b/content/browser/net/sqlite_persistent_cookie_store.cc
index 5da609bb67f72da1a964f60e0c6f67c8d5b41b74..63ea01d60293148c5c4a48029e6ce91e10617b44 100644
--- a/content/browser/net/sqlite_persistent_cookie_store.cc
+++ b/content/browser/net/sqlite_persistent_cookie_store.cc
@@ -432,9 +432,15 @@ bool InitTable(sql::Connection* db) {
if (!db->Execute("CREATE INDEX domain ON cookies(host_key)"))
return false;
+#if defined(OS_IOS)
+ // iOS 8.1 and older doesn't support partial indices. iOS 8.2 supports
+ // partial indices.
+ if (!db->Execute("CREATE INDEX is_transient ON cookies(persistent)")) {
+#else
if (!db->Execute(
"CREATE INDEX is_transient ON cookies(persistent) "
"where persistent != 1")) {
+#endif
return false;
}
@@ -981,9 +987,16 @@ bool SQLitePersistentCookieStore::Backend::EnsureDatabaseVersion() {
return false;
}
+#if defined(OS_IOS)
+ // iOS 8.1 and older doesn't support partial indices. iOS 8.2 supports
+ // partial indices.
+ if (!db_->Execute(
+ "CREATE INDEX IF NOT EXISTS is_transient ON cookies(persistent)")) {
+#else
if (!db_->Execute(
- "CREATE INDEX IF NOT EXISTS is_transient ON cookies(persistent) "
- "where persistent != 1")) {
+ "CREATE INDEX IF NOT EXISTS is_transient ON cookies(persistent) "
+ "where persistent != 1")) {
+#endif
LOG(WARNING)
<< "Unable to create index is_transient in update to version 9.";
return false;
« 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