Bug 1453795 - WebRTC/Signaling - Initialize member fields in classes/ structures. r=jesup
authorAndi-Bogdan Postelnicu <bpostelnicu@mozilla.com>
Fri, 15 Jun 2018 18:36:21 +0300
changeset 479415 485b3efd9ea89580be685757a783730e2589c0d4
parent 479414 87163f9d6bc7670d074512cf96062ea01193ffb2
child 479416 3bd8839fdafacfdc8c1d2c6c4b01a1722817ff2f
push id1757
push userffxbld-merge
push dateFri, 24 Aug 2018 17:02:43 +0000
treeherdermozilla-release@736023aebdb1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjesup
bugs1453795
milestone62.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 1453795 - WebRTC/Signaling - Initialize member fields in classes/ structures. r=jesup
media/webrtc/signaling/gtest/sdp_unittests.cpp
media/webrtc/signaling/src/jsep/JsepCodecDescription.h
media/webrtc/signaling/src/jsep/JsepSessionImpl.h
media/webrtc/signaling/src/media-conduit/RtpSourceObserver.cpp
media/webrtc/signaling/src/media-conduit/RunningStat.h
media/webrtc/signaling/src/media-conduit/WebrtcGmpVideoCodec.cpp
media/webrtc/signaling/src/media-conduit/WebrtcMediaDataDecoderCodec.cpp
media/webrtc/signaling/src/mediapipeline/MediaPipeline.cpp
media/webrtc/signaling/src/peerconnection/PeerConnectionImpl.cpp
media/webrtc/signaling/src/sdp/SipccSdpMediaSection.h
--- a/media/webrtc/signaling/gtest/sdp_unittests.cpp
+++ b/media/webrtc/signaling/gtest/sdp_unittests.cpp
@@ -36,17 +36,19 @@ extern "C" {
 #define SKIP_TEST_WITH_RUST_PARSER if (!::testing::get<1>(GetParam())) {return;}
 
 using namespace mozilla;
 
 namespace test {
 
 class SdpTest : public ::testing::Test {
   public:
-    SdpTest() : sdp_ptr_(nullptr) {
+    SdpTest()
+      : final_level_(0)
+      , sdp_ptr_(nullptr) {
     }
 
     ~SdpTest() {
       sdp_free_description(sdp_ptr_);
     }
 
     static void SetUpTestCase() {
       NSS_NoDB_Init(nullptr);
@@ -1501,17 +1503,18 @@ TEST_F(SdpTest, parseIceLite) {
   ASSERT_TRUE(sdp_attr_is_present(sdp_ptr_, SDP_ATTR_ICE_LITE,
                                   SDP_SESSION_LEVEL, 0));
 }
 
 class NewSdpTest : public ::testing::Test,
                    public ::testing::WithParamInterface<
                      ::testing::tuple<bool, bool> > {
   public:
-    NewSdpTest() {}
+    NewSdpTest() : mSdpErrorHolder(nullptr) {
+    }
 
     void ParseSdp(const std::string &sdp, bool expectSuccess = true) {
       if (::testing::get<1>(GetParam())) {
         mSdpErrorHolder = &mSipccParser;
         mSdp = mSipccParser.Parse(sdp);
       } else {
         mSdpErrorHolder = &mRustParser;
         mSdp = mRustParser.Parse(sdp);
--- a/media/webrtc/signaling/src/jsep/JsepCodecDescription.h
+++ b/media/webrtc/signaling/src/jsep/JsepCodecDescription.h
@@ -231,16 +231,19 @@ class JsepVideoCodecDescription : public
                             const std::string& name,
                             uint32_t clock,
                             bool enabled = true)
       : JsepCodecDescription(mozilla::SdpMediaSection::kVideo, defaultPt, name,
                              clock, 0, enabled),
         mTmmbrEnabled(false),
         mRembEnabled(false),
         mFECEnabled(false),
+        mREDPayloadType(0),
+        mULPFECPayloadType(0),
+        mProfileLevelId(0),
         mPacketizationMode(0)
   {
     // Add supported rtcp-fb types
     mNackFbTypes.push_back("");
     mNackFbTypes.push_back(SdpRtcpFbAttributeList::pli);
     mCcmFbTypes.push_back(SdpRtcpFbAttributeList::fir);
   }
 
@@ -758,17 +761,18 @@ class JsepApplicationCodecDescription : 
                                   uint16_t localPort,
                                   uint32_t localMaxMessageSize,
                                   bool enabled = true)
       : JsepCodecDescription(mozilla::SdpMediaSection::kApplication, "",
                              name, 0, channels, enabled),
         mLocalPort(localPort),
         mLocalMaxMessageSize(localMaxMessageSize),
         mRemotePort(0),
-        mRemoteMaxMessageSize(0)
+        mRemoteMaxMessageSize(0),
+        mRemoteMMSSet(false)
   {
   }
 
   JSEP_CODEC_CLONE(JsepApplicationCodecDescription)
 
   // Override, uses sctpport or sctpmap instead of rtpmap
   virtual bool
   Matches(const std::string& fmt,
--- a/media/webrtc/signaling/src/jsep/JsepSessionImpl.h
+++ b/media/webrtc/signaling/src/jsep/JsepSessionImpl.h
@@ -38,17 +38,18 @@ public:
         mIceControlling(false),
         mLocalIceIsRestarting(false),
         mRemoteIsIceLite(false),
         mRemoteIceIsRestarting(false),
         mBundlePolicy(kBundleBalanced),
         mSessionId(0),
         mSessionVersion(0),
         mUuidGen(std::move(uuidgen)),
-        mSdpHelper(&mLastError)
+        mSdpHelper(&mLastError),
+        mRunRustParser(false)
   {
   }
 
   // Implement JsepSession methods.
   virtual nsresult Init() override;
 
   virtual nsresult SetIceCredentials(const std::string& ufrag,
                                      const std::string& pwd) override;
--- a/media/webrtc/signaling/src/media-conduit/RtpSourceObserver.cpp
+++ b/media/webrtc/signaling/src/media-conduit/RtpSourceObserver.cpp
@@ -14,16 +14,17 @@ RtpSourceObserver::RtpSourceEntry::ToLin
   if (audioLevel == 127) {
     return 0;
   }
   // All other values are calculated as 10^(-rfc_level/20)
   return std::pow(10, -static_cast<double>(audioLevel) / 20);
 }
 
 RtpSourceObserver::RtpSourceObserver() :
+  mMaxJitterWindow(0),
   mLevelGuard("RtpSourceObserver::mLevelGuard") {}
 
 void
 RtpSourceObserver::OnRtpPacket(const webrtc::WebRtcRTPHeader* aHeader,
                                      const int64_t aTimestamp,
                                      const uint32_t aJitter)
 {
   auto& header = aHeader->header;
--- a/media/webrtc/signaling/src/media-conduit/RunningStat.h
+++ b/media/webrtc/signaling/src/media-conduit/RunningStat.h
@@ -7,17 +7,24 @@
 #define RUNNING_STAT_H_
 #include <math.h>
 
 namespace mozilla {
 
 class RunningStat
 {
 public:
-  RunningStat() : mN(0) {}
+  RunningStat()
+    : mN(0)
+    , mOldM(0.0)
+    , mNewM(0.0)
+    , mOldS(0.0)
+    , mNewS(0.0)
+  {
+  }
 
   void Clear()
   {
     mN = 0;
   }
 
   void Push(double x)
   {
--- a/media/webrtc/signaling/src/media-conduit/WebrtcGmpVideoCodec.cpp
+++ b/media/webrtc/signaling/src/media-conduit/WebrtcGmpVideoCodec.cpp
@@ -75,16 +75,30 @@ WebrtcGmpVideoEncoder::WebrtcGmpVideoEnc
   : mGMP(nullptr)
   , mInitting(false)
   , mHost(nullptr)
   , mMaxPayloadSize(0)
   , mCallbackMutex("WebrtcGmpVideoEncoder encoded callback mutex")
   , mCallback(nullptr)
   , mCachedPluginId(0)
 {
+  mCodecParams.mGMPApiVersion = 0;
+  mCodecParams.mCodecType = kGMPVideoCodecInvalid;
+  mCodecParams.mPLType = 0;
+  mCodecParams.mWidth = 0;
+  mCodecParams.mHeight = 0;
+  mCodecParams.mStartBitrate = 0;
+  mCodecParams.mMaxBitrate = 0;
+  mCodecParams.mMinBitrate = 0;
+  mCodecParams.mMaxFramerate = 0;
+  mCodecParams.mFrameDroppingOn = false;
+  mCodecParams.mKeyFrameInterval = 0;
+  mCodecParams.mQPMax = 0;
+  mCodecParams.mNumberOfSimulcastStreams = 0;
+  mCodecParams.mMode = kGMPCodecModeInvalid;
   if (mPCHandle.empty()) {
     mPCHandle = WebrtcGmpPCHandleSetter::GetCurrentHandle();
   }
   MOZ_ASSERT(!mPCHandle.empty());
 }
 
 WebrtcGmpVideoEncoder::~WebrtcGmpVideoEncoder()
 {
--- a/media/webrtc/signaling/src/media-conduit/WebrtcMediaDataDecoderCodec.cpp
+++ b/media/webrtc/signaling/src/media-conduit/WebrtcMediaDataDecoderCodec.cpp
@@ -15,16 +15,17 @@ namespace mozilla {
 
 WebrtcMediaDataDecoder::WebrtcMediaDataDecoder()
   : mThreadPool(GetMediaThreadPool(MediaThreadType::PLATFORM_DECODER))
   , mTaskQueue(new TaskQueue(do_AddRef(mThreadPool),
                              "WebrtcMediaDataDecoder::mTaskQueue"))
   , mImageContainer(layers::LayerManager::CreateImageContainer(
       layers::ImageContainer::ASYNCHRONOUS))
   , mFactory(new PDMFactory())
+  , mTrackType(TrackInfo::kUndefinedTrack)
 {
 }
 
 WebrtcMediaDataDecoder::~WebrtcMediaDataDecoder()
 {
   mTaskQueue->BeginShutdown();
   mTaskQueue->AwaitShutdownAndIdle();
 }
--- a/media/webrtc/signaling/src/mediapipeline/MediaPipeline.cpp
+++ b/media/webrtc/signaling/src/mediapipeline/MediaPipeline.cpp
@@ -2170,16 +2170,18 @@ MediaPipelineReceiveAudio::OnRtpPacketRe
 }
 
 class MediaPipelineReceiveVideo::PipelineListener
   : public GenericReceiveListener
 {
 public:
   explicit PipelineListener(dom::MediaStreamTrack* aTrack)
     : GenericReceiveListener(aTrack)
+    , mWidth(0)
+    , mHeight(0)
     , mImageContainer(
         LayerManager::CreateImageContainer(ImageContainer::ASYNCHRONOUS))
     , mMutex("Video PipelineListener")
   {
     AddTrackToSource();
   }
 
   // Implement MediaStreamListener
--- a/media/webrtc/signaling/src/peerconnection/PeerConnectionImpl.cpp
+++ b/media/webrtc/signaling/src/peerconnection/PeerConnectionImpl.cpp
@@ -231,17 +231,18 @@ struct nsISupportsWeakReference::COMType
 };
 const nsIID nsISupportsWeakReference::COMTypeInfo<nsSupportsWeakReference, void>::kIID = NS_ISUPPORTSWEAKREFERENCE_IID;
 
 namespace mozilla {
 
 RTCStatsQuery::RTCStatsQuery(bool internal) :
   failed(false),
   internalStats(internal),
-  grabAllLevels(false) {
+  grabAllLevels(false),
+  now(0.0) {
 }
 
 RTCStatsQuery::~RTCStatsQuery() {
   MOZ_ASSERT(NS_IsMainThread());
 }
 
 
 NS_IMPL_ISUPPORTS0(PeerConnectionImpl)
@@ -334,16 +335,19 @@ PeerConnectionImpl::PeerConnectionImpl(c
   , mHaveConfiguredCodecs(false)
   , mHaveDataStream(false)
   , mAddCandidateErrorCount(0)
   , mTrickle(true) // TODO(ekr@rtfm.com): Use pref
   , mPrivateWindow(false)
   , mActiveOnWindow(false)
   , mPacketDumpEnabled(false)
   , mPacketDumpFlagsMutex("Packet dump flags mutex")
+  , listenPort(0)
+  , connectPort(0)
+  , connectStr(nullptr)
 {
   MOZ_ASSERT(NS_IsMainThread());
   auto log = RLogConnector::CreateInstance();
   if (aGlobal) {
     mWindow = do_QueryInterface(aGlobal->GetAsSupports());
     if (IsPrivateBrowsing(mWindow)) {
       mPrivateWindow = true;
       log->EnterPrivateMode();
--- a/media/webrtc/signaling/src/sdp/SipccSdpMediaSection.h
+++ b/media/webrtc/signaling/src/sdp/SipccSdpMediaSection.h
@@ -63,17 +63,22 @@ public:
 
   virtual void AddDataChannel(const std::string& name, uint16_t port,
                               uint16_t streams, uint32_t message_size) override;
 
   virtual void Serialize(std::ostream&) const override;
 
 private:
   SipccSdpMediaSection(size_t level, const SipccSdpAttributeList* sessionLevel)
-      : SdpMediaSection(level), mAttributeList(sessionLevel)
+      : SdpMediaSection(level),
+        mMediaType(static_cast<MediaType>(0)),
+        mPort(0),
+        mPortCount(0),
+        mProtocol(static_cast<Protocol>(0)),
+        mAttributeList(sessionLevel)
   {
   }
 
   bool Load(sdp_t* sdp, uint16_t level, SdpErrorHolder& errorHolder);
   bool LoadConnection(sdp_t* sdp, uint16_t level, SdpErrorHolder& errorHolder);
   bool LoadProtocol(sdp_t* sdp, uint16_t level, SdpErrorHolder& errorHolder);
   bool LoadFormats(sdp_t* sdp, uint16_t level, SdpErrorHolder& errorHolder);
   bool ValidateSimulcast(sdp_t* sdp, uint16_t level,