Chromium Code Reviews| Index: chromecast/base/task_runner_impl.cc |
| diff --git a/chromecast/base/task_runner_impl.cc b/chromecast/base/task_runner_impl.cc |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..54b5ba23287fc3b8feac69424136c658b472e66d |
| --- /dev/null |
| +++ b/chromecast/base/task_runner_impl.cc |
| @@ -0,0 +1,33 @@ |
| +// Copyright (c) 2015 The Chromium Authors. All rights reserved. |
|
gunsch
2015/07/29 17:04:20
no (c)
halliwell
2015/07/29 19:58:20
Done.
|
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#include "chromecast/base/task_runner_impl.h" |
| + |
| +#include "base/bind.h" |
| +#include "base/location.h" |
| +#include "base/single_thread_task_runner.h" |
| +#include "base/thread_task_runner_handle.h" |
| + |
| +namespace chromecast { |
| + |
| +TaskRunnerImpl::TaskRunnerImpl() |
| + : runner_(base::ThreadTaskRunnerHandle::Get()) { |
| + DCHECK(runner_.get()); |
| +} |
| + |
| +TaskRunnerImpl::~TaskRunnerImpl() {} |
| + |
| +bool TaskRunnerImpl::BelongsToCurrentThread() { |
| + return runner_->BelongsToCurrentThread(); |
| +} |
| + |
| +bool TaskRunnerImpl::PostTask(Task* task, uint64_t delay_milliseconds) { |
| + // TODO(halliwell): FROM_HERE is misleading, we should consider a macro for |
| + // vendor backends to send the callsite info. |
| + return runner_->PostDelayedTask( |
| + FROM_HERE, base::Bind(&Task::Run, base::Owned(task)), |
| + base::TimeDelta::FromMilliseconds(delay_milliseconds)); |
| +} |
| + |
| +} // namespace chromecast |