| OLD | NEW |
| 1 $$ This is a pump file for generating file templates. Pump is a python | 1 $$ This is a pump file for generating file templates. Pump is a python |
| 2 $$ script that is part of the Google Test suite of utilities. Description | 2 $$ script that is part of the Google Test suite of utilities. Description |
| 3 $$ can be found here: | 3 $$ can be found here: |
| 4 $$ | 4 $$ |
| 5 $$ http://code.google.com/p/googletest/wiki/PumpManual | 5 $$ http://code.google.com/p/googletest/wiki/PumpManual |
| 6 $$ | 6 $$ |
| 7 | 7 |
| 8 $$ See comment for MAX_ARITY in base/bind.h.pump. | 8 $$ See comment for MAX_ARITY in base/bind.h.pump. |
| 9 $var MAX_ARITY = 7 | 9 $var MAX_ARITY = 7 |
| 10 | 10 |
| 11 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 11 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 12 // Use of this source code is governed by a BSD-style license that can be | 12 // Use of this source code is governed by a BSD-style license that can be |
| 13 // found in the LICENSE file. | 13 // found in the LICENSE file. |
| 14 | 14 |
| 15 #ifndef MEDIA_BASE_BIND_TO_LOOP_H_ | 15 #ifndef MEDIA_BASE_BIND_TO_LOOP_H_ |
| 16 #define MEDIA_BASE_BIND_TO_LOOP_H_ | 16 #define MEDIA_BASE_BIND_TO_LOOP_H_ |
| 17 | 17 |
| 18 #include "base/bind.h" | 18 #include "base/bind.h" |
| 19 #include "base/location.h" | 19 #include "base/location.h" |
| 20 #include "base/message_loop_proxy.h" | 20 #include "base/message_loop/message_loop_proxy.h" |
| 21 | 21 |
| 22 // This is a helper utility for base::Bind()ing callbacks on to particular | 22 // This is a helper utility for base::Bind()ing callbacks on to particular |
| 23 // MessageLoops. A typical use is when |a| (of class |A|) wants to hand a | 23 // MessageLoops. A typical use is when |a| (of class |A|) wants to hand a |
| 24 // callback such as base::Bind(&A::AMethod, a) to |b|, but needs to ensure that | 24 // callback such as base::Bind(&A::AMethod, a) to |b|, but needs to ensure that |
| 25 // when |b| executes the callback, it does so on a particular MessageLoop. | 25 // when |b| executes the callback, it does so on a particular MessageLoop. |
| 26 // | 26 // |
| 27 // Typical usage: request to be called back on the current thread: | 27 // Typical usage: request to be called back on the current thread: |
| 28 // other->StartAsyncProcessAndCallMeBack( | 28 // other->StartAsyncProcessAndCallMeBack( |
| 29 // media::BindToLoop(MessageLoopProxy::current(), | 29 // media::BindToLoop(MessageLoopProxy::current(), |
| 30 // base::Bind(&MyClass::MyMethod, this))); | 30 // base::Bind(&MyClass::MyMethod, this))); |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 91 | 91 |
| 92 template<typename T> | 92 template<typename T> |
| 93 static base::Callback<T> BindToCurrentLoop( | 93 static base::Callback<T> BindToCurrentLoop( |
| 94 const base::Callback<T>& cb) { | 94 const base::Callback<T>& cb) { |
| 95 return BindToLoop(base::MessageLoopProxy::current(), cb); | 95 return BindToLoop(base::MessageLoopProxy::current(), cb); |
| 96 } | 96 } |
| 97 | 97 |
| 98 } // namespace media | 98 } // namespace media |
| 99 | 99 |
| 100 #endif // MEDIA_BASE_BIND_TO_LOOP_H_ | 100 #endif // MEDIA_BASE_BIND_TO_LOOP_H_ |
| OLD | NEW |