Bug 1554976 - Copy actual address to CandidateInfo in MediaTransportHandler; r=mjf
authorDan Minor <dminor@mozilla.com>
Wed, 28 Aug 2019 19:49:36 +0000
changeset 551123 fd061900910bb5cbd2b9fe58103de3926a7ac827
parent 551122 3356f4e4828e6b171b67686bcebaf2c83b5a6fac
child 551124 841a7ca50a14d523ce88999fbb493ba1dd7a874d
push id11865
push userbtara@mozilla.com
push dateMon, 02 Sep 2019 08:54:37 +0000
treeherdermozilla-beta@37f59c4671b3 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmjf
bugs1554976
milestone70.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 1554976 - Copy actual address to CandidateInfo in MediaTransportHandler; r=mjf Differential Revision: https://phabricator.services.mozilla.com/D38494
dom/media/webrtc/WebrtcIPCTraits.h
media/webrtc/signaling/src/common/CandidateInfo.h
media/webrtc/signaling/src/peerconnection/MediaTransportHandler.cpp
--- a/dom/media/webrtc/WebrtcIPCTraits.h
+++ b/dom/media/webrtc/WebrtcIPCTraits.h
@@ -153,15 +153,16 @@ static bool ReadParams(const Message* aM
     }                                                                        \
   };
 
 DEFINE_IPC_SERIALIZER_WITH_FIELDS(mozilla::dom::RTCIceServer, mCredential,
                                   mCredentialType, mUrl, mUrls, mUsername)
 
 DEFINE_IPC_SERIALIZER_WITH_FIELDS(mozilla::CandidateInfo, mCandidate, mUfrag,
                                   mDefaultHostRtp, mDefaultPortRtp,
-                                  mDefaultHostRtcp, mDefaultPortRtcp)
+                                  mDefaultHostRtcp, mDefaultPortRtcp,
+                                  mMDNSAddress, mActualAddress)
 
 DEFINE_IPC_SERIALIZER_WITH_FIELDS(mozilla::DtlsDigest, algorithm_, value_)
 
 }  // namespace IPC
 
 #endif  // _WEBRTC_IPC_TRAITS_H_
--- a/media/webrtc/signaling/src/common/CandidateInfo.h
+++ b/media/webrtc/signaling/src/common/CandidateInfo.h
@@ -8,16 +8,18 @@
 #include <string>
 #include <cstdint>
 
 namespace mozilla {
 
 // This is used both by IPDL code, and by signaling code.
 struct CandidateInfo {
   std::string mCandidate;
+  std::string mMDNSAddress;
+  std::string mActualAddress;
   std::string mUfrag;
   std::string mDefaultHostRtp;
   uint16_t mDefaultPortRtp = 0;
   std::string mDefaultHostRtcp;
   uint16_t mDefaultPortRtcp = 0;
 };
 
 }  // namespace mozilla
--- a/media/webrtc/signaling/src/peerconnection/MediaTransportHandler.cpp
+++ b/media/webrtc/signaling/src/peerconnection/MediaTransportHandler.cpp
@@ -142,17 +142,18 @@ class MediaTransportHandlerSTS : public 
   using MediaTransportHandler::OnStateChange;
 
   void OnGatheringStateChange(NrIceCtx* aIceCtx,
                               NrIceCtx::GatheringState aState);
   void OnConnectionStateChange(NrIceCtx* aIceCtx,
                                NrIceCtx::ConnectionState aState);
   void OnCandidateFound(NrIceMediaStream* aStream,
                         const std::string& aCandidate,
-                        const std::string& aUfrag);
+                        const std::string& aUfrag, const std::string& aMDNSAddr,
+                        const std::string& aActualAddr);
   void OnStateChange(TransportLayer* aLayer, TransportLayer::State);
   void OnRtcpStateChange(TransportLayer* aLayer, TransportLayer::State);
   void PacketReceived(TransportLayer* aLayer, MediaPacket& aPacket);
   void EncryptedPacketSending(TransportLayer* aLayer, MediaPacket& aPacket);
   RefPtr<TransportFlow> GetTransportFlow(const std::string& aTransportId,
                                          bool aIsRtcp) const;
   void GetIceStats(const NrIceMediaStream& aStream, DOMHighResTimeStamp aNow,
                    dom::RTCStatsReportInternal* aReport) const;
@@ -1352,19 +1353,20 @@ static mozilla::dom::RTCIceConnectionSta
 }
 
 void MediaTransportHandlerSTS::OnConnectionStateChange(
     NrIceCtx* aIceCtx, NrIceCtx::ConnectionState aState) {
   OnConnectionStateChange(toDomIceConnectionState(aState));
 }
 
 // The stuff below here will eventually go into the MediaTransportChild class
-void MediaTransportHandlerSTS::OnCandidateFound(NrIceMediaStream* aStream,
-                                                const std::string& aCandidate,
-                                                const std::string& aUfrag) {
+void MediaTransportHandlerSTS::OnCandidateFound(
+    NrIceMediaStream* aStream, const std::string& aCandidate,
+    const std::string& aUfrag, const std::string& aMDNSAddr,
+    const std::string& aActualAddr) {
   CandidateInfo info;
   info.mCandidate = aCandidate;
   MOZ_ASSERT(!aUfrag.empty());
   info.mUfrag = aUfrag;
   NrIceCandidate defaultRtpCandidate;
   NrIceCandidate defaultRtcpCandidate;
   nsresult rv = aStream->GetDefaultCandidate(1, &defaultRtpCandidate);
   if (NS_SUCCEEDED(rv)) {
@@ -1379,16 +1381,19 @@ void MediaTransportHandlerSTS::OnCandida
   }
 
   // Optional; component won't exist if doing rtcp-mux
   if (NS_SUCCEEDED(aStream->GetDefaultCandidate(2, &defaultRtcpCandidate))) {
     info.mDefaultHostRtcp = defaultRtcpCandidate.cand_addr.host;
     info.mDefaultPortRtcp = defaultRtcpCandidate.cand_addr.port;
   }
 
+  info.mMDNSAddress = aMDNSAddr;
+  info.mActualAddress = aActualAddr;
+
   OnCandidate(aStream->GetId(), info);
 }
 
 void MediaTransportHandlerSTS::OnStateChange(TransportLayer* aLayer,
                                              TransportLayer::State aState) {
   if (aState == TransportLayer::TS_OPEN) {
     MOZ_ASSERT(aLayer->id() == TransportLayerDtls::ID());
     TransportLayerDtls* dtlsLayer = static_cast<TransportLayerDtls*>(aLayer);