Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright (c) 2015 The Chromium Authors. All rights reserved. | |
| 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 #include "chromecast/base/time_conversions.h" | |
| 12 | |
| 13 namespace chromecast { | |
| 14 | |
| 15 TaskRunnerImpl::TaskRunnerImpl() | |
| 16 : runner_(base::ThreadTaskRunnerHandle::Get()) {} | |
|
byungchul
2015/07/27 18:22:22
DCHECK(runner_.get());
halliwell
2015/07/28 02:19:34
Done.
| |
| 17 | |
| 18 TaskRunnerImpl::~TaskRunnerImpl() {} | |
|
byungchul
2015/07/27 18:22:22
wrap line after {
halliwell
2015/07/28 02:19:35
clang format prefers it this way
| |
| 19 | |
| 20 bool TaskRunnerImpl::BelongsToCurrentThread() { | |
| 21 return runner_->BelongsToCurrentThread(); | |
| 22 } | |
| 23 | |
| 24 bool TaskRunnerImpl::PostTask(Task* task) { | |
| 25 return runner_->PostTask(FROM_HERE, | |
|
servolk
2015/07/27 21:25:47
Nit: this will make it look like all posttasks are
halliwell
2015/07/28 02:19:35
Good point. the downside to passing the info thro
servolk
2015/07/28 18:12:55
TBH I don't remember if I ever used this info dire
halliwell
2015/07/28 23:26:05
Ok, TODO and internal tracking bug filed.
servolk
2015/07/29 01:46:26
Wait, I meant a TODO comment in code, e.g. //TODO(
halliwell
2015/07/29 01:55:54
The TODO is in task_runner_impl.cc. Not sure Post
| |
| 26 base::Bind(&Task::Run, base::Owned(task))); | |
| 27 } | |
| 28 | |
| 29 bool TaskRunnerImpl::PostDelayedTask(Task* task, TimeDelta delay) { | |
| 30 return runner_->PostDelayedTask(FROM_HERE, | |
|
servolk
2015/07/27 21:25:47
Same
halliwell
2015/07/28 02:19:35
Same, need to introduce a new type. Let me know w
| |
| 31 base::Bind(&Task::Run, base::Owned(task)), | |
| 32 ToBaseTimeDelta(delay)); | |
| 33 } | |
| 34 | |
| 35 } // namespace chromecast | |
| OLD | NEW |