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

Side by Side Diff: base/bind.h

Issue 2386653002: Replace base::Callback with base::OnceCallback in base::PendingTask (Closed)
Patch Set: rebase Created 4 years, 2 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
OLDNEW
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 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
71 // Unannotated Bind. 71 // Unannotated Bind.
72 // TODO(tzik): Deprecate this and migrate to OnceCallback and 72 // TODO(tzik): Deprecate this and migrate to OnceCallback and
73 // RepeatingCallback, once they get ready. 73 // RepeatingCallback, once they get ready.
74 template <typename Functor, typename... Args> 74 template <typename Functor, typename... Args>
75 inline Callback<MakeUnboundRunType<Functor, Args...>> 75 inline Callback<MakeUnboundRunType<Functor, Args...>>
76 Bind(Functor&& functor, Args&&... args) { 76 Bind(Functor&& functor, Args&&... args) {
77 return BindRepeating(std::forward<Functor>(functor), 77 return BindRepeating(std::forward<Functor>(functor),
78 std::forward<Args>(args)...); 78 std::forward<Args>(args)...);
79 } 79 }
80 80
81 // Converts a OnceClosure to a RepeatingClosure. It hits CHECK failure to run
82 // the resulting RepeatingClosure more than once.
83 // TODO(tzik): This will be unneeded after the Closure-to-OnceClosure migration
84 // on TaskRunner. Remove it once it gets unneeded.
85 BASE_EXPORT RepeatingClosure UnsafeConvertOnceClosureToRepeating(
86 OnceClosure cb);
87
81 } // namespace base 88 } // namespace base
82 89
83 #endif // BASE_BIND_H_ 90 #endif // BASE_BIND_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698