Changeset 213992 in webkit


Ignore:
Timestamp:
Mar 15, 2017 11:15:31 AM (7 years ago)
Author:
jonlee@apple.com
Message:

Clean up RTCPeerConnection IDL
https://bugs.webkit.org/show_bug.cgi?id=169660

Reviewed by Youenn Fablet.

  • Modules/mediastream/RTCPeerConnection.cpp:

(WebCore::RTCPeerConnection::addTransceiver): Refactor to use RTCRtpTransceiverInit.
(WebCore::RTCPeerConnection::completeAddTransceiver):

  • Modules/mediastream/RTCPeerConnection.h: Remove redundant definitions.
  • Modules/mediastream/RTCPeerConnection.idl: Using 13 March 2017 Editor's Draft of

WebRTC spec. Move RTCOfferAnswerOptions out to separate IDLs. Keep RTCDataChannelInit and
RTCRtpTransceiverInit since they appear to be used only in RTCPeerConnection.

Reorder the properties, functions, and events based on their appearance in the spec.

Legacy MediaStream calls are placed at the end. I tried to use "partial interface" in the
same file, but in the end nothing was generated, so everything is contained in one interface
block.

  • Modules/mediastream/RTCEnums.h: Added. This will be an all-in-one header to hold the

enums.

Move RTCAnswerOptions, RTCOfferAnswerOptions, RTCOfferOptions, RTCRtpTransceiverDirection
out to their own IDL's.

  • CMakeLists.txt:
  • DerivedSources.make:
  • Modules/mediastream/RTCAnswerOptions.h: Added.
  • Modules/mediastream/RTCAnswerOptions.idl: Added.
  • Modules/mediastream/RTCOfferAnswerOptions.h:
  • Modules/mediastream/RTCOfferAnswerOptions.idl: Added.
  • Modules/mediastream/RTCOfferOptions.h: Added. Remove |offerToReceiveVideo| and

|offerToReceiveAudio|, which are not used.

  • Modules/mediastream/RTCOfferOptions.idl: Added.
  • Modules/mediastream/RTCRtpTransceiverDirection.h: Added.
  • Modules/mediastream/RTCRtpTransceiverDirection.idl: Added. Use a typedef for

RTCRtpTransceiverDirection to prevent the code generator from prefixing RTCRtpTransceiver.

  • Modules/mediastream/RTCRtpTransceiver.idl: Move RTCRtpTransceiverDirection.
  • WebCore.xcodeproj/project.pbxproj: Add IDLs and derived sources. Remove unused

HTMLMediaElementMediaStream.h. Reorder.

Refactor.

  • Modules/mediastream/RTCRtpTransceiver.h: Use RTCRtpTransceiverDirection.
  • Modules/mediastream/MediaEndpointPeerConnection.cpp:
