Bug 1173851: rename DataChannel to RTCDataChannel draft
authorNils Ohlmeier [:drno] <drno@ohlmeier.org>
Fri, 09 Feb 2018 14:36:48 -0800
changeset 755291 85d971214e9a05efb24587c382d489c8f40dc940
parent 755180 27fd083ed7ee5782e52a5eaf0286c5ffa8b35a9e
child 755292 bc298f34c4823ba66cf2fb175863dbc0481cb755
push id99142
push userdrno@ohlmeier.org
push dateThu, 15 Feb 2018 04:06:17 +0000
bugs1173851
milestone60.0a1
Bug 1173851: rename DataChannel to RTCDataChannel MozReview-Commit-ID: L8OrIlxM7r1
dom/base/nsDOMDataChannel.cpp
dom/base/nsDOMDataChannel.h
dom/bindings/Bindings.conf
dom/webidl/DataChannel.webidl
dom/webidl/PeerConnectionImpl.webidl
dom/webidl/PeerConnectionObserver.webidl
dom/webidl/RTCDataChannel.webidl
dom/webidl/RTCDataChannelEvent.webidl
dom/webidl/RTCPeerConnection.webidl
dom/webidl/moz.build
media/webrtc/signaling/src/peerconnection/PeerConnectionImpl.cpp
xpcom/reflect/xptinfo/ShimInterfaceInfo.cpp
--- a/dom/base/nsDOMDataChannel.cpp
+++ b/dom/base/nsDOMDataChannel.cpp
@@ -47,17 +47,17 @@ nsDOMDataChannel::~nsDOMDataChannel()
   LOG(("%p: Close()ing %p", this, mDataChannel.get()));
   mDataChannel->SetListener(nullptr, nullptr);
   mDataChannel->Close();
 }
 
 /* virtual */ JSObject*
 nsDOMDataChannel::WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto)
 {
-  return DataChannelBinding::Wrap(aCx, this, aGivenProto);
+  return RTCDataChannelBinding::Wrap(aCx, this, aGivenProto);
 }
 
 NS_IMPL_CYCLE_COLLECTION_CLASS(nsDOMDataChannel)
 
 NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INHERITED(nsDOMDataChannel,
                                                   DOMEventTargetHelper)
 NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
 
--- a/dom/base/nsDOMDataChannel.h
+++ b/dom/base/nsDOMDataChannel.h
@@ -4,17 +4,17 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef nsDOMDataChannel_h
 #define nsDOMDataChannel_h
 
 #include "mozilla/Attributes.h"
 #include "mozilla/DOMEventTargetHelper.h"
