Index: components/precache/core/precache_url_table.cc |
diff --git a/components/precache/core/precache_url_table.cc b/components/precache/core/precache_url_table.cc |
index bdee5136bfc72c35459ed4f195f7d4b4dcb84aae..46a815be6eb54adf7b55c35ccd5514efd39bc1be 100644 |
--- a/components/precache/core/precache_url_table.cc |
+++ b/components/precache/core/precache_url_table.cc |
@@ -108,12 +108,20 @@ void PrecacheURLTable::GetURLListForReferrerHost( |
} |
void PrecacheURLTable::ClearAllForReferrerHost(int64_t referrer_host_id) { |
- Statement statement(db_->GetCachedStatement( |
+ // Delete the URLs that are not precached. |
+ Statement delete_statement( |
+ db_->GetCachedStatement(SQL_FROM_HERE, |
+ "DELETE FROM precache_urls WHERE " |
+ "referrer_host_id=? AND is_precached=0")); |
+ delete_statement.BindInt64(0, referrer_host_id); |
+ delete_statement.Run(); |
+ |
+ // Clear was_used for precached URLs. |
+ Statement update_statement(db_->GetCachedStatement( |
SQL_FROM_HERE, |
"UPDATE precache_urls SET was_used=0 WHERE referrer_host_id=?")); |
- |
- statement.BindInt64(0, referrer_host_id); |
- statement.Run(); |
+ update_statement.BindInt64(0, referrer_host_id); |
+ update_statement.Run(); |
} |
void PrecacheURLTable::DeleteAllPrecachedBefore(const base::Time& delete_end) { |