Declare the Clone operator of SessionDescriptionInterface as const.

Bug: webrtc:12215
Change-Id: I8e44e2b9365893ecf481e69060771c2c208bbcdf
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/198125
Reviewed-by: Markus Handell <handellm@webrtc.org>
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32858}
This commit is contained in:
Harald Alvestrand 2020-12-17 19:28:29 +00:00 committed by Commit Bot
parent 26d017e0e2
commit c908f1c19a
3 changed files with 4 additions and 3 deletions

View File

@ -139,7 +139,7 @@ class RTC_EXPORT SessionDescriptionInterface {
// Create a new SessionDescriptionInterface object
// with the same values as the old object.
// TODO(bugs.webrtc.org:12215): Remove default implementation
virtual std::unique_ptr<SessionDescriptionInterface> Clone() {
virtual std::unique_ptr<SessionDescriptionInterface> Clone() const {
return nullptr;
}

View File

@ -49,7 +49,7 @@ class JsepSessionDescription : public SessionDescriptionInterface {
const std::string& session_id,
const std::string& session_version);
virtual std::unique_ptr<SessionDescriptionInterface> Clone();
virtual std::unique_ptr<SessionDescriptionInterface> Clone() const;
virtual cricket::SessionDescription* description() {
return description_.get();

View File

@ -215,7 +215,8 @@ bool JsepSessionDescription::Initialize(
return true;
}
std::unique_ptr<SessionDescriptionInterface> JsepSessionDescription::Clone() {
std::unique_ptr<SessionDescriptionInterface> JsepSessionDescription::Clone()
const {
auto new_description = std::make_unique<JsepSessionDescription>(type_);
new_description->Initialize(description_->Clone(), session_id_,
session_version_);