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

Unified Diff: base/bind_internal.h

Issue 2039093002: Pass bound values as const values to the bound function (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase 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') | base/bind_internal_win.h » ('j') | 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 d998491b60e2bb208537e830eed710a8d7859172..0107efc62545bdf644e2a92066afb9a05d520280 100644
--- a/base/bind_internal.h
+++ b/base/bind_internal.h
@@ -156,7 +156,7 @@ class RunnableAdapter<R(*)(Args...)> {
}
template <typename... RunArgs>
- R Run(RunArgs&&... args) {
+ R Run(RunArgs&&... args) const {
return function_(std::forward<RunArgs>(args)...);
}
@@ -178,7 +178,7 @@ class RunnableAdapter<R(T::*)(Args...)> {
}
template <typename Receiver, typename... RunArgs>
- R Run(Receiver&& receiver_ptr, RunArgs&&... args) {
+ R Run(Receiver&& receiver_ptr, RunArgs&&... args) const {
// Clang skips CV qualifier check on a method pointer invocation when the
// receiver is a subclass. Store the receiver into a const reference to
// T to ensure the CV check works.
@@ -203,7 +203,7 @@ class RunnableAdapter<R(T::*)(Args...) const> {
}
template <typename Receiver, typename... RunArgs>
- R Run(Receiver&& receiver_ptr, RunArgs&&... args) {
+ R Run(Receiver&& receiver_ptr, RunArgs&&... args) const {
// Clang skips CV qualifier check on a method pointer invocation when the
// receiver is a subclass. Store the receiver into a unqualified reference
// to T to ensure the CV check works.
@@ -357,7 +357,7 @@ struct Invoker<IndexSequence<bound_indices...>,
is_weak_call,
R(UnboundArgs...)> {
static R Run(BindStateBase* base, UnboundArgs&&... unbound_args) {
- StorageType* storage = static_cast<StorageType*>(base);
+ const StorageType* storage = static_cast<StorageType*>(base);
// Local references to make debugger stepping easier. If in a debugger,
// you really want to warp ahead and step through the
// InvokeHelper<>::MakeItSo() call below.
« no previous file with comments | « base/bind_helpers.h ('k') | base/bind_internal_win.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698