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

Unified Diff: base/bind_helpers.h

Issue 2103113002: Remove overloads for Callback in bind_helpers.h (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@00_remove_unused
Patch Set: Created 4 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/bind_helpers.h
diff --git a/base/bind_helpers.h b/base/bind_helpers.h
index d86393bec05676d942bd13f3df72a08ce828d53a..093f5dcfeeead6af87659347517a398472eb3cf3 100644
--- a/base/bind_helpers.h
+++ b/base/bind_helpers.h
@@ -344,18 +344,11 @@ class RetainedRefWrapper {
template <typename T>
struct IgnoreResultHelper {
- explicit IgnoreResultHelper(T functor) : functor_(functor) {}
+ explicit IgnoreResultHelper(T functor) : functor_(std::move(functor)) {}
Yuta Kitamura 2016/06/29 00:07:55 Do you expect |T| to be something like Callback<T>
tzik 2016/06/29 02:49:08 T is a Functor. That can be Callback<>, function p
T functor_;
};
-template <typename T>
-struct IgnoreResultHelper<Callback<T> > {
- explicit IgnoreResultHelper(const Callback<T>& functor) : functor_(functor) {}
-
- const Callback<T>& functor_;
-};
-
// An alternate implementation is to avoid the destructive copy, and instead
// specialize ParamTraits<> for OwnedWrapper<> to change the StorageType to
// a class that is essentially a std::unique_ptr<>.
@@ -421,8 +414,8 @@ class PassedWrapper {
// Unwrap the stored parameters for the wrappers above.
template <typename T>
-const T& Unwrap(const T& o) {
- return o;
+T&& Unwrap(T&& o) {
Yuta Kitamura 2016/06/29 00:07:55 aside: If the argument can be an rvalue reference,
tzik 2016/06/29 02:49:08 No. The constness of the internal storage is from
+ return std::forward<T>(o);
}
template <typename T>
@@ -611,13 +604,7 @@ static inline internal::PassedWrapper<T> Passed(T* scoper) {
template <typename T>
static inline internal::IgnoreResultHelper<T> IgnoreResult(T data) {
- return internal::IgnoreResultHelper<T>(data);
-}
-
-template <typename T>
-static inline internal::IgnoreResultHelper<Callback<T> >
-IgnoreResult(const Callback<T>& data) {
- return internal::IgnoreResultHelper<Callback<T> >(data);
+ return internal::IgnoreResultHelper<T>(std::move(data));
}
BASE_EXPORT void DoNothing();
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698