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

Unified Diff: base/bind_internal.h

Issue 1815363002: Add RetainedRef uses where needed. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 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
Index: base/bind_internal.h
diff --git a/base/bind_internal.h b/base/bind_internal.h
index 199467c5495197ae0f60827910f3681c8660e349..ffbf9262fcdf313b9a8be3458b088290fbcee1e4 100644
--- a/base/bind_internal.h
+++ b/base/bind_internal.h
@@ -181,6 +181,11 @@ class RunnableAdapter<R(T::*)(Args...)> {
return (object->*method_)(std::forward<RunArgs>(args)...);
}
+ template <typename RefType, typename... RunArgs>
+ R Run(const scoped_refptr<RefType>& object, RunArgs&&... args) {
+ return Run(object.get(), std::forward<RunArgs>(args)...);
+ }
+
private:
R (T::*method_)(Args...);
};
@@ -201,6 +206,11 @@ class RunnableAdapter<R(T::*)(Args...) const> {
return (object->*method_)(std::forward<RunArgs>(args)...);
}
+ template <typename RefType, typename... RunArgs>
+ R Run(const scoped_refptr<RefType>& object, RunArgs&&... args) {
+ return Run(object.get(), std::forward<RunArgs>(args)...);
+ }
+
private:
R (T::*method_)(Args...) const;
};

Powered by Google App Engine
This is Rietveld 408576698