Primary eng (and PM) emails
Eng: gui...@chromium.org, h...@chromium.org
Link to “Intent to Deprecate” thread
Summary
Make the failureCallback parameter mandatory in RTCPeerConnection.createOffer() and RTCPeerConnection.createAnswer().
Motivation
The latest version of the WebRTC spec introduces new promise-based versions of the following methods:
createOffer
setLocalDescription
createAnswer
setRemoteDescription
addIceCandidate
The spec also maintains support for the legacy callback versions of these.
Blink currently supports the legacy version of these methods, but admits some uses that are not compliant with the spec. In the particular case of createOffer and createAnswer, some of these uses prevent us from adding the new promise-based versions due to overloading issues.
For example, the spec versions of createOffer are:
Promise<RTCSessionDescription> createOffer (optional RTCOfferOptions options);
void createOffer (RTCSessionDescriptionCallback successCallback, RTCPeerConnectionErrorCallback failureCallback, optional RTCOfferOptions options);
while the current Blink version is
void createOffer (RTCSessionDescriptionCallback successCallback, optional RTCErrorCallback failureCallback, optional Dictionary options);
It can be seen that having the failureCallback parameter as optional makes it impossible to add the promise-based version since RTCOfferOptions (a dictionary) and RTCSessionDescriptionCallback (a callback) are indistinguishable types in IDL.
Existing calls that only provide the successCallback argument would become ambiguous if we added the promise-based overload.
Our plan is to remove support to failureCallback as an optional parameter, and make it mandatory instead in both createOffer and createAnswer.
Compatibility Risk
With regards to existing Web sites, making the failureCallback parameter mandatory represents a minor compatibility risk. UseCounter data shows that createOffer and createAnswer calls that provide a failureCallback argument vastly outnumber calls without a failureCallback.
With regards to compatibility with other browsers, this change will make Chromium more compatible with Firefox, which supports a more recent version of the spec than Chromium, including the new promise-based methods.
Usage information from UseCounter
How much of the web are you going to break?
createOffer with failure callback
createOffer without failure callback
createAnswer with failure callback
createAnswer without failure callback
Note that these counters were introduced in M49, so they include Beta, Dev and Canary channels only.
OWP launch tracking bug
Entry on the feature dashboard
https://www.chromestatus.com/feature/5663288008376320
--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+unsubscribe@chromium.org.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.
We believe it is a good idea to let these changes in the legacy API stabilize during one release cycle, giving developers some time to update their applications, if necessary. After this, the addition of the promise-based createAnswer() and createOffer() can be done without causing any unexpected incompatibilities with existing code.
LGTM3 - assuming the Android beta numbers look similarly very low.
LGTM2.:DG<
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+unsubscribe@chromium.org.
--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+unsubscribe@chromium.org.