[webrtc-pc] Pull Request: Handle ICE state and candidate pair changes in the same task

henbos has just submitted a new pull request for https://github.com/w3c/webrtc-pc:

== Handle ICE state and candidate pair changes in the same task ==
Fixes #2283.

If the selected candidate pair causes the ICE connection state to change, we surface all state changes first and fire all events later, in the following order:
- transport.selectedcandidatepairchange
- transport.statechange
- connection.iceconnectionstatechange
- connection.connectionstatechange

This gives a well-defined event firing order. It also makes it possible to inspect the state of the connection or transport and not find inconsistencies, e.g. in selectedcandidatepairchange we are guaranteed to see an up-to-date transport.state or vice versa.


See https://github.com/w3c/webrtc-pc/pull/2444

Received on Wednesday, 22 January 2020 11:21:36 UTC