diff options
Diffstat (limited to 'chromium/media/base/serial_runner.h')
-rw-r--r-- | chromium/media/base/serial_runner.h | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/chromium/media/base/serial_runner.h b/chromium/media/base/serial_runner.h index a59c7753c9c..eaae625cd43 100644 --- a/chromium/media/base/serial_runner.h +++ b/chromium/media/base/serial_runner.h @@ -11,6 +11,7 @@ #include "base/memory/ref_counted.h" #include "base/memory/scoped_ptr.h" #include "base/memory/weak_ptr.h" +#include "media/base/media_export.h" #include "media/base/pipeline_status.h" namespace base { @@ -22,13 +23,13 @@ namespace media { // Runs a series of bound functions accepting Closures or PipelineStatusCB. // SerialRunner doesn't use regular Closure/PipelineStatusCBs as it late binds // the completion callback as the series progresses. -class SerialRunner { +class MEDIA_EXPORT SerialRunner { public: typedef base::Callback<void(const base::Closure&)> BoundClosure; typedef base::Callback<void(const PipelineStatusCB&)> BoundPipelineStatusCB; // Serial queue of bound functions to run. - class Queue { + class MEDIA_EXPORT Queue { public: Queue(); ~Queue(); @@ -50,6 +51,13 @@ class SerialRunner { // All bound functions are executed on the thread that Run() is called on, // including |done_cb|. // + // To eliminate an unnecessary posted task, the first function is executed + // immediately on the caller's stack. It is *strongly advised* to ensure + // the calling code does no more work after the call to Run(). + // + // In all cases, |done_cb| is guaranteed to execute on a separate calling + // stack. + // // Deleting the object will prevent execution of any unstarted bound // functions, including |done_cb|. static scoped_ptr<SerialRunner> Run( |