diff --git a/common/settings.h b/common/settings.h index b857b4aade6a2e0c08943e72576140bc0a731ef9..e58a3d0aef90f3edee95072e5bc66d396f0658b4 100644 --- a/common/settings.h +++ b/common/settings.h @@ -79,7 +79,7 @@ struct Settings { // tasks suitable when idling. Due to this, embedders are still advised to be // as fast as possible in returning from this callback. Long running // operations in this callback do have the capability of introducing jank. - fml::closure idle_notification_callback; + std::function idle_notification_callback; bool enable_software_rendering = false; bool skia_deterministic_rendering_on_cpu = false; bool verbose_logging = false; diff --git a/runtime/runtime_controller.cc b/runtime/runtime_controller.cc index e4c3c3289e0060d66e13fe9a1b3b24843851c433..5176101f4a2a3200086f60f458c56a30fe85e50f 100644 --- a/runtime/runtime_controller.cc +++ b/runtime/runtime_controller.cc @@ -25,7 +25,7 @@ RuntimeController::RuntimeController( fml::RefPtr p_unref_queue, std::string p_advisory_script_uri, std::string p_advisory_script_entrypoint, - fml::closure p_idle_notification_callback) + std::function p_idle_notification_callback) : RuntimeController(p_client, p_vm, std::move(p_isolate_snapshot), @@ -50,7 +50,7 @@ RuntimeController::RuntimeController( fml::RefPtr p_unref_queue, std::string p_advisory_script_uri, std::string p_advisory_script_entrypoint, - fml::closure idle_notification_callback, + std::function idle_notification_callback, WindowData p_window_data) : client_(p_client), vm_(p_vm), @@ -212,7 +212,7 @@ bool RuntimeController::NotifyIdle(int64_t deadline) { // Idle notifications being in isolate scope are part of the contract. if (idle_notification_callback_) { TRACE_EVENT0("flutter", "EmbedderIdleNotification"); - idle_notification_callback_(); + idle_notification_callback_(deadline); } return true; } diff --git a/runtime/runtime_controller.h b/runtime/runtime_controller.h index 5bbb47e221e776a9f1562ef521427a883495039d..0aacc8289043f0b757fa1b0b556996c19ebc498d 100644 --- a/runtime/runtime_controller.h +++ b/runtime/runtime_controller.h @@ -37,7 +37,7 @@ class RuntimeController final : public WindowClient { fml::RefPtr unref_queue, std::string advisory_script_uri, std::string advisory_script_entrypoint, - fml::closure idle_notification_callback); + std::function idle_notification_callback); ~RuntimeController() override; @@ -126,7 +126,7 @@ class RuntimeController final : public WindowClient { fml::RefPtr unref_queue_; std::string advisory_script_uri_; std::string advisory_script_entrypoint_; - fml::closure idle_notification_callback_; + std::function idle_notification_callback_; WindowData window_data_; std::weak_ptr root_isolate_; std::pair root_isolate_return_code_ = {false, 0}; @@ -141,7 +141,7 @@ class RuntimeController final : public WindowClient { fml::RefPtr unref_queue, std::string advisory_script_uri, std::string advisory_script_entrypoint, - fml::closure idle_notification_callback, + std::function idle_notification_callback, WindowData data); Window* GetWindowIfAvailable();