Index: third_party/WebKit/Source/modules/peerconnection/RTCRtpReceiver.h |
diff --git a/third_party/WebKit/Source/modules/peerconnection/RTCRtpReceiver.h b/third_party/WebKit/Source/modules/peerconnection/RTCRtpReceiver.h |
index bc47664985182b0c321569c3e5a413e6bd039a1a..ba22835f7eb291296645f9244ffaff793d099b35 100644 |
--- a/third_party/WebKit/Source/modules/peerconnection/RTCRtpReceiver.h |
+++ b/third_party/WebKit/Source/modules/peerconnection/RTCRtpReceiver.h |
@@ -5,8 +5,11 @@ |
#ifndef RTCRtpReceiver_h |
#define RTCRtpReceiver_h |
+#include <map> |
+ |
#include "bindings/core/v8/ScriptWrappable.h" |
#include "modules/mediastream/MediaStreamTrack.h" |
+#include "modules/peerconnection/RTCRtpContributingSource.h" |
#include "platform/heap/GarbageCollected.h" |
#include "platform/heap/Member.h" |
#include "platform/heap/Visitor.h" |
@@ -24,12 +27,31 @@ class RTCRtpReceiver final : public GarbageCollectedFinalized<RTCRtpReceiver>, |
RTCRtpReceiver(std::unique_ptr<WebRTCRtpReceiver>, MediaStreamTrack*); |
MediaStreamTrack* track() const; |
+ const HeapVector<Member<RTCRtpContributingSource>>& getContributingSources(); |
+ |
+ void updateSourcesIfNeeded(); |
DECLARE_VIRTUAL_TRACE(); |
private: |
+ void setContributingSourcesNeedsUpdating(); |
+ |
std::unique_ptr<WebRTCRtpReceiver> m_receiver; |
Member<MediaStreamTrack> m_track; |
+ |
+ // All contributing sources that have ever been returned by |
+ // |getContributingSources| that are still alive. If |updateSourcesIfNeeded| |
+ // encounters a source that already has an associate |
+ // |RTCRtpContributingSource| it will be kept up-to-date. Garbage collected |
+ // sources are automatically removed from the map. |
+ HeapHashMap<uint32_t, |
+ WeakMember<RTCRtpContributingSource>, |
+ typename DefaultHash<uint32_t>::Hash, |
+ WTF::UnsignedWithZeroKeyHashTraits<uint32_t>> |
+ m_contributingSourcesBySourceId; |
+ // The current contributing sources (|getContributingSources|). |
+ HeapVector<Member<RTCRtpContributingSource>> m_contributingSources; |
+ bool m_contributingSourcesNeedsUpdating = true; |
}; |
} // namespace blink |