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

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: 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
« no previous file with comments | « no previous file | content/browser/dom_storage/dom_storage_context_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..9909fdd6c5b77391ecd8bc084e2013d7675fa229 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.
@@ -143,7 +145,7 @@ class CONTENT_EXPORT DOMStorageArea
base::TimeDelta time_quantum_;
};
- struct CommitBatch {
+ struct CONTENT_EXPORT CommitBatch {
bool clear_all_first;
DOMStorageValuesMap changed_values;
« no previous file with comments | « no previous file | content/browser/dom_storage/dom_storage_context_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698