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

Unified Diff: webkit/dom_storage/dom_storage_namespace.cc

Issue 12398008: Purge in-memory localStorage areas if the # of areas exceeds the limit (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 9 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: webkit/dom_storage/dom_storage_namespace.cc
diff --git a/webkit/dom_storage/dom_storage_namespace.cc b/webkit/dom_storage/dom_storage_namespace.cc
index 4c1cbd7466c63818c755b183a3bcd628882e0225..ca9fb64a33efde74e04d09d5ccff0850d6ea090f 100644
--- a/webkit/dom_storage/dom_storage_namespace.cc
+++ b/webkit/dom_storage/dom_storage_namespace.cc
@@ -117,6 +117,20 @@ void DomStorageNamespace::DeleteSessionStorageOrigin(const GURL& origin) {
CloseStorageArea(area);
}
+void DomStorageNamespace::PurgeUnopenedAreas() {
+ if (directory_.empty())
+ return; // We can't purge w/o backing on disk.
+ AreaMap::iterator it = areas_.begin();
+ while (it != areas_.end()) {
michaeln 2013/04/05 23:39:23 There's a block of code in PurgeMemory that i thin
kinuko 2013/04/10 07:04:14 Sounds good, I consolidated the two methods.
+ if (it->second.open_count_ == 0) {
+ it->second.area_->Shutdown();
+ areas_.erase(it++);
+ continue;
+ }
+ ++it;
+ }
+}
+
void DomStorageNamespace::PurgeMemory() {
if (directory_.empty())
return; // We can't purge w/o backing on disk.

Powered by Google App Engine
This is Rietveld 408576698