| 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) 2011 The Chromium Authors. All rights reserved. | 11 // Copyright (c) 2011 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 BASE_CALLBACK_H_ | 15 #ifndef BASE_CALLBACK_H_ |
| 16 #define BASE_CALLBACK_H_ | 16 #define BASE_CALLBACK_H_ |
| 17 #pragma once | 17 #pragma once |
| 18 | 18 |
| 19 #include "base/callback_forward.h" | 19 #include "base/callback_forward.h" |
| 20 #include "base/callback_internal.h" | 20 #include "base/callback_internal.h" |
| 21 #include "base/template_util.h" | 21 #include "base/template_util.h" |
| 22 | 22 |
| 23 // NOTE: Header files that do not require the full definition of Callback or | 23 // NOTE: Header files that do not require the full definition of Callback or |
| 24 // Closure should #include "base/callback_forward.h" instead of this file. | 24 // Closure should #include "base/callback_forward.h" instead of this file. |
| 25 | 25 |
| 26 // New, super-duper, unified Callback system. This will eventually replace | |
| 27 // NewRunnableMethod, CreateFunctor, and CreateCallback systems currently in the | |
| 28 // Chromium code base. | |
| 29 // | |
| 30 // WHAT IS THIS: | 26 // WHAT IS THIS: |
| 31 // | 27 // |
| 32 // The templated Callback class is a generalized function object. Together | 28 // The templated Callback class is a generalized function object. Together |
| 33 // with the Bind() function in bind.h, they provide a type-safe method for | 29 // with the Bind() function in bind.h, they provide a type-safe method for |
| 34 // performing currying of arguments, and creating a "closure." | 30 // performing currying of arguments, and creating a "closure." |
| 35 // | 31 // |
| 36 // In programming languages, a closure is a first-class function where all its | 32 // In programming languages, a closure is a first-class function where all its |
| 37 // parameters have been bound (usually via currying). Closures are well | 33 // parameters have been bound (usually via currying). Closures are well |
| 38 // suited for representing, and passing around a unit of delayed execution. | 34 // suited for representing, and passing around a unit of delayed execution. |
| 39 // They are used in Chromium code to schedule tasks on different MessageLoops. | 35 // They are used in Chromium code to schedule tasks on different MessageLoops. |
| (...skipping 267 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 307 | 303 |
| 308 ]] $$ for ARITY | 304 ]] $$ for ARITY |
| 309 | 305 |
| 310 // Syntactic sugar to make Callbacks<void(void)> easier to declare since it | 306 // Syntactic sugar to make Callbacks<void(void)> easier to declare since it |
| 311 // will be used in a lot of APIs with delayed execution. | 307 // will be used in a lot of APIs with delayed execution. |
| 312 typedef Callback<void(void)> Closure; | 308 typedef Callback<void(void)> Closure; |
| 313 | 309 |
| 314 } // namespace base | 310 } // namespace base |
| 315 | 311 |
| 316 #endif // BASE_CALLBACK_H | 312 #endif // BASE_CALLBACK_H |
| OLD | NEW |