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

Unified Diff: webkit/dom_storage/dom_storage_namespace.h

Issue 12398008: Purge in-memory localStorage areas if the # of areas exceeds the limit (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: comment fix Created 7 years, 8 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 | « webkit/dom_storage/dom_storage_host.cc ('k') | webkit/dom_storage/dom_storage_namespace.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/dom_storage/dom_storage_namespace.h
diff --git a/webkit/dom_storage/dom_storage_namespace.h b/webkit/dom_storage/dom_storage_namespace.h
index 78ef4d77ff10b690dd39f97b569f17e4686a4632..1d20e8638d973dc437dfd4f49503fd41c7da91dd 100644
--- a/webkit/dom_storage/dom_storage_namespace.h
+++ b/webkit/dom_storage/dom_storage_namespace.h
@@ -25,6 +25,16 @@ class SessionStorageDatabase;
class WEBKIT_STORAGE_EXPORT DomStorageNamespace
: public base::RefCountedThreadSafe<DomStorageNamespace> {
public:
+ // Option for PurgeMemory.
+ enum PurgeOption {
+ // Purge unopened areas only.
+ PURGE_UNOPENED,
+
+ // Purge aggressively, i.e. discard cache even for areas that have
+ // non-zero open count.
+ PURGE_AGGRESSIVE,
+ };
+
// Constructor for a LocalStorage namespace with id of 0
// and an optional backing directory on disk.
DomStorageNamespace(const base::FilePath& directory, // may be empty
@@ -59,9 +69,11 @@ class WEBKIT_STORAGE_EXPORT DomStorageNamespace
void DeleteLocalStorageOrigin(const GURL& origin);
void DeleteSessionStorageOrigin(const GURL& origin);
- void PurgeMemory();
+ void PurgeMemory(PurgeOption purge);
void Shutdown();
+ unsigned int CountInMemoryAreas() const;
+
private:
friend class base::RefCountedThreadSafe<DomStorageNamespace>;
« no previous file with comments | « webkit/dom_storage/dom_storage_host.cc ('k') | webkit/dom_storage/dom_storage_namespace.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698