From 1f9dd80243427dab53cbe57245c952a7afae3c57 Mon Sep 17 00:00:00 2001 From: Byron Campen Date: Wed, 17 Sep 2014 18:02:27 -0700 Subject: [PATCH] Compiles and links. --- media/webrtc/signaling/src/sdp/Sdp.h | 3 +-- media/webrtc/signaling/src/sdp/SdpAttribute.h | 4 +--- media/webrtc/signaling/src/sdp/SipccSdp.cpp | 2 +- media/webrtc/signaling/src/sdp/SipccSdp.h | 4 +++- media/webrtc/signaling/src/sdp/SipccSdpAttributeList.h | 1 + media/webrtc/signaling/src/sdp/SipccSdpMediaSection.h | 3 ++- media/webrtc/signaling/src/sdp/SipccSdpParser.h | 4 ++-- media/webrtc/signaling/test/sdp_unittests.cpp | 8 ++++---- 8 files changed, 15 insertions(+), 14 deletions(-) diff --git a/media/webrtc/signaling/src/sdp/Sdp.h b/media/webrtc/signaling/src/sdp/Sdp.h index 06b4e9b34e328..76a151b985bfa 100644 --- a/media/webrtc/signaling/src/sdp/Sdp.h +++ b/media/webrtc/signaling/src/sdp/Sdp.h @@ -25,7 +25,7 @@ class SdpMediaSection; class Sdp { public: - Sdp(); + Sdp() {}; virtual SdpOrigin GetOrigin() const = 0; virtual std::string GetSessionName() const = 0; @@ -39,7 +39,6 @@ class Sdp virtual const SdpMediaSection &GetMediaSection(uint16_t level) const = 0; virtual SdpMediaSection &GetMediaSection(uint16_t level) = 0; -protected: virtual ~Sdp() {}; }; diff --git a/media/webrtc/signaling/src/sdp/SdpAttribute.h b/media/webrtc/signaling/src/sdp/SdpAttribute.h index 533f879b4ce26..b09f167924cc2 100644 --- a/media/webrtc/signaling/src/sdp/SdpAttribute.h +++ b/media/webrtc/signaling/src/sdp/SdpAttribute.h @@ -19,6 +19,7 @@ class SdpAttribute public: SdpAttribute(sdp::AttributeType type, std::string typeName) : mType(type), mTypeName(typeName) {} + virtual ~SdpAttribute() {} virtual sdp::AttributeType GetType() { @@ -30,9 +31,6 @@ class SdpAttribute return mTypeName; } -protected: - virtual ~SdpAttribute() {} - private: sdp::AttributeType mType; std::string mTypeName; diff --git a/media/webrtc/signaling/src/sdp/SipccSdp.cpp b/media/webrtc/signaling/src/sdp/SipccSdp.cpp index 2f4b967c4f1f5..95697b10209c3 100644 --- a/media/webrtc/signaling/src/sdp/SipccSdp.cpp +++ b/media/webrtc/signaling/src/sdp/SipccSdp.cpp @@ -19,7 +19,7 @@ SipccSdp::GetSessionName() const { } Maybe -SipccSdp::GetBandwidth(std::string type) const { +SipccSdp::GetBandwidth(const std::string& type) const { return Maybe(); } diff --git a/media/webrtc/signaling/src/sdp/SipccSdp.h b/media/webrtc/signaling/src/sdp/SipccSdp.h index 6742002d2cef9..d56df37f1c4c4 100644 --- a/media/webrtc/signaling/src/sdp/SipccSdp.h +++ b/media/webrtc/signaling/src/sdp/SipccSdp.h @@ -54,7 +54,9 @@ class SipccSdp MOZ_FINAL : public Sdp virtual SdpMediaSection &GetMediaSection(uint16_t level) MOZ_OVERRIDE; private: - SipccSdp(sdp_t* sdp) : mSdp(sdp) {} + explicit SipccSdp(sdp_t* sdp) : + mSdp(sdp), + mAttributeList(sdp, 0) {} void Load(); diff --git a/media/webrtc/signaling/src/sdp/SipccSdpAttributeList.h b/media/webrtc/signaling/src/sdp/SipccSdpAttributeList.h index 5bf30e0895889..6047b86681e4d 100644 --- a/media/webrtc/signaling/src/sdp/SipccSdpAttributeList.h +++ b/media/webrtc/signaling/src/sdp/SipccSdpAttributeList.h @@ -19,6 +19,7 @@ class SipccSdpMediaSection; class SipccSdpAttributeList : public SdpAttributeList { friend class SipccSdpMediaSection; + friend class SipccSdp; public: virtual unsigned int CountAttributes(sdp::AttributeType type) const MOZ_OVERRIDE; virtual bool HasAttribute(sdp::AttributeType type) const MOZ_OVERRIDE; diff --git a/media/webrtc/signaling/src/sdp/SipccSdpMediaSection.h b/media/webrtc/signaling/src/sdp/SipccSdpMediaSection.h index c08d26a079c56..0864191c0b516 100644 --- a/media/webrtc/signaling/src/sdp/SipccSdpMediaSection.h +++ b/media/webrtc/signaling/src/sdp/SipccSdpMediaSection.h @@ -24,6 +24,8 @@ class SipccSdpMediaSection MOZ_FINAL : public SdpMediaSection { friend class SipccSdp; public: + ~SipccSdpMediaSection() {} + virtual sdp::MediaType GetMediaType() const MOZ_OVERRIDE { @@ -46,7 +48,6 @@ class SipccSdpMediaSection MOZ_FINAL : public SdpMediaSection mLevel(level), mAttributes(sdp, level), mConnection(sdp::kInternet, sdp::kIPv4, "0.0.0.0") {} - ~SipccSdpMediaSection() {} void Load(); diff --git a/media/webrtc/signaling/src/sdp/SipccSdpParser.h b/media/webrtc/signaling/src/sdp/SipccSdpParser.h index 6593a715ba64c..6037aca4e16ce 100644 --- a/media/webrtc/signaling/src/sdp/SipccSdpParser.h +++ b/media/webrtc/signaling/src/sdp/SipccSdpParser.h @@ -34,11 +34,11 @@ class SipccSdpParser * Returns a reference to the list of parse errors. * This gets cleared out when you call Parse. */ - const std::vector >& + const std::vector >& GetParseErrors() const { return mErrors; } private: - std::vector > mErrors; + std::vector > mErrors; }; } // namespace mozilla diff --git a/media/webrtc/signaling/test/sdp_unittests.cpp b/media/webrtc/signaling/test/sdp_unittests.cpp index 94f244d0067fa..6daba2e81ecd4 100644 --- a/media/webrtc/signaling/test/sdp_unittests.cpp +++ b/media/webrtc/signaling/test/sdp_unittests.cpp @@ -105,13 +105,13 @@ class SdpTest : public ::testing::Test { if (!sdp_ptr_) { sdp_free_description(sdp_ptr_); } - sdp_ptr_ = sdp_init_description("BogusPeerConnectionId", config_p_); + sdp_ptr_ = sdp_init_description(config_p_); } void ParseSdp(const std::string &sdp_str) { - char *bufp = const_cast(sdp_str.data()); + const char *buf = sdp_str.data(); ResetSdp(); - ASSERT_EQ(sdp_parse(sdp_ptr_, &bufp, sdp_str.size()), SDP_SUCCESS); + ASSERT_EQ(sdp_parse(sdp_ptr_, buf, sdp_str.size()), SDP_SUCCESS); } void InitLocalSdp() { @@ -246,7 +246,7 @@ class SdpTest : public ::testing::Test { protected: int final_level_; - void *config_p_; + sdp_conf_options_t *config_p_; sdp_t *sdp_ptr_; };