Skip to content

fix: blend node and blink code generation policy when both are loaded - #36567

Merged
nornagon merged 5 commits into
mainfrom
fix-node-csp
Dec 14, 2022
Merged

nornagon merged 5 commits into
mainfrom
fix-node-csp

Conversation

@nornagon

@nornagon nornagon commented Dec 5, 2022

Copy link
Copy Markdown
Contributor

Description of Change

This fixes a crash in some situations when sandbox: false.

Checklist

Release Notes

Notes: Fixed a crash that could occur when running eval in inline scripts in unsandboxed renderer processes.

@nornagon
nornagon requested a review from a team as a code owner December 5, 2022 22:34
@nornagon nornagon added semver/patch backwards-compatible bug fixes target/22-x-y PR should also be added to the "22-x-y" branch. target/23-x-y PR should also be added to the "23-x-y" branch. labels Dec 5, 2022
@electron-cation electron-cation Bot added the new-pr 🌱 PR opened recently label Dec 5, 2022
Comment thread shell/common/node_bindings.cc
Comment thread shell/common/node_bindings.cc
@electron-cation electron-cation Bot removed the new-pr 🌱 PR opened recently label Dec 6, 2022
// If we're running with contextIsolation enabled in the renderer process,
// fall back to Blink's logic.
if (node::Environment::GetCurrent(context) == nullptr) {
if (gin_helper::Locker::IsBrowserProcess()) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Which scenario we support today might enter this block ? Don't we always have a node environment in the browser process ?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

None, hence the NOTREACHED below

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Do we even need the NOTREACHED in that case ? My understanding is that NOTREACHED is useful to abort when there is no default action for switch statements or when an method is not implemented.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I guess this could just be a CHECK :)

@nornagon
nornagon merged commit 9e7fbc7 into main Dec 14, 2022
@nornagon
nornagon deleted the fix-node-csp branch December 14, 2022 18:05
@release-clerk

release-clerk Bot commented Dec 14, 2022

Copy link
Copy Markdown

Release Notes Persisted

Fixed a crash that could occur when running eval in inline scripts in unsandboxed renderer processes.

trop Bot added a commit that referenced this pull request Dec 14, 2022
trop Bot added a commit that referenced this pull request Dec 14, 2022
@trop

trop Bot commented Dec 14, 2022

Copy link
Copy Markdown
Contributor

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

@trop

trop Bot commented Dec 14, 2022

Copy link
Copy Markdown
Contributor

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

@trop trop Bot added in-flight/23-x-y merged/23-x-y PR was merged to the "23-x-y" branch. and removed target/23-x-y PR should also be added to the "23-x-y" branch. target/22-x-y PR should also be added to the "22-x-y" branch. in-flight/23-x-y labels Dec 14, 2022
codebytere pushed a commit that referenced this pull request Jan 2, 2023
…#36668)

* fix: blend node and blink code generation policy when both are loaded (#36567)

Co-authored-by: Jeremy Rose <jeremya@chromium.org>

* Update .patches

* fix patches

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Jeremy Rose <jeremya@chromium.org>
Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
@trop trop Bot added merged/22-x-y PR was merged to the "22-x-y" branch. and removed in-flight/22-x-y labels Jan 2, 2023
khalwa pushed a commit to solarwindscloud/electron that referenced this pull request Feb 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merged/22-x-y PR was merged to the "22-x-y" branch. merged/23-x-y PR was merged to the "23-x-y" branch. semver/patch backwards-compatible bug fixes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants