Repository navigation
fix: keep remote api::WebContents alive while their content::WebContents lives - #52903
Merged
Conversation
…nts lives The api::WebContents wrapping a DevTools WebContents is created up front in InspectableWebContents::ShowDevTools but only referenced again once the frontend has loaded. It is a kRemote WebContents, so nothing pinned it and a GC in between collected its wrapper; DevToolsOpened() then either got an empty handle back from FromOrCreate() and crashed dereferencing it, or created a second api::WebContents for the same DevTools WebContents. Pin remote api::WebContents in the constructor and unpin them in WebContentsDestroyed(), the same mechanism background pages already use. Fixes #52158 Co-authored-by: Samuel Attard <[email protected]>
No-Verification-Needed: formatting-only change Co-authored-by: Samuel Attard <[email protected]>
4 tasks done
MarshallOfSound
approved these changes
Aug 17, 2026
MarshallOfSound
enabled auto-merge (squash)
August 17, 2026 11:47
MarshallOfSound
deleted the
trop/43-x-y-bp-fix-keep-remote-api-webcontents-alive-while-their-content-webcontents-lives-1786967009898
branch
August 17, 2026 13:06
|
Release Notes Persisted
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Backport of #52847
See that PR for details.
Notes: Fixed a rare crash in the main process when DevTools were opened and a garbage collection ran before the DevTools frontend finished loading.