| 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 264 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 275 scoped_refptr<base::SequencedTaskRunner> primary_sequence; | 275 scoped_refptr<base::SequencedTaskRunner> primary_sequence; |
| 276 scoped_refptr<base::SequencedTaskRunner> commit_sequence; | 276 scoped_refptr<base::SequencedTaskRunner> commit_sequence; |
| 277 if (GetContentClient()->browser()->ShouldRedirectDOMStorageTaskRunner()) { | 277 if (GetContentClient()->browser()->ShouldRedirectDOMStorageTaskRunner()) { |
| 278 // TaskPriority::USER_BLOCKING as an experiment because this is currently | 278 // TaskPriority::USER_BLOCKING as an experiment because this is currently |
| 279 // believed to be blocking synchronous IPCs from the renderers: | 279 // believed to be blocking synchronous IPCs from the renderers: |
| 280 // http://crbug.com/665588 (yes we want to fix that bug, but are taking it | 280 // http://crbug.com/665588 (yes we want to fix that bug, but are taking it |
| 281 // as an opportunity to experiment with the scheduler). | 281 // as an opportunity to experiment with the scheduler). |
| 282 base::TaskTraits dom_storage_traits = | 282 base::TaskTraits dom_storage_traits = |
| 283 base::TaskTraits() | 283 base::TaskTraits() |
| 284 .WithShutdownBehavior(base::TaskShutdownBehavior::BLOCK_SHUTDOWN) | 284 .WithShutdownBehavior(base::TaskShutdownBehavior::BLOCK_SHUTDOWN) |
| 285 .WithFileIO() | 285 .MayBlock() |
| 286 .WithPriority(base::TaskPriority::USER_BLOCKING); | 286 .WithPriority(base::TaskPriority::USER_BLOCKING); |
| 287 primary_sequence = | 287 primary_sequence = |
| 288 base::CreateSequencedTaskRunnerWithTraits(dom_storage_traits); | 288 base::CreateSequencedTaskRunnerWithTraits(dom_storage_traits); |
| 289 commit_sequence = | 289 commit_sequence = |
| 290 base::CreateSequencedTaskRunnerWithTraits(dom_storage_traits); | 290 base::CreateSequencedTaskRunnerWithTraits(dom_storage_traits); |
| 291 } else { | 291 } else { |
| 292 base::SequencedWorkerPool* worker_pool = BrowserThread::GetBlockingPool(); | 292 base::SequencedWorkerPool* worker_pool = BrowserThread::GetBlockingPool(); |
| 293 primary_sequence = worker_pool->GetSequencedTaskRunner( | 293 primary_sequence = worker_pool->GetSequencedTaskRunner( |
| 294 worker_pool->GetNamedSequenceToken("dom_storage_primary")); | 294 worker_pool->GetNamedSequenceToken("dom_storage_primary")); |
| 295 commit_sequence = worker_pool->GetSequencedTaskRunner( | 295 commit_sequence = worker_pool->GetSequencedTaskRunner( |
| (...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 454 } | 454 } |
| 455 | 455 |
| 456 void DOMStorageContextWrapper::PurgeMemory(DOMStorageContextImpl::PurgeOption | 456 void DOMStorageContextWrapper::PurgeMemory(DOMStorageContextImpl::PurgeOption |
| 457 purge_option) { | 457 purge_option) { |
| 458 context_->task_runner()->PostTask( | 458 context_->task_runner()->PostTask( |
| 459 FROM_HERE, | 459 FROM_HERE, |
| 460 base::Bind(&DOMStorageContextImpl::PurgeMemory, context_, purge_option)); | 460 base::Bind(&DOMStorageContextImpl::PurgeMemory, context_, purge_option)); |
| 461 } | 461 } |
| 462 | 462 |
| 463 } // namespace content | 463 } // namespace content |
| OLD | NEW |