Commit cae8fa0
Fix cross-world Promise leak in navigator.keyboard.getLayoutMap()
This CL refactors KeyboardLayout::GetKeyboardLayoutMap to use
ScriptPromiseProperty instead of maintaining a HeapVector of
ScriptPromiseResolvers.
This change aligns the implementation with Blink's preferred patterns
for Promise-returning methods while continuing to satisfy the
Keyboard API specifications:
- Concurrent requests within the same world are automatically handled
by ScriptPromiseProperty to return the same pending promise
instance.
- To ensure sequential calls return new promise instances (as
required by the spec), `layout_map_property_` is now explicitly
cleared once it has reached a resolved or rejected state.
Bug: 501485453
Change-Id: Ia19bc3408e61ec160764f6229b6158fa5a912c3f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7751051
Reviewed-by: Yuki Shiino <yukishiino@chromium.org>
Commit-Queue: Joe Downing <joedow@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1615641}1 parent fb35c08 commit cae8fa0
File tree
1 file changed
+7
-5
lines changed- keyboard-map
1 file changed
+7
-5
lines changedLines changed: 7 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | | - | |
9 | | - | |
10 | | - | |
11 | | - | |
12 | | - | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
13 | 15 | | |
14 | 16 | | |
0 commit comments