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

Side by Side Diff: base/callback.h.pump

Issue 6538045: Callback: Replumb the type-inference. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/base
Patch Set: rebased Created 9 years, 10 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
« base/bind_internal.h ('K') | « base/callback.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 $var MAX_ARITY = 6 8 $var MAX_ARITY = 6
9 9
10 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 10 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
(...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after
249 249
250 // We pass InvokerStorageHolder by const ref to avoid incurring an 250 // We pass InvokerStorageHolder by const ref to avoid incurring an
251 // unnecessary AddRef/Unref pair even though we will modify the object. 251 // unnecessary AddRef/Unref pair even though we will modify the object.
252 // We cannot use a normal reference because the compiler will warn 252 // We cannot use a normal reference because the compiler will warn
253 // since this is often used on a return value, which is a temporary. 253 // since this is often used on a return value, which is a temporary.
254 // 254 //
255 // Note that this constructor CANNOT be explicit, and that Bind() CANNOT 255 // Note that this constructor CANNOT be explicit, and that Bind() CANNOT
256 // return the exact Callback<> type. See base/bind.h for details. 256 // return the exact Callback<> type. See base/bind.h for details.
257 template <typename T> 257 template <typename T>
258 Callback(const internal::InvokerStorageHolder<T>& invoker_holder) 258 Callback(const internal::InvokerStorageHolder<T>& invoker_holder)
259 : polymorphic_invoke_(&T::FunctionTraits::DoInvoke) { 259 : polymorphic_invoke_(&T::Invoker::DoInvoke) {
260 invoker_storage_.swap(invoker_holder.invoker_storage_); 260 invoker_storage_.swap(invoker_holder.invoker_storage_);
261 } 261 }
262 262
263 263
264 $if ARITY == 0 [[ 264 $if ARITY == 0 [[
265 R Run(void) const { 265 R Run(void) const {
266 ]] $else [[ 266 ]] $else [[
267 R Run($for ARG , 267 R Run($for ARG ,
268 [[const A$(ARG)& a$(ARG)]]) const { 268 [[const A$(ARG)& a$(ARG)]]) const {
269 ]] 269 ]]
(...skipping 12 matching lines...) Expand all
282 282
283 ]] $$ for ARITY 283 ]] $$ for ARITY
284 284
285 // Syntactic sugar to make Callbacks<void(void)> easier to declare since it 285 // Syntactic sugar to make Callbacks<void(void)> easier to declare since it
286 // will be used in a lot of APIs with delayed execution. 286 // will be used in a lot of APIs with delayed execution.
287 typedef Callback<void(void)> Closure; 287 typedef Callback<void(void)> Closure;
288 288
289 } // namespace base 289 } // namespace base
290 290
291 #endif // BASE_CALLBACK_H 291 #endif // BASE_CALLBACK_H
OLDNEW
« base/bind_internal.h ('K') | « base/callback.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698