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

Unified Diff: webkit/dom_storage/dom_storage_area.h

Issue 9817011: DomStorage data deletion and memory purging. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 8 years, 9 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 | « content/browser/dom_storage/dom_storage_context_impl_new.cc ('k') | webkit/dom_storage/dom_storage_area.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/dom_storage/dom_storage_area.h
===================================================================
--- webkit/dom_storage/dom_storage_area.h (revision 127981)
+++ webkit/dom_storage/dom_storage_area.h (working copy)
@@ -29,6 +29,7 @@
public:
static const FilePath::CharType kDatabaseFileExtension[];
static FilePath DatabaseFileNameFromOrigin(const GURL& origin);
+ static GURL OriginFromDatabaseFileName(const FilePath& file_name);
DomStorageArea(int64 namespace_id,
const GURL& origin,
@@ -48,6 +49,17 @@
DomStorageArea* ShallowCopy(int64 destination_namespace_id);
+ bool HasUncommittedChanges() const;
+
+ // Similar to Clear() but more optimized for just deleting
+ // without raising events.
+ void DeleteOrigin();
+
+ // Frees up memory when possible. Typically, this method returns
+ // the object to its just constructed state, however if uncommitted
+ // changes are pending, it does nothing.
+ void PurgeMemory();
+
// Schedules the commit of any unsaved changes and enters a
// shutdown state such that the value getters and setters will
// no longer do anything.
@@ -60,6 +72,8 @@
FRIEND_TEST_ALL_PREFIXES(DomStorageAreaTest, TestDatabaseFilePath);
FRIEND_TEST_ALL_PREFIXES(DomStorageAreaTest, CommitTasks);
FRIEND_TEST_ALL_PREFIXES(DomStorageAreaTest, CommitChangesAtShutdown);
+ FRIEND_TEST_ALL_PREFIXES(DomStorageAreaTest, DeleteOrigin);
+ FRIEND_TEST_ALL_PREFIXES(DomStorageAreaTest, PurgeMemory);
friend class base::RefCountedThreadSafe<DomStorageArea>;
struct CommitBatch {
« no previous file with comments | « content/browser/dom_storage/dom_storage_context_impl_new.cc ('k') | webkit/dom_storage/dom_storage_area.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698