[MediaStreams] Check the context state in MediaStreamTrack::Ended()
Prior to this CL, the state of the execution context (destroyed or not) was stored in a boolean field updated when the execution context was destroyed. After UserMediaClient/UserMediaProcessor was moved to Blink, the timing for the stopping of sources changed slightly. Instead of clearing state upon starting a new navigation, it is now cleared when the execution context is destroyed. If the dying context notifies UMC/UMP before notifying the MediaStreamTrack about the destruction it can happen that MediaStreamTrack tries to fire an event on the destroyed context without knowing that the context has already been destroyed. To prevent this from happening, instead of keeping the state of the context in a separate variable updated via ContextLifecycleObserver, we now track the context using a WeakMember. Bug: 996051 Change-Id: I0027c267a0d067ba67ffcf8f508c1bc56f36a72a Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1768460 Commit-Queue: Guido Urdaneta <guidou@chromium.org> Reviewed-by:Marina Ciocea <marinaciocea@chromium.org> Cr-Commit-Position: refs/heads/master@{#690349}
Showing
Please register or sign in to comment