Bug 1531904 - Part 2: Keep up with webidl changes in part 1. r=smaug,jib
authorByron Campen [:bwc] <docfaraday@gmail.com>
Tue, 16 Apr 2019 16:38:23 +0000
changeset 469707 08102fb37153
parent 469706 86d62da0f2a8
child 469708 3e57d6dc64b2
push id35879
push usernerli@mozilla.com
push dateTue, 16 Apr 2019 22:01:48 +0000
treeherdermozilla-central@12a60898fdc1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssmaug, jib
bugs1531904
milestone68.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1531904 - Part 2: Keep up with webidl changes in part 1. r=smaug,jib Differential Revision: https://phabricator.services.mozilla.com/D26771
dom/base/nsDOMDataChannel.cpp
dom/base/nsDOMDataChannel.h
--- a/dom/base/nsDOMDataChannel.cpp
+++ b/dom/base/nsDOMDataChannel.cpp
@@ -114,17 +114,23 @@ nsresult nsDOMDataChannel::Init(nsPIDOMW
 void nsDOMDataChannel::GetLabel(nsAString& aLabel) {
   mDataChannel->GetLabel(aLabel);
 }
 
 void nsDOMDataChannel::GetProtocol(nsAString& aProtocol) {
   mDataChannel->GetProtocol(aProtocol);
 }
 
-uint16_t nsDOMDataChannel::Id() const { return mDataChannel->GetStream(); }
+mozilla::dom::Nullable<uint16_t> nsDOMDataChannel::GetId() const {
+  mozilla::dom::Nullable<uint16_t> result = mDataChannel->GetStream();
+  if (result.Value() == 65535) {
+    result.SetNull();
+  }
+  return result;
+}
 
 // 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 {
--- a/dom/base/nsDOMDataChannel.h
+++ b/dom/base/nsDOMDataChannel.h
@@ -71,17 +71,17 @@ class nsDOMDataChannel final : public mo
   }
   void Send(const nsAString& aData, mozilla::ErrorResult& aRv);
   void Send(mozilla::dom::Blob& aData, mozilla::ErrorResult& aRv);
   void Send(const mozilla::dom::ArrayBuffer& aData, mozilla::ErrorResult& aRv);
   void Send(const mozilla::dom::ArrayBufferView& aData,
             mozilla::ErrorResult& aRv);
 
   bool Ordered() const;
-  uint16_t Id() const;
+  mozilla::dom::Nullable<uint16_t> GetId() const;
 
   nsresult DoOnMessageAvailable(const nsACString& aMessage, bool aBinary);
 
   virtual nsresult OnMessageAvailable(nsISupports* aContext,
                                       const nsACString& aMessage) override;
 
   virtual nsresult OnBinaryMessageAvailable(
       nsISupports* aContext, const nsACString& aMessage) override;