Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(254)

Unified Diff: webrtc/modules/rtp_rtcp/source/rtcp_packet/bye.cc

Issue 2370313002: Reland of Unify rtcp packet setters (Closed)
Patch Set: Fix breaking mistype Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: webrtc/modules/rtp_rtcp/source/rtcp_packet/bye.cc
diff --git a/webrtc/modules/rtp_rtcp/source/rtcp_packet/bye.cc b/webrtc/modules/rtp_rtcp/source/rtcp_packet/bye.cc
index 7b688ab9a4e7cdd04c7c9084c5c8e9ba3dab594c..610dfe36ff6ad750c0c253e534fdd34603845ebe 100644
--- a/webrtc/modules/rtp_rtcp/source/rtcp_packet/bye.cc
+++ b/webrtc/modules/rtp_rtcp/source/rtcp_packet/bye.cc
@@ -10,6 +10,8 @@
#include "webrtc/modules/rtp_rtcp/source/rtcp_packet/bye.h"
+#include <utility>
+
#include "webrtc/base/checks.h"
#include "webrtc/base/logging.h"
#include "webrtc/modules/rtp_rtcp/source/byte_io.h"
@@ -109,18 +111,18 @@ bool Bye::Create(uint8_t* packet,
return true;
}
-bool Bye::WithCsrc(uint32_t csrc) {
- if (csrcs_.size() >= kMaxNumberOfCsrcs) {
- LOG(LS_WARNING) << "Max CSRC size reached.";
+bool Bye::SetCsrcs(std::vector<uint32_t> csrcs) {
+ if (csrcs.size() > kMaxNumberOfCsrcs) {
+ LOG(LS_WARNING) << "Too many CSRCs for Bye packet.";
return false;
}
- csrcs_.push_back(csrc);
+ csrcs_ = std::move(csrcs);
return true;
}
-void Bye::WithReason(const std::string& reason) {
+void Bye::SetReason(std::string reason) {
RTC_DCHECK_LE(reason.size(), 0xffu);
- reason_ = reason;
+ reason_ = std::move(reason);
}
size_t Bye::BlockLength() const {
« no previous file with comments | « webrtc/modules/rtp_rtcp/source/rtcp_packet/bye.h ('k') | webrtc/modules/rtp_rtcp/source/rtcp_packet/bye_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698