Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(oopifs): account for various races between processes #5320

Merged
merged 1 commit into from Feb 5, 2021
Merged

fix(oopifs): account for various races between processes #5320

merged 1 commit into from Feb 5, 2021

Conversation

dgozman
Copy link
Contributor

@dgozman dgozman commented Feb 5, 2021

Consider the following situation (one among many possible).

  • FrameA has an oopif child FrameB;
  • FrameA navigates to same-process origin (e.g. about:blank);
  • at the same time, FrameC is attached to the FrameB in the FrameB's process.

In this case, we get frameNavigated event for FrameA, immediately
followed by frameAttached event for FrameC. Since we detach all
FrameA's child frames on navigation, including the oopif FrameB,
there is no parent frame for FrameC to attach to.

In general, multiple processes (main and oopifs) may send their
events in wildly different order, and their view about the frame
tree may not always correspond to the "up to date" frame tree as
seen from the main frame's process. We try to keep our frame tree
aligned with what main process thinks, and ignore events that
reference frames absent in this tree.

Drive-by: fix async processing of file chooser that may throw.

Fixes #4624.

src/server/chromium/crPage.ts Outdated Show resolved Hide resolved
src/server/chromium/crPage.ts Outdated Show resolved Hide resolved
src/server/chromium/crPage.ts Outdated Show resolved Hide resolved
src/server/chromium/crPage.ts Outdated Show resolved Hide resolved
src/server/webkit/wkPage.ts Outdated Show resolved Hide resolved
src/server/chromium/crPage.ts Show resolved Hide resolved
Consider the following situation (one among many possible).
- FrameA has an oopif child FrameB;
- FrameA navigates to same-process origin (e.g. about:blank);
- at the same time, FrameC is attached to the FrameB in the
  FrameB's process.

In this case, we get `frameNavigated` event for FrameA, immediately
followed by `frameAttached` event for FrameC. Since we detach all
FrameA's child frames on navigation, including the oopif FrameB,
there is no parent frame for FrameC to attach to.

In general, multiple processes coming from oopif may send their
events in wildly different order, and their view about the frame
tree may not always correspond to the "up to date" frame tree as
seen from the main frame's process. We try to keep our frame tree
aligned with what main process thinks, and ignore events that
reference frames absent in this tree.

Drive-by: handle filechooser exceptions because of async processing.
@dgozman dgozman merged commit de30ee0 into microsoft:master Feb 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Endless frameattached events [BUG]
2 participants