OLD | NEW |
(Empty) | |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "content/browser/download/download_task_runner.h" |
| 6 |
| 7 #include "base/task_scheduler/lazy_task_runner.h" |
| 8 #include "build/build_config.h" |
| 9 |
| 10 namespace content { |
| 11 |
| 12 namespace { |
| 13 |
| 14 #if defined(OS_WIN) |
| 15 // On Windows, the download code dips into COM and the shell here and there, |
| 16 // necessitating the use of a COM single-threaded apartment sequence. |
| 17 base::LazyCOMSTATaskRunner g_download_task_runner = |
| 18 LAZY_COM_STA_TASK_RUNNER_INITIALIZER( |
| 19 base::TaskTraits(base::MayBlock(), base::TaskPriority::USER_VISIBLE), |
| 20 base::SingleThreadTaskRunnerThreadMode::SHARED); |
| 21 #else |
| 22 base::LazySequencedTaskRunner g_download_task_runner = |
| 23 LAZY_SEQUENCED_TASK_RUNNER_INITIALIZER( |
| 24 base::TaskTraits(base::MayBlock(), base::TaskPriority::USER_VISIBLE)); |
| 25 #endif |
| 26 |
| 27 } // namespace |
| 28 |
| 29 scoped_refptr<base::SequencedTaskRunner> GetDownloadTaskRunner() { |
| 30 return g_download_task_runner.Get(); |
| 31 } |
| 32 |
| 33 } // namespace content |
OLD | NEW |