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

Side by Side Diff: media/base/bind_to_current_loop.h.pump

Issue 132163006: Rename media/base/bind_to_loop.h to media/base/bind_to_current_loop.h. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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_CURRENT_LOOP_H_
16 #define MEDIA_BASE_BIND_TO_LOOP_H_ 16 #define MEDIA_BASE_BIND_TO_CURRENT_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/message_loop_proxy.h" 20 #include "base/message_loop/message_loop_proxy.h"
21 #include "base/single_thread_task_runner.h" 21 #include "base/single_thread_task_runner.h"
22 22
23 // This is a helper utility for base::Bind()ing callbacks to the current 23 // This is a helper utility for base::Bind()ing callbacks to the current
24 // MessageLoop. The typical use is when |a| (of class |A|) wants to hand a 24 // MessageLoop. The typical use is when |a| (of class |A|) wants to hand a
25 // callback such as base::Bind(&A::AMethod, a) to |b|, but needs to ensure that 25 // callback such as base::Bind(&A::AMethod, a) to |b|, but needs to ensure that
26 // when |b| executes the callback, it does so on |a|'s current MessageLoop. 26 // when |b| executes the callback, it does so on |a|'s current MessageLoop.
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
71 $if ARITY != 0 [[, ]] 71 $if ARITY != 0 [[, ]]
72 $for ARG , [[internal::TrampolineForward(a$(ARG))]])); 72 $for ARG , [[internal::TrampolineForward(a$(ARG))]]));
73 } 73 }
74 }; 74 };
75 75
76 76
77 ]] $$ for ARITY 77 ]] $$ for ARITY
78 78
79 } // namespace internal 79 } // namespace internal
80 80
81 // TODO(scherkus): Rename me to something that emphasizes the asynchrony
82 // http://crbug.com/167240
83 template<typename T> 81 template<typename T>
84 static base::Callback<T> BindToCurrentLoop( 82 static base::Callback<T> BindToCurrentLoop(
85 const base::Callback<T>& cb) { 83 const base::Callback<T>& cb) {
86 return base::Bind(&internal::TrampolineHelper<T>::Run, 84 return base::Bind(&internal::TrampolineHelper<T>::Run,
87 base::MessageLoopProxy::current(), cb); 85 base::MessageLoopProxy::current(), cb);
88 } 86 }
89 87
90 } // namespace media 88 } // namespace media
91 89
92 #endif // MEDIA_BASE_BIND_TO_LOOP_H_ 90 #endif // MEDIA_BASE_BIND_TO_CURRENT_LOOP_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698