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

Unified Diff: content/browser/dom_storage/dom_storage_namespace.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: Fixes. 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_namespace.h
diff --git a/content/browser/dom_storage/dom_storage_namespace.h b/content/browser/dom_storage/dom_storage_namespace.h
index f572284d5aea7f1484b768884f55f311e63c3d58..8529c148644101da8fae5c4cd45ca2c57aa1cbf6 100644
--- a/content/browser/dom_storage/dom_storage_namespace.h
+++ b/content/browser/dom_storage/dom_storage_namespace.h
@@ -34,6 +34,9 @@ class CONTENT_EXPORT DOMStorageNamespace
public:
// Option for PurgeMemory.
enum PurgeOption {
+ // Determines is purging is required based on the usage and the platform.
+ PURGE_IF_NEEDED,
+
// Purge unopened areas only.
PURGE_UNOPENED,
@@ -80,8 +83,6 @@ class CONTENT_EXPORT DOMStorageNamespace
void Shutdown();
void Flush();
- unsigned int CountInMemoryAreas() const;
-
// Adds memory statistics to |pmd| for chrome://tracing.
void OnMemoryDump(base::trace_event::ProcessMemoryDump* pmd);
@@ -107,12 +108,17 @@ class CONTENT_EXPORT DOMStorageNamespace
// Returns a pointer to the area holder in our map or NULL.
AreaHolder* GetAreaHolder(const GURL& origin);
+ // Helper to determine is purging is needed based on the usage and the
+ // platform.
+ bool ShouldPurgeMemory();
+
int64_t namespace_id_;
std::string persistent_namespace_id_;
base::FilePath directory_;
AreaMap areas_;
scoped_refptr<DOMStorageTaskRunner> task_runner_;
scoped_refptr<SessionStorageDatabase> session_storage_database_;
+ bool is_low_end_device_;
};
} // namespace content

Powered by Google App Engine
This is Rietveld 408576698