/* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this file,
* You can obtain one at http://mozilla.org/MPL/2.0/. */
namespace mozilla { namespace dom { // Calls aFunction with all public members of aStats. // Typical usage would have aFunction take a parameter pack. // To avoid inconsistencies, this should be the only explicit list of the // public RTCStatscollection members in C++. template <typename Collection, typename Function> staticauto ForAllPublicRTCStatsCollectionMembers(Collection& aStats,
Function aFunction) {
static_assert(std::is_same_v<typename std::remove_const<Collection>::type,
RTCStatsCollection>, "aStats must be a const or non-const RTCStatsCollection"); return aFunction(
aStats.mInboundRtpStreamStats, aStats.mOutboundRtpStreamStats,
aStats.mRemoteInboundRtpStreamStats, aStats.mRemoteOutboundRtpStreamStats,
aStats.mMediaSourceStats, aStats.mVideoSourceStats,
aStats.mPeerConnectionStats, aStats.mRtpContributingSourceStats,
aStats.mIceCandidatePairStats, aStats.mIceCandidateStats,
aStats.mTrickledIceCandidateStats, aStats.mDataChannelStats,
aStats.mCodecStats);
}
// Calls aFunction with all members of aStats, including internal ones. // Typical usage would have aFunction take a parameter pack. // To avoid inconsistencies, this should be the only explicit list of the // internal RTCStatscollection members in C++. template <typename Collection, typename Function> staticauto ForAllRTCStatsCollectionMembers(Collection& aStats,
Function aFunction) {
static_assert(std::is_same_v<typename std::remove_const<Collection>::type,
RTCStatsCollection>, "aStats must be a const or non-const RTCStatsCollection"); return ForAllPublicRTCStatsCollectionMembers(aStats, [&](auto&... aMember) { return aFunction(aMember..., aStats.mRawLocalCandidates,
aStats.mRawRemoteCandidates, aStats.mVideoFrameHistories,
aStats.mBandwidthEstimations);
});
}
} // namespace dom
} // namespace mozilla
namespace IPC {
template <> struct ParamTraits<mozilla::dom::RTCStatsType>
: public mozilla::dom::WebIDLEnumSerializer<mozilla::dom::RTCStatsType> {};
template <> struct ParamTraits<mozilla::dom::RTCStatsIceCandidatePairState>
: public mozilla::dom::WebIDLEnumSerializer<
mozilla::dom::RTCStatsIceCandidatePairState> {};
template <> struct ParamTraits<mozilla::dom::RTCIceCandidateType>
: public mozilla::dom::WebIDLEnumSerializer<
mozilla::dom::RTCIceCandidateType> {};
template <> struct ParamTraits<mozilla::dom::RTCBundlePolicy>
: public mozilla::dom::WebIDLEnumSerializer<mozilla::dom::RTCBundlePolicy> {
};
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.