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

Unified Diff: base/bind_internal.h

Issue 2048023004: Introduce base::IsWeakReceiver for base::Bind to support external weak pointers (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: comment fix. reorder template specializations. use Perfect Forwarding for weak call Created 4 years, 6 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 4da13eed99d20a001e08c564f3fd7818d9549955..d998491b60e2bb208537e830eed710a8d7859172 100644
--- a/base/bind_internal.h
+++ b/base/bind_internal.h
@@ -317,13 +317,13 @@ template <>
struct InvokeHelper<true, void> {
template <typename Runnable, typename BoundWeakPtr, typename... RunArgs>
static void MakeItSo(Runnable&& runnable,
- BoundWeakPtr weak_ptr,
+ BoundWeakPtr&& weak_ptr,
RunArgs&&... args) {
- if (!weak_ptr.get()) {
+ if (!weak_ptr) {
return;
}
std::forward<Runnable>(runnable).Run(
- weak_ptr.get(), std::forward<RunArgs>(args)...);
+ std::forward<BoundWeakPtr>(weak_ptr), std::forward<RunArgs>(args)...);
}
};
« 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