Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(73)

Side by Side Diff: content/browser/download/download_task_runner.cc

Issue 2890853002: Downloads: replace BrowserThread::FILE with task scheduler. (Closed)
Patch Set: Revert ScopedCOMInitializer invocations. Created 3 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698