This repository was archived by the owner on Feb 25, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6k
[fuchsia] SceneHostBindings are no longer thread locals #16262
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
arbreng
approved these changes
Jan 30, 2020
lib/ui/compositing/scene_host.h
Outdated
#include "flutter/fml/memory/ref_counted.h" | ||
#include "flutter/fml/task_runner.h" | ||
#include "flutter/lib/ui/dart_wrapper.h" | ||
|
||
namespace flutter { | ||
|
||
struct SceneHostBindingKey { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you move all of this and the #include into the .cc file?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yup!
80d4e9d
to
f4b2f32
Compare
lib/ui/compositing/scene_host.cc
Outdated
#include "flutter/flow/view_holder.h" | ||
#include "flutter/fml/thread_local.h" | ||
#include "flutter/lib/ui/ui_dart_state.h" | ||
|
||
namespace { | ||
|
||
using SceneHostBindings = std::unordered_map<zx_koid_t, flutter::SceneHost*>; | ||
struct SceneHostBindingKey { | ||
Dart_Isolate associated_isolate; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Call Dart_IsolateServiceId
and use that to represent the isolate. A raw isolate handle can become invalid at any time.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good call, thanks @jason-simmons
Prior to this change SceneHostBindinds was a ThreadLocal but the intention was for it to be IsolateLocal. Given that dart could collect this map on a non-UI thread this caused use-after-free issues. This change fixes it by making it keyed on isolate and koid this is not the ideal solution, this would exist on dart isolate group data struct. Given that Fuchsia is moving to use the embedder API, the decision to use this temporary work around was made. fixes flutter/flutter#49738
f4b2f32
to
756b957
Compare
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/flutter
that referenced
this pull request
Jan 31, 2020
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/flutter
that referenced
this pull request
Jan 31, 2020
This was referenced Jan 31, 2020
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/flutter
that referenced
this pull request
Jan 31, 2020
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/flutter
that referenced
this pull request
Jan 31, 2020
engine-flutter-autoroll
added a commit
to flutter/flutter
that referenced
this pull request
Jan 31, 2020
flutter/engine@74d07b5...804dca6 git log 74d07b5..804dca6 --first-parent --oneline 2020-01-31 [email protected] Use bundled Roboto in all tests (flutter/engine#16218) 2020-01-31 [email protected] Revert "Migrate flutter_runner from flutter_runner::{Thread,Loop} to fml::{Thread,MessageLoop} (#15118)" (flutter/engine#16277) 2020-01-31 [email protected] Roll src/third_party/skia 36c0521d57de..6305b2f8342a (8 commits) (flutter/engine#16272) 2020-01-31 [email protected] Revert "[web] Correct getPositionForOffset for multi-line paragraphs (#16206)" (flutter/engine#16268) 2020-01-30 [email protected] Fix Windows file checks of unicode paths (flutter/engine#16105) 2020-01-30 [email protected] [fuchsia] Fix the import for dart_api.h (flutter/engine#16269) 2020-01-30 [email protected] [fuchsia] SceneHostBindings are no longer thread locals (flutter/engine#16262) 2020-01-30 [email protected] Pass through invoker.resources in fuchsia_test_archive (flutter/engine#16265) 2020-01-30 [email protected] Notify PlatformViewsController within FlutterEngine when a hot restart occurs. (#48518) (flutter/engine#16230) 2020-01-30 [email protected] Roll src/third_party/dart fc3af737c759..162d6c5634a0 (209 commits) (flutter/engine#16261) 2020-01-30 [email protected] Roll src/third_party/skia d1be5d64f8a7..36c0521d57de (13 commits) (flutter/engine#16260) 2020-01-30 [email protected] [web] Correct getPositionForOffset for multi-line paragraphs (flutter/engine#16206) 2020-01-30 [email protected] Roll fuchsia/sdk/core/linux-amd64 from -mGIA... to 93K0d... (flutter/engine#16257) If this roll has caused a breakage, revert this CL and stop the roller using the controls here: https://autoroll.skia.org/r/flutter-engine-flutter-autoroll Please CC [email protected] on the revert to ensure that a human is aware of the problem. To report a problem with the AutoRoller itself, please file a bug: https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+/master/autoroll/README.md
NoamDev
pushed a commit
to NoamDev/engine
that referenced
this pull request
Feb 27, 2020
Prior to this change SceneHostBindinds was a ThreadLocal but the intention was for it to be IsolateLocal. Given that dart could collect this map on a non-UI thread this caused use-after-free issues. This change fixes it by making it keyed on isolate and koid this is not the ideal solution, this would exist on dart isolate group data struct. Given that Fuchsia is moving to use the embedder API, the decision to use this temporary work around was made. fixes flutter/flutter#49738
NoamDev
added a commit
to NoamDev/engine
that referenced
this pull request
Feb 27, 2020
…ter#16262)" This reverts commit e8129d1.
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Prior to this change SceneHostBindinds was a ThreadLocal but the
intention was for it to be IsolateLocal. Given that dart
could collect this map on a non-UI thread this caused
use-after-free issues.
This change fixes it by making it keyed on isolate and koid
this is not the ideal solution, this would exist on
dart isolate group data struct. Given that Fuchsia is moving
to use the embedder API, the decision to use this temporary
work around was made.
fixes flutter/flutter#49738