Skip to content

refactor: remove dead named-window lookup from guest-window-manager#50474

Merged
MarshallOfSound merged 1 commit intomainfrom
sattard/remove-dead-frame-name-map
Mar 25, 2026
Merged

refactor: remove dead named-window lookup from guest-window-manager#50474
MarshallOfSound merged 1 commit intomainfrom
sattard/remove-dead-frame-name-map

Conversation

@MarshallOfSound
Copy link
Copy Markdown
Member

The frameNamesToWindow map was a holdover from the BrowserWindowProxy IPC shim. Since nativeWindowOpen became the only code path in #29405, Blink's FrameTree::FindOrCreateFrameForNavigation resolves named window targets directly in the renderer, scoped to the opener's browsing context group. When a matching named window exists, Blink navigates it without ever sending a CreateNewWindow IPC to the browser — so this JS-side map was never consulted in the legitimate same-opener case.

The only time the map found a match was when two unrelated renderers happened to use the same target name, in which case openGuestWindow would short-circuit before consuming the guest WebContents that Chromium had already created for the new window, leaking it.

Adds a test verifying Blink handles same-opener named-target reuse end-to-end (same WindowProxy returned, existing child navigated, setWindowOpenHandler not re-invoked) without any browser-side tracking.

Notes: none

The frameNamesToWindow map was a holdover from the BrowserWindowProxy
IPC shim. Since nativeWindowOpen became the only code path, Blink's
FrameTree::FindOrCreateFrameForNavigation resolves named window targets
directly in the renderer, scoped to the opener's browsing context
group. When a matching named window exists, Blink navigates it without
ever sending a CreateNewWindow IPC to the browser, so this map was
never consulted in the legitimate same-opener case.

The only time the map found a match was when two unrelated renderers
happened to use the same target name, in which case openGuestWindow
would short-circuit before consuming the guest WebContents that
Chromium had already created for the new window, leaking it.

Adds a test verifying Blink handles same-opener named-target reuse
end-to-end without any browser-side tracking.
@MarshallOfSound MarshallOfSound added semver/patch backwards-compatible bug fixes target/39-x-y PR should also be added to the "39-x-y" branch. target/40-x-y PR should also be added to the "40-x-y" branch. target/41-x-y PR should also be added to the "41-x-y" branch. target/42-x-y PR should also be added to the "42-x-y" branch. labels Mar 25, 2026
@electron-cation electron-cation bot added the new-pr 🌱 PR opened recently label Mar 25, 2026
@MarshallOfSound MarshallOfSound merged commit 1d14694 into main Mar 25, 2026
100 checks passed
@MarshallOfSound MarshallOfSound deleted the sattard/remove-dead-frame-name-map branch March 25, 2026 17:48
@release-clerk
Copy link
Copy Markdown

release-clerk bot commented Mar 25, 2026

No Release Notes

@trop
Copy link
Copy Markdown
Contributor

trop bot commented Mar 25, 2026

I have automatically backported this PR to "40-x-y", please check out #50495

@trop
Copy link
Copy Markdown
Contributor

trop bot commented Mar 25, 2026

I have automatically backported this PR to "42-x-y", please check out #50496

@trop
Copy link
Copy Markdown
Contributor

trop bot commented Mar 25, 2026

I have automatically backported this PR to "41-x-y", please check out #50497

@trop trop bot added in-flight/42-x-y and removed target/40-x-y PR should also be added to the "40-x-y" branch. labels Mar 25, 2026
@trop
Copy link
Copy Markdown
Contributor

trop bot commented Mar 25, 2026

I have automatically backported this PR to "39-x-y", please check out #50498

@trop trop bot added in-flight/41-x-y and removed target/42-x-y PR should also be added to the "42-x-y" branch. labels Mar 25, 2026
@trop trop bot added in-flight/39-x-y merged/39-x-y PR was merged to the "39-x-y" branch. merged/40-x-y PR was merged to the "40-x-y" branch. merged/41-x-y PR was merged to the "41-x-y" branch. merged/42-x-y PR was merged to the "42-x-y" branch. and removed target/41-x-y PR should also be added to the "41-x-y" branch. target/39-x-y PR should also be added to the "39-x-y" branch. in-flight/39-x-y in-flight/40-x-y in-flight/41-x-y in-flight/42-x-y labels Mar 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merged/39-x-y PR was merged to the "39-x-y" branch. merged/40-x-y PR was merged to the "40-x-y" branch. merged/41-x-y PR was merged to the "41-x-y" branch. merged/42-x-y PR was merged to the "42-x-y" branch. new-pr 🌱 PR opened recently semver/patch backwards-compatible bug fixes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants