Audio|VideoDecoderBroker: more weakptr, keep callbacks on main thread.
Using unretained for decoder/selector callbacks is generally not safe / fragile. For ex, some decoders (e.g. those that offload) will call the output callback after destruction. Another example: decoder selector internally posts the Select() callback, so it may run after destruction. Additionally, sending incoming callbacks as CrossThreadFunctions for invoking on the media thread is not safe. We may destruct while some callbacks are still pending, destroying the callbacks internal state (including bindings to blink GC types) off the main thread. Now we ensure that all callbacks are saved on the main thread and we extend the "client" interfaces of the broker for proxying the callbacks safely. Bug: 1120431 Change-Id: I2ccfe46982cda9b18e47a56424b25f54f8877883 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2366661 Commit-Queue: Chrome Cunningham <chcunningham@chromium.org> Auto-Submit: Chrome Cunningham <chcunningham@chromium.org> Reviewed-by:Dan Sanders <sandersd@chromium.org> Cr-Commit-Position: refs/heads/master@{#800776}
Showing
This diff is collapsed.
Please register or sign in to comment