-
Notifications
You must be signed in to change notification settings - Fork 15.8k
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: wasm code generation in the renderer #25777
Conversation
0c727b4
to
cf8b7b7
Compare
9f26ea0
to
2d17344
Compare
2d17344
to
c63b4ad
Compare
Release Notes Persisted
|
I was unable to backport this PR to "10-x-y" cleanly; |
I have automatically backported this PR to "11-x-y", please check out #25829 |
@codebytere has manually backported this PR to "10-x-y", please check out #26063 |
-- re-enable contextIsolation for version after that -- and make a versions array for future checks on versions -- references: -- electron/electron#26063 -- electron/electron#25777
This CL exposes WasmCodeGenerationCheckCallbackInMainThread. This is done so that Electron can access this callback for customization purposes, as we need to use different handlers for different processes depending on whether or not we currently have access to Node.js. See electron/electron#25777 for a more thorough explanation. Change-Id: Ib697973e88028ebf1922e4afd6bf069fc6580584 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2527943 Reviewed-by: Jeremy Roman <jbroman@chromium.org> Commit-Queue: Jeremy Roman <jbroman@chromium.org> Cr-Commit-Position: refs/heads/main@{#934533}
This CL exposes WasmCodeGenerationCheckCallbackInMainThread. This is done so that Electron can access this callback for customization purposes, as we need to use different handlers for different processes depending on whether or not we currently have access to Node.js. See electron/electron#25777 for a more thorough explanation. Change-Id: Ib697973e88028ebf1922e4afd6bf069fc6580584 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2527943 Reviewed-by: Jeremy Roman <jbroman@chromium.org> Commit-Queue: Jeremy Roman <jbroman@chromium.org> Cr-Commit-Position: refs/heads/main@{#934533} NOKEYCHECK=True GitOrigin-RevId: 23a9b2d0ff5786bcf5d3ebd90b2b68380ed27158
Description of Change
Closes #25127.
This issue arose from the fact that when
contextIsolation
is enabled, Node.js does not have control over aspects of the context being used in the renderer process. It therefore goes to use its own callback handlers by default, but has not set embedder data for the context in question, and so when it pulls the data piece representing whether Wasm codegen should be enabled from the index it thinks such data will be at, this data piece is actually (don't ask)String.prototype.link
represented as av8::Function
. We handle this by asking for the current Environment, and if none exists, we know that we're in the renderer withcontextIsolation
enabled and should fall back to Blink's handler.cc @MarshallOfSound @zcbenz
Checklist
npm test
passesRelease Notes
Notes: Fixed an issue where Wasm code generation erroneously showed as being disallowed by embedder when
contextIsolation
was enabled.