Skip to content

Commit

Permalink
Pass deadline to embedder idle notification callback (flutter#7444)
Browse files Browse the repository at this point in the history
  • Loading branch information
zanderso authored Jan 10, 2019
1 parent 5272805 commit b7f6bf0
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
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

0 comments on commit b7f6bf0

Please sign in to comment.