diff options
author | Allan Sandfeld Jensen <allan.jensen@theqtcompany.com> | 2016-08-01 12:59:39 +0200 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2016-08-04 12:40:43 +0000 |
commit | 28b1110370900897ab652cb420c371fab8857ad4 (patch) | |
tree | 41b32127d23b0df4f2add2a27e12dc87bddb260e /chromium/content/browser/dom_storage/dom_storage_namespace.cc | |
parent | 399c965b6064c440ddcf4015f5f8e9d131c7a0a6 (diff) |
BASELINE: Update Chromium to 53.0.2785.41
Also adds a few extra files for extensions.
Change-Id: Iccdd55d98660903331cf8b7b29188da781830af4
Reviewed-by: Michael BrĂ¼ning <michael.bruning@qt.io>
Diffstat (limited to 'chromium/content/browser/dom_storage/dom_storage_namespace.cc')
-rw-r--r-- | chromium/content/browser/dom_storage/dom_storage_namespace.cc | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/chromium/content/browser/dom_storage/dom_storage_namespace.cc b/chromium/content/browser/dom_storage/dom_storage_namespace.cc index 6f976f0d501..9aba4238b0e 100644 --- a/chromium/content/browser/dom_storage/dom_storage_namespace.cc +++ b/chromium/content/browser/dom_storage/dom_storage_namespace.cc @@ -117,9 +117,10 @@ void DOMStorageNamespace::DeleteSessionStorageOrigin(const GURL& origin) { CloseStorageArea(area); } -void DOMStorageNamespace::PurgeMemory(PurgeOption option) { +void DOMStorageNamespace::PurgeMemory(bool aggressively) { if (directory_.empty()) return; // We can't purge w/o backing on disk. + AreaMap::iterator it = areas_.begin(); while (it != areas_.end()) { const AreaHolder& holder = it->second; @@ -143,7 +144,7 @@ void DOMStorageNamespace::PurgeMemory(PurgeOption option) { continue; } - if (option == PURGE_AGGRESSIVE) { + if (aggressively) { // If aggressive is true, we clear caches and such // for opened areas. holder.area_->PurgeMemory(); @@ -167,13 +168,18 @@ void DOMStorageNamespace::Flush() { } } -unsigned int DOMStorageNamespace::CountInMemoryAreas() const { - unsigned int area_count = 0; +DOMStorageNamespace::UsageStatistics DOMStorageNamespace::GetUsageStatistics() + const { + UsageStatistics stats = {0}; for (AreaMap::const_iterator it = areas_.begin(); it != areas_.end(); ++it) { - if (it->second.area_->IsLoadedInMemory()) - ++area_count; + if (it->second.area_->IsLoadedInMemory()) { + stats.total_cache_size += it->second.area_->map_usage_in_bytes(); + ++stats.total_area_count; + if (it->second.open_count_ == 0) + ++stats.inactive_area_count; + } } - return area_count; + return stats; } void DOMStorageNamespace::OnMemoryDump( |