Index: third_party/mojo/src/mojo/public/cpp/bindings/callback.h |
diff --git a/third_party/mojo/src/mojo/public/cpp/bindings/callback.h b/third_party/mojo/src/mojo/public/cpp/bindings/callback.h |
index beec1a102e7024a44a33b51c20ba9da49e1ee4fe..17d1caf24a18efcb54b9602fd7b34fdbcd09698c 100644 |
--- a/third_party/mojo/src/mojo/public/cpp/bindings/callback.h |
+++ b/third_party/mojo/src/mojo/public/cpp/bindings/callback.h |
@@ -37,7 +37,7 @@ |
explicit Callback(Runnable* runnable) : sink_(runnable) {} |
// As above, but can take an object that isn't derived from Runnable, so long |
- // as it has a compatible operator() or Run() method. operator() will be |
+ // as it has a compatible operator() or Run() method. operator() will be |
// preferred if the type has both. |
template <typename Sink> |
Callback(const Sink& sink) { |
@@ -46,11 +46,6 @@ |
FunctorAdapter<Sink>, RunnableAdapter<Sink>>::type; |
sink_ = internal::SharedPtr<Runnable>(new sink_type(sink)); |
} |
- |
- // As above, but can take a compatible function pointer. |
- Callback(void (*function_ptr)( |
- typename internal::Callback_ParamTraits<Args>::ForwardType...)) |
- : sink_(new FunctionPtrAdapter(function_ptr)) {} |
// Executes the callback function, invoking Pass() on move-only types. |
void Run(typename internal::Callback_ParamTraits<Args>::ForwardType... args) |
@@ -78,7 +73,7 @@ |
Sink sink; |
}; |
- // Adapts a class that has a compatible operator() to be callable by Callback. |
+ // Adapts a class that has a compatible operator() callable by Callback. |
template <typename Sink> |
struct FunctorAdapter : public Runnable { |
explicit FunctorAdapter(const Sink& sink) : sink(sink) {} |
@@ -90,20 +85,6 @@ |
Sink sink; |
}; |
- // Adapts a function pointer. |
- struct FunctionPtrAdapter : public Runnable { |
- explicit FunctionPtrAdapter(void (*function_ptr)( |
- typename internal::Callback_ParamTraits<Args>::ForwardType...)) |
- : function_ptr(function_ptr) {} |
- virtual void Run( |
- typename internal::Callback_ParamTraits<Args>::ForwardType... args) |
- const override { |
- (*function_ptr)(internal::Forward(args)...); |
- } |
- void (*function_ptr)( |
- typename internal::Callback_ParamTraits<Args>::ForwardType...); |
- }; |
- |
internal::SharedPtr<Runnable> sink_; |
}; |