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

Unified Diff: media/base/bind_to_loop.h.pump

Issue 66953005: Remove media::BindToLoop() in favour of media::BindToCurrentLoop(). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: comma operator Created 6 years, 11 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/bind_to_loop.h ('k') | media/base/bind_to_loop_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/base/bind_to_loop.h.pump
diff --git a/media/base/bind_to_loop.h.pump b/media/base/bind_to_loop.h.pump
index 41510c16236ba97bd3aedb4cca961f7aab3b118d..3529c21d2195ffccc2cc889f8b111fe7b30b67e9 100644
--- a/media/base/bind_to_loop.h.pump
+++ b/media/base/bind_to_loop.h.pump
@@ -20,19 +20,18 @@ $var MAX_ARITY = 7
#include "base/message_loop/message_loop_proxy.h"
#include "base/single_thread_task_runner.h"
-// This is a helper utility for base::Bind()ing callbacks on to particular
-// MessageLoops. A typical use is when |a| (of class |A|) wants to hand a
+// This is a helper utility for base::Bind()ing callbacks to the current
+// MessageLoop. The typical use is when |a| (of class |A|) wants to hand a
// callback such as base::Bind(&A::AMethod, a) to |b|, but needs to ensure that
-// when |b| executes the callback, it does so on a particular MessageLoop.
+// when |b| executes the callback, it does so on |a|'s current MessageLoop.
//
// Typical usage: request to be called back on the current thread:
// other->StartAsyncProcessAndCallMeBack(
-// media::BindToLoop(MessageLoopProxy::current(),
-// base::Bind(&MyClass::MyMethod, this)));
+// media::BindToCurrentLoop(base::Bind(&MyClass::MyMethod, this)));
//
-// Note that like base::Bind(), BindToLoop() can't bind non-constant references,
-// and that *unlike* base::Bind(), BindToLoop() makes copies of its arguments,
-// and thus can't be used with arrays.
+// Note that like base::Bind(), BindToCurrentLoop() can't bind non-constant
+// references, and that *unlike* base::Bind(), BindToCurrentLoop() makes copies
+// of its arguments, and thus can't be used with arrays.
namespace media {
@@ -79,17 +78,13 @@ $for ARG , [[internal::TrampolineForward(a$(ARG))]]));
} // namespace internal
-template<typename T>
-static base::Callback<T> BindToLoop(
- const scoped_refptr<base::SingleThreadTaskRunner>& task_runner,
- const base::Callback<T>& cb) {
- return base::Bind(&internal::TrampolineHelper<T>::Run, task_runner, cb);
-}
-
+// TODO(scherkus): Rename me to something that emphasizes the asynchrony
+// http://crbug.com/167240
template<typename T>
static base::Callback<T> BindToCurrentLoop(
const base::Callback<T>& cb) {
- return BindToLoop(base::MessageLoopProxy::current(), cb);
+ return base::Bind(&internal::TrampolineHelper<T>::Run,
+ base::MessageLoopProxy::current(), cb);
}
} // namespace media
« no previous file with comments | « media/base/bind_to_loop.h ('k') | media/base/bind_to_loop_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698