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

Side by Side Diff: media/base/callback_util.h

Issue 10753021: Move AudioRenderer out of Filter heirarchy. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src
Patch Set: woot for RunInSeries/Parallel Created 8 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright (c) 2012 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 #ifndef MEDIA_BASE_CALLBACK_UTIL_H_
6 #define MEDIA_BASE_CALLBACK_UTIL_H_
7
8 #include <queue>
9
10 #include "base/callback.h"
11 #include "base/memory/scoped_ptr.h"
12
13 namespace media {
14
15 typedef base::Callback<void(const base::Closure&)> ClosureCB;
16
17 // Executes the closures in FIFO order, executing |done_cb| when the last
18 // closure has completed running.
19 //
20 // |done_cb| will be executed on the same thread as the last completed closure
21 // or the current thread if |closures| is empty.
22 void RunInSeries(scoped_ptr<std::queue<ClosureCB> > closures,
23 const base::Closure& done_cb);
24
25 // Executes the closures in parallel, executing |done_cb| when all closures have
26 // completed running.
27 //
28 // No attempt is made to parallelize execution of the closures. In other words,
29 // this method will run all closures in FIFO order if said closures execute
30 // synchronously on the same call stack.
31 //
32 // |done_cb| will be executed on the same thread as the last completed closure
33 // or the current thread if |closures| is empty.
34 void RunInParallel(scoped_ptr<std::queue<ClosureCB> > closures,
35 const base::Closure& done_cb);
36
37 } // namespace media
38
39 #endif // MEDIA_BASE_CALLBACK_UTIL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698