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

Unified Diff: media/base/serial_runner.cc

Issue 275673002: Remove completion callbacks from AudioRenderer::Play/Pause(). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 6 years, 7 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
« no previous file with comments | « media/base/serial_runner.h ('k') | media/base/serial_runner_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/base/serial_runner.cc
diff --git a/media/base/serial_runner.cc b/media/base/serial_runner.cc
index 257cd910ae8a6e56ca1b9fdb5f56d6fd7c04c91b..779566c794100d853533e7aaeeb8d33303bc7135 100644
--- a/media/base/serial_runner.cc
+++ b/media/base/serial_runner.cc
@@ -12,6 +12,14 @@
namespace media {
+// Converts a Closure into a bound function accepting a PipelineStatusCB.
+static void RunClosure(
+ const base::Closure& closure,
+ const PipelineStatusCB& status_cb) {
+ closure.Run();
+ status_cb.Run(PIPELINE_OK);
+}
+
// Converts a bound function accepting a Closure into a bound function
// accepting a PipelineStatusCB. Since closures have no way of reporting a
// status |status_cb| is executed with PIPELINE_OK.
@@ -34,6 +42,10 @@ static void RunOnTaskRunner(
SerialRunner::Queue::Queue() {}
SerialRunner::Queue::~Queue() {}
+void SerialRunner::Queue::Push(const base::Closure& closure) {
+ bound_fns_.push(base::Bind(&RunClosure, closure));
+}
+
void SerialRunner::Queue::Push(
const BoundClosure& bound_closure) {
bound_fns_.push(base::Bind(&RunBoundClosure, bound_closure));
« no previous file with comments | « media/base/serial_runner.h ('k') | media/base/serial_runner_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698