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

Unified Diff: content/browser/dom_storage/dom_storage_context_impl.cc

Issue 9963107: Persist sessionStorage on disk. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Draft: associate with session restore. Created 8 years, 7 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/dom_storage/dom_storage_context_impl.cc
diff --git a/content/browser/dom_storage/dom_storage_context_impl.cc b/content/browser/dom_storage/dom_storage_context_impl.cc
index 683e105d7d4587564208ed0abe0bd487c1195c76..91d3e36049b8b4daf452718baa20927ee6d7c0eb 100644
--- a/content/browser/dom_storage/dom_storage_context_impl.cc
+++ b/content/browser/dom_storage/dom_storage_context_impl.cc
@@ -26,6 +26,7 @@ using webkit_database::DatabaseUtil;
namespace {
const char kLocalStorageDirectory[] = "Local Storage";
+const char kSessionStorageDirectory[] = "Session Storage";
// TODO(michaeln): Fix the content layer api, FilePaths and
// string16 origin_ids are just wrong. Then get rid of
@@ -86,7 +87,8 @@ DOMStorageContextImpl::DOMStorageContextImpl(
context_ = new dom_storage::DomStorageContext(
data_path.empty() ?
data_path : data_path.AppendASCII(kLocalStorageDirectory),
- FilePath(), // Empty session storage directory.
+ data_path.empty() ?
+ data_path : data_path.AppendASCII(kSessionStorageDirectory),
special_storage_policy,
new DomStorageWorkerPoolTaskRunner(
worker_pool,
@@ -142,6 +144,16 @@ void DOMStorageContextImpl::DeleteDataModifiedSince(const base::Time& cutoff) {
cutoff));
}
+void DOMStorageContextImpl::AssociateSessionStorage(
+ int64 namespace_id, int64 real_id) {
+ DCHECK(context_);
+ context_->task_runner()->PostShutdownBlockingTask(
+ FROM_HERE,
+ DomStorageTaskRunner::PRIMARY_SEQUENCE,
+ base::Bind(&DomStorageContext::AssociateSessionStorage, context_,
+ namespace_id, real_id));
+}
+
void DOMStorageContextImpl::PurgeMemory() {
DCHECK(context_);
context_->task_runner()->PostShutdownBlockingTask(

Powered by Google App Engine
This is Rietveld 408576698