| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_wrapper.h" | 5 #include "content/browser/dom_storage/dom_storage_context_wrapper.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 267 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 278 | 278 |
| 279 void DOMStorageContextWrapper::OnPurgeMemory() { | 279 void DOMStorageContextWrapper::OnPurgeMemory() { |
| 280 PurgeMemory(DOMStorageContextImpl::PURGE_AGGRESSIVE); | 280 PurgeMemory(DOMStorageContextImpl::PURGE_AGGRESSIVE); |
| 281 } | 281 } |
| 282 | 282 |
| 283 void DOMStorageContextWrapper::PurgeMemory(DOMStorageContextImpl::PurgeOption | 283 void DOMStorageContextWrapper::PurgeMemory(DOMStorageContextImpl::PurgeOption |
| 284 purge_option) { | 284 purge_option) { |
| 285 context_->task_runner()->PostTask( | 285 context_->task_runner()->PostTask( |
| 286 FROM_HERE, | 286 FROM_HERE, |
| 287 base::Bind(&DOMStorageContextImpl::PurgeMemory, context_, purge_option)); | 287 base::Bind(&DOMStorageContextImpl::PurgeMemory, context_, purge_option)); |
| 288 if (mojo_state_ && purge_option == DOMStorageContextImpl::PURGE_AGGRESSIVE) |
| 289 mojo_state_->PurgeMemory(); |
| 288 } | 290 } |
| 289 | 291 |
| 290 void DOMStorageContextWrapper::GotMojoLocalStorageUsage( | 292 void DOMStorageContextWrapper::GotMojoLocalStorageUsage( |
| 291 GetLocalStorageUsageCallback callback, | 293 GetLocalStorageUsageCallback callback, |
| 292 std::vector<LocalStorageUsageInfo> usage) { | 294 std::vector<LocalStorageUsageInfo> usage) { |
| 293 context_->task_runner()->PostShutdownBlockingTask( | 295 context_->task_runner()->PostShutdownBlockingTask( |
| 294 FROM_HERE, DOMStorageTaskRunner::PRIMARY_SEQUENCE, | 296 FROM_HERE, DOMStorageTaskRunner::PRIMARY_SEQUENCE, |
| 295 base::Bind(&GetLocalStorageUsageHelper, base::Passed(&usage), | 297 base::Bind(&GetLocalStorageUsageHelper, base::Passed(&usage), |
| 296 base::RetainedRef(base::ThreadTaskRunnerHandle::Get()), | 298 base::RetainedRef(base::ThreadTaskRunnerHandle::Get()), |
| 297 base::RetainedRef(context_), callback)); | 299 base::RetainedRef(context_), callback)); |
| 298 } | 300 } |
| 299 | 301 |
| 300 } // namespace content | 302 } // namespace content |
| OLD | NEW |