| 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/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 Loading... |
| 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 } |
| OLD | NEW |