Location:
trunk/Source/WebCore
Files:
8 added
11 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/CMakeLists.txt

    r213671 r213992  
    234234    Modules/mediastream/OverconstrainedError.idl
    235235    Modules/mediastream/OverconstrainedErrorEvent.idl
     236    Modules/mediastream/RTCAnswerOptions.idl
    236237    Modules/mediastream/RTCConfiguration.idl
    237238    Modules/mediastream/RTCDTMFSender.idl
     
    242243    Modules/mediastream/RTCIceCandidateEvent.idl
    243244    Modules/mediastream/RTCIceServer.idl
     245    Modules/mediastream/RTCOfferAnswerOptions.idl
     246    Modules/mediastream/RTCOfferOptions.idl
    244247    Modules/mediastream/RTCPeerConnection.idl
    245248    Modules/mediastream/RTCRtpReceiver.idl
    246249    Modules/mediastream/RTCRtpSender.idl
    247250    Modules/mediastream/RTCRtpTransceiver.idl
     251    Modules/mediastream/RTCRtpTransceiverDirection.idl
    248252    Modules/mediastream/RTCSessionDescription.idl
    249253    Modules/mediastream/RTCStatsReport.idl
  • trunk/Source/WebCore/ChangeLog

    r213990 r213992  
     12017-03-14  Jon Lee  <jonlee@apple.com>
     2
     3        Clean up RTCPeerConnection IDL
     4        https://bugs.webkit.org/show_bug.cgi?id=169660
     5
     6        Reviewed by Youenn Fablet.
     7
     8        * Modules/mediastream/RTCPeerConnection.cpp:
     9        (WebCore::RTCPeerConnection::addTransceiver): Refactor to use RTCRtpTransceiverInit.
     10        (WebCore::RTCPeerConnection::completeAddTransceiver):
     11        * Modules/mediastream/RTCPeerConnection.h: Remove redundant definitions.
     12        * Modules/mediastream/RTCPeerConnection.idl: Using 13 March 2017 Editor's Draft of
     13        WebRTC spec. Move RTCOfferAnswerOptions out to separate IDLs. Keep RTCDataChannelInit and
     14        RTCRtpTransceiverInit since they appear to be used only in RTCPeerConnection.
     15            Reorder the properties, functions, and events based on their appearance in the spec.
     16        Legacy MediaStream calls are placed at the end. I tried to use "partial interface" in the
     17        same file, but in the end nothing was generated, so everything is contained in one interface
     18        block.
     19
     20        * Modules/mediastream/RTCEnums.h: Added. This will be an all-in-one header to hold the
     21        enums.
     22
     23        Move RTCAnswerOptions, RTCOfferAnswerOptions, RTCOfferOptions, RTCRtpTransceiverDirection
     24        out to their own IDL's.
     25        * CMakeLists.txt:
     26        * DerivedSources.make:
     27        * Modules/mediastream/RTCAnswerOptions.h: Added.
     28        * Modules/mediastream/RTCAnswerOptions.idl: Added.
     29        * Modules/mediastream/RTCOfferAnswerOptions.h:
     30        * Modules/mediastream/RTCOfferAnswerOptions.idl: Added.
     31        * Modules/mediastream/RTCOfferOptions.h: Added. Remove |offerToReceiveVideo| and
     32        |offerToReceiveAudio|, which are not used.
     33        * Modules/mediastream/RTCOfferOptions.idl: Added.
     34        * Modules/mediastream/RTCRtpTransceiverDirection.h: Added.
     35        * Modules/mediastream/RTCRtpTransceiverDirection.idl: Added. Use a typedef for
     36        RTCRtpTransceiverDirection to prevent the code generator from prefixing RTCRtpTransceiver.
     37        * Modules/mediastream/RTCRtpTransceiver.idl: Move RTCRtpTransceiverDirection.
     38        * WebCore.xcodeproj/project.pbxproj: Add IDLs and derived sources. Remove unused
     39        HTMLMediaElementMediaStream.h. Reorder.
     40
     41        Refactor.
     42        * Modules/mediastream/RTCRtpTransceiver.h: Use RTCRtpTransceiverDirection.
     43        * Modules/mediastream/MediaEndpointPeerConnection.cpp:
     44
    1452017-03-15  Zan Dobersek  <zdobersek@igalia.com>
    246
  • trunk/Source/WebCore/DerivedSources.make

    r213762 r213992  
    178178    $(WebCore)/Modules/mediastream/OverconstrainedError.idl \
    179179    $(WebCore)/Modules/mediastream/OverconstrainedErrorEvent.idl \
     180    $(WebCore)/Modules/mediastream/RTCAnswerOptions.idl \
    180181    $(WebCore)/Modules/mediastream/RTCConfiguration.idl \
    181182    $(WebCore)/Modules/mediastream/RTCDTMFSender.idl \
     
    186187    $(WebCore)/Modules/mediastream/RTCIceCandidateEvent.idl \
    187188    $(WebCore)/Modules/mediastream/RTCIceServer.idl \
     189    $(WebCore)/Modules/mediastream/RTCOfferAnswerOptions.idl \
     190    $(WebCore)/Modules/mediastream/RTCOfferOptions.idl \
    188191    $(WebCore)/Modules/mediastream/RTCPeerConnection.idl \
    189192    $(WebCore)/Modules/mediastream/RTCRtpReceiver.idl \
    190193    $(WebCore)/Modules/mediastream/RTCRtpSender.idl \
    191194    $(WebCore)/Modules/mediastream/RTCRtpTransceiver.idl \
     195    $(WebCore)/Modules/mediastream/RTCRtpTransceiverDirection.idl \
    192196    $(WebCore)/Modules/mediastream/RTCSessionDescription.idl \
    193197    $(WebCore)/Modules/mediastream/RTCStatsReport.idl \
  • trunk/Source/WebCore/Modules/mediastream/MediaEndpointPeerConnection.cpp

    r213736 r213992  
    4343#include "NotImplemented.h"
    4444#include "PeerMediaDescription.h"
     45#include "RTCAnswerOptions.h"
    4546#include "RTCConfiguration.h"
    4647#include "RTCIceCandidate.h"
    4748#include "RTCIceCandidateEvent.h"
    48 #include "RTCOfferAnswerOptions.h"
     49#include "RTCOfferOptions.h"
    4950#include "RTCPeerConnection.h"
    5051#include "RTCRtpTransceiver.h"
  • trunk/Source/WebCore/Modules/mediastream/RTCOfferAnswerOptions.h

    r208141 r213992  
    3535};
    3636
    37 struct RTCOfferOptions : RTCOfferAnswerOptions {
    38     int64_t offerToReceiveVideo { 0 };
    39     int64_t offerToReceiveAudio { 0 };
    40     bool iceRestart { false };
    41 };
    42 
    43 struct RTCAnswerOptions : RTCOfferAnswerOptions {
    44 };
    45 
    4637} // namespace WebCore
    4738
  • trunk/Source/WebCore/Modules/mediastream/RTCPeerConnection.cpp

    r213982 r213992  
    33 * Copyright (C) 2013 Nokia Corporation and/or its subsidiary(-ies).
    44 * Copyright (C) 2015, 2016 Ericsson AB. All rights reserved.
     5 * Copyright (C) 2017 Apple Inc. All rights reserved.
    56 *
    67 * Redistribution and use in source and binary forms, with or without
     
    4950#include "RTCIceCandidate.h"
    5051#include "RTCIceCandidateEvent.h"
    51 #include "RTCOfferAnswerOptions.h"
    5252#include "RTCSessionDescription.h"
    5353#include "RTCTrackEvent.h"
     
    173173}
    174174
    175 ExceptionOr<Ref<RTCRtpTransceiver>> RTCPeerConnection::addTransceiver(Ref<MediaStreamTrack>&& track, const RtpTransceiverInit& init)
     175ExceptionOr<Ref<RTCRtpTransceiver>> RTCPeerConnection::addTransceiver(Ref<MediaStreamTrack>&& track, const RTCRtpTransceiverInit& init)
    176176{
    177177    if (m_signalingState == SignalingState::Closed)
     
    191191}
    192192
    193 ExceptionOr<Ref<RTCRtpTransceiver>> RTCPeerConnection::addTransceiver(const String& kind, const RtpTransceiverInit& init)
     193ExceptionOr<Ref<RTCRtpTransceiver>> RTCPeerConnection::addTransceiver(const String& kind, const RTCRtpTransceiverInit& init)
    194194{
    195195    if (m_signalingState == SignalingState::Closed)
     
    211211}
    212212
    213 void RTCPeerConnection::completeAddTransceiver(RTCRtpTransceiver& transceiver, const RtpTransceiverInit& init)
     213void RTCPeerConnection::completeAddTransceiver(RTCRtpTransceiver& transceiver, const RTCRtpTransceiverInit& init)
    214214{
    215215    transceiver.setDirection(static_cast<RTCRtpTransceiver::Direction>(init.direction));
  • trunk/Source/WebCore/Modules/mediastream/RTCPeerConnection.h

    r213736 r213992  
    33 * Copyright (C) 2013 Nokia Corporation and/or its subsidiary(-ies).
    44 * Copyright (C) 2015 Ericsson AB. All rights reserved.
     5 * Copyright (C) 2017 Apple Inc. All rights reserved.
    56 *
    67 * Redistribution and use in source and binary forms, with or without
     
    3839#include "EventTarget.h"
    3940#include "MediaStream.h"
     41#include "RTCAnswerOptions.h"
    4042#include "RTCConfiguration.h"
    4143#include "RTCDataChannel.h"
    42 #include "RTCOfferAnswerOptions.h"
     44#include "RTCEnums.h"
     45#include "RTCOfferOptions.h"
    4346#include "RTCRtpTransceiver.h"
    4447
     
    5255class RTCSessionDescription;
    5356class RTCStatsCallback;
     57
     58struct RTCRtpTransceiverInit {
     59    RTCRtpTransceiverDirection direction;
     60};
    5461
    5562class RTCPeerConnection final : public RefCounted<RTCPeerConnection>, public RTCRtpSenderClient, public EventTargetWithInlineData, public ActiveDOMObject {
     
    7582    ExceptionOr<void> removeTrack(RTCRtpSender&);
    7683
    77     // This enum is mirrored in RTCRtpTransceiver.h
    78     enum class RtpTransceiverDirection { Sendrecv, Sendonly, Recvonly, Inactive };
    79 
    80     struct RtpTransceiverInit {
    81         RtpTransceiverDirection direction;
    82     };
    83 
    84     ExceptionOr<Ref<RTCRtpTransceiver>> addTransceiver(Ref<MediaStreamTrack>&&, const RtpTransceiverInit&);
    85     ExceptionOr<Ref<RTCRtpTransceiver>> addTransceiver(const String& kind, const RtpTransceiverInit&);
     84    ExceptionOr<Ref<RTCRtpTransceiver>> addTransceiver(Ref<MediaStreamTrack>&&, const RTCRtpTransceiverInit&);
     85    ExceptionOr<Ref<RTCRtpTransceiver>> addTransceiver(const String& kind, const RTCRtpTransceiverInit&);
    8686
    8787    void queuedCreateOffer(RTCOfferOptions&&, PeerConnection::SessionDescriptionPromise&&);
     
    144144    RTCPeerConnection(ScriptExecutionContext&);
    145145
    146     void completeAddTransceiver(RTCRtpTransceiver&, const RtpTransceiverInit&);
     146    void completeAddTransceiver(RTCRtpTransceiver&, const RTCRtpTransceiverInit&);
    147147
    148148    RTCController& rtcController();
  • trunk/Source/WebCore/Modules/mediastream/RTCPeerConnection.idl

    r211404 r213992  
    33 * Copyright (C) 2013 Nokia Corporation and/or its subsidiary(-ies).
    44 * Copyright (C) 2015, 2016 Ericsson AB. All rights reserved.
     5 * Copyright (C) 2017 Apple Inc. All rights reserved.
    56 *
    67 * Redistribution and use in source and binary forms, with or without
     
    3132 */
    3233
    33 dictionary RTCOfferAnswerOptions {
    34     boolean voiceActivityDetection = true;
    35 };
    36 
    37 dictionary RTCOfferOptions : RTCOfferAnswerOptions {
    38     boolean iceRestart = false;
    39 };
    40 
    41 dictionary RTCAnswerOptions : RTCOfferAnswerOptions {
    42 };
    43 
    44 dictionary RTCDataChannelInit {
     34[
     35    Conditional=WEB_RTC,
     36    EnabledAtRuntime=PeerConnection
     37] dictionary RTCDataChannelInit {
    4538    boolean ordered = true;
     39    // FIXME 169644: rename to maxPacketLifeTime;
    4640    unsigned short maxRetransmitTime;
    4741    unsigned short maxRetransmits;
     
    4943    boolean negotiated = false;
    5044    unsigned short id;
     45    // FIXME 169644: missing priority
     46};
     47
     48[
     49    Conditional=WEB_RTC,
     50    EnabledAtRuntime=PeerConnection,
     51    ImplementedAs=RTCRtpTransceiverInit
     52] dictionary RTCRtpTransceiverInit {
     53    RTCRtpTransceiverDirection direction = "sendrecv";
    5154};
    5255
     
    5760    EnabledAtRuntime=PeerConnection,
    5861    ExportMacro=WEBCORE_EXPORT,
    59     JSBuiltinConstructor,
     62    JSBuiltinConstructor
    6063] interface RTCPeerConnection : EventTarget {
     64    // FIXME 169644: update Constructor to take optional RTCConfiguration
    6165    // Private initializer
    6266    [PrivateIdentifier, CallWith=Document, MayThrowException] void initializeWith(RTCConfiguration configuration);
    6367
     68
     69    // 4.3.2 Interface Definition
     70    // JSBuiltins provide support for legacy signatures
     71    [JSBuiltin] Promise<RTCSessionDescriptionInit> createOffer(optional RTCOfferOptions offerOptions);
     72    [JSBuiltin] Promise<RTCSessionDescriptionInit> createAnswer(optional RTCAnswerOptions answerOptions);
     73
     74    // FIXME 169644: change to RTCSessionDescriptionInit
     75    [JSBuiltin] Promise<void> setLocalDescription(RTCSessionDescription description);
     76    // FIXME 169644: change to nullable
     77    readonly attribute RTCSessionDescription localDescription;
     78    // FIXME 169644: change to nullable
     79    readonly attribute RTCSessionDescription currentLocalDescription;
     80    // FIXME 169644: change to nullable
     81    readonly attribute RTCSessionDescription pendingLocalDescription;
     82
     83    // FIXME 169644: change to RTCSessionDescriptionInit
     84    [JSBuiltin] Promise<void> setRemoteDescription(RTCSessionDescription description);
     85    // FIXME 169644: change to nullable
     86    readonly attribute RTCSessionDescription remoteDescription;
     87    // FIXME 169644: change to nullable
     88    readonly attribute RTCSessionDescription currentRemoteDescription;
     89    // FIXME 169644: change to nullable
     90    readonly attribute RTCSessionDescription pendingRemoteDescription;
     91
     92    // FIXME 169644: update parameter to (RTCIceCandidateInit or RTCIceCandidate)
     93    [JSBuiltin] Promise<void> addIceCandidate(RTCIceCandidate candidate);
     94
     95    // FIXME 169644: convert to enum
     96    readonly attribute DOMString signalingState;
     97    // FIXME 169644: convert to enum
     98    readonly attribute DOMString iceGatheringState;
     99    // FIXME 169644: convert to enum
     100    readonly attribute DOMString iceConnectionState;
     101
     102    // FIXME 169644: missing connectionState
     103    // FIXME 169644: missing canTrickleIceCandidates
     104    // FIXME 169644: missing defaultIceServers
     105
     106    RTCConfiguration getConfiguration();
     107    [MayThrowException] void setConfiguration(RTCConfiguration configuration);
     108    void close();
     109
     110    attribute EventHandler onnegotiationneeded;
     111    attribute EventHandler onicecandidate;
     112    // FIXME 169644: missing onicecandidateerror
     113    attribute EventHandler onsignalingstatechange;
     114    attribute EventHandler oniceconnectionstatechange;
     115    attribute EventHandler onicegatheringstatechange;
     116    // FIXME 169644: missing onconnectionstatechanged
     117    // FIXME 169644: missing onfingerprintfailure
     118
     119    // Private API used to implement the overloaded operations above. Queued functions are called by runQueuedOperation().
     120    // See RTCPeerConnectionInternals.js.
     121    [PrivateIdentifier] Promise<RTCSessionDescriptionInit> queuedCreateOffer(optional RTCOfferOptions offerOptions);
     122    [PrivateIdentifier] Promise<RTCSessionDescriptionInit> queuedCreateAnswer(optional RTCAnswerOptions answerOptions);
     123    [PrivateIdentifier] Promise<void> queuedSetLocalDescription(RTCSessionDescription description);
     124    [PrivateIdentifier] Promise<void> queuedSetRemoteDescription(RTCSessionDescription description);
     125    [PrivateIdentifier] Promise<void> queuedAddIceCandidate(RTCIceCandidate candidate);
     126
     127
     128    // 4.3.3.1 Legacy extensions supported
     129    // JSBuiltin attributes above handles support of the extensions
     130    // FIXME 169646: wrap legacy calls in runtime flag
     131
     132
     133    // 4.11 Certificate management
     134    // FIXME 169644: missing generateCertificate
     135
     136
     137    // 5.1 RTCPeerConnection extensions
    64138    // RTP Media API extensions
    65139    [PrivateIdentifier, PublicIdentifier] sequence<RTCRtpSender> getSenders();
     
    70144    [PrivateIdentifier, PublicIdentifier, MayThrowException] void removeTrack(RTCRtpSender sender);
    71145
     146    // FIXME 169644: convert to (MediaStreamTrack or DOMString)
    72147    [MayThrowException] RTCRtpTransceiver addTransceiver(MediaStreamTrack track, optional RTCRtpTransceiverInit init);
    73148    [MayThrowException] RTCRtpTransceiver addTransceiver(DOMString kind, optional RTCRtpTransceiverInit init);
    74149
    75     // Legacy MediaSream-based API (implemented on top of the RTP Media API)
     150    attribute EventHandler ontrack;
     151
     152
     153    // 6.1 Peer-to-peer data API
     154    // FIXME 169644: missing sctp
     155
     156    // FIXME 169644: convert to USVString
     157    [CallWith=ScriptExecutionContext, MayThrowException] RTCDataChannel createDataChannel([TreatNullAs=EmptyString] DOMString label, optional RTCDataChannelInit options);
     158    attribute EventHandler ondatachannel;
     159
     160
     161    // 8.2 Statistics API
     162    // FIXME 169644: |selector| may go away in a future version of the spec
     163    Promise<RTCStatsReport> getStats(optional MediaStreamTrack? selector = null);
     164
     165
     166    // 9.6 Identity Provider API
     167    // FIXME 169644: missing IdP
     168
     169
     170    // Legacy MediaStream API
     171    // FIXME 169646: wrap this in runtime flag
    76172    [JSBuiltin] sequence<MediaStream> getLocalStreams();
    77173    [PrivateIdentifier, PublicIdentifier] sequence<MediaStream> getRemoteStreams();
     
    81177    [JSBuiltin] void removeStream(MediaStream stream);
    82178
    83     [JSBuiltin] Promise<RTCSessionDescriptionInit> createOffer(optional RTCOfferOptions offerOptions);
    84     // Legacy signature: Promise<void> createOffer(RTCSessionDescriptionCallback successCallback
    85     //                                       RTCPeerConnectionErrorCallback errorCallback,
    86     //                                       optional Dictionary offerOptions);
    87 
    88     [JSBuiltin] Promise<RTCSessionDescriptionInit> createAnswer(optional RTCAnswerOptions answerOptions);
    89     // Legacy signature: Promise<void> createAnswer(RTCSessionDescriptionCallback successCallback
    90     //                                        RTCPeerConnectionErrorCallback errorCallback,
    91     //                                        optional Dictionary answerOptions);
    92 
    93     [JSBuiltin] Promise<void> setLocalDescription(RTCSessionDescription description);
    94     // Legacy signature: Promise<void> setLocalDescription(RTCSessionDescription description
    95     //                                               VoidCallback successCallback,
    96     //                                               RTCPeerConnectionErrorCallback errorCallback);
    97 
    98     readonly attribute RTCSessionDescription localDescription;
    99     readonly attribute RTCSessionDescription currentLocalDescription;
    100     readonly attribute RTCSessionDescription pendingLocalDescription;
    101 
    102     [JSBuiltin] Promise<void> setRemoteDescription(RTCSessionDescription description);
    103     // Legacy signature: Promise<void> setRemoteDescription(RTCSessionDescription description
    104     //                                                VoidCallback successCallback,
    105     //                                                RTCPeerConnectionErrorCallback errorCallback);
    106 
    107     readonly attribute RTCSessionDescription remoteDescription;
    108     readonly attribute RTCSessionDescription currentRemoteDescription;
    109     readonly attribute RTCSessionDescription pendingRemoteDescription;
    110 
    111     readonly attribute DOMString signalingState;
    112 
    113     [JSBuiltin] Promise<void> addIceCandidate(RTCIceCandidate candidate);
    114     // Legacy signature: Promise<void> addIceCandidate(RTCIceCandidate candidate
    115     //                                           VoidCallback successCallback,
    116     //                                           RTCPeerConnectionErrorCallback errorCallback);
    117 
    118     readonly attribute DOMString iceGatheringState;
    119     readonly attribute DOMString iceConnectionState;
    120 
    121     RTCConfiguration getConfiguration();
    122     [MayThrowException] void setConfiguration(RTCConfiguration configuration);
    123 
    124     Promise<RTCStatsReport> getStats(optional MediaStreamTrack? selector = null);
    125 
    126     // Private API used to implement the overloaded operations above. Queued functions are called by
    127     // runQueuedOperation() (defined in RTCPeerConnectionInternals.js).
    128     [PrivateIdentifier] Promise<RTCSessionDescriptionInit> queuedCreateOffer(optional RTCOfferOptions offerOptions);
    129     [PrivateIdentifier] Promise<RTCSessionDescriptionInit> queuedCreateAnswer(optional RTCAnswerOptions answerOptions);
    130     [PrivateIdentifier] Promise<void> queuedSetLocalDescription(RTCSessionDescription description);
    131     [PrivateIdentifier] Promise<void> queuedSetRemoteDescription(RTCSessionDescription description);
    132     [PrivateIdentifier] Promise<void> queuedAddIceCandidate(RTCIceCandidate candidate);
    133 
    134     [CallWith=ScriptExecutionContext, MayThrowException] RTCDataChannel createDataChannel([TreatNullAs=EmptyString] DOMString label, optional RTCDataChannelInit options);
    135 
    136     void close();
    137 
    138     attribute EventHandler onnegotiationneeded;
    139     attribute EventHandler onicecandidate;
    140     attribute EventHandler onsignalingstatechange;
    141     attribute EventHandler ontrack;
    142     attribute EventHandler oniceconnectionstatechange;
    143     attribute EventHandler onicegatheringstatechange;
    144     attribute EventHandler ondatachannel;
    145 
    146179    // Legacy event handler (MediaStream-based API)
    147180    attribute EventHandler onaddstream;
    148181};
    149 
    150 // This enum is mirrored in RTCRtpTransceiver.idl
    151 enum RTCRtpTransceiverDirection { "sendrecv", "sendonly", "recvonly", "inactive" };
    152 
    153 dictionary RTCRtpTransceiverInit {
    154     RTCRtpTransceiverDirection direction = "sendrecv";
    155 };
  • trunk/Source/WebCore/Modules/mediastream/RTCRtpTransceiver.h

    r208683 r213992  
    3333#if ENABLE(WEB_RTC)
    3434
     35#include "RTCEnums.h"
    3536#include "RTCIceTransport.h"
    3637#include "RTCRtpReceiver.h"
     
    4647public:
    4748    // This enum is mirrored in RTCPeerConnection.h
    48     enum class Direction { Sendrecv, Sendonly, Recvonly, Inactive };
     49    using Direction = RTCRtpTransceiverDirection;
    4950
    5051    static Ref<RTCRtpTransceiver> create(Ref<RTCRtpSender>&& sender, Ref<RTCRtpReceiver>&& receiver) { return adoptRef(*new RTCRtpTransceiver(WTFMove(sender), WTFMove(receiver))); }
  • trunk/Source/WebCore/Modules/mediastream/RTCRtpTransceiver.idl

    r211006 r213992  
    11/*
    22 * Copyright (C) 2016 Ericsson AB. All rights reserved.
     3 * Copyright (C) 2017 Apple Inc. All rights reserved.
    34 *
    45 * Redistribution and use in source and binary forms, with or without
     
    2930 */
    3031
     32typedef RTCRtpTransceiverDirection RtpTransceiverDirection;
     33
    3134[
    3235    Conditional=WEB_RTC,
    33     EnabledAtRuntime=PeerConnection,
     36    EnabledAtRuntime=PeerConnection
    3437] interface RTCRtpTransceiver {
    3538    readonly attribute DOMString? mid;
     
    3740    readonly attribute RTCRtpReceiver receiver;
    3841    readonly attribute boolean stopped;
    39     readonly attribute RTCRtpTransceiverDirection direction;
     42    readonly attribute RtpTransceiverDirection direction;
    4043
    41     void setDirection(RTCRtpTransceiverDirection direction);
     44    void setDirection(RtpTransceiverDirection direction);
    4245    void stop();
    4346};
    44 
    45 // This enum is mirrored in RTCPeerConnection.idl
    46 enum RTCRtpTransceiverDirection { "sendrecv", "sendonly", "recvonly", "inactive" };
  • trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj

    r213985 r213992  
    166166                077664FC183E6B5C00133B92 /* JSQuickTimePluginReplacement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 077664FA183E6B5C00133B92 /* JSQuickTimePluginReplacement.cpp */; };
    167167                077664FD183E6B5C00133B92 /* JSQuickTimePluginReplacement.h in Headers */ = {isa = PBXBuildFile; fileRef = 077664FB183E6B5C00133B92 /* JSQuickTimePluginReplacement.h */; };
    168                 0779BF0E18453168000B6AE7 /* HTMLMediaElementMediaStream.h in Headers */ = {isa = PBXBuildFile; fileRef = 0779BF0B18453168000B6AE7 /* HTMLMediaElementMediaStream.h */; };
    169168                077AF14018F4AE400001ED61 /* SerializedPlatformRepresentation.h in Headers */ = {isa = PBXBuildFile; fileRef = 077AF13E18F4AE400001ED61 /* SerializedPlatformRepresentation.h */; settings = {ATTRIBUTES = (Private, ); }; };
    170169                077AF14318F4B1BB0001ED61 /* SerializedPlatformRepresentationMac.h in Headers */ = {isa = PBXBuildFile; fileRef = 077AF14118F4B1BB0001ED61 /* SerializedPlatformRepresentationMac.h */; };
     
    14211420                316BDC0C1E7634CF00DE0D5A /* GPURenderPipelineColorAttachmentDescriptor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 316BDC081E76342700DE0D5A /* GPURenderPipelineColorAttachmentDescriptor.cpp */; };
    14221421                316BDC0D1E7634D200DE0D5A /* GPURenderPipelineColorAttachmentDescriptor.h in Headers */ = {isa = PBXBuildFile; fileRef = 316BDC091E76342700DE0D5A /* GPURenderPipelineColorAttachmentDescriptor.h */; settings = {ATTRIBUTES = (Private, ); }; };
     1422                316DCB1F1E78CA55001B5F87 /* JSRTCOfferAnswerOptions.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 316DCB191E78CA55001B5F87 /* JSRTCOfferAnswerOptions.cpp */; };
     1423                316DCB201E78CA55001B5F87 /* JSRTCOfferAnswerOptions.h in Headers */ = {isa = PBXBuildFile; fileRef = 316DCB1A1E78CA55001B5F87 /* JSRTCOfferAnswerOptions.h */; };
     1424                316DCB211E78CA55001B5F87 /* JSRTCRtpTransceiverDirection.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 316DCB1B1E78CA55001B5F87 /* JSRTCRtpTransceiverDirection.cpp */; };
     1425                316DCB221E78CA55001B5F87 /* JSRTCRtpTransceiverDirection.h in Headers */ = {isa = PBXBuildFile; fileRef = 316DCB1C1E78CA55001B5F87 /* JSRTCRtpTransceiverDirection.h */; };
     1426                316DCB311E78FB6C001B5F87 /* JSRTCAnswerOptions.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 316DCB2D1E78F496001B5F87 /* JSRTCAnswerOptions.cpp */; };
     1427                316DCB321E78FB70001B5F87 /* JSRTCOfferOptions.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 316DCB2F1E78F496001B5F87 /* JSRTCOfferOptions.cpp */; };
    14231428                316FE0710E6CCBEE00BF6088 /* JSCSSKeyframeRule.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 316FE06D0E6CCBEE00BF6088 /* JSCSSKeyframeRule.cpp */; };
    14241429                316FE0720E6CCBEE00BF6088 /* JSCSSKeyframeRule.h in Headers */ = {isa = PBXBuildFile; fileRef = 316FE06E0E6CCBEE00BF6088 /* JSCSSKeyframeRule.h */; };
     
    74947499                077664FA183E6B5C00133B92 /* JSQuickTimePluginReplacement.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSQuickTimePluginReplacement.cpp; sourceTree = "<group>"; };
    74957500                077664FB183E6B5C00133B92 /* JSQuickTimePluginReplacement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSQuickTimePluginReplacement.h; sourceTree = "<group>"; };
    7496                 0779BF0B18453168000B6AE7 /* HTMLMediaElementMediaStream.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HTMLMediaElementMediaStream.h; sourceTree = "<group>"; };
    7497                 0779BF0C18453168000B6AE7 /* HTMLMediaElementMediaStream.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = HTMLMediaElementMediaStream.idl; sourceTree = "<group>"; };
    74987501                077AF13E18F4AE400001ED61 /* SerializedPlatformRepresentation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SerializedPlatformRepresentation.h; sourceTree = "<group>"; };
    74997502                077AF14118F4B1BB0001ED61 /* SerializedPlatformRepresentationMac.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SerializedPlatformRepresentationMac.h; sourceTree = "<group>"; };
     
    88978900                316BDC091E76342700DE0D5A /* GPURenderPipelineColorAttachmentDescriptor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GPURenderPipelineColorAttachmentDescriptor.h; sourceTree = "<group>"; };
    88988901                316BDC0A1E76343600DE0D5A /* GPURenderPipelineColorAttachmentDescriptorMetal.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = GPURenderPipelineColorAttachmentDescriptorMetal.mm; sourceTree = "<group>"; };
     8902                316DCB121E78BE43001B5F87 /* RTCOfferAnswerOptions.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = RTCOfferAnswerOptions.idl; sourceTree = "<group>"; };
     8903                316DCB161E78C330001B5F87 /* RTCRtpTransceiverDirection.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RTCRtpTransceiverDirection.h; sourceTree = "<group>"; };
     8904                316DCB171E78C330001B5F87 /* RTCRtpTransceiverDirection.idl */ = {isa = PBXFileReference; lastKnownFileType = text; path = RTCRtpTransceiverDirection.idl; sourceTree = "<group>"; };
     8905                316DCB181E78C453001B5F87 /* RTCEnums.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RTCEnums.h; sourceTree = "<group>"; };
     8906                316DCB191E78CA55001B5F87 /* JSRTCOfferAnswerOptions.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSRTCOfferAnswerOptions.cpp; sourceTree = "<group>"; };
     8907                316DCB1A1E78CA55001B5F87 /* JSRTCOfferAnswerOptions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSRTCOfferAnswerOptions.h; sourceTree = "<group>"; };
     8908                316DCB1B1E78CA55001B5F87 /* JSRTCRtpTransceiverDirection.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSRTCRtpTransceiverDirection.cpp; sourceTree = "<group>"; };
     8909                316DCB1C1E78CA55001B5F87 /* JSRTCRtpTransceiverDirection.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSRTCRtpTransceiverDirection.h; sourceTree = "<group>"; };
     8910                316DCB281E78F395001B5F87 /* RTCOfferOptions.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RTCOfferOptions.h; sourceTree = "<group>"; };
     8911                316DCB291E78F395001B5F87 /* RTCOfferOptions.idl */ = {isa = PBXFileReference; lastKnownFileType = text; path = RTCOfferOptions.idl; sourceTree = "<group>"; };
     8912                316DCB2B1E78F3A9001B5F87 /* RTCAnswerOptions.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RTCAnswerOptions.h; sourceTree = "<group>"; };
     8913                316DCB2C1E78F3A9001B5F87 /* RTCAnswerOptions.idl */ = {isa = PBXFileReference; lastKnownFileType = text; path = RTCAnswerOptions.idl; sourceTree = "<group>"; };
     8914                316DCB2D1E78F496001B5F87 /* JSRTCAnswerOptions.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSRTCAnswerOptions.cpp; sourceTree = "<group>"; };
     8915                316DCB2E1E78F496001B5F87 /* JSRTCAnswerOptions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSRTCAnswerOptions.h; sourceTree = "<group>"; };
     8916                316DCB2F1E78F496001B5F87 /* JSRTCOfferOptions.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSRTCOfferOptions.cpp; sourceTree = "<group>"; };
     8917                316DCB301E78F496001B5F87 /* JSRTCOfferOptions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSRTCOfferOptions.h; sourceTree = "<group>"; };
    88998918                316FE06D0E6CCBEE00BF6088 /* JSCSSKeyframeRule.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSCSSKeyframeRule.cpp; sourceTree = "<group>"; };
    89008919                316FE06E0E6CCBEE00BF6088 /* JSCSSKeyframeRule.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSCSSKeyframeRule.h; sourceTree = "<group>"; };
     
    1579015809                                93A806111E03B51C008A1F26 /* DoubleRange.h */,
    1579115810                                93A806121E03B51C008A1F26 /* DoubleRange.idl */,
    15792                                 0779BF0B18453168000B6AE7 /* HTMLMediaElementMediaStream.h */,
    15793                                 0779BF0C18453168000B6AE7 /* HTMLMediaElementMediaStream.idl */,
    1579415811                                93A806131E03B51C008A1F26 /* LongRange.h */,
    1579515812                                93A806141E03B51C008A1F26 /* LongRange.idl */,
     
    1584015857                                41E408381DCB747900EFCE19 /* PeerConnectionBackend.cpp */,
    1584115858                                5E2C434D1BCEE2E50001E2BC /* PeerConnectionBackend.h */,
     15859                                316DCB2B1E78F3A9001B5F87 /* RTCAnswerOptions.h */,
     15860                                316DCB2C1E78F3A9001B5F87 /* RTCAnswerOptions.idl */,
    1584215861                                07AB996518DA3C010018771E /* RTCConfiguration.h */,
    1584315862                                07AB996618DA3C010018771E /* RTCConfiguration.idl */,
     
    1585615875                                07221B6D17CEC32700848E51 /* RTCDTMFToneChangeEvent.h */,
    1585715876                                07221B6E17CEC32700848E51 /* RTCDTMFToneChangeEvent.idl */,
     15877                                316DCB181E78C453001B5F87 /* RTCEnums.h */,
    1585815878                                07221B7117CEC32700848E51 /* RTCIceCandidate.cpp */,
    1585915879                                07221B7217CEC32700848E51 /* RTCIceCandidate.h */,
     
    1586615886                                5E6653091DA437BF00FDD84C /* RTCIceTransport.h */,
    1586715887                                073794DC19EE2C5200E5A045 /* RTCOfferAnswerOptions.h */,
     15888                                316DCB121E78BE43001B5F87 /* RTCOfferAnswerOptions.idl */,
     15889                                316DCB281E78F395001B5F87 /* RTCOfferOptions.h */,
     15890                                316DCB291E78F395001B5F87 /* RTCOfferOptions.idl */,
    1586815891                                07221B7717CEC32700848E51 /* RTCPeerConnection.cpp */,
    1586915892                                07221B7817CEC32700848E51 /* RTCPeerConnection.h */,
     
    1588115904                                5E5E2B111CFC3E4B000C0D85 /* RTCRtpTransceiver.h */,
    1588215905                                5E5E2B121CFC3E4B000C0D85 /* RTCRtpTransceiver.idl */,
     15906                                316DCB161E78C330001B5F87 /* RTCRtpTransceiverDirection.h */,
     15907                                316DCB171E78C330001B5F87 /* RTCRtpTransceiverDirection.idl */,
    1588315908                                07221B7A17CEC32700848E51 /* RTCSessionDescription.cpp */,
    1588415909                                07221B7B17CEC32700848E51 /* RTCSessionDescription.h */,
     
    1606316088                                0704A4131D6F39FB0086DCDB /* JSOverconstrainedErrorEvent.cpp */,
    1606416089                                0704A4141D6F39FB0086DCDB /* JSOverconstrainedErrorEvent.h */,
     16090                                316DCB2D1E78F496001B5F87 /* JSRTCAnswerOptions.cpp */,
     16091                                316DCB2E1E78F496001B5F87 /* JSRTCAnswerOptions.h */,
    1606516092                                073794E319EE2FF200E5A045 /* JSRTCConfiguration.cpp */,
    1606616093                                073794E419EE2FF200E5A045 /* JSRTCConfiguration.h */,
     
    1607916106                                073794E919EE341E00E5A045 /* JSRTCIceServer.cpp */,
    1608016107                                073794EA19EE341E00E5A045 /* JSRTCIceServer.h */,
     16108                                316DCB191E78CA55001B5F87 /* JSRTCOfferAnswerOptions.cpp */,
     16109                                316DCB1A1E78CA55001B5F87 /* JSRTCOfferAnswerOptions.h */,
     16110                                316DCB2F1E78F496001B5F87 /* JSRTCOfferOptions.cpp */,
     16111                                316DCB301E78F496001B5F87 /* JSRTCOfferOptions.h */,
    1608116112                                07969D9F17D14151007FF842 /* JSRTCPeerConnection.cpp */,
    1608216113                                07969DA017D14151007FF842 /* JSRTCPeerConnection.h */,
     
    1608716118                                5E2C436D1BCF0D690001E2BD /* JSRTCRtpTransceiver.cpp */,
    1608816119                                5E2C436E1BCF0D690001E2BD /* JSRTCRtpTransceiver.h */,
     16120                                316DCB1B1E78CA55001B5F87 /* JSRTCRtpTransceiverDirection.cpp */,
     16121                                316DCB1C1E78CA55001B5F87 /* JSRTCRtpTransceiverDirection.h */,
    1608916122                                07969DA117D14151007FF842 /* JSRTCSessionDescription.cpp */,
    1609016123                                07969DA217D14151007FF842 /* JSRTCSessionDescription.h */,
     
    2704727080                                CD5209E61B0BD9E10077184E /* HTMLMediaElementEnums.h in Headers */,
    2704827081                                C937FE8D1B1F6821008ECC5D /* HTMLMediaElementMediaSession.h in Headers */,
    27049                                 0779BF0E18453168000B6AE7 /* HTMLMediaElementMediaStream.h in Headers */,
    2705027082                                A8EA79F40A1916DF00A8EF5F /* HTMLMenuElement.h in Headers */,
    2705127083                                2BE8E2C712A589EC00FAD550 /* HTMLMetaCharsetParser.h in Headers */,
     
    2714527177                                5185FC911BB4C4E80012898F /* IDBIndex.h in Headers */,
    2714627178                                51F798F01BE880E7008AE491 /* IDBIndexInfo.h in Headers */,
     27179                                316DCB201E78CA55001B5F87 /* JSRTCOfferAnswerOptions.h in Headers */,
    2714727180                                51E269371DD3BD9B006B6A58 /* IDBIterateCursorData.h in Headers */,
    2714827181                                5185FC951BB4C4E80012898F /* IDBKey.h in Headers */,
     
    2733427367                                FDA15EA412B03EE1003A583A /* JSChannelSplitterNode.h in Headers */,
    2733527368                                65DF31F409D1CC60000BE325 /* JSCharacterData.h in Headers */,
     27369                                316DCB221E78CA55001B5F87 /* JSRTCRtpTransceiverDirection.h in Headers */,
    2733627370                                BCC065880F3CE2A700CD2D87 /* JSClientRect.h in Headers */,
    2733727371                                BCC0658A0F3CE2A700CD2D87 /* JSClientRectList.h in Headers */,
     
    3050530539                                9418278E1D8CAF9200492764 /* CSSPendingSubstitutionValue.cpp in Sources */,
    3050630540                                977B3862122883E900B81FF8 /* CSSPreloadScanner.cpp in Sources */,
     30541                                316DCB1F1E78CA55001B5F87 /* JSRTCOfferAnswerOptions.cpp in Sources */,
    3050730542                                A80E6D050A1989CA007FB8C5 /* CSSPrimitiveValue.cpp in Sources */,
    3050830543                                A80E6CF70A1989CA007FB8C5 /* CSSProperty.cpp in Sources */,
     
    3084730882                                1432E8490C51493F00B1500F /* GCController.cpp in Sources */,
    3084830883                                4FB390AD15EF61F3007AD51F /* GeneratedImage.cpp in Sources */,
     30884                                316DCB211E78CA55001B5F87 /* JSRTCRtpTransceiverDirection.cpp in Sources */,
    3084930885                                830030F51B7D33B500ED3AAC /* GenericCachedHTMLCollection.cpp in Sources */,
    3085030886                                0720B0A014D3323500642955 /* GenericEventQueue.cpp in Sources */,
     
    3162431660                                CB38FD511CCF938900592A3F /* JSPerformanceEntry.cpp in Sources */,
    3162531661                                CB38FD571CD21E2A00592A3F /* JSPerformanceEntryCustom.cpp in Sources */,
     31662                                316DCB311E78FB6C001B5F87 /* JSRTCAnswerOptions.cpp in Sources */,
    3162631663                                A58C59D01E382EAC0047859C /* JSPerformanceMark.cpp in Sources */,
    3162731664                                A58C59D21E382EB00047859C /* JSPerformanceMeasure.cpp in Sources */,
     
    3199932036                                E18772F1126E2629003DD586 /* Language.cpp in Sources */,
    3200032037                                2917B5611473496C0052C9D0 /* LayerFlushScheduler.cpp in Sources */,
     32038                                316DCB321E78FB70001B5F87 /* JSRTCOfferOptions.cpp in Sources */,
    3200132039                                2917B566147349950052C9D0 /* LayerFlushSchedulerMac.cpp in Sources */,
    3200232040                                7AA3A69F194B59B6001CBD24 /* LayerPool.cpp in Sources */,
Note: See TracChangeset for help on using the changeset viewer.