Index: base/bind_helpers.h |
diff --git a/base/bind_helpers.h b/base/bind_helpers.h |
index 2add755b42601ed97b8edb687131d17229eb57bd..ece85b5cbb0eb0c281bb16f3b928074093a9ebb9 100644 |
--- a/base/bind_helpers.h |
+++ b/base/bind_helpers.h |
@@ -378,7 +378,7 @@ class PassedWrapper { |
: is_valid_(true), scoper_(std::move(scoper)) {} |
PassedWrapper(const PassedWrapper& other) |
: is_valid_(other.is_valid_), scoper_(std::move(other.scoper_)) {} |
- T Pass() const { |
+ T Take() const { |
CHECK(is_valid_); |
is_valid_ = false; |
return std::move(scoper_); |
@@ -391,54 +391,39 @@ class PassedWrapper { |
// Unwrap the stored parameters for the wrappers above. |
template <typename T> |
-struct UnwrapTraits { |
- using ForwardType = const T&; |
- static ForwardType Unwrap(const T& o) { return o; } |
-}; |
+const T& Unwrap(const T& o) { |
+ return o; |
+} |
template <typename T> |
-struct UnwrapTraits<UnretainedWrapper<T> > { |
- using ForwardType = T*; |
- static ForwardType Unwrap(UnretainedWrapper<T> unretained) { |
- return unretained.get(); |
- } |
-}; |
+T* Unwrap(UnretainedWrapper<T> unretained) { |
+ return unretained.get(); |
+} |
template <typename T> |
-struct UnwrapTraits<ConstRefWrapper<T> > { |
- using ForwardType = const T&; |
- static ForwardType Unwrap(ConstRefWrapper<T> const_ref) { |
- return const_ref.get(); |
- } |
-}; |
+const T& Unwrap(ConstRefWrapper<T> const_ref) { |
+ return const_ref.get(); |
+} |
template <typename T> |
-struct UnwrapTraits<scoped_refptr<T> > { |
- using ForwardType = T*; |
- static ForwardType Unwrap(const scoped_refptr<T>& o) { return o.get(); } |
-}; |
+T* Unwrap(const scoped_refptr<T>& o) { |
+ return o.get(); |
+} |
template <typename T> |
-struct UnwrapTraits<WeakPtr<T> > { |
- using ForwardType = const WeakPtr<T>&; |
- static ForwardType Unwrap(const WeakPtr<T>& o) { return o; } |
-}; |
+const WeakPtr<T>& Unwrap(const WeakPtr<T>& o) { |
+ return o; |
+} |
template <typename T> |
-struct UnwrapTraits<OwnedWrapper<T> > { |
- using ForwardType = T*; |
- static ForwardType Unwrap(const OwnedWrapper<T>& o) { |
- return o.get(); |
- } |
-}; |
+T* Unwrap(const OwnedWrapper<T>& o) { |
+ return o.get(); |
+} |
template <typename T> |
-struct UnwrapTraits<PassedWrapper<T> > { |
- using ForwardType = T; |
- static T Unwrap(PassedWrapper<T>& o) { |
- return o.Pass(); |
- } |
-}; |
+T Unwrap(PassedWrapper<T>& o) { |
+ return o.Take(); |
+} |
// Utility for handling different refcounting semantics in the Bind() |
// function. |