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

Unified Diff: mojo/public/cpp/bindings/callback.h

Issue 1863283002: Make mojo::Callback<>::Runnable::Run non-const. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased. Created 4 years, 8 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
Index: mojo/public/cpp/bindings/callback.h
diff --git a/mojo/public/cpp/bindings/callback.h b/mojo/public/cpp/bindings/callback.h
index 4e9a933edda66f0eda47724836aa45b0f0bb0f45..91f37d03fef390fe904a3c93475fb28b7a5085e2 100644
--- a/mojo/public/cpp/bindings/callback.h
+++ b/mojo/public/cpp/bindings/callback.h
@@ -33,8 +33,7 @@ class Callback<void(Args...)> {
// because it is a virtual interface. So we have to take the arguments
// all by value (except String which we take as a const reference due to
// ForwardType).
- typename internal::Callback_ParamTraits<Args>::ForwardType...)
- const = 0;
+ typename internal::Callback_ParamTraits<Args>::ForwardType...) = 0;
};
// Constructs a "null" callback that does nothing.
@@ -98,7 +97,7 @@ class Callback<void(Args...)> {
explicit RunnableAdapter(const Sink& sink) : sink(sink) {}
virtual void Run(
typename internal::Callback_ParamTraits<Args>::ForwardType... args)
- const override {
+ override {
sink.Run(std::forward<
typename internal::Callback_ParamTraits<Args>::ForwardType>(
args)...);
@@ -112,7 +111,7 @@ class Callback<void(Args...)> {
explicit FunctorAdapter(const Sink& sink) : sink(sink) {}
virtual void Run(
typename internal::Callback_ParamTraits<Args>::ForwardType... args)
- const override {
+ override {
sink.operator()(
std::forward<
typename internal::Callback_ParamTraits<Args>::ForwardType>(
@@ -132,7 +131,7 @@ class Callback<void(Args...)> {
: function_ptr(function_ptr) {}
virtual void Run(
typename internal::Callback_ParamTraits<Args>::ForwardType... args)
- const override {
+ override {
(*function_ptr)(
std::forward<
typename internal::Callback_ParamTraits<Args>::ForwardType>(

Powered by Google App Engine
This is Rietveld 408576698