blob: dd825d2fdc79c2725caa05cc94fbffd503655b0e [file] [log] [blame]
tommic06b1332016-05-14 11:31:40 -07001/*
2 * Copyright 2016 The WebRTC Project Authors. All rights reserved.
3 *
4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree.
9 */
10
Danil Chapovalov826f2e72019-02-20 18:13:09 +010011#include "rtc_base/task_queue_win.h"
tommic06b1332016-05-14 11:31:40 -070012
Yves Gerey665174f2018-06-19 15:03:05 +020013// clang-format off
14// clang formating would change include order.
15
Danil Chapovalov02fddf62018-02-12 12:41:16 +010016// Include winsock2.h before including <windows.h> to maintain consistency with
Niels Möllerb06b0a62018-05-25 10:05:34 +020017// win32.h. To include win32.h directly, it must be broken out into its own
18// build target.
Danil Chapovalov02fddf62018-02-12 12:41:16 +010019#include <winsock2.h>
20#include <windows.h>
Yves Gerey665174f2018-06-19 15:03:05 +020021#include <sal.h> // Must come after windows headers.
Danil Chapovalov02fddf62018-02-12 12:41:16 +010022#include <mmsystem.h> // Must come after windows headers.
Yves Gerey665174f2018-06-19 15:03:05 +020023// clang-format on
tommic06b1332016-05-14 11:31:40 -070024#include <string.h>
tommic06b1332016-05-14 11:31:40 -070025
tommif9d91542017-02-17 02:47:11 -080026#include <algorithm>
Mirko Bonadei317a1f02019-09-17 17:06:18 +020027#include <memory>
tommi0b942152017-03-10 09:33:53 -080028#include <queue>
Danil Chapovalov6f09ae22017-10-12 14:39:25 +020029#include <utility>
tommif9d91542017-02-17 02:47:11 -080030
Danil Chapovalov826f2e72019-02-20 18:13:09 +010031#include "absl/strings/string_view.h"
32#include "api/task_queue/queued_task.h"
33#include "api/task_queue/task_queue_base.h"
Mirko Bonadei92ea95e2017-09-15 06:47:31 +020034#include "rtc_base/arraysize.h"
35#include "rtc_base/checks.h"
Steve Anton10542f22019-01-11 09:11:00 -080036#include "rtc_base/critical_section.h"
Mirko Bonadei92ea95e2017-09-15 06:47:31 +020037#include "rtc_base/event.h"
38#include "rtc_base/logging.h"
Karl Wiberge40468b2017-11-22 10:42:26 +010039#include "rtc_base/numerics/safe_conversions.h"
Mirko Bonadei92ea95e2017-09-15 06:47:31 +020040#include "rtc_base/platform_thread.h"
Steve Anton10542f22019-01-11 09:11:00 -080041#include "rtc_base/time_utils.h"
tommic06b1332016-05-14 11:31:40 -070042
Danil Chapovalov826f2e72019-02-20 18:13:09 +010043namespace webrtc {
tommic06b1332016-05-14 11:31:40 -070044namespace {
45#define WM_RUN_TASK WM_USER + 1
46#define WM_QUEUE_DELAYED_TASK WM_USER + 2
47
tommic06b1332016-05-14 11:31:40 -070048void CALLBACK InitializeQueueThread(ULONG_PTR param) {
49 MSG msg;
tommif9d91542017-02-17 02:47:11 -080050 ::PeekMessage(&msg, nullptr, WM_USER, WM_USER, PM_NOREMOVE);
Danil Chapovalov826f2e72019-02-20 18:13:09 +010051 rtc::Event* data = reinterpret_cast<rtc::Event*>(param);
52 data->Set();
tommic06b1332016-05-14 11:31:40 -070053}
tommic9bb7912017-02-24 10:42:14 -080054
Danil Chapovalov826f2e72019-02-20 18:13:09 +010055rtc::ThreadPriority TaskQueuePriorityToThreadPriority(
56 TaskQueueFactory::Priority priority) {
tommic9bb7912017-02-24 10:42:14 -080057 switch (priority) {
Danil Chapovalov826f2e72019-02-20 18:13:09 +010058 case TaskQueueFactory::Priority::HIGH:
59 return rtc::kRealtimePriority;
60 case TaskQueueFactory::Priority::LOW:
61 return rtc::kLowPriority;
62 case TaskQueueFactory::Priority::NORMAL:
63 return rtc::kNormalPriority;
tommic9bb7912017-02-24 10:42:14 -080064 default:
65 RTC_NOTREACHED();
66 break;
67 }
Danil Chapovalov826f2e72019-02-20 18:13:09 +010068 return rtc::kNormalPriority;
tommic9bb7912017-02-24 10:42:14 -080069}
tommi5bdee472017-03-03 05:20:12 -080070
tommi0b942152017-03-10 09:33:53 -080071int64_t GetTick() {
tommi5bdee472017-03-03 05:20:12 -080072 static const UINT kPeriod = 1;
73 bool high_res = (timeBeginPeriod(kPeriod) == TIMERR_NOERROR);
Danil Chapovalov826f2e72019-02-20 18:13:09 +010074 int64_t ret = rtc::TimeMillis();
tommi5bdee472017-03-03 05:20:12 -080075 if (high_res)
76 timeEndPeriod(kPeriod);
77 return ret;
78}
tommic06b1332016-05-14 11:31:40 -070079
tommi0b942152017-03-10 09:33:53 -080080class DelayedTaskInfo {
tommif9d91542017-02-17 02:47:11 -080081 public:
tommi0b942152017-03-10 09:33:53 -080082 // Default ctor needed to support priority_queue::pop().
83 DelayedTaskInfo() {}
84 DelayedTaskInfo(uint32_t milliseconds, std::unique_ptr<QueuedTask> task)
85 : due_time_(GetTick() + milliseconds), task_(std::move(task)) {}
86 DelayedTaskInfo(DelayedTaskInfo&&) = default;
tommif9d91542017-02-17 02:47:11 -080087
tommi0b942152017-03-10 09:33:53 -080088 // Implement for priority_queue.
89 bool operator>(const DelayedTaskInfo& other) const {
90 return due_time_ > other.due_time_;
91 }
tommif9d91542017-02-17 02:47:11 -080092
tommi0b942152017-03-10 09:33:53 -080093 // Required by priority_queue::pop().
94 DelayedTaskInfo& operator=(DelayedTaskInfo&& other) = default;
95
96 // See below for why this method is const.
97 void Run() const {
98 RTC_DCHECK(due_time_);
99 task_->Run() ? task_.reset() : static_cast<void>(task_.release());
100 }
101
102 int64_t due_time() const { return due_time_; }
103
104 private:
105 int64_t due_time_ = 0; // Absolute timestamp in milliseconds.
106
107 // |task| needs to be mutable because std::priority_queue::top() returns
108 // a const reference and a key in an ordered queue must not be changed.
109 // There are two basic workarounds, one using const_cast, which would also
110 // make the key (|due_time|), non-const and the other is to make the non-key
111 // (|task|), mutable.
112 // Because of this, the |task| variable is made private and can only be
113 // mutated by calling the |Run()| method.
114 mutable std::unique_ptr<QueuedTask> task_;
115};
116
117class MultimediaTimer {
118 public:
tommi83722262017-03-15 04:36:29 -0700119 // Note: We create an event that requires manual reset.
120 MultimediaTimer() : event_(::CreateEvent(nullptr, true, false, nullptr)) {}
tommif9d91542017-02-17 02:47:11 -0800121
tommi0b942152017-03-10 09:33:53 -0800122 ~MultimediaTimer() {
123 Cancel();
124 ::CloseHandle(event_);
tommif9d91542017-02-17 02:47:11 -0800125 }
126
tommi0b942152017-03-10 09:33:53 -0800127 bool StartOneShotTimer(UINT delay_ms) {
tommif9d91542017-02-17 02:47:11 -0800128 RTC_DCHECK_EQ(0, timer_id_);
129 RTC_DCHECK(event_ != nullptr);
tommif9d91542017-02-17 02:47:11 -0800130 timer_id_ =
131 ::timeSetEvent(delay_ms, 0, reinterpret_cast<LPTIMECALLBACK>(event_), 0,
132 TIME_ONESHOT | TIME_CALLBACK_EVENT_SET);
133 return timer_id_ != 0;
134 }
135
tommi0b942152017-03-10 09:33:53 -0800136 void Cancel() {
tommi83722262017-03-15 04:36:29 -0700137 ::ResetEvent(event_);
tommif9d91542017-02-17 02:47:11 -0800138 if (timer_id_) {
139 ::timeKillEvent(timer_id_);
140 timer_id_ = 0;
141 }
tommif9d91542017-02-17 02:47:11 -0800142 }
143
tommi0b942152017-03-10 09:33:53 -0800144 HANDLE* event_for_wait() { return &event_; }
tommif9d91542017-02-17 02:47:11 -0800145
146 private:
tommif9d91542017-02-17 02:47:11 -0800147 HANDLE event_ = nullptr;
148 MMRESULT timer_id_ = 0;
tommif9d91542017-02-17 02:47:11 -0800149
150 RTC_DISALLOW_COPY_AND_ASSIGN(MultimediaTimer);
151};
152
Danil Chapovalov826f2e72019-02-20 18:13:09 +0100153class TaskQueueWin : public TaskQueueBase {
tommi0b942152017-03-10 09:33:53 -0800154 public:
Danil Chapovalov826f2e72019-02-20 18:13:09 +0100155 TaskQueueWin(absl::string_view queue_name, rtc::ThreadPriority priority);
156 ~TaskQueueWin() override = default;
tommi0b942152017-03-10 09:33:53 -0800157
Danil Chapovalov826f2e72019-02-20 18:13:09 +0100158 void Delete() override;
159 void PostTask(std::unique_ptr<QueuedTask> task) override;
160 void PostDelayedTask(std::unique_ptr<QueuedTask> task,
161 uint32_t milliseconds) override;
nisse341c8e42017-09-06 04:38:22 -0700162
163 void RunPendingTasks();
tommi0b942152017-03-10 09:33:53 -0800164
165 private:
nisse341c8e42017-09-06 04:38:22 -0700166 static void ThreadMain(void* context);
tommi0b942152017-03-10 09:33:53 -0800167
Danil Chapovalov826f2e72019-02-20 18:13:09 +0100168 class WorkerThread : public rtc::PlatformThread {
nisse341c8e42017-09-06 04:38:22 -0700169 public:
Danil Chapovalov826f2e72019-02-20 18:13:09 +0100170 WorkerThread(rtc::ThreadRunFunction func,
nisse341c8e42017-09-06 04:38:22 -0700171 void* obj,
Danil Chapovalov826f2e72019-02-20 18:13:09 +0100172 absl::string_view thread_name,
173 rtc::ThreadPriority priority)
nisse341c8e42017-09-06 04:38:22 -0700174 : PlatformThread(func, obj, thread_name, priority) {}
175
176 bool QueueAPC(PAPCFUNC apc_function, ULONG_PTR data) {
Danil Chapovalov826f2e72019-02-20 18:13:09 +0100177 return rtc::PlatformThread::QueueAPC(apc_function, data);
nisse341c8e42017-09-06 04:38:22 -0700178 }
tommi0b942152017-03-10 09:33:53 -0800179 };
180
Danil Chapovalov826f2e72019-02-20 18:13:09 +0100181 void RunThreadMain();
182 bool ProcessQueuedMessages();
183 void RunDueTasks();
184 void ScheduleNextTimer();
185 void CancelTimers();
nisse341c8e42017-09-06 04:38:22 -0700186
Danil Chapovalov826f2e72019-02-20 18:13:09 +0100187 // Since priority_queue<> by defult orders items in terms of
188 // largest->smallest, using std::less<>, and we want smallest->largest,
189 // we would like to use std::greater<> here. Alas it's only available in
190 // C++14 and later, so we roll our own compare template that that relies on
191 // operator<().
192 template <typename T>
193 struct greater {
194 bool operator()(const T& l, const T& r) { return l > r; }
nisse341c8e42017-09-06 04:38:22 -0700195 };
196
Danil Chapovalov826f2e72019-02-20 18:13:09 +0100197 MultimediaTimer timer_;
198 std::priority_queue<DelayedTaskInfo,
199 std::vector<DelayedTaskInfo>,
200 greater<DelayedTaskInfo>>
201 timer_tasks_;
202 UINT_PTR timer_id_ = 0;
nisse341c8e42017-09-06 04:38:22 -0700203 WorkerThread thread_;
204 rtc::CriticalSection pending_lock_;
danilchapa37de392017-09-09 04:17:22 -0700205 std::queue<std::unique_ptr<QueuedTask>> pending_
206 RTC_GUARDED_BY(pending_lock_);
tommi83722262017-03-15 04:36:29 -0700207 HANDLE in_queue_;
tommi0b942152017-03-10 09:33:53 -0800208};
209
Danil Chapovalov826f2e72019-02-20 18:13:09 +0100210TaskQueueWin::TaskQueueWin(absl::string_view queue_name,
211 rtc::ThreadPriority priority)
212 : thread_(&TaskQueueWin::ThreadMain, this, queue_name, priority),
nisse341c8e42017-09-06 04:38:22 -0700213 in_queue_(::CreateEvent(nullptr, true, false, nullptr)) {
tommi83722262017-03-15 04:36:29 -0700214 RTC_DCHECK(in_queue_);
tommic06b1332016-05-14 11:31:40 -0700215 thread_.Start();
Danil Chapovalov826f2e72019-02-20 18:13:09 +0100216 rtc::Event event(false, false);
tommic06b1332016-05-14 11:31:40 -0700217 RTC_CHECK(thread_.QueueAPC(&InitializeQueueThread,
Danil Chapovalov826f2e72019-02-20 18:13:09 +0100218 reinterpret_cast<ULONG_PTR>(&event)));
219 event.Wait(rtc::Event::kForever);
tommic06b1332016-05-14 11:31:40 -0700220}
221
Danil Chapovalov826f2e72019-02-20 18:13:09 +0100222void TaskQueueWin::Delete() {
tommic06b1332016-05-14 11:31:40 -0700223 RTC_DCHECK(!IsCurrent());
tommif9d91542017-02-17 02:47:11 -0800224 while (!::PostThreadMessage(thread_.GetThreadRef(), WM_QUIT, 0, 0)) {
kwiberg352444f2016-11-28 15:58:53 -0800225 RTC_CHECK_EQ(ERROR_NOT_ENOUGH_QUOTA, ::GetLastError());
tommic06b1332016-05-14 11:31:40 -0700226 Sleep(1);
227 }
228 thread_.Stop();
tommi83722262017-03-15 04:36:29 -0700229 ::CloseHandle(in_queue_);
Danil Chapovalov826f2e72019-02-20 18:13:09 +0100230 delete this;
tommic06b1332016-05-14 11:31:40 -0700231}
232
Danil Chapovalov826f2e72019-02-20 18:13:09 +0100233void TaskQueueWin::PostTask(std::unique_ptr<QueuedTask> task) {
tommi83722262017-03-15 04:36:29 -0700234 rtc::CritScope lock(&pending_lock_);
235 pending_.push(std::move(task));
236 ::SetEvent(in_queue_);
tommic06b1332016-05-14 11:31:40 -0700237}
238
Danil Chapovalov826f2e72019-02-20 18:13:09 +0100239void TaskQueueWin::PostDelayedTask(std::unique_ptr<QueuedTask> task,
240 uint32_t milliseconds) {
tommi0b942152017-03-10 09:33:53 -0800241 if (!milliseconds) {
242 PostTask(std::move(task));
243 return;
244 }
245
246 // TODO(tommi): Avoid this allocation. It is currently here since
247 // the timestamp stored in the task info object, is a 64bit timestamp
248 // and WPARAM is 32bits in 32bit builds. Otherwise, we could pass the
249 // task pointer and timestamp as LPARAM and WPARAM.
250 auto* task_info = new DelayedTaskInfo(milliseconds, std::move(task));
251 if (!::PostThreadMessage(thread_.GetThreadRef(), WM_QUEUE_DELAYED_TASK, 0,
252 reinterpret_cast<LPARAM>(task_info))) {
253 delete task_info;
tommic06b1332016-05-14 11:31:40 -0700254 }
255}
256
Danil Chapovalov826f2e72019-02-20 18:13:09 +0100257void TaskQueueWin::RunPendingTasks() {
tommi83722262017-03-15 04:36:29 -0700258 while (true) {
259 std::unique_ptr<QueuedTask> task;
260 {
261 rtc::CritScope lock(&pending_lock_);
262 if (pending_.empty())
263 break;
264 task = std::move(pending_.front());
265 pending_.pop();
266 }
267
268 if (!task->Run())
269 task.release();
270 }
271}
272
tommic06b1332016-05-14 11:31:40 -0700273// static
Danil Chapovalov826f2e72019-02-20 18:13:09 +0100274void TaskQueueWin::ThreadMain(void* context) {
275 static_cast<TaskQueueWin*>(context)->RunThreadMain();
tommi0b942152017-03-10 09:33:53 -0800276}
tommif9d91542017-02-17 02:47:11 -0800277
Danil Chapovalov826f2e72019-02-20 18:13:09 +0100278void TaskQueueWin::RunThreadMain() {
279 CurrentTaskQueueSetter set_current(this);
Yves Gerey665174f2018-06-19 15:03:05 +0200280 HANDLE handles[2] = {*timer_.event_for_wait(), in_queue_};
tommib89257a2016-07-12 01:24:36 -0700281 while (true) {
tommif9d91542017-02-17 02:47:11 -0800282 // Make sure we do an alertable wait as that's required to allow APCs to run
283 // (e.g. required for InitializeQueueThread and stopping the thread in
284 // PlatformThread).
tommi0b942152017-03-10 09:33:53 -0800285 DWORD result = ::MsgWaitForMultipleObjectsEx(
tommi83722262017-03-15 04:36:29 -0700286 arraysize(handles), handles, INFINITE, QS_ALLEVENTS, MWMO_ALERTABLE);
tommib89257a2016-07-12 01:24:36 -0700287 RTC_CHECK_NE(WAIT_FAILED, result);
tommi83722262017-03-15 04:36:29 -0700288 if (result == (WAIT_OBJECT_0 + 2)) {
tommi0b942152017-03-10 09:33:53 -0800289 // There are messages in the message queue that need to be handled.
290 if (!ProcessQueuedMessages())
tommib89257a2016-07-12 01:24:36 -0700291 break;
tommi83722262017-03-15 04:36:29 -0700292 }
293
Yves Gerey665174f2018-06-19 15:03:05 +0200294 if (result == WAIT_OBJECT_0 ||
295 (!timer_tasks_.empty() &&
296 ::WaitForSingleObject(*timer_.event_for_wait(), 0) == WAIT_OBJECT_0)) {
tommi0b942152017-03-10 09:33:53 -0800297 // The multimedia timer was signaled.
298 timer_.Cancel();
tommi0b942152017-03-10 09:33:53 -0800299 RunDueTasks();
300 ScheduleNextTimer();
tommi83722262017-03-15 04:36:29 -0700301 }
302
303 if (result == (WAIT_OBJECT_0 + 1)) {
304 ::ResetEvent(in_queue_);
Danil Chapovalov826f2e72019-02-20 18:13:09 +0100305 RunPendingTasks();
tommib89257a2016-07-12 01:24:36 -0700306 }
307 }
tommib89257a2016-07-12 01:24:36 -0700308}
tommic06b1332016-05-14 11:31:40 -0700309
Danil Chapovalov826f2e72019-02-20 18:13:09 +0100310bool TaskQueueWin::ProcessQueuedMessages() {
tommib89257a2016-07-12 01:24:36 -0700311 MSG msg = {};
tommi83722262017-03-15 04:36:29 -0700312 // To protect against overly busy message queues, we limit the time
313 // we process tasks to a few milliseconds. If we don't do that, there's
314 // a chance that timer tasks won't ever run.
315 static const int kMaxTaskProcessingTimeMs = 500;
316 auto start = GetTick();
tommif9d91542017-02-17 02:47:11 -0800317 while (::PeekMessage(&msg, nullptr, 0, 0, PM_REMOVE) &&
tommib89257a2016-07-12 01:24:36 -0700318 msg.message != WM_QUIT) {
tommic06b1332016-05-14 11:31:40 -0700319 if (!msg.hwnd) {
320 switch (msg.message) {
tommi83722262017-03-15 04:36:29 -0700321 // TODO(tommi): Stop using this way of queueing tasks.
tommic06b1332016-05-14 11:31:40 -0700322 case WM_RUN_TASK: {
323 QueuedTask* task = reinterpret_cast<QueuedTask*>(msg.lParam);
324 if (task->Run())
325 delete task;
326 break;
327 }
328 case WM_QUEUE_DELAYED_TASK: {
tommi0b942152017-03-10 09:33:53 -0800329 std::unique_ptr<DelayedTaskInfo> info(
330 reinterpret_cast<DelayedTaskInfo*>(msg.lParam));
331 bool need_to_schedule_timers =
332 timer_tasks_.empty() ||
333 timer_tasks_.top().due_time() > info->due_time();
334 timer_tasks_.emplace(std::move(*info.get()));
335 if (need_to_schedule_timers) {
336 CancelTimers();
337 ScheduleNextTimer();
tommif9d91542017-02-17 02:47:11 -0800338 }
tommic06b1332016-05-14 11:31:40 -0700339 break;
340 }
341 case WM_TIMER: {
tommi0b942152017-03-10 09:33:53 -0800342 RTC_DCHECK_EQ(timer_id_, msg.wParam);
tommif9d91542017-02-17 02:47:11 -0800343 ::KillTimer(nullptr, msg.wParam);
tommi0b942152017-03-10 09:33:53 -0800344 timer_id_ = 0;
345 RunDueTasks();
346 ScheduleNextTimer();
tommic06b1332016-05-14 11:31:40 -0700347 break;
348 }
349 default:
350 RTC_NOTREACHED();
351 break;
352 }
353 } else {
tommif9d91542017-02-17 02:47:11 -0800354 ::TranslateMessage(&msg);
355 ::DispatchMessage(&msg);
tommic06b1332016-05-14 11:31:40 -0700356 }
tommi83722262017-03-15 04:36:29 -0700357
358 if (GetTick() > start + kMaxTaskProcessingTimeMs)
359 break;
tommic06b1332016-05-14 11:31:40 -0700360 }
tommib89257a2016-07-12 01:24:36 -0700361 return msg.message != WM_QUIT;
tommic06b1332016-05-14 11:31:40 -0700362}
tommib89257a2016-07-12 01:24:36 -0700363
Danil Chapovalov826f2e72019-02-20 18:13:09 +0100364void TaskQueueWin::RunDueTasks() {
tommi0b942152017-03-10 09:33:53 -0800365 RTC_DCHECK(!timer_tasks_.empty());
366 auto now = GetTick();
367 do {
368 const auto& top = timer_tasks_.top();
369 if (top.due_time() > now)
370 break;
371 top.Run();
372 timer_tasks_.pop();
373 } while (!timer_tasks_.empty());
374}
375
Danil Chapovalov826f2e72019-02-20 18:13:09 +0100376void TaskQueueWin::ScheduleNextTimer() {
tommi0b942152017-03-10 09:33:53 -0800377 RTC_DCHECK_EQ(timer_id_, 0);
378 if (timer_tasks_.empty())
379 return;
380
381 const auto& next_task = timer_tasks_.top();
382 int64_t delay_ms = std::max(0ll, next_task.due_time() - GetTick());
383 uint32_t milliseconds = rtc::dchecked_cast<uint32_t>(delay_ms);
384 if (!timer_.StartOneShotTimer(milliseconds))
385 timer_id_ = ::SetTimer(nullptr, 0, milliseconds, nullptr);
386}
387
Danil Chapovalov826f2e72019-02-20 18:13:09 +0100388void TaskQueueWin::CancelTimers() {
tommi0b942152017-03-10 09:33:53 -0800389 timer_.Cancel();
390 if (timer_id_) {
391 ::KillTimer(nullptr, timer_id_);
392 timer_id_ = 0;
393 }
394}
395
Danil Chapovalov826f2e72019-02-20 18:13:09 +0100396class TaskQueueWinFactory : public TaskQueueFactory {
397 public:
398 std::unique_ptr<TaskQueueBase, TaskQueueDeleter> CreateTaskQueue(
399 absl::string_view name,
400 Priority priority) const override {
401 return std::unique_ptr<TaskQueueBase, TaskQueueDeleter>(
402 new TaskQueueWin(name, TaskQueuePriorityToThreadPriority(priority)));
403 }
404};
405
406} // namespace
407
408std::unique_ptr<TaskQueueFactory> CreateTaskQueueWinFactory() {
Mirko Bonadei317a1f02019-09-17 17:06:18 +0200409 return std::make_unique<TaskQueueWinFactory>();
nisse341c8e42017-09-06 04:38:22 -0700410}
411
Danil Chapovalov826f2e72019-02-20 18:13:09 +0100412} // namespace webrtc