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

Unified Diff: media/base/serial_runner.cc

Issue 10837206: Rewrite media::Pipeline state transition machinery and simplify shutdown. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src
Patch Set: nits Created 8 years, 3 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/pipeline_unittest.cc ('k') | webkit/media/webmediaplayer_impl.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 b41ff0c1344b581417f3ea077d58ef28a497e496..9d6c6ed88d272742ed2a11b8cf1782833be65501 100644
--- a/media/base/serial_runner.cc
+++ b/media/base/serial_runner.cc
@@ -20,18 +20,14 @@ static void RunBoundClosure(
bound_closure.Run(base::Bind(status_cb, PIPELINE_OK));
}
-// Runs |status_cb| with |last_status| on |message_loop|, trampolining if
-// necessary.
+// Runs |status_cb| with |last_status| on |message_loop|.
static void RunOnMessageLoop(
const scoped_refptr<base::MessageLoopProxy>& message_loop,
const PipelineStatusCB& status_cb,
PipelineStatus last_status) {
- if (!message_loop->BelongsToCurrentThread()) {
- message_loop->PostTask(FROM_HERE, base::Bind(
- &RunOnMessageLoop, message_loop, status_cb, last_status));
- return;
- }
- status_cb.Run(last_status);
+ // Force post to permit cancellation of a series in the scenario where all
+ // bound functions run on the same thread.
+ message_loop->PostTask(FROM_HERE, base::Bind(status_cb, last_status));
}
SerialRunner::Queue::Queue() {}
« no previous file with comments | « media/base/pipeline_unittest.cc ('k') | webkit/media/webmediaplayer_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698