DevTools: skip audio context selector empty list state with _items.replace
Problem: When a web audio context change event occurs the "changed to" context is first removed from the context selector list then added back. If the list only contains 1 items then the list contents goes 1 -> 0 -> 1 and the event listener AudioContextSelector._onListItemReplaced will intermediately disable the context menu during the change event when the empty state list is reached. This can cause side-effects and is extra cycles we don't need to spend. Solution: The UI.ListModel.replace method does the same operation without the intermediary empty list state. Change-Id: Ide76e2281c6c7224c22e77f3e7a5766fb2ef0a24 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1823730 Commit-Queue: John Emau <John.Emau@microsoft.com> Reviewed-by:Yang Guo <yangguo@chromium.org> Reviewed-by:
Mandy Chen <mandy.chen@microsoft.com> Cr-Commit-Position: refs/heads/master@{#704856}
Showing
Please register or sign in to comment