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: ensure that functions are not retained beyond their context being released #23207
fix: ensure that functions are not retained beyond their context being released #23207
Conversation
shell/renderer/api/context_bridge/render_frame_function_store.cc
Outdated
Show resolved
Hide resolved
ecb6317
to
e012274
Compare
e012274
to
18f7178
Compare
Release Notes Persisted
|
I was unable to backport this PR to "7-2-x" cleanly; |
I was unable to backport this PR to "8-x-y" cleanly; |
I have automatically backported this PR to "9-x-y", please check out #23209 |
@MarshallOfSound has manually backported this PR to "8-x-y", please check out #23231 |
@MarshallOfSound has manually backported this PR to "7-2-x", please check out #23232 |
We were cleaning up the
RenderFrameFunctionStore
instances when a render frame was destroyed. For same site navigations / reloads the render frame isn't destroyed, it's reused so we were leaking the old context and all the functions. This updates our impl to listen for WillReleaseScriptContext and release our holds on objects in that context once that context is about to be released.Also adds a test for good measure 😄 Had to update the contextBridge specs to use an actual HTTP server so that same-site rules applied
Notes: fixed memory leak when using contextBridge with sandbox=true