From 5d7640072559f274bd02fede253a27c09615e829 Mon Sep 17 00:00:00 2001 From: "Nils Ohlmeier [:drno]" Date: Fri, 9 Feb 2018 14:36:48 -0800 Subject: [PATCH] Bug 1173851: rename DataChannel to RTCDataChannel r=jib,smaug MozReview-Commit-ID: L8OrIlxM7r1 --HG-- rename : dom/webidl/DataChannel.webidl => dom/webidl/RTCDataChannel.webidl extra : rebase_source : 013fd0b02c6b5e3a95395bbfed68e27138b507ed --- dom/base/nsDOMDataChannel.cpp | 2 +- dom/base/nsDOMDataChannel.h | 2 +- dom/bindings/Bindings.conf | 9 ++++----- dom/webidl/PeerConnectionImpl.webidl | 2 +- dom/webidl/PeerConnectionObserver.webidl | 2 +- .../{DataChannel.webidl => RTCDataChannel.webidl} | 5 ++--- dom/webidl/RTCDataChannelEvent.webidl | 2 -- dom/webidl/RTCPeerConnection.webidl | 2 -- dom/webidl/moz.build | 2 +- .../src/peerconnection/PeerConnectionImpl.cpp | 2 +- xpcom/reflect/xptinfo/ShimInterfaceInfo.cpp | 12 ++++++------ 11 files changed, 18 insertions(+), 24 deletions(-) rename dom/webidl/{DataChannel.webidl => RTCDataChannel.webidl} (90%) diff --git a/dom/base/nsDOMDataChannel.cpp b/dom/base/nsDOMDataChannel.cpp index 8b328439550c..b6d9d2cd9de0 100644 --- a/dom/base/nsDOMDataChannel.cpp +++ b/dom/base/nsDOMDataChannel.cpp @@ -52,7 +52,7 @@ nsDOMDataChannel::~nsDOMDataChannel() /* virtual */ JSObject* nsDOMDataChannel::WrapObject(JSContext* aCx, JS::Handle aGivenProto) { - return DataChannelBinding::Wrap(aCx, this, aGivenProto); + return RTCDataChannelBinding::Wrap(aCx, this, aGivenProto); } NS_IMPL_CYCLE_COLLECTION_CLASS(nsDOMDataChannel) diff --git a/dom/base/nsDOMDataChannel.h b/dom/base/nsDOMDataChannel.h index 81e957b019eb..c2f058624135 100644 --- a/dom/base/nsDOMDataChannel.h +++ b/dom/base/nsDOMDataChannel.h @@ -9,7 +9,7 @@ #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" diff --git a/dom/bindings/Bindings.conf b/dom/bindings/Bindings.conf index 05184526faaf..44bfe9f48a83 100644 --- a/dom/bindings/Bindings.conf +++ b/dom/bindings/Bindings.conf @@ -227,10 +227,6 @@ DOMInterfaces = { 'nativeType': 'nsDOMCSSValueList' }, -'DataChannel': { - 'nativeType': 'nsDOMDataChannel', -}, - 'DedicatedWorkerGlobalScope': { 'headerFile': 'mozilla/dom/WorkerScope.h', 'implicitJSContext': [ 'close' ], @@ -743,6 +739,10 @@ DOMInterfaces = { 'nativeType': 'nsDOMCSSRGBColor', }, +'RTCDataChannel': { + 'nativeType': 'nsDOMDataChannel', +}, + 'Screen': { 'nativeType': 'nsScreen', }, @@ -1693,7 +1693,6 @@ def addExternalIface(iface, nativeType=None, headerFile=None, 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) diff --git a/dom/webidl/PeerConnectionImpl.webidl b/dom/webidl/PeerConnectionImpl.webidl index 2e5f9b21ff11..bbef2175a579 100644 --- a/dom/webidl/PeerConnectionImpl.webidl +++ b/dom/webidl/PeerConnectionImpl.webidl @@ -126,7 +126,7 @@ interface PeerConnectionImpl { /* 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); diff --git a/dom/webidl/PeerConnectionObserver.webidl b/dom/webidl/PeerConnectionObserver.webidl index ee2773d7e2ee..c0955dd1263d 100644 --- a/dom/webidl/PeerConnectionObserver.webidl +++ b/dom/webidl/PeerConnectionObserver.webidl @@ -29,7 +29,7 @@ interface PeerConnectionObserver 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); diff --git a/dom/webidl/DataChannel.webidl b/dom/webidl/RTCDataChannel.webidl similarity index 90% rename from dom/webidl/DataChannel.webidl rename to dom/webidl/RTCDataChannel.webidl index 43955745ec08..2c5a75fc1289 100644 --- a/dom/webidl/DataChannel.webidl +++ b/dom/webidl/RTCDataChannel.webidl @@ -14,8 +14,7 @@ enum RTCDataChannelType { "blob" }; -// XXX This interface is called RTCDataChannel in the spec. -interface DataChannel : EventTarget +interface RTCDataChannel : EventTarget { readonly attribute DOMString label; readonly attribute boolean reliable; @@ -40,7 +39,7 @@ interface DataChannel : EventTarget }; // Mozilla extensions. -partial interface DataChannel +partial interface RTCDataChannel { readonly attribute DOMString protocol; readonly attribute boolean ordered; diff --git a/dom/webidl/RTCDataChannelEvent.webidl b/dom/webidl/RTCDataChannelEvent.webidl index 4c74bddb0efa..51063134ea1f 100644 --- a/dom/webidl/RTCDataChannelEvent.webidl +++ b/dom/webidl/RTCDataChannelEvent.webidl @@ -7,8 +7,6 @@ * http://dev.w3.org/2011/webrtc/editor/webrtc.html#idl-def-RTCDataChannelEvent */ -interface RTCDataChannel; - dictionary RTCDataChannelEventInit : EventInit { RTCDataChannel? channel = null; }; diff --git a/dom/webidl/RTCPeerConnection.webidl b/dom/webidl/RTCPeerConnection.webidl index 5c5c9133fa84..8b2e787feec3 100644 --- a/dom/webidl/RTCPeerConnection.webidl +++ b/dom/webidl/RTCPeerConnection.webidl @@ -73,8 +73,6 @@ dictionary RTCOfferOptions : RTCOfferAnswerOptions { boolean iceRestart = false; }; -interface RTCDataChannel; - [Pref="media.peerconnection.enabled", JSImplementation="@mozilla.org/dom/peerconnection;1", Constructor (optional RTCConfiguration configuration, diff --git a/dom/webidl/moz.build b/dom/webidl/moz.build index 19c4a973729a..5f212ba42537 100644 --- a/dom/webidl/moz.build +++ b/dom/webidl/moz.build @@ -967,13 +967,13 @@ WEBIDL_FILES = [ 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', diff --git a/media/webrtc/signaling/src/peerconnection/PeerConnectionImpl.cpp b/media/webrtc/signaling/src/peerconnection/PeerConnectionImpl.cpp index b379d3d98774..fddd14f7397a 100644 --- a/media/webrtc/signaling/src/peerconnection/PeerConnectionImpl.cpp +++ b/media/webrtc/signaling/src/peerconnection/PeerConnectionImpl.cpp @@ -90,7 +90,7 @@ #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" diff --git a/xpcom/reflect/xptinfo/ShimInterfaceInfo.cpp b/xpcom/reflect/xptinfo/ShimInterfaceInfo.cpp index 5a2034893b25..d8f2c73c1e4c 100644 --- a/xpcom/reflect/xptinfo/ShimInterfaceInfo.cpp +++ b/xpcom/reflect/xptinfo/ShimInterfaceInfo.cpp @@ -74,9 +74,6 @@ #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" @@ -115,6 +112,9 @@ #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" @@ -198,9 +198,6 @@ const ComponentsInterfaceShimEntry kComponentsInterfaceShimMap[] = 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), @@ -231,6 +228,9 @@ const ComponentsInterfaceShimEntry kComponentsInterfaceShimMap[] = 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),