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

Unified Diff: content/browser/dom_storage/dom_storage_area.h

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: Add unittest. 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_area.h
diff --git a/content/browser/dom_storage/dom_storage_area.h b/content/browser/dom_storage/dom_storage_area.h
index 9fc646be19bae8f38225e9204c780fb8ab094188..06c06e84ab0580d58bf3bd375b5afeb971f5c339 100644
--- a/content/browser/dom_storage/dom_storage_area.h
+++ b/content/browser/dom_storage/dom_storage_area.h
@@ -18,6 +18,7 @@
#include "base/strings/nullable_string16.h"
#include "base/strings/string16.h"
#include "content/common/content_export.h"
+#include "content/common/dom_storage/dom_storage_map.h"
#include "content/common/dom_storage/dom_storage_types.h"
#include "url/gurl.h"
@@ -30,7 +31,6 @@ class ProcessMemoryDump;
namespace content {
class DOMStorageDatabaseAdapter;
-class DOMStorageMap;
class DOMStorageTaskRunner;
class SessionStorageDatabase;
@@ -65,6 +65,7 @@ class CONTENT_EXPORT DOMStorageArea
const GURL& origin() const { return origin_; }
int64_t namespace_id() const { return namespace_id_; }
+ size_t map_usage_in_bytes() const { return map_ ? map_->bytes_used() : 0; }
// Writes a copy of the current set of values in the area to the |map|.
void ExtractValues(DOMStorageValuesMap* map);
@@ -116,6 +117,7 @@ class CONTENT_EXPORT DOMStorageArea
FRIEND_TEST_ALL_PREFIXES(DOMStorageAreaTest, PurgeMemory);
FRIEND_TEST_ALL_PREFIXES(DOMStorageAreaTest, RateLimiter);
FRIEND_TEST_ALL_PREFIXES(DOMStorageContextImplTest, PersistentIds);
+ FRIEND_TEST_ALL_PREFIXES(DOMStorageContextImplTest, PurgeMemory);
friend class base::RefCountedThreadSafe<DOMStorageArea>;
// Used to rate limit commits.

Powered by Google App Engine
This is Rietveld 408576698