-
Notifications
You must be signed in to change notification settings - Fork 6k
[Embedder API] Introduce new semantics update callback and migrate Windows #37129
[Embedder API] Introduce new semantics update callback and migrate Windows #37129
Conversation
ASSERT_FALSE(engine.is_valid()); | ||
engine.reset(); | ||
} | ||
|
||
TEST_F(EmbedderA11yTest, A11yTreeIsConsistent) { |
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.
This diff is a bit confusing. The contents of the old A11TreeIsConsistent
was moved to a new test A11yTreeIsConsistentUsingLegacyCallbacks
, which starts below on line 215. This A11TreeIsConsistent
now tests the new embedder API.
b582aaf
to
af21cf7
Compare
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.
LGTM, but I just want to ask if there is any particular reason to have a method which returns the callback function instead of storing the sub-callbacks as members like before and calling them all from a callback method instead?
EDIT: After mulling this over, the two layers of "translation" callbacks adds too much cognitive overhead. I will simplify this to just a single layer of "translation" callbacks. Original reply...@yaakovschectman The high-level flow hasn't changed, here's how registering the embedder's callbacks work before and after this change:
After this change, there are now two layers of "translation" callbacks:
The
This still works the same way as before: the embedder provides its callbacks using Please let me know if I misunderstood something! Also, please let me know if you have suggestions on how to improve clarity! |
@yaakovschectman I simplified this change, please take another look! Below is the updated version of this comment. The high-level flow for the callbacks hasn't changed, here's it works for both before and after this change:
After this change, there are now three possible "translation" callbacks:
The
This still works the same way as before: the embedder provides its callbacks using Please let me know if I misunderstood something! Also, please let me know if you have suggestions on how to improve clarity! |
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.
LGTM
e01274b
to
6f4996b
Compare
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.
LGTM, do you have a pr to migrate the macOS as well?
@chunhtai Not yet, I was waiting to in case the embedder API received feedback. The macOS changes will be very similar to the Windows changes. EDIT: Here's a prototype of the macOS changes: loic-sharma@5ddcc8a |
57db430
to
ea97a5e
Compare
GetUpdateSemanticsNodeCallbackHook(); | ||
FlutterUpdateSemanticsCallback GetUpdateSemanticsCallbackHook(); | ||
|
||
FlutterUpdateSemanticsNodeCallback GetUpdateSemanticsNodeCallbackHook(); |
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 these be removed now that we have the alternative? It doesn't look like we ever actually use them in tests (or maybe I'm mis-grepping).
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.
These are still used by the A11yTreeIsConsistentUsingLegacyCallbacks
unit test to test the legacy callbacks (see the context.SetSemanticsNodeCallback
and context.SetSemanticsCustomActionCallback
calls)
891c857
to
775ffec
Compare
…114847) * 3d9f48580 [Embedder API] Introduce new semantics update callback (flutter/engine#37129) * b673ce3c3 Roll Skia from da9fad017aee to dec7a930c0b7 (10 revisions) (flutter/engine#37390) * df602070a [Web] Synthesize modifiers key up based on known logical key (flutter/engine#37280)
/cc @chinmaygarde |
The unit test here is consistently exceeding the 120s timeouts in runs: https://ci.chromium.org/p/flutter/builders/try/Mac%20Host%20Engine Starting a revert... |
There is also a potential fix for the race conditions: #37488 |
I closed the revert in favor of the fix - #37488 |
Just noticed this accidentally removed the tooltip from the embedder callback. Will need to add that back in #37676 |
…lutter#114847) * 3d9f48580 [Embedder API] Introduce new semantics update callback (flutter/engine#37129) * b673ce3c3 Roll Skia from da9fad017aee to dec7a930c0b7 (10 revisions) (flutter/engine#37390) * df602070a [Web] Synthesize modifiers key up based on known logical key (flutter/engine#37280)
…lutter#114847) * 3d9f48580 [Embedder API] Introduce new semantics update callback (flutter/engine#37129) * b673ce3c3 Roll Skia from da9fad017aee to dec7a930c0b7 (10 revisions) (flutter/engine#37390) * df602070a [Web] Synthesize modifiers key up based on known logical key (flutter/engine#37280)
This introduces a new embedder API to notify the embedder of semantic updates, and, migrates Windows to this new embedder API. The Linux and macOS migrations will be done in follow-up changes.
Part of flutter/flutter#114201
Background
In the old embedder API, the engine breaks up a batch of semantic updates and sends each update individually to the embedder. This is problematic as there may be dependencies across these updates, so the ordering of these updates is crucial to prevent crashes (see flutter/flutter#103808 and #35792). In other words, there was an implicit contract between the embedder and the engine on the ordering of these updates.
The new embedder API just sends the entire batch of semantic updates in one go, allowing us to remove ordering concerns from the embedder API.
Pre-launch Checklist
///
).If you need help, consider asking for advice on the #hackers-new channel on Discord.