summaryrefslogtreecommitdiff
path: root/chromium/third_party/blink/renderer/platform/peerconnection/rtc_stats.cc
diff options
context:
space:
mode:
Diffstat (limited to 'chromium/third_party/blink/renderer/platform/peerconnection/rtc_stats.cc')
-rw-r--r--chromium/third_party/blink/renderer/platform/peerconnection/rtc_stats.cc80
1 files changed, 40 insertions, 40 deletions
diff --git a/chromium/third_party/blink/renderer/platform/peerconnection/rtc_stats.cc b/chromium/third_party/blink/renderer/platform/peerconnection/rtc_stats.cc
index 083e9c33525..b2a3543b933 100644
--- a/chromium/third_party/blink/renderer/platform/peerconnection/rtc_stats.cc
+++ b/chromium/third_party/blink/renderer/platform/peerconnection/rtc_stats.cc
@@ -22,50 +22,50 @@ namespace blink {
namespace {
-class RTCStatsWhitelist {
+class RTCStatsAllowlist {
public:
- RTCStatsWhitelist() {
- whitelisted_stats_types_.insert(webrtc::RTCCertificateStats::kType);
- whitelisted_stats_types_.insert(webrtc::RTCCodecStats::kType);
- whitelisted_stats_types_.insert(webrtc::RTCDataChannelStats::kType);
- whitelisted_stats_types_.insert(webrtc::RTCIceCandidatePairStats::kType);
- whitelisted_stats_types_.insert(webrtc::RTCIceCandidateStats::kType);
- whitelisted_stats_types_.insert(webrtc::RTCLocalIceCandidateStats::kType);
- whitelisted_stats_types_.insert(webrtc::RTCRemoteIceCandidateStats::kType);
- whitelisted_stats_types_.insert(webrtc::RTCMediaStreamStats::kType);
- whitelisted_stats_types_.insert(webrtc::RTCMediaStreamTrackStats::kType);
- whitelisted_stats_types_.insert(webrtc::RTCPeerConnectionStats::kType);
- whitelisted_stats_types_.insert(webrtc::RTCRTPStreamStats::kType);
- whitelisted_stats_types_.insert(webrtc::RTCInboundRTPStreamStats::kType);
- whitelisted_stats_types_.insert(webrtc::RTCOutboundRTPStreamStats::kType);
- whitelisted_stats_types_.insert(
+ RTCStatsAllowlist() {
+ allowlisted_stats_types_.insert(webrtc::RTCCertificateStats::kType);
+ allowlisted_stats_types_.insert(webrtc::RTCCodecStats::kType);
+ allowlisted_stats_types_.insert(webrtc::RTCDataChannelStats::kType);
+ allowlisted_stats_types_.insert(webrtc::RTCIceCandidatePairStats::kType);
+ allowlisted_stats_types_.insert(webrtc::RTCIceCandidateStats::kType);
+ allowlisted_stats_types_.insert(webrtc::RTCLocalIceCandidateStats::kType);
+ allowlisted_stats_types_.insert(webrtc::RTCRemoteIceCandidateStats::kType);
+ allowlisted_stats_types_.insert(webrtc::RTCMediaStreamStats::kType);
+ allowlisted_stats_types_.insert(webrtc::RTCMediaStreamTrackStats::kType);
+ allowlisted_stats_types_.insert(webrtc::RTCPeerConnectionStats::kType);
+ allowlisted_stats_types_.insert(webrtc::RTCRTPStreamStats::kType);
+ allowlisted_stats_types_.insert(webrtc::RTCInboundRTPStreamStats::kType);
+ allowlisted_stats_types_.insert(webrtc::RTCOutboundRTPStreamStats::kType);
+ allowlisted_stats_types_.insert(
webrtc::RTCRemoteInboundRtpStreamStats::kType);
- whitelisted_stats_types_.insert(webrtc::RTCMediaSourceStats::kType);
- whitelisted_stats_types_.insert(webrtc::RTCAudioSourceStats::kType);
- whitelisted_stats_types_.insert(webrtc::RTCVideoSourceStats::kType);
- whitelisted_stats_types_.insert(webrtc::RTCTransportStats::kType);
+ allowlisted_stats_types_.insert(webrtc::RTCMediaSourceStats::kType);
+ allowlisted_stats_types_.insert(webrtc::RTCAudioSourceStats::kType);
+ allowlisted_stats_types_.insert(webrtc::RTCVideoSourceStats::kType);
+ allowlisted_stats_types_.insert(webrtc::RTCTransportStats::kType);
}
- bool IsWhitelisted(const webrtc::RTCStats& stats) {
- return whitelisted_stats_types_.find(stats.type()) !=
- whitelisted_stats_types_.end();
+ bool IsAllowlisted(const webrtc::RTCStats& stats) {
+ return allowlisted_stats_types_.find(stats.type()) !=
+ allowlisted_stats_types_.end();
}
- void WhitelistStatsForTesting(const char* type) {
- whitelisted_stats_types_.insert(type);
+ void AllowStatsForTesting(const char* type) {
+ allowlisted_stats_types_.insert(type);
}
private:
- std::set<std::string> whitelisted_stats_types_;
+ std::set<std::string> allowlisted_stats_types_;
};
-RTCStatsWhitelist* GetStatsWhitelist() {
- static RTCStatsWhitelist* whitelist = new RTCStatsWhitelist();
- return whitelist;
+RTCStatsAllowlist* GetStatsAllowlist() {
+ static RTCStatsAllowlist* list = new RTCStatsAllowlist();
+ return list;
}
-bool IsWhitelistedStats(const webrtc::RTCStats& stats) {
- return GetStatsWhitelist()->IsWhitelisted(stats);
+bool IsAllowlistedStats(const webrtc::RTCStats& stats) {
+ return GetStatsAllowlist()->IsAllowlisted(stats);
}
// Filters stats that should be surfaced to JS. Stats are surfaced if they're
@@ -74,9 +74,9 @@ bool IsWhitelistedStats(const webrtc::RTCStats& stats) {
std::vector<const webrtc::RTCStatsMemberInterface*> FilterMembers(
std::vector<const webrtc::RTCStatsMemberInterface*> stats_members,
const Vector<webrtc::NonStandardGroupId>& exposed_group_ids) {
- // Note that using "is_standarized" avoids having to maintain a whitelist of
+ // Note that using "is_standarized" avoids having to maintain an allowlist of
// every single standardized member, as we do at the "stats object" level
- // with "RTCStatsWhitelist".
+ // with "RTCStatsAllowlist".
base::EraseIf(
stats_members,
[&exposed_group_ids](const webrtc::RTCStatsMemberInterface* member) {
@@ -96,11 +96,11 @@ std::vector<const webrtc::RTCStatsMemberInterface*> FilterMembers(
return stats_members;
}
-size_t CountWhitelistedStats(
+size_t CountAllowlistedStats(
const scoped_refptr<const webrtc::RTCStatsReport>& stats_report) {
size_t size = 0;
for (const auto& stats : *stats_report) {
- if (IsWhitelistedStats(stats)) {
+ if (IsAllowlistedStats(stats)) {
++size;
}
}
@@ -123,7 +123,7 @@ RTCStatsReportPlatform::RTCStatsReportPlatform(
it_(stats_report_->begin()),
end_(stats_report_->end()),
exposed_group_ids_(exposed_group_ids),
- size_(CountWhitelistedStats(stats_report)) {
+ size_(CountAllowlistedStats(stats_report)) {
DCHECK(stats_report_);
}
@@ -138,7 +138,7 @@ std::unique_ptr<RTCStatsReportPlatform> RTCStatsReportPlatform::CopyHandle()
std::unique_ptr<RTCStats> RTCStatsReportPlatform::GetStats(
const String& id) const {
const webrtc::RTCStats* stats = stats_report_->Get(id.Utf8());
- if (!stats || !IsWhitelistedStats(*stats))
+ if (!stats || !IsAllowlistedStats(*stats))
return std::unique_ptr<RTCStats>();
return std::make_unique<RTCStats>(stats_report_, stats, exposed_group_ids_);
}
@@ -147,7 +147,7 @@ std::unique_ptr<RTCStats> RTCStatsReportPlatform::Next() {
while (it_ != end_) {
const webrtc::RTCStats& next = *it_;
++it_;
- if (IsWhitelistedStats(next)) {
+ if (IsAllowlistedStats(next)) {
return std::make_unique<RTCStats>(stats_report_, &next,
exposed_group_ids_);
}
@@ -346,8 +346,8 @@ void RTCStatsCollectorCallbackImpl::OnStatsDeliveredOnMainThread(
base::WrapRefCounted(report.get()), exposed_group_ids_));
}
-void WhitelistStatsForTesting(const char* type) {
- GetStatsWhitelist()->WhitelistStatsForTesting(type);
+void AllowStatsForTesting(const char* type) {
+ GetStatsAllowlist()->AllowStatsForTesting(type);
}
} // namespace blink