Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Draft
samuelmaddock wants to merge4 commits intomain
base:main
Choose a base branch
Loading
fromfeat/sync-routing-id

Conversation

samuelmaddock
Copy link
Member

@samuelmaddocksamuelmaddock commentedJul 10, 2025
edited
Loading

Description of Change

#47616

ReplaceswebFrame.routingId andwebFrame.findFrameByRoutingId() with internal synchronous IPC implementations. This allows us to avoid immediate breaking changes and allows application developers time to upgrade.

Checklist

Release Notes

Notes:

  • AddedwebFrameMain.fromFrameToken(processId, frameToken) to get aWebFrameMain instance from its frame token.

): Electron.WebFrame | null {
findFrameByRoutingIdDeprecated();
const frameToken = ipcRendererUtils.invokeSync<string | undefined>(
IPC_MESSAGES.BROWSER_GET_FRAME_TOKEN_SYNC,

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.

Copy link
MemberAuthor

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 theWebFrame API.

content::RenderFrame* render_frame =
content::RenderFrame::FromWebFrame(web_frame);
if (render_frame)
returnWebFrameRenderer::Create(isolate, render_frame).ToV8();

*`frameToken` string - A`string` representing the unique frame token in the
current renderer process.

Returns`WebFrameMain | undefined` - A frame with the given process and frame token,

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Is there a reason thatWebFrameMain returnsundefined butWebFrame returnsnull? Or is that just an artifact of the APIs evolving independently.

Copy link
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

The latter. Definitely open to changing this at some point later on 😄

@@ -133,7 +133,8 @@ declare namespace NodeJS {

interfaceWebFrameMainBinding{
WebFrameMain:typeofElectron.WebFrameMain;
fromId(processId:number,routingId:number):Electron.WebFrameMain;
fromId(processId:number,routingId:number):Electron.WebFrameMain|null;
fromFrameToken(processId:number,frameToken:string):Electron.WebFrameMain|null;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Seems like this is typed as| null here, but inweb-frame-main.md it's| undefined?

@samuelmaddock
Copy link
MemberAuthor

I'll wait for the roll to be merged before fixing up this PR.

Base automatically changed fromroller/chromium/main tomainJuly 14, 2025 20:42
@electron-cationelectron-cationbot removed the new-pr 🌱PR opened recently labelJul 17, 2025
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@itsanandersonitsanandersonitsananderson left review comments

@codebyterecodebytereAwaiting requested review from codebytere

@MarshallOfSoundMarshallOfSoundAwaiting requested review from MarshallOfSound

At least 1 approving review is required to merge this pull request.

Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

2 participants
@samuelmaddock@itsananderson

[8]ページ先頭

©2009-2025 Movatter.jp