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" |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
59 context->GetSessionStorageUsage(infos); | 59 context->GetSessionStorageUsage(infos); |
60 reply_loop->PostTask( | 60 reply_loop->PostTask( |
61 FROM_HERE, | 61 FROM_HERE, |
62 base::Bind(&InvokeSessionStorageUsageCallbackHelper, | 62 base::Bind(&InvokeSessionStorageUsageCallbackHelper, |
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 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() ? |
74 data_path : data_path.AppendASCII(kLocalStorageDirectory), | 74 data_path : data_path.AppendASCII(kLocalStorageDirectory), |
75 data_path.empty() ? | 75 data_path.empty() ? |
76 data_path : data_path.AppendASCII(kSessionStorageDirectory), | 76 data_path : data_path.AppendASCII(kSessionStorageDirectory), |
77 special_storage_policy, | 77 special_storage_policy, |
78 new DomStorageWorkerPoolTaskRunner( | 78 new DomStorageWorkerPoolTaskRunner( |
79 worker_pool, | 79 worker_pool, |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
164 | 164 |
165 void DOMStorageContextImpl::Shutdown() { | 165 void DOMStorageContextImpl::Shutdown() { |
166 DCHECK(context_); | 166 DCHECK(context_); |
167 context_->task_runner()->PostShutdownBlockingTask( | 167 context_->task_runner()->PostShutdownBlockingTask( |
168 FROM_HERE, | 168 FROM_HERE, |
169 DomStorageTaskRunner::PRIMARY_SEQUENCE, | 169 DomStorageTaskRunner::PRIMARY_SEQUENCE, |
170 base::Bind(&DomStorageContext::Shutdown, context_)); | 170 base::Bind(&DomStorageContext::Shutdown, context_)); |
171 } | 171 } |
172 | 172 |
173 } // namespace content | 173 } // namespace content |
OLD | NEW |