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

Side by Side Diff: content/browser/dom_storage/dom_storage_context_impl.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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/browser/dom_storage/dom_storage_context_impl.h" 5 #include "content/browser/dom_storage/dom_storage_context_impl.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/bind_helpers.h" 8 #include "base/bind_helpers.h"
9 #include "base/file_path.h" 9 #include "base/file_path.h"
10 #include "base/message_loop_proxy.h" 10 #include "base/message_loop_proxy.h"
11 #include "content/browser/dom_storage/session_storage_namespace_impl.h"
11 #include "content/public/browser/browser_thread.h" 12 #include "content/public/browser/browser_thread.h"
12 #include "webkit/dom_storage/dom_storage_area.h" 13 #include "webkit/dom_storage/dom_storage_area.h"
13 #include "webkit/dom_storage/dom_storage_context.h" 14 #include "webkit/dom_storage/dom_storage_context.h"
14 #include "webkit/dom_storage/dom_storage_task_runner.h" 15 #include "webkit/dom_storage/dom_storage_task_runner.h"
15 16
16 using content::BrowserThread; 17 using content::BrowserThread;
17 using content::DOMStorageContext; 18 using content::DOMStorageContext;
18 using dom_storage::DomStorageArea; 19 using dom_storage::DomStorageArea;
19 using dom_storage::DomStorageContext; 20 using dom_storage::DomStorageContext;
20 using dom_storage::DomStorageTaskRunner; 21 using dom_storage::DomStorageTaskRunner;
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
77 } 78 }
78 79
79 void DOMStorageContextImpl::DeleteOrigin(const GURL& origin) { 80 void DOMStorageContextImpl::DeleteOrigin(const GURL& origin) {
80 DCHECK(context_); 81 DCHECK(context_);
81 context_->task_runner()->PostShutdownBlockingTask( 82 context_->task_runner()->PostShutdownBlockingTask(
82 FROM_HERE, 83 FROM_HERE,
83 DomStorageTaskRunner::PRIMARY_SEQUENCE, 84 DomStorageTaskRunner::PRIMARY_SEQUENCE,
84 base::Bind(&DomStorageContext::DeleteOrigin, context_, origin)); 85 base::Bind(&DomStorageContext::DeleteOrigin, context_, origin));
85 } 86 }
86 87
88 scoped_refptr<content::SessionStorageNamespace>
89 DOMStorageContextImpl::RecreateSessionStorage(
90 const std::string& persistent_id) {
91 return scoped_refptr<content::SessionStorageNamespace>(
92 new SessionStorageNamespaceImpl(this, persistent_id));
93 }
94
87 void DOMStorageContextImpl::PurgeMemory() { 95 void DOMStorageContextImpl::PurgeMemory() {
88 DCHECK(context_); 96 DCHECK(context_);
89 context_->task_runner()->PostShutdownBlockingTask( 97 context_->task_runner()->PostShutdownBlockingTask(
90 FROM_HERE, 98 FROM_HERE,
91 DomStorageTaskRunner::PRIMARY_SEQUENCE, 99 DomStorageTaskRunner::PRIMARY_SEQUENCE,
92 base::Bind(&DomStorageContext::PurgeMemory, context_)); 100 base::Bind(&DomStorageContext::PurgeMemory, context_));
93 } 101 }
94 102
95 void DOMStorageContextImpl::SetForceKeepSessionState() { 103 void DOMStorageContextImpl::SetForceKeepSessionState() {
96 DCHECK(context_); 104 DCHECK(context_);
97 context_->task_runner()->PostShutdownBlockingTask( 105 context_->task_runner()->PostShutdownBlockingTask(
98 FROM_HERE, 106 FROM_HERE,
99 DomStorageTaskRunner::PRIMARY_SEQUENCE, 107 DomStorageTaskRunner::PRIMARY_SEQUENCE,
100 base::Bind(&DomStorageContext::SetForceKeepSessionState, context_)); 108 base::Bind(&DomStorageContext::SetForceKeepSessionState, context_));
101 } 109 }
102 110
103 void DOMStorageContextImpl::Shutdown() { 111 void DOMStorageContextImpl::Shutdown() {
104 DCHECK(context_); 112 DCHECK(context_);
105 context_->task_runner()->PostShutdownBlockingTask( 113 context_->task_runner()->PostShutdownBlockingTask(
106 FROM_HERE, 114 FROM_HERE,
107 DomStorageTaskRunner::PRIMARY_SEQUENCE, 115 DomStorageTaskRunner::PRIMARY_SEQUENCE,
108 base::Bind(&DomStorageContext::Shutdown, context_)); 116 base::Bind(&DomStorageContext::Shutdown, context_));
109 } 117 }
OLDNEW
« no previous file with comments | « content/browser/dom_storage/dom_storage_context_impl.h ('k') | content/browser/dom_storage/session_storage_namespace_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698