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

Unified Diff: webrtc/common_types.cc

Issue 2920993002: Add RSID-based demuxing to RtpDemuxer (Closed)
Patch Set: Missed one cast. Created 3 years, 6 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
« no previous file with comments | « webrtc/common_types.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/common_types.cc
diff --git a/webrtc/common_types.cc b/webrtc/common_types.cc
index c9f7fa1e738fbbd1b61b704bb5d4458667a49e5d..5cbc452db33f82735092fd28460a56859f70e982 100644
--- a/webrtc/common_types.cc
+++ b/webrtc/common_types.cc
@@ -11,6 +11,7 @@
#include "webrtc/common_types.h"
#include <string.h>
+#include <algorithm>
#include <limits>
#include <type_traits>
@@ -23,6 +24,11 @@ StreamDataCounters::StreamDataCounters() : first_packet_time_ms(-1) {}
constexpr size_t StreamId::kMaxSize;
+bool StreamId::IsLegalName(rtc::ArrayView<const char> name) {
+ return (name.size() <= kMaxSize && name.size() > 0 &&
+ std::all_of(name.data(), name.data() + name.size(), isalnum));
+}
+
void StreamId::Set(const char* data, size_t size) {
// If |data| contains \0, the stream id size might become less than |size|.
RTC_CHECK_LE(size, kMaxSize);
« no previous file with comments | « webrtc/common_types.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698