| OLD | NEW |
| 1 // This file was GENERATED by command: | 1 // This file was GENERATED by command: |
| 2 // pump.py callback.h.pump | 2 // pump.py callback.h.pump |
| 3 // DO NOT EDIT BY HAND!!! | 3 // DO NOT EDIT BY HAND!!! |
| 4 | 4 |
| 5 | 5 |
| 6 | 6 |
| 7 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 7 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| 8 // Use of this source code is governed by a BSD-style license that can be | 8 // Use of this source code is governed by a BSD-style license that can be |
| 9 // found in the LICENSE file. | 9 // found in the LICENSE file. |
| 10 | 10 |
| 11 #ifndef BASE_CALLBACK_H_ | 11 #ifndef BASE_CALLBACK_H_ |
| 12 #define BASE_CALLBACK_H_ | 12 #define BASE_CALLBACK_H_ |
| 13 #pragma once | 13 #pragma once |
| 14 | 14 |
| 15 #include "base/callback_internal.h" | 15 #include "base/callback_internal.h" |
| 16 #include "base/template_util.h" | 16 #include "base/template_util.h" |
| 17 | 17 |
| 18 // New, super-duper, unified Callback system. This will eventually replace | 18 // New, super-duper, unified Callback system. This will eventually replace |
| 19 // NewRunnableMethod, NewRunnableFunction, CreateFunctor, and CreateCallback | 19 // NewRunnableMethod, NewRunnableFunction, CreateFunctor, and CreateCallback |
| 20 // systems currently in the Chromium code base. | 20 // systems currently in the Chromium code base. |
| 21 // | 21 // |
| 22 // WHAT IS THIS: | 22 // WHAT IS THIS: |
| 23 // | 23 // |
| 24 // The templated Callback class is a generalized function object. Together | 24 // The templated Callback class is a generalized function object. Together |
| 25 // with the Bind() function in bind.h, they provide a type-safe method for | 25 // with the Bind() function in bind.h, they provide a type-safe method for |
| 26 // performing currying of arguments, and creating a "closure." | 26 // performing currying of arguments, and creating a "closure." |
| 27 // | 27 // |
| 28 // In programing languages, a closure is a first-class function where all its | 28 // In programming languages, a closure is a first-class function where all its |
| 29 // parameters have been bound (usually via currying). Closures are well | 29 // parameters have been bound (usually via currying). Closures are well |
| 30 // suited for representing, and passing around a unit of delayed execution. | 30 // suited for representing, and passing around a unit of delayed execution. |
| 31 // They are used in Chromium code to schedule tasks on different MessageLoops. | 31 // They are used in Chromium code to schedule tasks on different MessageLoops. |
| 32 // | 32 // |
| 33 // | 33 // |
| 34 // MEMORY MANAGEMENT AND PASSING | 34 // MEMORY MANAGEMENT AND PASSING |
| 35 // | 35 // |
| 36 // The Callback objects themselves should be passed by const-reference, and | 36 // The Callback objects themselves should be passed by const-reference, and |
| 37 // stored by copy. They internally store their state via a refcounted class | 37 // stored by copy. They internally store their state via a refcounted class |
| 38 // and thus do not need to be deleted. | 38 // and thus do not need to be deleted. |
| (...skipping 507 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 546 }; | 546 }; |
| 547 | 547 |
| 548 | 548 |
| 549 // Syntactic sugar to make Callbacks<void(void)> easier to declare since it | 549 // Syntactic sugar to make Callbacks<void(void)> easier to declare since it |
| 550 // will be used in a lot of APIs with delayed execution. | 550 // will be used in a lot of APIs with delayed execution. |
| 551 typedef Callback<void(void)> Closure; | 551 typedef Callback<void(void)> Closure; |
| 552 | 552 |
| 553 } // namespace base | 553 } // namespace base |
| 554 | 554 |
| 555 #endif // BASE_CALLBACK_H | 555 #endif // BASE_CALLBACK_H |
| OLD | NEW |