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

Unified Diff: content/browser/in_process_webkit/dom_storage_namespace.h

Issue 7480041: Adding session-only localStorage. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Adding tests. Created 9 years, 5 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/in_process_webkit/dom_storage_namespace.h
diff --git a/content/browser/in_process_webkit/dom_storage_namespace.h b/content/browser/in_process_webkit/dom_storage_namespace.h
index 1a6f1245ca35a5fc26dbceed445026288ba3933d..2b88549eac76b29194c38243699e6264e52e073a 100644
--- a/content/browser/in_process_webkit/dom_storage_namespace.h
+++ b/content/browser/in_process_webkit/dom_storage_namespace.h
@@ -31,7 +31,8 @@ class DOMStorageNamespace {
~DOMStorageNamespace();
- DOMStorageArea* GetStorageArea(const string16& origin);
+ DOMStorageArea* GetStorageArea(const string16& origin,
+ bool allow_permanent_storage);
DOMStorageNamespace* Copy(int64 clone_namespace_id);
void PurgeMemory();
@@ -57,6 +58,10 @@ class DOMStorageNamespace {
// Creates the underlying WebStorageNamespace on demand.
void CreateWebStorageNamespaceIfNecessary();
+ // Helpers for creating DOMStorageAreas.
+ DOMStorageArea* GetExistingStorageArea(const string16& origin);
+ DOMStorageArea* CreateStorageArea(const string16& origin);
+
// All the storage areas we own.
typedef base::hash_map<string16, DOMStorageArea*> OriginToStorageAreaMap;
OriginToStorageAreaMap origin_to_storage_area_;
@@ -77,6 +82,12 @@ class DOMStorageNamespace {
// SessionStorage vs. LocalStorage.
const DOMStorageType dom_storage_type_;
+ // A LocalStorage namespace holds a pointer to a session-only LocalStorage
+ // namespace. NULL if this DOMStorageNamespace is a SessionStorage, or a
+ // session-only LocalStorage, or a LocalStorage associated with an off the
+ // record profile.
+ scoped_ptr<DOMStorageNamespace> session_only_local_storage_;
+
DISALLOW_IMPLICIT_CONSTRUCTORS(DOMStorageNamespace);
};

Powered by Google App Engine
This is Rietveld 408576698