-#include "mozilla/dom/DataChannelBinding.h"
+#include "mozilla/dom/RTCDataChannelBinding.h"
 #include "mozilla/dom/TypedArray.h"
 #include "mozilla/net/DataChannelListener.h"
 #include "nsIDOMDataChannel.h"
 #include "nsIInputStream.h"
 
 
 namespace mozilla {
 namespace dom {
--- a/dom/bindings/Bindings.conf
+++ b/dom/bindings/Bindings.conf
@@ -222,20 +222,16 @@ DOMInterfaces = {
 'CSSValue': {
     'concrete': False
 },
 
 'CSSValueList': {
     'nativeType': 'nsDOMCSSValueList'
 },
 
-'DataChannel': {
-    'nativeType': 'nsDOMDataChannel',
-},
-
 'DedicatedWorkerGlobalScope': {
     'headerFile': 'mozilla/dom/WorkerScope.h',
     'implicitJSContext': [ 'close' ],
 },
 
 'DeviceAcceleration': {
     'headerFile': 'mozilla/dom/DeviceMotionEvent.h',
 },
@@ -738,16 +734,20 @@ DOMInterfaces = {
     'implicitJSContext': [ 'arrayBuffer', 'blob', 'formData', 'json', 'text',
                            'clone', 'cloneUnfiltered' ],
 },
 
 'RGBColor': {
     'nativeType': 'nsDOMCSSRGBColor',
 },
 
+'RTCDataChannel': {
+    'nativeType': 'nsDOMDataChannel',
+},
+
 'Screen': {
     'nativeType': 'nsScreen',
 },
 
 'ServiceWorkerGlobalScope': {
     'headerFile': 'mozilla/dom/WorkerScope.h',
 },
 
@@ -1688,17 +1688,16 @@ def addExternalIface(iface, nativeType=N
     if not headerFile is None:
         domInterface['headerFile'] = headerFile
     domInterface['notflattened'] = notflattened
     DOMInterfaces[iface] = domInterface
 
 addExternalIface('ApplicationCache', nativeType='nsIDOMOfflineResourceList')
 addExternalIface('Cookie', nativeType='nsICookie2',
                  headerFile='nsICookie2.h', notflattened=True)
-addExternalIface('RTCDataChannel', nativeType='nsIDOMDataChannel')
 addExternalIface('HitRegionOptions', nativeType='nsISupports')
 addExternalIface('imgINotificationObserver', nativeType='imgINotificationObserver')
 addExternalIface('imgIRequest', nativeType='imgIRequest', notflattened=True)
 addExternalIface('LoadContext', nativeType='nsILoadContext', notflattened=True)
 addExternalIface('LoadInfo', nativeType='nsILoadInfo',
                  headerFile='nsILoadInfo.h', notflattened=True)
 addExternalIface('MenuBuilder', nativeType='nsIMenuBuilder', notflattened=True)
 addExternalIface('XULControllers', nativeType='nsIControllers', notflattened=True)
--- a/dom/webidl/PeerConnectionImpl.webidl
+++ b/dom/webidl/PeerConnectionImpl.webidl
@@ -123,13 +123,13 @@ interface PeerConnectionImpl  {
   attribute DOMString id;
 
   [SetterThrows]
   attribute DOMString peerIdentity;
   readonly attribute boolean privacyRequested;
 
   /* Data channels */
   [Throws]
-  DataChannel createDataChannel(DOMString label, DOMString protocol,
+  RTCDataChannel createDataChannel(DOMString label, DOMString protocol,
     unsigned short type, boolean ordered,
     unsigned short maxTime, unsigned short maxNum,
     boolean externalNegotiated, unsigned short stream);
 };
--- a/dom/webidl/PeerConnectionObserver.webidl
+++ b/dom/webidl/PeerConnectionObserver.webidl
@@ -24,17 +24,17 @@ interface PeerConnectionObserver
   void onAddIceCandidateError(unsigned long name, DOMString message);
   void onIceCandidate(unsigned short level, DOMString mid, DOMString candidate);
 
   /* Stats callbacks */
   void onGetStatsSuccess(optional RTCStatsReportInternal report);
   void onGetStatsError(unsigned long name, DOMString message);
 
   /* Data channel callbacks */
-  void notifyDataChannel(DataChannel channel);
+  void notifyDataChannel(RTCDataChannel channel);
 
   /* Notification of one of several types of state changed */
   void onStateChange(PCObserverStateType state);
 
   /* Changes to MediaStreamTracks */
   void onRemoveStream(MediaStream stream);
 
   /* Transceiver management; called when setRemoteDescription causes a
rename from dom/webidl/DataChannel.webidl
rename to dom/webidl/RTCDataChannel.webidl
--- a/dom/webidl/DataChannel.webidl
+++ b/dom/webidl/RTCDataChannel.webidl
@@ -9,18 +9,17 @@ enum RTCDataChannelState {
   "closed"
 };
 
 enum RTCDataChannelType {
   "arraybuffer",
   "blob"
 };
 
-// XXX This interface is called RTCDataChannel in the spec.
-interface DataChannel : EventTarget
+interface RTCDataChannel : EventTarget
 {
   readonly attribute DOMString label;
   readonly attribute boolean reliable;
   readonly attribute RTCDataChannelState readyState;
   readonly attribute unsigned long bufferedAmount;
   attribute unsigned long bufferedAmountLowThreshold;
   attribute EventHandler onopen;
   attribute EventHandler onerror;
@@ -35,14 +34,14 @@ interface DataChannel : EventTarget
   void send(Blob data);
   [Throws]
   void send(ArrayBuffer data);
   [Throws]
   void send(ArrayBufferView data);
 };
 
 // Mozilla extensions.
-partial interface DataChannel
+partial interface RTCDataChannel
 {
   readonly attribute DOMString protocol;
   readonly attribute boolean ordered;
   readonly attribute unsigned short id;
 };
--- a/dom/webidl/RTCDataChannelEvent.webidl
+++ b/dom/webidl/RTCDataChannelEvent.webidl
@@ -2,18 +2,16 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this file,
  * You can obtain one at http://mozilla.org/MPL/2.0/.
  *
  * The origin of this IDL file is
  * http://dev.w3.org/2011/webrtc/editor/webrtc.html#idl-def-RTCDataChannelEvent
  */
 
-interface RTCDataChannel;
-
 dictionary RTCDataChannelEventInit : EventInit {
     RTCDataChannel? channel = null;
 };
 
 [Pref="media.peerconnection.enabled",
  Constructor(DOMString type, optional RTCDataChannelEventInit eventInitDict)]
 interface RTCDataChannelEvent : Event {
   readonly attribute RTCDataChannel? channel;
--- a/dom/webidl/RTCPeerConnection.webidl
+++ b/dom/webidl/RTCPeerConnection.webidl
@@ -68,18 +68,16 @@ dictionary RTCAnswerOptions : RTCOfferAn
 };
 
 dictionary RTCOfferOptions : RTCOfferAnswerOptions {
   boolean offerToReceiveVideo;
   boolean offerToReceiveAudio;
   boolean iceRestart = false;
 };
 
-interface RTCDataChannel;
-
 [Pref="media.peerconnection.enabled",
  JSImplementation="@mozilla.org/dom/peerconnection;1",
  Constructor (optional RTCConfiguration configuration,
               optional object? constraints)]
 interface RTCPeerConnection : EventTarget  {
   [Throws, StaticClassOverride="mozilla::dom::RTCCertificate"]
   static Promise<RTCCertificate> generateCertificate (AlgorithmIdentifier keygenAlgorithm);
 
--- a/dom/webidl/moz.build
+++ b/dom/webidl/moz.build
@@ -962,23 +962,23 @@ WEBIDL_FILES = [
     'XSLTProcessor.webidl',
     'XULCommandEvent.webidl',
     'XULDocument.webidl',
     'XULElement.webidl',
 ]
 
 if CONFIG['MOZ_WEBRTC']:
     WEBIDL_FILES += [
-        'DataChannel.webidl',
         'PeerConnectionImpl.webidl',
         'PeerConnectionImplEnums.webidl',
         'PeerConnectionObserver.webidl',
         'PeerConnectionObserverEnums.webidl',
         'RTCCertificate.webidl',
         'RTCConfiguration.webidl',
+        'RTCDataChannel.webidl',
         'RTCDTMFSender.webidl',
         'RTCIceCandidate.webidl',
         'RTCIdentityAssertion.webidl',
         'RTCIdentityProvider.webidl',
         'RTCPeerConnection.webidl',
         'RTCPeerConnectionStatic.webidl',
         'RTCRtpReceiver.webidl',
         'RTCRtpSender.webidl',
--- a/media/webrtc/signaling/src/peerconnection/PeerConnectionImpl.cpp
+++ b/media/webrtc/signaling/src/peerconnection/PeerConnectionImpl.cpp
@@ -85,17 +85,17 @@
 #include "mozilla/dom/RTCConfigurationBinding.h"
 #include "mozilla/dom/RTCDTMFSenderBinding.h"
 #include "mozilla/dom/RTCDTMFToneChangeEvent.h"
 #include "mozilla/dom/RTCRtpReceiverBinding.h"
 #include "mozilla/dom/RTCRtpSenderBinding.h"
 #include "mozilla/dom/RTCStatsReportBinding.h"
 #include "mozilla/dom/RTCPeerConnectionBinding.h"
 #include "mozilla/dom/PeerConnectionImplBinding.h"
-#include "mozilla/dom/DataChannelBinding.h"
+#include "mozilla/dom/RTCDataChannelBinding.h"
 #include "mozilla/dom/PerformanceTiming.h"
 #include "mozilla/dom/PluginCrashedEvent.h"
 #include "MediaStreamTrack.h"
 #include "AudioStreamTrack.h"
 #include "VideoStreamTrack.h"
 #include "nsIScriptGlobalObject.h"
 #include "MediaStreamGraph.h"
 #include "DOMMediaStream.h"
--- a/xpcom/reflect/xptinfo/ShimInterfaceInfo.cpp
+++ b/xpcom/reflect/xptinfo/ShimInterfaceInfo.cpp
@@ -70,19 +70,16 @@
 #include "mozilla/dom/ClipboardEventBinding.h"
 #include "mozilla/dom/CommentBinding.h"
 #include "mozilla/dom/CSSPrimitiveValueBinding.h"
 #include "mozilla/dom/CSSStyleDeclarationBinding.h"
 #include "mozilla/dom/CSSStyleSheetBinding.h"
 #include "mozilla/dom/CSSValueBinding.h"
 #include "mozilla/dom/CSSValueListBinding.h"
 #include "mozilla/dom/CustomEventBinding.h"
-#ifdef MOZ_WEBRTC
-#include "mozilla/dom/DataChannelBinding.h"
-#endif
 #include "mozilla/dom/DataTransferBinding.h"
 #include "mozilla/dom/DOMCursorBinding.h"
 #include "mozilla/dom/DOMExceptionBinding.h"
 #include "mozilla/dom/DOMParserBinding.h"
 #include "mozilla/dom/DOMRequestBinding.h"
 #include "mozilla/dom/DocumentBinding.h"
 #include "mozilla/dom/DocumentFragmentBinding.h"
 #include "mozilla/dom/DocumentTypeBinding.h"
@@ -112,16 +109,19 @@
 #include "mozilla/dom/NodeBinding.h"
 #include "mozilla/dom/NotifyPaintEventBinding.h"
 #include "mozilla/dom/EventBinding.h"
 #include "mozilla/dom/OfflineResourceListBinding.h"
 #include "mozilla/dom/PositionErrorBinding.h"
 #include "mozilla/dom/ProcessingInstructionBinding.h"
 #include "mozilla/dom/RangeBinding.h"
 #include "mozilla/dom/RectBinding.h"
+#ifdef MOZ_WEBRTC
+#include "mozilla/dom/RTCDataChannelBinding.h"
+#endif
 #include "mozilla/dom/ScreenBinding.h"
 #include "mozilla/dom/SelectionBinding.h"
 #include "mozilla/dom/ScrollAreaEventBinding.h"
 #include "mozilla/dom/StorageEventBinding.h"
 #include "mozilla/dom/StyleSheetBinding.h"
 #include "mozilla/dom/StyleSheetListBinding.h"
 #include "mozilla/dom/SVGElementBinding.h"
 #include "mozilla/dom/TextBinding.h"
@@ -195,19 +195,16 @@ const ComponentsInterfaceShimEntry kComp
 {
   DEFINE_SHIM(CanvasRenderingContext2D),
   DEFINE_SHIM(CharacterData),
   DEFINE_SHIM_WITH_CUSTOM_INTERFACE(nsIDOMClientRect, DOMRectReadOnly),
   DEFINE_SHIM_WITH_CUSTOM_INTERFACE(nsIDOMClientRectList, DOMRectList),
   DEFINE_SHIM(ClipboardEvent),
   DEFINE_SHIM(Comment),
   DEFINE_SHIM(CustomEvent),
-#ifdef MOZ_WEBRTC
-  DEFINE_SHIM(DataChannel),
-#endif
   DEFINE_SHIM(DataTransfer),
   DEFINE_SHIM(DOMCursor),
   DEFINE_SHIM(DOMException),
   DEFINE_SHIM(DOMRequest),
   DEFINE_SHIM(Document),
   DEFINE_SHIM(DocumentFragment),
   DEFINE_SHIM(DocumentType),
   DEFINE_SHIM_WITH_CUSTOM_INTERFACE(nsIDOMDocumentXBL, Document),
@@ -229,16 +226,19 @@ const ComponentsInterfaceShimEntry kComp
   DEFINE_SHIM(NodeList),
   DEFINE_SHIM(Node),
   DEFINE_SHIM(NotifyPaintEvent),
   DEFINE_SHIM_WITH_CUSTOM_INTERFACE(nsIDOMNSEvent, Event),
   DEFINE_SHIM(OfflineResourceList),
   DEFINE_SHIM_WITH_CUSTOM_INTERFACE(nsIDOMParser, DOMParser),
   DEFINE_SHIM(ProcessingInstruction),
   DEFINE_SHIM(Range),
+#ifdef MOZ_WEBRTC
+  DEFINE_SHIM_WITH_CUSTOM_INTERFACE(nsIDOMDataChannel, RTCDataChannel),
+#endif
   DEFINE_SHIM(Screen),
   DEFINE_SHIM(ScrollAreaEvent),
   DEFINE_SHIM_WITH_CUSTOM_INTERFACE(nsIDOMSerializer, XMLSerializer),
   DEFINE_SHIM(Text),
   DEFINE_SHIM(TimeRanges),
   DEFINE_SHIM_WITH_CUSTOM_INTERFACE(nsITreeBoxObject, TreeBoxObject),
   DEFINE_SHIM(UIEvent),
   DEFINE_SHIM_WITH_CUSTOM_INTERFACE(nsIWebBrowserPersistable, FrameLoader),