| Index: base/bind_helpers.h
|
| diff --git a/base/bind_helpers.h b/base/bind_helpers.h
|
| index 117fc68e177d59afe3c7dba93b2cd77ebb006a03..735c1aa726f1ae749760d8f039b785d5b2ddc7e9 100644
|
| --- a/base/bind_helpers.h
|
| +++ b/base/bind_helpers.h
|
| @@ -312,6 +312,16 @@ class ConstRefWrapper {
|
| };
|
|
|
| template <typename T>
|
| +class RetainedRefWrapper {
|
| + public:
|
| + explicit RetainedRefWrapper(T* o) : ptr_(o) {}
|
| + explicit RetainedRefWrapper(scoped_refptr<T> o) : ptr_(std::move(o)) {}
|
| + T* get() const { return ptr_.get(); }
|
| + private:
|
| + scoped_refptr<T> ptr_;
|
| +};
|
| +
|
| +template <typename T>
|
| struct IgnoreResultHelper {
|
| explicit IgnoreResultHelper(T functor) : functor_(functor) {}
|
|
|
| @@ -410,6 +420,11 @@ T* Unwrap(const scoped_refptr<T>& o) {
|
| }
|
|
|
| template <typename T>
|
| +T* Unwrap(const RetainedRefWrapper<T>& o) {
|
| + return o.get();
|
| +}
|
| +
|
| +template <typename T>
|
| const WeakPtr<T>& Unwrap(const WeakPtr<T>& o) {
|
| return o;
|
| }
|
| @@ -545,6 +560,16 @@ static inline internal::UnretainedWrapper<T> Unretained(T* o) {
|
| }
|
|
|
| template <typename T>
|
| +static inline internal::RetainedRefWrapper<T> RetainedRef(T* o) {
|
| + return internal::RetainedRefWrapper<T>(o);
|
| +}
|
| +
|
| +template <typename T>
|
| +static inline internal::RetainedRefWrapper<T> RetainedRef(scoped_refptr<T> o) {
|
| + return internal::RetainedRefWrapper<T>(std::move(o));
|
| +}
|
| +
|
| +template <typename T>
|
| static inline internal::ConstRefWrapper<T> ConstRef(const T& o) {
|
| return internal::ConstRefWrapper<T>(o);
|
| }
|
|
|