Bug 265718
| Summary: | [GPUP] Remove TrackPrivateRemoteIdentifier, fix memory leak | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | Jean-Yves Avenard [:jya] <jean-yves.avenard> |
| Component: | Media | Assignee: | Jean-Yves Avenard [:jya] <jean-yves.avenard> |
| Status: | RESOLVED FIXED | ||
| Severity: | Normal | CC: | webkit-bug-importer |
| Priority: | P2 | Keywords: | InRadar |
| Version: | WebKit Nightly Build | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| See Also: | https://bugs.webkit.org/show_bug.cgi?id=242925 | ||
Jean-Yves Avenard [:jya]
following bug 254099; we are no longer using AtomString as track identifier and as such we no longer need the `TrackPrivateRemoteIdentifier` to bridge the TrackPrivate living in the GPU Process to those in the web content process, instead simply using their TrackID (an uint64_t).
While in the process of performing this task, I identify a leak in the `MediaPlayerPrivateRemote` code, which was only partially fixed in bug 242925
Whenever a new init segment is parsed by a sourceBuffer in the GPU Process (through the SourceBufferParser); a new TrackPrivate is created and stored in the `InitializationSegment`
When the SourceBufferPrivate call the SourceBufferPrivateClient, the `RemoteSourceBufferProxy` will create a new `RemoteVideoTrackProxy` [1]
This is done by `RemoteMediaPlayerProxy::addRemote[Video|Audio|Text]TrackProxy`, which will check of the track id is already existing, and if so will overwrite it with the new TrackPrivate [2]
But regardless of the preview tack id, a `Remote[Video|Audio|Text]TrackProxy` will be created, with a new, unique TrackPrivateRemoteIdentifier [3] which will then create the RemoteVideoTrack/RemoteAudioTrack/RemoteTextTrack in the content process [4]
The code there ensure that the existing RemoteTrack with this unique TrackPrivateRemoteIdentifier doesn't exist and will create a new one.
This RemoteTrack will never be deleted, it just becomes unused as the corresponding TrackPrivate in the GPU Process got deleted.
[1] https://searchfox.org/wubkat/rev/02b2f8b7a253140d82f59e38a68257431139d2e7/Source/WebKit/GPUProcess/media/RemoteSourceBufferProxy.cpp#88,97,106
[2] https://searchfox.org/wubkat/rev/02b2f8b7a253140d82f59e38a68257431139d2e7/Source/WebKit/GPUProcess/media/RemoteMediaPlayerProxy.cpp#637-643
[3] https://searchfox.org/wubkat/rev/02b2f8b7a253140d82f59e38a68257431139d2e7/Source/WebKit/GPUProcess/media/RemoteMediaPlayerProxy.cpp#645-647
[4] https://searchfox.org/wubkat/rev/02b2f8b7a253140d82f59e38a68257431139d2e7/Source/WebKit/WebProcess/GPU/media/MediaPlayerPrivateRemote.cpp#762-764
| Attachments | ||
|---|---|---|
| Add attachment proposed patch, testcase, etc. |
Jean-Yves Avenard [:jya]
[press saved to quickly] bug 242925 identify the issue, but all it did was removed the TrackPrivate from the GPU process, not the corresponding TrackPrivateRemote in the content process.
Radar WebKit Bug Importer
<rdar://problem/119070875>
Jean-Yves Avenard [:jya]
Pull request: https://github.com/WebKit/WebKit/pull/21207
EWS
Committed 271599@main (e0a0bc967262): <https://commits.webkit.org/271599@main>
Reviewed commits have been landed. Closing PR #21207 and removing active labels.