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

Unified Diff: base/bind_internal.h

Issue 1816713002: base: Remove scoped_refptr unwrapping for Bind arguments. (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
« no previous file with comments | « base/bind_helpers.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/bind_internal.h
diff --git a/base/bind_internal.h b/base/bind_internal.h
index 199467c5495197ae0f60827910f3681c8660e349..de14bfff0b4f1e77c88dfb2a53d70ee21137668e 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 (object.get()->*method_)(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 (object.get()->*method_)(std::forward<RunArgs>(args)...);
+ }
+
private:
R (T::*method_)(Args...) const;
};
« no previous file with comments | « base/bind_helpers.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698