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: account for potentially swapped FrameTreeNodeId
in WebFrameMain
#41538
Conversation
3dd4a9d
to
5234415
Compare
FrameTreeNodeId
in WebFrameMain
|
||
// TODO(codebytere): remove after refactoring away from FrameTreeNodeId as map | ||
// key. | ||
auto* ftn = |
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.
Does the current map get updated when ftn gets swapped for the pre-rendering case ? What is the alternative here, should we change to use GlobalRenderFrameHostToken
as the map identifier ?
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.
No - at the moment it doesn't since it was written for the assumption that wouldn't happen. I do think we can use GlobalRenderFrameHostToken
instead; i can refactor it in this PR but i wasn't sure how much time it'd take to look into it more so I thought i'd mitigate a hard crash before doing so. Do you have a preference?
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.
Lets do it as follow-up, we might want to change to track ftn directly rather than the underlying rfh so this needs further discussion.
Looking at the call stack, I'm not seeing where a frame is being created in
The intent I had with designing WebFrameMain was to essentially track a corresponding That being said, I think merging this to protect against the hard crash is fine for now. |
Yeah its from a fork which has the find API based on #28274 |
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
Failures are known flakes. |
No Release Notes |
…in` (#41538) fix: account for potentially swapped FrameTreeNodeId in WebFrameMain Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org> Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
I have automatically backported this PR to "28-x-y", please check out #41592 |
I have automatically backported this PR to "29-x-y", please check out #41593 |
I have automatically backported this PR to "30-x-y", please check out #41594 |
Description of Change
Refs https://issues.chromium.org/issues/40169570
Refs #30076
Fixes a crash in
WebFrameMain::FromRenderFrameHost
that could occur when a given RenderFrameHost's FrameTreeNode is invalid. In #30076 we addressed cross-origin navigation disposing WebFrameMain instances by mapping FrameTreeNode ids to WebFrameMains. At the time, a RenderFrameHost's FrameTreeNode was constant for the lifetime of the RenderFrameHost - that's no longer the case. With prerendering and bfcache, aRenderFrameHost
can travel from oneFrameTreeNode
to another one during prerender activation.We should migrate our mapping logic away from 1:1
FrameTreeNode
->RenderFrameHost
but this addresses it crashing in the short term.Details
Checklist
npm test
passesRelease Notes
Notes: none