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

Unified Diff: base/bind_internal.h.pump

Issue 15836004: Update base/ to use WeakPtr<T>::get() instead of implicit "operator T*" (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address comments Created 7 years, 7 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_internal.h ('k') | base/observer_list.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/bind_internal.h.pump
diff --git a/base/bind_internal.h.pump b/base/bind_internal.h.pump
index ac228e6eeac9e9c4123f99fb8f458cd561b565d8..f632b99e556db0aeb1669dabd1dc1b4b1be30e97 100644
--- a/base/bind_internal.h.pump
+++ b/base/bind_internal.h.pump
@@ -286,6 +286,7 @@ struct InvokeHelper;
$for ARITY [[
$range ARG 1..ARITY
+$range WEAKCALL_ARG 2..ARITY
template <typename ReturnType, typename Runnable[[]]
$if ARITY > 0 [[,]] $for ARG , [[typename A$(ARG)]]>
@@ -309,16 +310,18 @@ $if ARITY > 0[[, ]] $for ARG , [[A$(ARG) a$(ARG)]]) {
$if ARITY > 0 [[
-template <typename Runnable[[]], $for ARG , [[typename A$(ARG)]]>
+template <typename Runnable[[]], typename BoundWeakPtr
+$if ARITY > 1[[, ]] $for WEAKCALL_ARG , [[typename A$(WEAKCALL_ARG)]]>
struct InvokeHelper<true, void, Runnable,
- void($for ARG , [[A$(ARG)]])> {
- static void MakeItSo(Runnable runnable[[]]
-$if ARITY > 0[[, ]] $for ARG , [[A$(ARG) a$(ARG)]]) {
- if (!a1.get()) {
+ void(BoundWeakPtr
+$if ARITY > 1[[, ]] $for WEAKCALL_ARG , [[A$(WEAKCALL_ARG)]])> {
+ static void MakeItSo(Runnable runnable, BoundWeakPtr weak_ptr
+$if ARITY > 1[[, ]] $for WEAKCALL_ARG , [[A$(WEAKCALL_ARG) a$(WEAKCALL_ARG)]]) {
+ if (!weak_ptr.get()) {
return;
}
-
- runnable.Run($for ARG , [[CallbackForward(a$(ARG))]]);
+ runnable.Run(weak_ptr.get()
+$if ARITY > 1[[, ]] $for WEAKCALL_ARG , [[CallbackForward(a$(WEAKCALL_ARG))]]);
}
};
« no previous file with comments | « base/bind_internal.h ('k') | base/observer_list.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698