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

Unified Diff: chromecast/base/task_runner_impl.cc

Issue 1105803002: Exposes a shlib interface for media/audio path. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Comment out streaming test until the default implementation is improved. Created 5 years, 5 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 side-by-side diff with in-line comments
Download patch
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..f188ca1358f7caa95825514fe03f46ba9bef6b7d
--- /dev/null
+++ b/chromecast/base/task_runner_impl.cc
@@ -0,0 +1,39 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// NOTE: This is included in the review for clarity, but this will be submitted
+// in halliwell@'s review (1257013003), so this should be removed before
+// submit.
+
+#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

Powered by Google App Engine
This is Rietveld 408576698