Index: content/browser/download/download_task_runner.cc |
diff --git a/content/browser/download/download_task_runner.cc b/content/browser/download/download_task_runner.cc |
new file mode 100644 |
index 0000000000000000000000000000000000000000..abaa7db808d7f069e3b1dc990b984063d0d365d5 |
--- /dev/null |
+++ b/content/browser/download/download_task_runner.cc |
@@ -0,0 +1,29 @@ |
+// Copyright 2017 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#include "content/browser/download/download_task_runner.h" |
+ |
+#include "base/lazy_instance.h" |
+#include "base/task_scheduler/post_task.h" |
+ |
+namespace content { |
+ |
+namespace { |
+ |
+struct DownloadTaskRunner { |
+ const scoped_refptr<base::SingleThreadTaskRunner> task_runner = |
+ base::CreateSingleThreadTaskRunnerWithTraits( |
+ {base::MayBlock(), base::TaskPriority::BACKGROUND}); |
gab
2017/06/21 19:42:24
Isn't this USER_VISIBLE?
Sigurður Ásgeirsson
2017/06/22 14:50:09
I'm not sure either way, the activity on this sequ
gab
2017/06/22 17:10:08
Right not interactive but user visible, i.e. not U
Sigurður Ásgeirsson
2017/06/22 18:47:28
Done.
|
+}; |
+ |
+base::LazyInstance<DownloadTaskRunner>::Leaky g_download_task_runner = |
+ LAZY_INSTANCE_INITIALIZER; |
gab
2017/06/21 19:42:24
Francois added a new API to do all of this in one
Sigurður Ásgeirsson
2017/06/22 14:50:09
Done.
|
+ |
+} // namespace |
+ |
+scoped_refptr<base::SingleThreadTaskRunner> GetDownloadTaskRunner() { |
+ return g_download_task_runner.Get().task_runner; |
+} |
+ |
+} // content |