fix: use nested run loop in clipboard.readImage #39466
Merged
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.
Description of Change
Refs #39069.
Closes #39446.
Must explicitly specify kNestableTasksAllowed to make nested run loop work.
Note that this is totally valid trick, there are a few examples can be found in Chromium:
https://source.chromium.org/chromium/chromium/src/+/refs/heads/main:components/printing/renderer/print_render_frame_helper.cc;l=2607;drc=b86abfa407f3f35d3e5904e76b9a8d3a741bdc8b
https://source.chromium.org/chromium/chromium/src/+/main:components/ui_devtools/agent_util.cc;l=38;drc=8ba1bad80dc22235693a0dd41fe55c0fd2dbdabd
/cc @codebytere @TomaszMa
Release Notes
Notes: Fix
clipboard.readImage()
getting blocked when there is no PNG image in the clipboard.