summaryrefslogtreecommitdiffstats
path: root/base/bind_internal.h.pump
diff options
context:
space:
mode:
authorakalin@chromium.org <akalin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-06-03 22:15:21 +0000
committerakalin@chromium.org <akalin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-06-03 22:15:21 +0000
commitf0737afdfa797f20c8ba9a105a56e360420f00eb (patch)
tree42f2912366f37dc54e749fd5aa33d31849867bf1 /base/bind_internal.h.pump
parentfc10dd4eb4a6e7164ef8418749ef5418cba8b40a (diff)
downloadchromium_src-f0737afdfa797f20c8ba9a105a56e360420f00eb.zip
chromium_src-f0737afdfa797f20c8ba9a105a56e360420f00eb.tar.gz
chromium_src-f0737afdfa797f20c8ba9a105a56e360420f00eb.tar.bz2
Update base/ to use WeakPtr<T>::get() instead of implicit "operator T*"
BUG=245942 TBR=ajwong@chromium.org Review URL: https://codereview.chromium.org/15836004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@203782 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/bind_internal.h.pump')
-rw-r--r--base/bind_internal.h.pump17
1 files changed, 10 insertions, 7 deletions
diff --git a/base/bind_internal.h.pump b/base/bind_internal.h.pump
index ac228e6e..f632b99 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))]]);
}
};