Repository navigation
fix: dangling raw_ptr api::Protocol::protocol_registry_ - #50829
Merged
Merged
Conversation
deepak1556
reviewed
Apr 9, 2026
ckerr
marked this pull request as draft
April 9, 2026 15:01
4 tasks done
ckerr
force-pushed
the
fix/dangling-raw-ptr-Protocol-protocol_registry_
branch
from
April 9, 2026 20:25
bf8c3d2 to
95b06da
Compare
ckerr
force-pushed
the
fix/dangling-raw-ptr-Protocol-protocol_registry_
branch
2 times, most recently
from
April 10, 2026 20:13
86383ce to
ed3b3e9
Compare
ckerr
marked this pull request as ready for review
April 10, 2026 20:13
deepak1556
reviewed
Apr 10, 2026
Member
|
We should convert
|
deepak1556
force-pushed
the
fix/dangling-raw-ptr-Protocol-protocol_registry_
branch
from
April 11, 2026 10:01
ed3b3e9 to
e61e9d4
Compare
deepak1556
marked this pull request as ready for review
April 11, 2026 11:03
|
No Release Notes |
Contributor
|
I have automatically backported this PR to "42-x-y", please check out #50951 |
This was referenced Apr 12, 2026
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.
Description of Change
Fix another dangling raw_ptr bug, This time it's
api::Protocol::protocol_registry_, which is a raw_ptr to a ProtocolRegistry owned by BrowserContext. That gets destroyed in DestroyAllContexts() but the JS api::Protocol object lives on.This PR changes
Protocol::protocol_registry_to be abase::WeakPtrand updates its users to check for nullptr before use.The raw_ptr error:
Slightly different error reporting this time around. I've turned on the
enable_backup_ref_ptr_instance_tracerflag to get better error reports. Tested by modifying the build flags locally:Checklist
npm testpassesRelease Notes
Notes: none.