OLD | NEW |
1 // This file was GENERATED by command: | 1 // This file was GENERATED by command: |
2 // pump.py bind_to_loop.h.pump | 2 // pump.py bind_to_current_loop.h.pump |
3 // DO NOT EDIT BY HAND!!! | 3 // DO NOT EDIT BY HAND!!! |
4 | 4 |
5 | 5 |
6 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 6 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
7 // Use of this source code is governed by a BSD-style license that can be | 7 // Use of this source code is governed by a BSD-style license that can be |
8 // found in the LICENSE file. | 8 // found in the LICENSE file. |
9 | 9 |
10 #ifndef MEDIA_BASE_BIND_TO_LOOP_H_ | 10 #ifndef MEDIA_BASE_BIND_TO_CURRENT_LOOP_H_ |
11 #define MEDIA_BASE_BIND_TO_LOOP_H_ | 11 #define MEDIA_BASE_BIND_TO_CURRENT_LOOP_H_ |
12 | 12 |
13 #include "base/bind.h" | 13 #include "base/bind.h" |
14 #include "base/location.h" | 14 #include "base/location.h" |
15 #include "base/message_loop/message_loop_proxy.h" | 15 #include "base/message_loop/message_loop_proxy.h" |
16 #include "base/single_thread_task_runner.h" | 16 #include "base/single_thread_task_runner.h" |
17 | 17 |
18 // This is a helper utility for base::Bind()ing callbacks to the current | 18 // This is a helper utility for base::Bind()ing callbacks to the current |
19 // MessageLoop. The typical use is when |a| (of class |A|) wants to hand a | 19 // MessageLoop. The typical use is when |a| (of class |A|) wants to hand a |
20 // callback such as base::Bind(&A::AMethod, a) to |b|, but needs to ensure that | 20 // callback such as base::Bind(&A::AMethod, a) to |b|, but needs to ensure that |
21 // when |b| executes the callback, it does so on |a|'s current MessageLoop. | 21 // when |b| executes the callback, it does so on |a|'s current MessageLoop. |
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
147 internal::TrampolineForward(a1), internal::TrampolineForward(a2), | 147 internal::TrampolineForward(a1), internal::TrampolineForward(a2), |
148 internal::TrampolineForward(a3), internal::TrampolineForward(a4), | 148 internal::TrampolineForward(a3), internal::TrampolineForward(a4), |
149 internal::TrampolineForward(a5), internal::TrampolineForward(a6), | 149 internal::TrampolineForward(a5), internal::TrampolineForward(a6), |
150 internal::TrampolineForward(a7))); | 150 internal::TrampolineForward(a7))); |
151 } | 151 } |
152 }; | 152 }; |
153 | 153 |
154 | 154 |
155 } // namespace internal | 155 } // namespace internal |
156 | 156 |
157 // TODO(scherkus): Rename me to something that emphasizes the asynchrony | |
158 // http://crbug.com/167240 | |
159 template<typename T> | 157 template<typename T> |
160 static base::Callback<T> BindToCurrentLoop( | 158 static base::Callback<T> BindToCurrentLoop( |
161 const base::Callback<T>& cb) { | 159 const base::Callback<T>& cb) { |
162 return base::Bind(&internal::TrampolineHelper<T>::Run, | 160 return base::Bind(&internal::TrampolineHelper<T>::Run, |
163 base::MessageLoopProxy::current(), cb); | 161 base::MessageLoopProxy::current(), cb); |
164 } | 162 } |
165 | 163 |
166 } // namespace media | 164 } // namespace media |
167 | 165 |
168 #endif // MEDIA_BASE_BIND_TO_LOOP_H_ | 166 #endif // MEDIA_BASE_BIND_TO_CURRENT_LOOP_H_ |
OLD | NEW |