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/files/file_path.h" | 9 #include "base/files/file_path.h" |
10 #include "base/message_loop/message_loop_proxy.h" | 10 #include "base/message_loop/message_loop_proxy.h" |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
63 callback, base::Owned(infos))); | 63 callback, base::Owned(infos))); |
64 } | 64 } |
65 | 65 |
66 } // namespace | 66 } // namespace |
67 | 67 |
68 DOMStorageContextImpl::DOMStorageContextImpl( | 68 DOMStorageContextImpl::DOMStorageContextImpl( |
69 const base::FilePath& data_path, | 69 const base::FilePath& data_path, |
70 quota::SpecialStoragePolicy* special_storage_policy) { | 70 quota::SpecialStoragePolicy* special_storage_policy) { |
71 base::SequencedWorkerPool* worker_pool = BrowserThread::GetBlockingPool(); | 71 base::SequencedWorkerPool* worker_pool = BrowserThread::GetBlockingPool(); |
72 context_ = new dom_storage::DomStorageContext( | 72 context_ = new dom_storage::DomStorageContext( |
73 data_path.empty() ? | 73 data_path.empty() ? data_path |
74 data_path : data_path.AppendASCII(kLocalStorageDirectory), | 74 : data_path.AppendASCII(kLocalStorageDirectory), |
75 data_path.empty() ? | 75 data_path.empty() ? data_path |
76 data_path : data_path.AppendASCII(kSessionStorageDirectory), | 76 : data_path.AppendASCII(kSessionStorageDirectory), |
77 special_storage_policy, | 77 special_storage_policy, |
78 new DomStorageWorkerPoolTaskRunner( | 78 new DomStorageWorkerPoolTaskRunner( |
79 worker_pool, | 79 worker_pool, |
80 worker_pool->GetNamedSequenceToken("dom_storage_primary"), | 80 worker_pool->GetNamedSequenceToken("dom_storage_primary"), |
81 worker_pool->GetNamedSequenceToken("dom_storage_commit"), | 81 worker_pool->GetNamedSequenceToken("dom_storage_commit"), |
82 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO))); | 82 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO) |
| 83 .get())); |
83 } | 84 } |
84 | 85 |
85 DOMStorageContextImpl::~DOMStorageContextImpl() { | 86 DOMStorageContextImpl::~DOMStorageContextImpl() { |
86 } | 87 } |
87 | 88 |
88 void DOMStorageContextImpl::GetLocalStorageUsage( | 89 void DOMStorageContextImpl::GetLocalStorageUsage( |
89 const GetLocalStorageUsageCallback& callback) { | 90 const GetLocalStorageUsageCallback& callback) { |
90 DCHECK(context_.get()); | 91 DCHECK(context_.get()); |
91 context_->task_runner() | 92 context_->task_runner() |
92 ->PostShutdownBlockingTask(FROM_HERE, | 93 ->PostShutdownBlockingTask(FROM_HERE, |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
166 | 167 |
167 void DOMStorageContextImpl::Shutdown() { | 168 void DOMStorageContextImpl::Shutdown() { |
168 DCHECK(context_.get()); | 169 DCHECK(context_.get()); |
169 context_->task_runner()->PostShutdownBlockingTask( | 170 context_->task_runner()->PostShutdownBlockingTask( |
170 FROM_HERE, | 171 FROM_HERE, |
171 DomStorageTaskRunner::PRIMARY_SEQUENCE, | 172 DomStorageTaskRunner::PRIMARY_SEQUENCE, |
172 base::Bind(&DomStorageContext::Shutdown, context_)); | 173 base::Bind(&DomStorageContext::Shutdown, context_)); |
173 } | 174 } |
174 | 175 |
175 } // namespace content | 176 } // namespace content |
OLD | NEW |