Chromium Code Reviews| 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. |