Bug 169660 - Clean up RTCPeerConnection IDL
Summary: Clean up RTCPeerConnection IDL
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit Misc. (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Jon Lee
URL:
Keywords: InRadar
Depends on:
Blocks: 169662
  Show dependency treegraph
 
Reported: 2017-03-14 21:56 PDT by Jon Lee
Modified: 2017-03-15 11:15 PDT (History)
10 users (show)

See Also:


Attachments
Patch (59.22 KB, patch)
2017-03-14 22:09 PDT, Jon Lee
no flags Details | Formatted Diff | Diff
Patch (60.51 KB, patch)
2017-03-14 23:21 PDT, Jon Lee
youennf: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jon Lee 2017-03-14 21:56:16 PDT
Clean up RTCPeerConnection IDL
Comment 1 Jon Lee 2017-03-14 22:09:36 PDT
Created attachment 304476 [details]
Patch
Comment 2 Radar WebKit Bug Importer 2017-03-14 22:10:28 PDT
<rdar://problem/31056344>
Comment 3 Jon Lee 2017-03-14 23:21:06 PDT
Created attachment 304480 [details]
Patch
Comment 4 youenn fablet 2017-03-15 09:06:34 PDT
Comment on attachment 304480 [details]
Patch

LGTM.
I am not sure I love the one enum/one IDL/one header thing though since these make a lot of very small files.

View in context: https://bugs.webkit.org/attachment.cgi?id=304480&action=review

> Source/WebCore/Modules/mediastream/RTCEnums.h:29
> +#include "RTCRtpTransceiverDirection.h"

Do we really need this include?

> Source/WebCore/Modules/mediastream/RTCPeerConnection.h:58
> +struct RTCRtpTransceiverInit {

I guess it will move to its own header at some point?

> Source/WebCore/Modules/mediastream/RTCPeerConnection.idl:62
> +    JSBuiltinConstructor

Matter of style I guess, ',' allows to not touch the line should we add a new keyword after it.

> Source/WebCore/Modules/mediastream/RTCPeerConnection.idl:136
> +    // Promise<void> addIceCandidate(RTCIceCandidate candidate, VoidCallback successCallback, RTCPeerConnectionErrorCallback errorCallback);

I am not sure we need these, a comment stating that overloaded legacy operations are handled in RTCPeerConnection.js seems good enough.

> Source/WebCore/Modules/mediastream/RTCPeerConnection.idl:168
> +    Promise<RTCStatsReport> getStats(optional MediaStreamTrack? selector = null);

selector will go away.
I would probably just add a big FIXME 169644, but if you want to be precise, you should also add a fix here.
Comment 5 youenn fablet 2017-03-15 09:06:59 PDT
(In reply to comment #4)
> Comment on attachment 304480 [details]
> Patch
> 
> LGTM.
> I am not sure I love the one enum/one IDL/one header thing though since
> these make a lot of very small files.
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=304480&action=review
> 
> > Source/WebCore/Modules/mediastream/RTCEnums.h:29
> > +#include "RTCRtpTransceiverDirection.h"
> 
> Do we really need this include?

I was meaning: do we really need RTCEnums.h?

> > Source/WebCore/Modules/mediastream/RTCPeerConnection.h:58
> > +struct RTCRtpTransceiverInit {
> 
> I guess it will move to its own header at some point?
> 
> > Source/WebCore/Modules/mediastream/RTCPeerConnection.idl:62
> > +    JSBuiltinConstructor
> 
> Matter of style I guess, ',' allows to not touch the line should we add a
> new keyword after it.
> 
> > Source/WebCore/Modules/mediastream/RTCPeerConnection.idl:136
> > +    // Promise<void> addIceCandidate(RTCIceCandidate candidate, VoidCallback successCallback, RTCPeerConnectionErrorCallback errorCallback);
> 
> I am not sure we need these, a comment stating that overloaded legacy
> operations are handled in RTCPeerConnection.js seems good enough.
> 
> > Source/WebCore/Modules/mediastream/RTCPeerConnection.idl:168
> > +    Promise<RTCStatsReport> getStats(optional MediaStreamTrack? selector = null);
> 
> selector will go away.
> I would probably just add a big FIXME 169644, but if you want to be precise,
> you should also add a fix here.
Comment 6 Jon Lee 2017-03-15 10:24:13 PDT
Comment on attachment 304480 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=304480&action=review

>>> Source/WebCore/Modules/mediastream/RTCEnums.h:29
>>> +#include "RTCRtpTransceiverDirection.h"
>> 
>> Do we really need this include?
> 
> I was meaning: do we really need RTCEnums.h?

More will be added here in subsequent patches. I think it's nicer to not have to include every enum's header file in implementations.

Another possible way of doing this would be to move the enums to PeerConnectionStates, and then just include that header file for each of the individual enum header files.

>>> Source/WebCore/Modules/mediastream/RTCPeerConnection.h:58
>>> +struct RTCRtpTransceiverInit {
>> 
>> I guess it will move to its own header at some point?
> 
> 

Yes, though I don't think any other file uses it.

>> Source/WebCore/Modules/mediastream/RTCPeerConnection.idl:62
>> +    JSBuiltinConstructor
> 
> Matter of style I guess, ',' allows to not touch the line should we add a new keyword after it.

Ok.

>> Source/WebCore/Modules/mediastream/RTCPeerConnection.idl:136
>> +    // Promise<void> addIceCandidate(RTCIceCandidate candidate, VoidCallback successCallback, RTCPeerConnectionErrorCallback errorCallback);
> 
> I am not sure we need these, a comment stating that overloaded legacy operations are handled in RTCPeerConnection.js seems good enough.

Done.

>> Source/WebCore/Modules/mediastream/RTCPeerConnection.idl:168
>> +    Promise<RTCStatsReport> getStats(optional MediaStreamTrack? selector = null);
> 
> selector will go away.
> I would probably just add a big FIXME 169644, but if you want to be precise, you should also add a fix here.

This is a more recent development than what's in the spec?
Comment 7 Jon Lee 2017-03-15 10:26:17 PDT
(In reply to comment #4)
> Comment on attachment 304480 [details]
> Patch
> 
> LGTM.
> I am not sure I love the one enum/one IDL/one header thing though since
> these make a lot of very small files.

For enums that are used in other IDLs, this is what is currently required by the code generator.
Comment 8 youenn fablet 2017-03-15 10:29:17 PDT
> >> Source/WebCore/Modules/mediastream/RTCPeerConnection.idl:168
> >> +    Promise<RTCStatsReport> getStats(optional MediaStreamTrack? selector = null);
> > 
> > selector will go away.
> > I would probably just add a big FIXME 169644, but if you want to be precise, you should also add a fix here.
> 
> This is a more recent development than what's in the spec?

Ah, this might not have landed yet.
Comment 9 Jon Lee 2017-03-15 11:15:54 PDT
Committed r213992: <http://trac.webkit.org/changeset/213992>