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; |