commit | bd82fc5c072529638631929e7f1fe75f653b52c6 | [log] [tgz] |
---|---|---|
author | Henrik Boström <hbos@chromium.org> | Fri Feb 09 10:24:56 2018 |
committer | Commit Bot <commit-bot@chromium.org> | Fri Feb 09 10:24:56 2018 |
tree | bef4979e5f82fe1d6b19c25bf7b703c6aeefaaac | |
parent | 5e06da6ad2f2e8e6984fb5ed57c236ecc66b8a6e [diff] |
Don't fire onnegotiationneeded if flag has already been reset. Per-spec, updating the negotiation needed flag is slightly more complicated than "= true;" and involves checking if negotiation is needed. https://w3c.github.io/webrtc-pc/#dfn-update-the-negotiation-needed-flag This operation is not implemented in third_party/webrtc, so both before and after this CL we trust that when the negotiation needed signal reaches the main thread negotiation is still needed. This may not hold in some obscure edge cases like rollback. This is an existing problem not new to this CL. This CL implements the part of the spec that says to queue a task that fires the event and resets the flag if the flag is not already reset. This resolves a long-lived bug where onnegotiationneeded is fired multiple times - once per API call instead of once for each time the flag goes from false to true. Example: pc.addTrack(t1); pc.addTrack(t2); pc.onnegotiationneeded = () => { console.log('negotiation needed!'); } Before the CL, that fired twice. Now it fires once. Both tracks set the flag and queue a task, but by the time the second task is executed the flag has already been reset so the second event is not redundently fired. Bug: 740501, webrtc:7693 Change-Id: I0430d26158d50aa4d18d5f27f92a5a7bb3e68a9d Reviewed-on: https://chromium-review.googlesource.com/908450 Commit-Queue: Henrik Boström <hbos@chromium.org> Reviewed-by: Harald Alvestrand <hta@chromium.org> Cr-Commit-Position: refs/heads/master@{#535681}
Chromium is an open-source browser project that aims to build a safer, faster, and more stable way for all users to experience the web.
The project's web site is https://www.chromium.org.
Documentation in the source is rooted in docs/README.md.
Learn how to Get Around the Chromium Source Code Directory Structure .