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

Unified Diff: webkit/dom_storage/dom_storage_session.cc

Issue 10572015: Session restore: Store and restore persistent IDs for sessionStorage. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: test fix 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
« no previous file with comments | « webkit/dom_storage/dom_storage_session.h ('k') | webkit/tools/test_shell/simple_dom_storage_system.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 91c2f39de7e21da437ec646f7755388f54c2eee3..2961fa3f8b7b3a0f5fbb20a6bd244f9d91605167 100644
--- a/webkit/dom_storage/dom_storage_session.cc
+++ b/webkit/dom_storage/dom_storage_session.cc
@@ -16,7 +16,8 @@ namespace dom_storage {
DomStorageSession::DomStorageSession(DomStorageContext* context)
: context_(context),
namespace_id_(context->AllocateSessionId()),
- persistent_namespace_id_(context->AllocatePersistentSessionId()) {
+ persistent_namespace_id_(context->AllocatePersistentSessionId()),
+ should_persist_(false) {
context->task_runner()->PostTask(
FROM_HERE,
base::Bind(&DomStorageContext::CreateSessionNamespace,
@@ -27,13 +28,18 @@ DomStorageSession::DomStorageSession(DomStorageContext* context,
const std::string& persistent_namespace_id)
: context_(context),
namespace_id_(context->AllocateSessionId()),
- persistent_namespace_id_(persistent_namespace_id) {
+ persistent_namespace_id_(persistent_namespace_id),
+ should_persist_(false) {
context->task_runner()->PostTask(
FROM_HERE,
base::Bind(&DomStorageContext::CreateSessionNamespace,
context_, namespace_id_, persistent_namespace_id_));
}
+void DomStorageSession::SetShouldPersist(bool should_persist) {
+ should_persist_ = should_persist;
+}
+
DomStorageSession* DomStorageSession::Clone() {
return CloneFrom(context_, namespace_id_);
}
@@ -63,7 +69,7 @@ DomStorageSession::~DomStorageSession() {
context_->task_runner()->PostTask(
FROM_HERE,
base::Bind(&DomStorageContext::DeleteSessionNamespace,
- context_, namespace_id_));
+ context_, namespace_id_, should_persist_));
}
} // namespace dom_storage
« no previous file with comments | « webkit/dom_storage/dom_storage_session.h ('k') | webkit/tools/test_shell/simple_dom_storage_system.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698