| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chromecast/base/task_runner_impl.h" | 5 #include "chromecast/base/task_runner_impl.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/location.h" | 8 #include "base/location.h" |
| 9 #include "base/single_thread_task_runner.h" | 9 #include "base/single_thread_task_runner.h" |
| 10 #include "base/thread_task_runner_handle.h" | 10 #include "base/threading/thread_task_runner_handle.h" |
| 11 | 11 |
| 12 namespace chromecast { | 12 namespace chromecast { |
| 13 | 13 |
| 14 TaskRunnerImpl::TaskRunnerImpl() | 14 TaskRunnerImpl::TaskRunnerImpl() |
| 15 : runner_(base::ThreadTaskRunnerHandle::Get()) { | 15 : runner_(base::ThreadTaskRunnerHandle::Get()) { |
| 16 DCHECK(runner_.get()); | 16 DCHECK(runner_.get()); |
| 17 } | 17 } |
| 18 | 18 |
| 19 TaskRunnerImpl::~TaskRunnerImpl() {} | 19 TaskRunnerImpl::~TaskRunnerImpl() {} |
| 20 | 20 |
| 21 bool TaskRunnerImpl::PostTask(Task* task, uint64_t delay_milliseconds) { | 21 bool TaskRunnerImpl::PostTask(Task* task, uint64_t delay_milliseconds) { |
| 22 DCHECK(task); | 22 DCHECK(task); |
| 23 // TODO(halliwell): FROM_HERE is misleading, we should consider a macro for | 23 // TODO(halliwell): FROM_HERE is misleading, we should consider a macro for |
| 24 // vendor backends to send the callsite info. | 24 // vendor backends to send the callsite info. |
| 25 return runner_->PostDelayedTask( | 25 return runner_->PostDelayedTask( |
| 26 FROM_HERE, base::Bind(&Task::Run, base::Owned(task)), | 26 FROM_HERE, base::Bind(&Task::Run, base::Owned(task)), |
| 27 base::TimeDelta::FromMilliseconds(delay_milliseconds)); | 27 base::TimeDelta::FromMilliseconds(delay_milliseconds)); |
| 28 } | 28 } |
| 29 | 29 |
| 30 } // namespace chromecast | 30 } // namespace chromecast |
| OLD | NEW |