| 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 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 177 | 177 |
| 178 void DOMStorageContextImpl::DeleteLocalStorageFile(const FilePath& file_path) { | 178 void DOMStorageContextImpl::DeleteLocalStorageFile(const FilePath& file_path) { |
| 179 DCHECK(context_); | 179 DCHECK(context_); |
| 180 context_->task_runner()->PostShutdownBlockingTask( | 180 context_->task_runner()->PostShutdownBlockingTask( |
| 181 FROM_HERE, | 181 FROM_HERE, |
| 182 DomStorageTaskRunner::PRIMARY_SEQUENCE, | 182 DomStorageTaskRunner::PRIMARY_SEQUENCE, |
| 183 base::Bind(&DomStorageContext::DeleteOrigin, context_, | 183 base::Bind(&DomStorageContext::DeleteOrigin, context_, |
| 184 FilePathToOrigin(file_path))); | 184 FilePathToOrigin(file_path))); |
| 185 } | 185 } |
| 186 | 186 |
| 187 void DOMStorageContextImpl::DeleteDataModifiedSince(const base::Time& cutoff) { | |
| 188 DCHECK(context_); | |
| 189 context_->task_runner()->PostShutdownBlockingTask( | |
| 190 FROM_HERE, | |
| 191 DomStorageTaskRunner::PRIMARY_SEQUENCE, | |
| 192 base::Bind(&DomStorageContext::DeleteDataModifiedSince, context_, | |
| 193 cutoff)); | |
| 194 } | |
| 195 | |
| 196 void DOMStorageContextImpl::PurgeMemory() { | 187 void DOMStorageContextImpl::PurgeMemory() { |
| 197 DCHECK(context_); | 188 DCHECK(context_); |
| 198 context_->task_runner()->PostShutdownBlockingTask( | 189 context_->task_runner()->PostShutdownBlockingTask( |
| 199 FROM_HERE, | 190 FROM_HERE, |
| 200 DomStorageTaskRunner::PRIMARY_SEQUENCE, | 191 DomStorageTaskRunner::PRIMARY_SEQUENCE, |
| 201 base::Bind(&DomStorageContext::PurgeMemory, context_)); | 192 base::Bind(&DomStorageContext::PurgeMemory, context_)); |
| 202 } | 193 } |
| 203 | 194 |
| 204 void DOMStorageContextImpl::SetClearLocalState(bool clear_local_state) { | 195 void DOMStorageContextImpl::SetClearLocalState(bool clear_local_state) { |
| 205 DCHECK(context_); | 196 DCHECK(context_); |
| (...skipping 23 matching lines...) Expand all Loading... |
| 229 int64 DOMStorageContextImpl::LeakyCloneSessionStorage( | 220 int64 DOMStorageContextImpl::LeakyCloneSessionStorage( |
| 230 int64 existing_namespace_id) { | 221 int64 existing_namespace_id) { |
| 231 DCHECK(context_); | 222 DCHECK(context_); |
| 232 int64 clone_id = context_->AllocateSessionId(); | 223 int64 clone_id = context_->AllocateSessionId(); |
| 233 context_->task_runner()->PostTask( | 224 context_->task_runner()->PostTask( |
| 234 FROM_HERE, | 225 FROM_HERE, |
| 235 base::Bind(&DomStorageContext::CloneSessionNamespace, context_, | 226 base::Bind(&DomStorageContext::CloneSessionNamespace, context_, |
| 236 existing_namespace_id, clone_id)); | 227 existing_namespace_id, clone_id)); |
| 237 return clone_id; | 228 return clone_id; |
| 238 } | 229 } |
| OLD | NEW |