- 
Henrik Boström authored
https://chromium-review.googlesource.com/c/566806 showed that the WebRtcRtpBrowserTest.AddAndRemoveTracks* tests would reliably crash if the garbage collector was invoked between addTrack and getSenders. Tracks that were added using addTrack would have their track adapters (glue between blink and webrtc) kept alive only by the blink layer sender holding on to a reference, since these were not kept alive by any "local streams" holding a reference. The blink::RTCPeerConnection now holds a strong reference to senders and receivers to prevent GC while in-use, with TODOs to remove ones no longer used when addStream/removeStream is implemented using addTrack/removeTrack. Furthermore the content::RTCPeerConnectionHandler holds on to the content layer representation of senders so that their associated set of streams are not forgotten between addTrack and getSenders. Having the handler keep track of senders is good practice, this gets rid of the assumption that blink layer senders have to be kept alive. A TODO was added to do the same for receivers (not yet required because blink layer receivers are kept alive). With this change, the AddAndRemoveTracks* tests pass and are re-enabled. Bug: 740650 Change-Id: Iec3a39a994bef31904f2969d791125867ec1e398 Reviewed-on: https://chromium-review.googlesource.com/567184Reviewed-by:
Henrik Boström <hbos@chromium.org> Reviewed-by:
Taylor Brandstetter <deadbeef@chromium.org> Reviewed-by:
Jochen Eisinger <jochen@chromium.org> Commit-Queue: Henrik Boström <hbos@chromium.org> Cr-Commit-Position: refs/heads/master@{#487430}
4979aac4