Remove deprecated "description" field of cricket::ContentInfo

Bug: webrtc:10701
Change-Id: I631616fefb59b49603e0a98267b3e58d93edfb50
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/169122
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30628}
This commit is contained in:
Harald Alvestrand
2020-02-26 09:32:30 +01:00
committed by Commit Bot
parent c93595b4b9
commit 8e7d4bfeef
2 changed files with 1 additions and 30 deletions

View File

@ -262,13 +262,6 @@ const ContentGroup* SessionDescription::GetGroupByName(
} }
ContentInfo::~ContentInfo() { ContentInfo::~ContentInfo() {
if (description_ && description_.get() != description) {
// If description_ is null, we assume that a move operator
// has been applied.
RTC_LOG(LS_ERROR) << "ContentInfo::description has been updated by "
"assignment. This usage is deprecated.";
description_.reset(description); // ensure that it is destroyed.
}
} }
// Copy operator. // Copy operator.
@ -277,8 +270,7 @@ ContentInfo::ContentInfo(const ContentInfo& o)
type(o.type), type(o.type),
rejected(o.rejected), rejected(o.rejected),
bundle_only(o.bundle_only), bundle_only(o.bundle_only),
description_(o.description_->Clone()), description_(o.description_->Clone()) {}
description(description_.get()) {}
ContentInfo& ContentInfo::operator=(const ContentInfo& o) { ContentInfo& ContentInfo::operator=(const ContentInfo& o) {
name = o.name; name = o.name;
@ -286,29 +278,14 @@ ContentInfo& ContentInfo::operator=(const ContentInfo& o) {
rejected = o.rejected; rejected = o.rejected;
bundle_only = o.bundle_only; bundle_only = o.bundle_only;
description_ = o.description_->Clone(); description_ = o.description_->Clone();
description = description_.get();
return *this; return *this;
} }
const MediaContentDescription* ContentInfo::media_description() const { const MediaContentDescription* ContentInfo::media_description() const {
if (description_.get() != description) {
// Someone's updated |description|, or used a move operator
// on the record.
RTC_LOG(LS_ERROR) << "ContentInfo::description has been updated by "
"assignment. This usage is deprecated.";
const_cast<ContentInfo*>(this)->description_.reset(description);
}
return description_.get(); return description_.get();
} }
MediaContentDescription* ContentInfo::media_description() { MediaContentDescription* ContentInfo::media_description() {
if (description_.get() != description) {
// Someone's updated |description|, or used a move operator
// on the record.
RTC_LOG(LS_ERROR) << "ContentInfo::description has been updated by "
"assignment. This usage is deprecated.";
description_.reset(description);
}
return description_.get(); return description_.get();
} }

View File

@ -441,8 +441,6 @@ class RTC_EXPORT ContentInfo {
void set_media_description(std::unique_ptr<MediaContentDescription> desc) { void set_media_description(std::unique_ptr<MediaContentDescription> desc) {
description_ = std::move(desc); description_ = std::move(desc);
// For backwards compatibility only.
description = description_.get();
} }
// TODO(bugs.webrtc.org/8620): Rename this to mid. // TODO(bugs.webrtc.org/8620): Rename this to mid.
@ -454,10 +452,6 @@ class RTC_EXPORT ContentInfo {
private: private:
friend class SessionDescription; friend class SessionDescription;
std::unique_ptr<MediaContentDescription> description_; std::unique_ptr<MediaContentDescription> description_;
public:
// Kept for backwards compatibility only.
MediaContentDescription* description = nullptr;
}; };
typedef std::vector<std::string> ContentNames; typedef std::vector<std::string> ContentNames;