Skip to content

Commit

Permalink
Merge pull request #29 from ekr/other_compile_fixes
Browse files Browse the repository at this point in the history
Clean up some other scary stuff
  • Loading branch information
martinthomson committed Sep 18, 2014
2 parents c097fea + 7a616b1 commit 6efd986
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 10 deletions.
13 changes: 9 additions & 4 deletions media/webrtc/signaling/src/sdp/SipccSdp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@

namespace mozilla {

SipccSdp::~SipccSdp() {
for (auto i = mMediaSections.begin(); i != mMediaSections.end(); ++i) {
delete *i;
}
}

const Maybe<std::string>&
SipccSdp::GetBandwidth(const std::string& type) const {
Expand All @@ -23,7 +28,7 @@ SipccSdp::GetMediaSection(uint16_t level) const
if (level > mMediaSections.size()) {
MOZ_CRASH();
}
return mMediaSections[level];
return *mMediaSections[level];
}

SdpMediaSection&
Expand All @@ -32,7 +37,7 @@ SipccSdp::GetMediaSection(uint16_t level)
if (level > mMediaSections.size()) {
MOZ_CRASH();
}
return mMediaSections[level];
return *mMediaSections[level];
}

void
Expand All @@ -44,8 +49,8 @@ SipccSdp::Load(sdp_t* sdp) {
for (int i = 0; i < sdp_get_num_media_lines(sdp); ++i) {
// note that we pass a "level" here that is one higher
// sipcc counts media sections from 1, using 0 as the "session"
SipccSdpMediaSection section();
section.Load(sdp, i + 1);
SipccSdpMediaSection* section = new SipccSdpMediaSection();
section->Load(sdp, i + 1);
mMediaSections.push_back(section);
}
}
Expand Down
4 changes: 2 additions & 2 deletions media/webrtc/signaling/src/sdp/SipccSdp.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class SipccSdp MOZ_FINAL : public Sdp
{
friend class SipccSdpParser;
public:
~SipccSdp() {}
~SipccSdp();

virtual const SdpOrigin& GetOrigin() const MOZ_OVERRIDE {
return *mOrigin;
Expand Down Expand Up @@ -62,7 +62,7 @@ class SipccSdp MOZ_FINAL : public Sdp

void Load(sdp_t* sdp);

std::vector<SipccSdpMediaSection> mMediaSections;
std::vector<SipccSdpMediaSection*> mMediaSections;
SipccSdpAttributeList mAttributeList;
std::map<std::string, std::string> mBandwidths;
std::string mSessionName;
Expand Down
6 changes: 3 additions & 3 deletions media/webrtc/signaling/src/sdp/SipccSdpAttributeList.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

namespace mozilla {

unsigned int
size_t
SipccSdpAttributeList::CountAttributes(AttributeType type) const {
return 0;
}
Expand All @@ -20,7 +20,7 @@ SipccSdpAttributeList::HasAttribute(AttributeType type) const {
return false;
}

const Maybe<SdpAttribute>
const SdpAttribute&
SipccSdpAttributeList::GetAttribute(AttributeType type, size_t index) const {
return Nothing();
}
Expand Down Expand Up @@ -80,7 +80,7 @@ SipccSdpAttributeList::GetImageattr() const {
MOZ_CRASH();;
}

std::string
const std::string&
SipccSdpAttributeList::GetLabel() const {
return "";
}
Expand Down
2 changes: 1 addition & 1 deletion media/webrtc/signaling/src/sdp/SipccSdpMediaSection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ SipccSdpMediaSection::GetPortCount() const {
return mPortCount;
}

Protocol
SdpMediaSection::Protocol
SipccSdpMediaSection::GetProtocol() const {
return mProtocol;
}
Expand Down

0 comments on commit 6efd986

Please sign in to comment.