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

Unified Diff: content/browser/dom_storage/dom_storage_host.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_host.cc
diff --git a/content/browser/dom_storage/dom_storage_host.cc b/content/browser/dom_storage/dom_storage_host.cc
index 3db7d5a15ec774e21de3ed46a77a109b981beed7..bba4460ce17788c84081f4eb9c75c96808bac411 100644
--- a/content/browser/dom_storage/dom_storage_host.cc
+++ b/content/browser/dom_storage/dom_storage_host.cc
@@ -7,7 +7,6 @@
#include "content/browser/dom_storage/dom_storage_area.h"
#include "content/browser/dom_storage/dom_storage_context_impl.h"
#include "content/browser/dom_storage/dom_storage_namespace.h"
-#include "content/common/dom_storage/dom_storage_types.h"
#include "url/gurl.h"
namespace content {
@@ -55,11 +54,7 @@ bool DOMStorageHost::ExtractAreaValues(
if (!area->IsLoadedInMemory()) {
DOMStorageNamespace* ns = GetNamespace(connection_id);
DCHECK(ns);
- if (ns->CountInMemoryAreas() > kMaxInMemoryStorageAreas) {
- ns->PurgeMemory(DOMStorageNamespace::PURGE_UNOPENED);
- if (ns->CountInMemoryAreas() > kMaxInMemoryStorageAreas)
- ns->PurgeMemory(DOMStorageNamespace::PURGE_AGGRESSIVE);
- }
+ context_->PurgeMemory(DOMStorageContextImpl::PURGE_IF_NEEDED);
}
area->ExtractValues(map);
return true;
« no previous file with comments | « content/browser/dom_storage/dom_storage_database.cc ('k') | content/browser/dom_storage/dom_storage_namespace.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698