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

Unified Diff: content/browser/dom_storage/dom_storage_database.cc

Issue 1953703004: Purge browser cache for dom storage in a smarter way (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@dom_storage
Patch Set: Fix limit and description for UMA. Created 4 years, 7 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
Index: content/browser/dom_storage/dom_storage_database.cc
diff --git a/content/browser/dom_storage/dom_storage_database.cc b/content/browser/dom_storage/dom_storage_database.cc
index b19dffa6c2fb947c499cc8cb854b3d388f8a0a06..5b1b5bd63c3d0d21a1fab3aa4df0471647d98d96 100644
--- a/content/browser/dom_storage/dom_storage_database.cc
+++ b/content/browser/dom_storage/dom_storage_database.cc
@@ -68,6 +68,9 @@ void DOMStorageDatabase::ReadAllValues(DOMStorageValuesMap* result) {
(*result)[key] = base::NullableString16(value, false);
}
known_to_be_empty_ = result->empty();
+
+ // Reduce the size of sqlite caches.
+ db_->TrimMemory(false /* aggressively */);
}
bool DOMStorageDatabase::CommitChanges(bool clear_all_first,
@@ -125,6 +128,10 @@ bool DOMStorageDatabase::CommitChanges(bool clear_all_first,
bool success = transaction.Commit();
if (!success)
known_to_be_empty_ = old_known_to_be_empty;
+
+ // Reduce the size of sqlite caches.
+ db_->TrimMemory(false /* aggressively */);
+
return success;
}
« no previous file with comments | « content/browser/dom_storage/dom_storage_context_wrapper.cc ('k') | content/browser/dom_storage/dom_storage_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698