@@ -26,7 +26,8 @@ RuntimeController::RuntimeController(
2626 std::string p_advisory_script_entrypoint,
2727 std::function<void (int64_t )> p_idle_notification_callback,
2828 fml::closure p_isolate_create_callback,
29- fml::closure p_isolate_shutdown_callback)
29+ fml::closure p_isolate_shutdown_callback,
30+ std::shared_ptr<const fml::Mapping> p_persistent_isolate_data)
3031 : RuntimeController(p_client,
3132 p_vm,
3233 std::move (p_isolate_snapshot),
@@ -39,7 +40,8 @@ RuntimeController::RuntimeController(
3940 p_idle_notification_callback,
4041 WindowData{/* default window data */ },
4142 p_isolate_create_callback,
42- p_isolate_shutdown_callback) {}
43+ p_isolate_shutdown_callback,
44+ std::move (p_persistent_isolate_data)) {}
4345
4446RuntimeController::RuntimeController (
4547 RuntimeDelegate& p_client,
@@ -54,7 +56,8 @@ RuntimeController::RuntimeController(
5456 std::function<void (int64_t )> idle_notification_callback,
5557 WindowData p_window_data,
5658 fml::closure p_isolate_create_callback,
57- fml::closure p_isolate_shutdown_callback)
59+ fml::closure p_isolate_shutdown_callback,
60+ std::shared_ptr<const fml::Mapping> p_persistent_isolate_data)
5861 : client_(p_client),
5962 vm_(p_vm),
6063 isolate_snapshot_(std::move(p_isolate_snapshot)),
@@ -67,7 +70,8 @@ RuntimeController::RuntimeController(
6770 idle_notification_callback_(idle_notification_callback),
6871 window_data_(std::move(p_window_data)),
6972 isolate_create_callback_(p_isolate_create_callback),
70- isolate_shutdown_callback_(p_isolate_shutdown_callback) {
73+ isolate_shutdown_callback_(p_isolate_shutdown_callback),
74+ persistent_isolate_data_(std::move(p_persistent_isolate_data)) {
7175 // Create the root isolate as soon as the runtime controller is initialized.
7276 // It will be run at a later point when the engine provides a run
7377 // configuration and then runs the isolate.
@@ -144,7 +148,8 @@ std::unique_ptr<RuntimeController> RuntimeController::Clone() const {
144148 idle_notification_callback_, //
145149 window_data_, //
146150 isolate_create_callback_, //
147- isolate_shutdown_callback_ //
151+ isolate_shutdown_callback_, //
152+ persistent_isolate_data_ //
148153 ));
149154}
150155
@@ -296,42 +301,56 @@ Window* RuntimeController::GetWindowIfAvailable() {
296301 return root_isolate ? root_isolate->window () : nullptr ;
297302}
298303
304+ // |WindowClient|
299305std::string RuntimeController::DefaultRouteName () {
300306 return client_.DefaultRouteName ();
301307}
302308
309+ // |WindowClient|
303310void RuntimeController::ScheduleFrame () {
304311 client_.ScheduleFrame ();
305312}
306313
314+ // |WindowClient|
307315void RuntimeController::Render (Scene* scene) {
308316 client_.Render (scene->takeLayerTree ());
309317}
310318
319+ // |WindowClient|
311320void RuntimeController::UpdateSemantics (SemanticsUpdate* update) {
312321 if (window_data_.semantics_enabled ) {
313322 client_.UpdateSemantics (update->takeNodes (), update->takeActions ());
314323 }
315324}
316325
326+ // |WindowClient|
317327void RuntimeController::HandlePlatformMessage (
318328 fml::RefPtr<PlatformMessage> message) {
319329 client_.HandlePlatformMessage (std::move (message));
320330}
321331
332+ // |WindowClient|
322333FontCollection& RuntimeController::GetFontCollection () {
323334 return client_.GetFontCollection ();
324335}
325336
337+ // |WindowClient|
326338void RuntimeController::UpdateIsolateDescription (const std::string isolate_name,
327339 int64_t isolate_port) {
328340 client_.UpdateIsolateDescription (isolate_name, isolate_port);
329341}
330342
343+ // |WindowClient|
331344void RuntimeController::SetNeedsReportTimings (bool value) {
332345 client_.SetNeedsReportTimings (value);
333346}
334347
348+ // |WindowClient|
349+ std::shared_ptr<const fml::Mapping>
350+ RuntimeController::GetPersistentIsolateData () {
351+ return persistent_isolate_data_;
352+ }
353+
335354Dart_Port RuntimeController::GetMainPort () {
336355 std::shared_ptr<DartIsolate> root_isolate = root_isolate_.lock ();
337356 return root_isolate ? root_isolate->main_port () : ILLEGAL_PORT;
0 commit comments