Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removing interface use for RTCSessionDescription and RTCIceCandidate #302

Merged
merged 4 commits into from
Oct 1, 2015

Conversation

martinthomson
Copy link
Member

We currently force people to do this:

var x = new {moz|webkit|prefix}RTCIceCandidate(stuff_I_got_from_signaling);
pc.addCandidate(x);

This is nicer:

pc.addCandidate(stuff_I_got_from_signaling);

Same for session descriptions.

@dontcallmedom
Copy link
Member

Is it safe to remove the constructors? I was under the impression they were used in quite a bit of developer documentation, and thus presumably in actual deployed code.

@martinthomson
Copy link
Member Author

Yes, the constructors are used by every piece of code that uses WebRTC because they are needed in the current API. We would, as a matter of practice, retain the constructors for a significant amount of time to avoid breaking things.

@dontcallmedom
Copy link
Member

Shouldn't there be some text indicating that the constructors are there purely for legacy reasons?

@stefhak
Copy link
Contributor

stefhak commented Sep 17, 2015

List discussion ongoing.

@stefhak
Copy link
Contributor

stefhak commented Sep 23, 2015

There has been some list discussion, and no-one seem to object this change, so I think we should merge.

@martinthomson
Copy link
Member Author

I just realized that there is a problem with this PR. You can't have dictionary attributes on an interface. localDescription on RTCPeerConnection won't work with this. Unless we change localDescription to be a getter, then we're required to have an interface.

@adam-be
Copy link
Member

adam-be commented Sep 25, 2015

Good catch. That is indeed a problem.

And we have the same issue with the RTCPeerConnectionIceEvent interface and its candidate attribute.

@dontcallmedom
Copy link
Member

Still, we could (as @jan-ivar suggested) make it possible to use the init dictionaries as arguments to addIceCandidate / set*Description.

@adam-be
Copy link
Member

adam-be commented Sep 25, 2015

I wish we had a special "pass by value" attribute in WebIDL. Because that's what we're doing with the local/remoteDescription attributes anyway.

@martinthomson
Copy link
Member Author

OK, I've updated the PR. All the setXxxDescription functions take an RTCSessionDescriptionInit argument. I've noted two aspects of deprecation on RTCSessionDescription: the constructor and the mutability.

@adam-be:

I wish we had a special "pass by value" attribute in WebIDL. Because that's what we're doing with the local/remoteDescription attributes anyway.

We could use a named getter to return a dictionary, but that would look terrible and have some unwanted side-effects. Or, we could request a change to WebIDL that allowed us to return a dictionary. Or, we could annotate as you suggest.

alvestrand added a commit that referenced this pull request Oct 1, 2015
Removing interface use for RTCSessionDescription and RTCIceCandidate
@alvestrand alvestrand merged commit e09f10d into w3c:master Oct 1, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants