| 313 | |
| 314 | template <typename Task> |
| 315 | base::TaskLoop::PushResult RunDelayedTask(Thread thread, base::DelayedThreadPool::Duration const & delay, |
| 316 | Task && task) |
| 317 | { |
| 318 | ASSERT(m_networkThread && m_fileThread && m_backgroundThread, ()); |
| 319 | switch (thread) |
| 320 | { |
| 321 | case Thread::File: return m_fileThread->PushDelayed(delay, std::forward<Task>(task)); |
| 322 | case Thread::Network: return m_networkThread->PushDelayed(delay, std::forward<Task>(task)); |
| 323 | case Thread::Gui: CHECK(false, ("Delayed tasks for gui thread are not supported yet")); return {}; |
| 324 | case Thread::Background: return m_backgroundThread->PushDelayed(delay, std::forward<Task>(task)); |
| 325 | } |
| 326 | UNREACHABLE(); |
| 327 | } |
| 328 | |
| 329 | void CancelTask(Thread thread, base::TaskLoop::TaskId id); |
| 330 |
no test coverage detected