OLD | NEW |
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/message_loop_proxy.h" | 9 #include "base/message_loop_proxy.h" |
10 #include "content/public/browser/browser_thread.h" | 10 #include "content/public/browser/browser_thread.h" |
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
143 } | 143 } |
144 | 144 |
145 void DOMStorageContextImpl::PurgeMemory() { | 145 void DOMStorageContextImpl::PurgeMemory() { |
146 DCHECK(context_); | 146 DCHECK(context_); |
147 context_->task_runner()->PostShutdownBlockingTask( | 147 context_->task_runner()->PostShutdownBlockingTask( |
148 FROM_HERE, | 148 FROM_HERE, |
149 DomStorageTaskRunner::PRIMARY_SEQUENCE, | 149 DomStorageTaskRunner::PRIMARY_SEQUENCE, |
150 base::Bind(&DomStorageContext::PurgeMemory, context_)); | 150 base::Bind(&DomStorageContext::PurgeMemory, context_)); |
151 } | 151 } |
152 | 152 |
153 void DOMStorageContextImpl::SetClearLocalState(bool clear_local_state) { | 153 void DOMStorageContextImpl::SetForceKeepSessionState() { |
154 DCHECK(context_); | 154 DCHECK(context_); |
155 context_->task_runner()->PostShutdownBlockingTask( | 155 context_->task_runner()->PostShutdownBlockingTask( |
156 FROM_HERE, | 156 FROM_HERE, |
157 DomStorageTaskRunner::PRIMARY_SEQUENCE, | 157 DomStorageTaskRunner::PRIMARY_SEQUENCE, |
158 base::Bind(&DomStorageContext::SetClearLocalState, context_, | 158 base::Bind(&DomStorageContext::SetForceKeepSessionState, context_)); |
159 clear_local_state)); | |
160 } | |
161 | |
162 void DOMStorageContextImpl::SaveSessionState() { | |
163 DCHECK(context_); | |
164 context_->task_runner()->PostShutdownBlockingTask( | |
165 FROM_HERE, | |
166 DomStorageTaskRunner::PRIMARY_SEQUENCE, | |
167 base::Bind(&DomStorageContext::SaveSessionState, context_)); | |
168 } | 159 } |
169 | 160 |
170 void DOMStorageContextImpl::Shutdown() { | 161 void DOMStorageContextImpl::Shutdown() { |
171 DCHECK(context_); | 162 DCHECK(context_); |
172 context_->task_runner()->PostShutdownBlockingTask( | 163 context_->task_runner()->PostShutdownBlockingTask( |
173 FROM_HERE, | 164 FROM_HERE, |
174 DomStorageTaskRunner::PRIMARY_SEQUENCE, | 165 DomStorageTaskRunner::PRIMARY_SEQUENCE, |
175 base::Bind(&DomStorageContext::Shutdown, context_)); | 166 base::Bind(&DomStorageContext::Shutdown, context_)); |
176 } | 167 } |
177 | 168 |
178 int64 DOMStorageContextImpl::LeakyCloneSessionStorage( | 169 int64 DOMStorageContextImpl::LeakyCloneSessionStorage( |
179 int64 existing_namespace_id) { | 170 int64 existing_namespace_id) { |
180 DCHECK(context_); | 171 DCHECK(context_); |
181 int64 clone_id = context_->AllocateSessionId(); | 172 int64 clone_id = context_->AllocateSessionId(); |
182 context_->task_runner()->PostTask( | 173 context_->task_runner()->PostTask( |
183 FROM_HERE, | 174 FROM_HERE, |
184 base::Bind(&DomStorageContext::CloneSessionNamespace, context_, | 175 base::Bind(&DomStorageContext::CloneSessionNamespace, context_, |
185 existing_namespace_id, clone_id)); | 176 existing_namespace_id, clone_id)); |
186 return clone_id; | 177 return clone_id; |
187 } | 178 } |
OLD | NEW |