DescriptionInvalidate all weak pointers during Decrypting{Audio|Video}Decoder::Stop().
This is a clean up CL following r251277.
During media pipeline shutdown, WebMediaPlayerImpl::Destroy() is blocking the
main render thread to wait for the media filters to be stopped correctly.
As a result, Decrypting{Audio|Video}Decoder::Stop() cannot wait for the
Decryptor to finish all pending operations because some Decryptors rely on the
main render thread to work. Instead, Decrypting{Audio|Video}Decoder::Stop()
clears its internal data, fires all pending callbacks, sets it's state to
kStopped and fires the stop callback immediately.
However, after this process, there may still be callbacks outstanding on
the Decrypting{Audio|Video}Decoder object. Previously we check the condition
"state_ == kStopped" in all callback functions to turn those callbacks into a
no-op. In this CL, we invalidate all weak pointers during the Stop() process so
that no pending callbacks will ever be fired back, which is cleaner and safer.
BUG=343748
TEST=Existing tests still pass.
Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=251837
Patch Set 1 #Patch Set 2 : #
Total comments: 4
Patch Set 3 : rebase only #
Messages
Total messages: 9 (0 generated)
|