diff --git a/engine/src/flutter/lib/ui/ui_dart_state.h b/engine/src/flutter/lib/ui/ui_dart_state.h index 5b16b63795..8c5d9928b6 100644 --- a/engine/src/flutter/lib/ui/ui_dart_state.h +++ b/engine/src/flutter/lib/ui/ui_dart_state.h @@ -20,7 +20,6 @@ class Window; class IsolateClient { public: virtual void DidCreateSecondaryIsolate(Dart_Isolate isolate) = 0; - virtual void WillShutDownIsolate(Dart_Isolate isolate) = 0; protected: virtual ~IsolateClient(); @@ -36,9 +35,6 @@ class UIDartState : public tonic::DartState { UIDartState* CreateForChildIsolate(); IsolateClient* isolate_client() { return isolate_client_; } - void set_isolate_client(IsolateClient* isolate_client) { - isolate_client_ = isolate_client; - } Dart_Port main_port() const { return main_port_; } const std::string& debug_name() const { return debug_name_; } Window* window() const { return window_.get(); } diff --git a/engine/src/flutter/runtime/dart_controller.cc b/engine/src/flutter/runtime/dart_controller.cc index b9ece77ea8..1fd2b5436a 100644 --- a/engine/src/flutter/runtime/dart_controller.cc +++ b/engine/src/flutter/runtime/dart_controller.cc @@ -49,8 +49,6 @@ DartController::DartController() DartController::~DartController() { if (ui_dart_state_) { - ui_dart_state_->set_isolate_client(nullptr); - // Don't use a tonic::DartIsolateScope here since we never exit the isolate. Dart_EnterIsolate(ui_dart_state_->isolate()); // Clear the message notify callback. @@ -219,8 +217,4 @@ void DartController::CreateIsolateFor( Dart_ExitIsolate(); } -void DartController::IsolateShuttingDown() { - ui_dart_state_ = nullptr; -} - } // namespace blink diff --git a/engine/src/flutter/runtime/dart_controller.h b/engine/src/flutter/runtime/dart_controller.h index 5706bca234..0145d30089 100644 --- a/engine/src/flutter/runtime/dart_controller.h +++ b/engine/src/flutter/runtime/dart_controller.h @@ -35,8 +35,6 @@ class DartController { UIDartState* dart_state() const { return ui_dart_state_; } - void IsolateShuttingDown(); - private: bool SendStartMessage(Dart_Handle root_library); diff --git a/engine/src/flutter/runtime/dart_init.cc b/engine/src/flutter/runtime/dart_init.cc index 5e08351d08..9a28a803bd 100644 --- a/engine/src/flutter/runtime/dart_init.cc +++ b/engine/src/flutter/runtime/dart_init.cc @@ -129,11 +129,7 @@ void IsolateShutdownCallback(void* callback_data) { Dart_Handle sticky_error = Dart_GetStickyError(); FXL_CHECK(LogIfError(sticky_error)); } - UIDartState* dart_state = static_cast(callback_data); - IsolateClient* isolate_client_ = dart_state->isolate_client(); - if (isolate_client_) { - isolate_client_->WillShutDownIsolate(dart_state->isolate()); - } + tonic::DartState* dart_state = static_cast(callback_data); delete dart_state; } diff --git a/engine/src/flutter/runtime/runtime_controller.cc b/engine/src/flutter/runtime/runtime_controller.cc index eb79901baa..64457934b1 100644 --- a/engine/src/flutter/runtime/runtime_controller.cc +++ b/engine/src/flutter/runtime/runtime_controller.cc @@ -134,10 +134,6 @@ void RuntimeController::DidCreateSecondaryIsolate(Dart_Isolate isolate) { client_->DidCreateSecondaryIsolate(isolate); } -void RuntimeController::WillShutDownIsolate(Dart_Isolate isolate) { - dart_controller_->IsolateShuttingDown(); -} - Dart_Port RuntimeController::GetMainPort() { if (!dart_controller_) { return ILLEGAL_PORT; diff --git a/engine/src/flutter/runtime/runtime_controller.h b/engine/src/flutter/runtime/runtime_controller.h index a24f851c6c..82032394bc 100644 --- a/engine/src/flutter/runtime/runtime_controller.h +++ b/engine/src/flutter/runtime/runtime_controller.h @@ -61,7 +61,6 @@ class RuntimeController : public WindowClient, public IsolateClient { void HandlePlatformMessage(fxl::RefPtr message) override; void DidCreateSecondaryIsolate(Dart_Isolate isolate) override; - void WillShutDownIsolate(Dart_Isolate isolate) override; RuntimeDelegate* client_; std::string language_code_;