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

Unified Diff: webkit/dom_storage/dom_storage_context.h

Issue 9963107: Persist sessionStorage on disk. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Code review. Created 8 years, 6 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: 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 ca2b570f618d74cb9cc0f66e3717faf6fde6fb4a..9c9d8d3ebafd0083c8181241eef38f575d503051 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.
@@ -153,10 +155,16 @@ class DomStorageContext
return session_id_sequence_.GetNext();
}
+ std::string AllocatePersistentSessionId();
+
// Must be called on the background thread.
- void CreateSessionNamespace(int64 namespace_id);
+ void CreateSessionNamespace(int64 namespace_id,
+ const std::string& persistent_namespace_id);
void DeleteSessionNamespace(int64 namespace_id);
- void CloneSessionNamespace(int64 existing_id, int64 new_id);
+ void CloneSessionNamespace(int64 existing_id, int64 new_id,
+ const std::string& new_persistent_id);
+
+ void DoomSessionStorage(int64 namespace_id);
private:
friend class DomStorageContextTest;
@@ -169,6 +177,8 @@ class DomStorageContext
void ClearLocalStateInCommitSequence();
+ void DeleteLeftoverDataInCommitSequence();
+
// Collection of namespaces keyed by id.
StorageNamespaceMap namespaces_;
@@ -194,6 +204,15 @@ class DomStorageContext
bool clear_local_state_;
bool save_session_state_;
scoped_refptr<quota::SpecialStoragePolicy> special_storage_policy_;
+ scoped_refptr<SessionStorageDatabase> session_storage_database_;
+
+ // Namespace IDs for sessionStorages which won't be needed for session
+ // restore.
+ std::set<int64> deletable_session_storages_;
michaeln 2012/06/05 01:41:07 would doomed_session_ids_ work as a name? i think
marja 2012/06/06 13:37:10 Changed to "doomed_persistent_session_ids_".
+
+ // Persistent namespace IDs to protect from leftover data deletion (they will
+ // be needed for session restore).
+ std::set<std::string> protected_session_storages_;
};
} // namespace dom_storage

Powered by Google App Engine
This is Rietveld 408576698