-
Notifications
You must be signed in to change notification settings - Fork 16.5k
refactor: replace webFrame.routingId with sync IPC #47717
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
Conversation
): Electron.WebFrame | null { | ||
findFrameByRoutingIdDeprecated(); | ||
const frameToken = ipcRendererUtils.invokeSync<string | undefined>( | ||
IPC_MESSAGES.BROWSER_GET_FRAME_TOKEN_SYNC, |
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.
It hadn't occurred to me that this workaround would require one roundtrip to get the routingId, and then a second roundtrip to convert it right back into a frame token 😅
That said, this still seems like the best way to give apps more time to migrate.
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.
It's only one roundtrip so it's not too bad! FindFrameByToken
only looks within the current renderer process afaik. If the frame is in another process, it won't be returned from the WebFrame
API.
electron/shell/renderer/api/electron_api_web_frame.cc
Lines 823 to 826 in a33b599
content::RenderFrame* render_frame = | |
content::RenderFrame::FromWebFrame(web_frame); | |
if (render_frame) | |
return WebFrameRenderer::Create(isolate, render_frame).ToV8(); |
3da63d1
to
b61f468
Compare
I'll wait for the roll to be merged before fixing up this PR. |
4db9fea
to
d3690a9
Compare
dd92508
to
18c2fdd
Compare
18c2fdd
to
3bd7805
Compare
No Release Notes |
I have automatically backported this PR to "38-x-y", please check out #47941 |
* refactor: replace webFrame.routingId with sync IPC * fix: GetConstructor missing isolate * fix: missing isolate
Description of Change
Follow up to #47616
Depends on #47850
Replaces
webFrame.routingId
andwebFrame.findFrameByRoutingId()
with internal synchronous IPC implementations. This allows us to avoid immediate breaking changes and allows application developers time to upgrade.Checklist
npm test
passesRelease Notes
Notes: none