OLD | NEW |
---|---|
(Empty) | |
1 // Copyright (c) 2015 The Chromium Authors. All rights reserved. | |
gunsch
2015/07/29 17:22:36
I like how this is the same file as Luke's, but wi
slan
2015/07/29 19:51:54
:) Added a NOTE for review purposes.
| |
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 "chromecast/base/task_runner_impl.h" | |
6 | |
7 #include "base/bind.h" | |
8 #include "base/location.h" | |
9 #include "base/single_thread_task_runner.h" | |
10 #include "base/thread_task_runner_handle.h" | |
11 | |
12 namespace chromecast { | |
13 | |
14 TaskRunnerImpl::TaskRunnerImpl() | |
15 : runner_(base::ThreadTaskRunnerHandle::Get()) { | |
16 DCHECK(runner_.get()); | |
17 } | |
18 | |
19 TaskRunnerImpl::~TaskRunnerImpl() { | |
20 } | |
21 | |
22 bool TaskRunnerImpl::BelongsToCurrentThread() { | |
23 return runner_->BelongsToCurrentThread(); | |
24 } | |
25 | |
26 bool TaskRunnerImpl::PostTask(Task* task, uint64_t delay_milliseconds) { | |
27 // TODO(halliwell): FROM_HERE is misleading, we should consider a macro for | |
28 // vendor backends to send the callsite info. | |
29 return runner_->PostDelayedTask( | |
30 FROM_HERE, | |
31 base::Bind(&Task::Run, base::Owned(task)), | |
32 base::TimeDelta::FromMilliseconds(delay_milliseconds)); | |
33 } | |
34 | |
35 } // namespace chromecast | |
OLD | NEW |