@@ -24,9 +24,8 @@ UIDartState::Context::Context(
2424 fml::TaskRunnerAffineWeakPtr<SnapshotDelegate> snapshot_delegate,
2525 fml::WeakPtr<IOManager> io_manager,
2626 fml::RefPtr<SkiaUnrefQueue> unref_queue,
27- fml::TaskRunnerAffineWeakPtr<ImageDecoder> image_decoder,
28- fml::TaskRunnerAffineWeakPtr<ImageGeneratorRegistry>
29- image_generator_registry,
27+ fml::WeakPtr<ImageDecoder> image_decoder,
28+ fml::WeakPtr<ImageGeneratorRegistry> image_generator_registry,
3029 std::string advisory_script_uri,
3130 std::string advisory_script_entrypoint,
3231 bool deterministic_rendering_enabled,
@@ -59,7 +58,6 @@ UIDartState::UIDartState(
5958 const UIDartState::Context& context)
6059 : add_callback_(std::move(add_callback)),
6160 remove_callback_(std::move(remove_callback)),
62- callback_queue_id_(fml::TaskQueueId::kInvalid ),
6361 logger_prefix_(std::move(logger_prefix)),
6462 is_root_isolate_(is_root_isolate),
6563 unhandled_exception_callback_(std::move(unhandled_exception_callback)),
@@ -180,12 +178,10 @@ void UIDartState::AddOrRemoveTaskObserver(bool add) {
180178 }
181179 FML_DCHECK (add_callback_ && remove_callback_);
182180 if (add) {
183- callback_queue_id_ =
184- add_callback_ (reinterpret_cast <intptr_t >(this ),
185- [this ]() { this ->FlushMicrotasksNow (); });
181+ add_callback_ (reinterpret_cast <intptr_t >(this ),
182+ [this ]() { this ->FlushMicrotasksNow (); });
186183 } else {
187- remove_callback_ (callback_queue_id_, reinterpret_cast <intptr_t >(this ));
188- callback_queue_id_ = fml::TaskQueueId::Invalid ();
184+ remove_callback_ (reinterpret_cast <intptr_t >(this ));
189185 }
190186}
191187
@@ -194,13 +190,12 @@ UIDartState::GetSnapshotDelegate() const {
194190 return context_.snapshot_delegate ;
195191}
196192
197- fml::TaskRunnerAffineWeakPtr<ImageDecoder> UIDartState::GetImageDecoder ()
198- const {
193+ fml::WeakPtr<ImageDecoder> UIDartState::GetImageDecoder () const {
199194 return context_.image_decoder ;
200195}
201196
202- fml::TaskRunnerAffineWeakPtr <ImageGeneratorRegistry>
203- UIDartState::GetImageGeneratorRegistry () const {
197+ fml::WeakPtr <ImageGeneratorRegistry> UIDartState::GetImageGeneratorRegistry ()
198+ const {
204199 return context_.image_generator_registry ;
205200}
206201
0 commit comments