Pass deadline to embedder idle notification callback (flutter/engine#7444)

This commit is contained in:
Zachary Anderson
2019-01-10 14:08:43 -08:00
committed by GitHub
parent c7de795701
commit 6bd9431a0c
3 changed files with 7 additions and 7 deletions

View File

@@ -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;

View File

@@ -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),
@@ -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),
@@ -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;
}

View File

@@ -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;
@@ -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};
@@ -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();