OLD | NEW |
---|---|
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef BASE_BIND_H_ | 5 #ifndef BASE_BIND_H_ |
6 #define BASE_BIND_H_ | 6 #define BASE_BIND_H_ |
7 | 7 |
8 #include "base/bind_internal.h" | 8 #include "base/bind_internal.h" |
9 | 9 |
10 // ----------------------------------------------------------------------------- | 10 // ----------------------------------------------------------------------------- |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
74 // Unannotated Bind. | 74 // Unannotated Bind. |
75 // TODO(tzik): Deprecate this and migrate to OnceCallback and | 75 // TODO(tzik): Deprecate this and migrate to OnceCallback and |
76 // RepeatingCallback, once they get ready. | 76 // RepeatingCallback, once they get ready. |
77 template <typename Functor, typename... Args> | 77 template <typename Functor, typename... Args> |
78 inline Callback<MakeUnboundRunType<Functor, Args...>> | 78 inline Callback<MakeUnboundRunType<Functor, Args...>> |
79 Bind(Functor&& functor, Args&&... args) { | 79 Bind(Functor&& functor, Args&&... args) { |
80 return internal::BindRepeating(std::forward<Functor>(functor), | 80 return internal::BindRepeating(std::forward<Functor>(functor), |
81 std::forward<Args>(args)...); | 81 std::forward<Args>(args)...); |
82 } | 82 } |
83 | 83 |
84 // Converts a OnceClosure to a RepeatingClosure. It hits CHECK failure to run | |
85 // the resulting RepeatingClosure more than once. | |
86 BASE_EXPORT internal::RepeatingClosure UnsafeConvertOnceClosureToRepeating( | |
fdoray
2016/10/06 17:37:22
Do you plan to use OnceClosure instead of Closure
tzik
2016/10/13 05:58:04
Yes, here is a CL to do that, though it's a bit st
| |
87 internal::OnceClosure cb); | |
88 | |
84 } // namespace base | 89 } // namespace base |
85 | 90 |
86 #endif // BASE_BIND_H_ | 91 #endif // BASE_BIND_H_ |
OLD | NEW |