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

Unified Diff: webkit/dom_storage/dom_storage_session.cc

Issue 10546167: Create and store persistent unique ids for sessionStorage. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebased 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_session.cc
diff --git a/webkit/dom_storage/dom_storage_session.cc b/webkit/dom_storage/dom_storage_session.cc
index 1f9c390651fbffbf6cfcabb77452b579f390c223..91c2f39de7e21da437ec646f7755388f54c2eee3 100644
--- a/webkit/dom_storage/dom_storage_session.cc
+++ b/webkit/dom_storage/dom_storage_session.cc
@@ -15,11 +15,23 @@ namespace dom_storage {
DomStorageSession::DomStorageSession(DomStorageContext* context)
: context_(context),
- namespace_id_(context->AllocateSessionId()) {
+ namespace_id_(context->AllocateSessionId()),
+ persistent_namespace_id_(context->AllocatePersistentSessionId()) {
context->task_runner()->PostTask(
FROM_HERE,
base::Bind(&DomStorageContext::CreateSessionNamespace,
- context_, namespace_id_));
+ context_, namespace_id_, persistent_namespace_id_));
+}
+
+DomStorageSession::DomStorageSession(DomStorageContext* context,
+ const std::string& persistent_namespace_id)
+ : context_(context),
+ namespace_id_(context->AllocateSessionId()),
+ persistent_namespace_id_(persistent_namespace_id) {
+ context->task_runner()->PostTask(
+ FROM_HERE,
+ base::Bind(&DomStorageContext::CreateSessionNamespace,
+ context_, namespace_id_, persistent_namespace_id_));
}
DomStorageSession* DomStorageSession::Clone() {
@@ -30,17 +42,20 @@ DomStorageSession* DomStorageSession::Clone() {
DomStorageSession* DomStorageSession::CloneFrom(DomStorageContext* context,
int64 namepace_id_to_clone) {
int64 clone_id = context->AllocateSessionId();
+ std::string persistent_clone_id = context->AllocatePersistentSessionId();
marja 2012/06/15 09:17:42 (This could also be const std::string& persistent_
context->task_runner()->PostTask(
FROM_HERE,
base::Bind(&DomStorageContext::CloneSessionNamespace,
- context, namepace_id_to_clone, clone_id));
- return new DomStorageSession(context, clone_id);
+ context, namepace_id_to_clone, clone_id, persistent_clone_id));
+ return new DomStorageSession(context, clone_id, persistent_clone_id);
}
DomStorageSession::DomStorageSession(DomStorageContext* context,
- int64 namespace_id)
+ int64 namespace_id,
+ const std::string& persistent_namespace_id)
: context_(context),
- namespace_id_(namespace_id) {
+ namespace_id_(namespace_id),
+ persistent_namespace_id_(persistent_namespace_id) {
// This ctor is intended for use by the Clone() method.
}

Powered by Google App Engine
This is Rietveld 408576698