Chromium Code Reviews| Index: webkit/dom_storage/dom_storage_context.h |
| diff --git a/webkit/dom_storage/dom_storage_context.h b/webkit/dom_storage/dom_storage_context.h |
| index b6fe5da6ba26b3925fc0f54da15c1f3721bd88cb..9a69ceed275ba1246f6d1033992f6d52aba6c1db 100644 |
| --- a/webkit/dom_storage/dom_storage_context.h |
| +++ b/webkit/dom_storage/dom_storage_context.h |
| @@ -7,6 +7,7 @@ |
| #pragma once |
| #include <map> |
| +#include <set> |
| #include <vector> |
| #include "base/atomic_sequence_num.h" |
| @@ -35,6 +36,7 @@ class DomStorageArea; |
| class DomStorageNamespace; |
| class DomStorageSession; |
| class DomStorageTaskRunner; |
| +class SessionStorageDatabase; |
| // The Context is the root of an object containment hierachy for |
| // Namespaces and Areas related to the owning profile. |
| @@ -160,6 +162,11 @@ class DomStorageContext |
| void CloneSessionNamespace(int64 existing_id, int64 new_id, |
| const std::string& new_persistent_id); |
| + // Deletes all namespaces which don't have an associated DomStorageNamespace |
| + // alive. This function is used for deleting possible leftover data after an |
| + // unclean exit. |
| + void StartScavengingUnusedSessionStorage(); |
| + |
| private: |
| friend class DomStorageContextTest; |
| FRIEND_TEST_ALL_PREFIXES(DomStorageContextTest, Basics); |
| @@ -171,6 +178,15 @@ class DomStorageContext |
| void ClearSessionOnlyOrigins(); |
| + void FindUnusedSessionStorage( |
|
michaeln
2012/07/10 01:16:58
naming nit: maybe name all of the Find and Delete
marja
2012/07/10 13:40:52
Done.
|
| + const std::set<std::string>& namespace_ids_in_use, |
| + const std::set<std::string>& protected_persistent_session_ids); |
| + void FindUnusedSessionStorageInCommitSequence( |
| + const std::set<std::string>& namespace_ids_in_use, |
| + const std::set<std::string>& protected_persistent_session_ids); |
| + void DeleteNextUnunsedNamespace(); |
|
michaeln
2012/07/10 01:16:58
typo Ununsed -> Unused
marja
2012/07/10 13:40:52
Done.
|
| + void DeleteNextUnunsedNamespaceInCommitSequence(); |
| + |
| // Collection of namespaces keyed by id. |
| StorageNamespaceMap namespaces_; |
| @@ -195,6 +211,15 @@ class DomStorageContext |
| bool is_shutdown_; |
| bool force_keep_session_state_; |
| scoped_refptr<quota::SpecialStoragePolicy> special_storage_policy_; |
| + scoped_refptr<SessionStorageDatabase> session_storage_database_; |
| + |
| + // For cleaning up unused namespaces gradually. |
| + bool scavenging_started_; |
| + std::vector<std::string> deletable_persistent_namespace_ids_; |
| + |
| + // Persistent namespace IDs to protect from gradual deletion (they will |
| + // be needed for session restore). |
| + std::set<std::string> protected_persistent_session_ids_; |
| }; |
| } // namespace dom_storage |