Bug 1464917 - Add maxPacketLifeTime and maxRetransmits to RTCDatachannel.webidl; r?baku draft
authorDan Minor <dminor@mozilla.com>
Thu, 31 May 2018 12:50:55 -0400
changeset 802798 7d3f3515c8ec
parent 802797 032aa6eef17d
child 802799 4bb24eb81367
child 802884 706ec4e3b843
push id111963
push userbmo:dminor@mozilla.com
push dateFri, 01 Jun 2018 13:44:22 +0000
reviewersbaku
bugs1464917
milestone62.0a1
Bug 1464917 - Add maxPacketLifeTime and maxRetransmits to RTCDatachannel.webidl; r?baku MozReview-Commit-ID: C7PagcoW7Xi
dom/base/nsDOMDataChannel.cpp
dom/base/nsDOMDataChannel.h
dom/webidl/RTCDataChannel.webidl
--- a/dom/base/nsDOMDataChannel.cpp
+++ b/dom/base/nsDOMDataChannel.cpp
@@ -131,16 +131,28 @@ nsDOMDataChannel::Id() const
 
 // XXX should be GetType()?  Open question for the spec
 bool
 nsDOMDataChannel::Reliable() const
 {
   return mDataChannel->GetType() == mozilla::DataChannelConnection::RELIABLE;
 }
 
+mozilla::dom::Nullable<uint16_t>
+nsDOMDataChannel::GetMaxPacketLifeTime() const
+{
+  return mozilla::dom::Nullable<uint16_t>();
+}
+
+mozilla::dom::Nullable<uint16_t>
+nsDOMDataChannel::GetMaxRetransmits() const
+{
+  return mozilla::dom::Nullable<uint16_t>();
+}
+
 bool
 nsDOMDataChannel::Ordered() const
 {
   return mDataChannel->GetOrdered();
 }
 
 RTCDataChannelState
 nsDOMDataChannel::ReadyState() const
--- a/dom/base/nsDOMDataChannel.h
+++ b/dom/base/nsDOMDataChannel.h
@@ -50,16 +50,18 @@ public:
   {
     return GetOwner();
   }
 
   // WebIDL
   void GetLabel(nsAString& aLabel);
   void GetProtocol(nsAString& aProtocol);
   bool Reliable() const;
+  mozilla::dom::Nullable<uint16_t> GetMaxPacketLifeTime() const;
+  mozilla::dom::Nullable<uint16_t> GetMaxRetransmits() const;
   mozilla::dom::RTCDataChannelState ReadyState() const;
   uint32_t BufferedAmount() const;
   uint32_t BufferedAmountLowThreshold() const;
   void SetBufferedAmountLowThreshold(uint32_t aThreshold);
   IMPL_EVENT_HANDLER(open)
   IMPL_EVENT_HANDLER(error)
   IMPL_EVENT_HANDLER(close)
   void Close();
--- a/dom/webidl/RTCDataChannel.webidl
+++ b/dom/webidl/RTCDataChannel.webidl
@@ -13,16 +13,18 @@ enum RTCDataChannelType {
   "arraybuffer",
   "blob"
 };
 
 interface RTCDataChannel : EventTarget
 {
   readonly attribute DOMString label;
   readonly attribute boolean reliable;
+  readonly attribute unsigned short? maxPacketLifeTime;
+  readonly attribute unsigned short? maxRetransmits;
   readonly attribute RTCDataChannelState readyState;
   readonly attribute unsigned long bufferedAmount;
   attribute unsigned long bufferedAmountLowThreshold;
   attribute EventHandler onopen;
   attribute EventHandler onerror;
   attribute EventHandler onclose;
   void close();
   attribute EventHandler onmessage;