Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(34)

Side by Side Diff: chromecast/base/task_runner_impl.cc

Issue 1257013003: Load CMA backend from shared library (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Tweaks to PostTask Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « chromecast/base/task_runner_impl.h ('k') | chromecast/browser/cast_content_browser_client.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
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 bool TaskRunnerImpl::PostTask(Task* task, uint64_t delay_milliseconds) {
byungchul 2015/07/30 05:22:54 DCHECK(task);
halliwell 2015/07/30 05:40:19 Done.
22 if (delay_milliseconds == 0 && runner_->BelongsToCurrentThread()) {
23 task->Run();
24 delete task;
25 return true;
26 }
27
28 // TODO(halliwell): FROM_HERE is misleading, we should consider a macro for
29 // vendor backends to send the callsite info.
30 return runner_->PostDelayedTask(
31 FROM_HERE, base::Bind(&Task::Run, base::Owned(task)),
32 base::TimeDelta::FromMilliseconds(delay_milliseconds));
33 }
34
35 } // namespace chromecast
OLDNEW
« no previous file with comments | « chromecast/base/task_runner_impl.h ('k') | chromecast/browser/cast_content_browser_client.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698