Pass weak pointer by ref in Bind implementation
Weak pointer in Bind impl is historically passed by value, however when
a blink::WeakPersistent is passed as a receiver of a method after
blink::ThreadState is destroyed, it can no longer be copied and causes
crash.
BUG=627820
Review-Url: https://codereview.chromium.org/2145383002
Cr-Commit-Position: refs/heads/master@{#405475}
CrOS-Libchrome-Original-Commit: 33871d83b7ee98a1aa5692f8f835d44b7da65ef5
diff --git a/base/bind_internal.h b/base/bind_internal.h
index e3ccb25..3d6ca09 100644
--- a/base/bind_internal.h
+++ b/base/bind_internal.h
@@ -295,7 +295,7 @@
template <typename Functor, typename BoundWeakPtr, typename... RunArgs>
static inline void MakeItSo(Functor&& functor,
- BoundWeakPtr weak_ptr,
+ BoundWeakPtr&& weak_ptr,
RunArgs&&... args) {
if (!weak_ptr)
return;