Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Pass deadline to embedder idle notification callback #7444

Merged
merged 1 commit into from
Jan 10, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion common/settings.h
Original file line number Diff line number Diff line change
Expand Up @@ -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<void(int64_t)> idle_notification_callback;
bool enable_software_rendering = false;
bool skia_deterministic_rendering_on_cpu = false;
bool verbose_logging = false;
Expand Down
6 changes: 3 additions & 3 deletions runtime/runtime_controller.cc
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ RuntimeController::RuntimeController(
fml::RefPtr<flow::SkiaUnrefQueue> p_unref_queue,
std::string p_advisory_script_uri,
std::string p_advisory_script_entrypoint,
fml::closure p_idle_notification_callback)
std::function<void(int64_t)> p_idle_notification_callback)
: RuntimeController(p_client,
p_vm,
std::move(p_isolate_snapshot),
Expand All @@ -50,7 +50,7 @@ RuntimeController::RuntimeController(
fml::RefPtr<flow::SkiaUnrefQueue> p_unref_queue,
std::string p_advisory_script_uri,
std::string p_advisory_script_entrypoint,
fml::closure idle_notification_callback,
std::function<void(int64_t)> idle_notification_callback,
WindowData p_window_data)
: client_(p_client),
vm_(p_vm),
Expand Down Expand Up @@ -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;
}
Expand Down
6 changes: 3 additions & 3 deletions runtime/runtime_controller.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class RuntimeController final : public WindowClient {
fml::RefPtr<flow::SkiaUnrefQueue> unref_queue,
std::string advisory_script_uri,
std::string advisory_script_entrypoint,
fml::closure idle_notification_callback);
std::function<void(int64_t)> idle_notification_callback);

~RuntimeController() override;

Expand Down Expand Up @@ -126,7 +126,7 @@ class RuntimeController final : public WindowClient {
fml::RefPtr<flow::SkiaUnrefQueue> unref_queue_;
std::string advisory_script_uri_;
std::string advisory_script_entrypoint_;
fml::closure idle_notification_callback_;
std::function<void(int64_t)> idle_notification_callback_;
WindowData window_data_;
std::weak_ptr<DartIsolate> root_isolate_;
std::pair<bool, uint32_t> root_isolate_return_code_ = {false, 0};
Expand All @@ -141,7 +141,7 @@ class RuntimeController final : public WindowClient {
fml::RefPtr<flow::SkiaUnrefQueue> unref_queue,
std::string advisory_script_uri,
std::string advisory_script_entrypoint,
fml::closure idle_notification_callback,
std::function<void(int64_t)> idle_notification_callback,
WindowData data);

Window* GetWindowIfAvailable();
Expand Down