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

Unified Diff: third_party/WebKit/Source/modules/peerconnection/RTCRtpContributingSource.cpp

Issue 2803693002: RTCRtpReceiver.getContributingSources() added. (Closed)
Patch Set: Created 3 years, 8 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: third_party/WebKit/Source/modules/peerconnection/RTCRtpContributingSource.cpp
diff --git a/third_party/WebKit/Source/modules/peerconnection/RTCRtpContributingSource.cpp b/third_party/WebKit/Source/modules/peerconnection/RTCRtpContributingSource.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..f865f5a5a01fb2805c2a19620602d4506f653e68
--- /dev/null
+++ b/third_party/WebKit/Source/modules/peerconnection/RTCRtpContributingSource.cpp
@@ -0,0 +1,42 @@
+// Copyright 2017 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "modules/peerconnection/RTCRtpContributingSource.h"
+
+#include "modules/peerconnection/RTCRtpReceiver.h"
+#include "public/platform/WebRTCRtpContributingSource.h"
+
+namespace blink {
+
+RTCRtpContributingSource::RTCRtpContributingSource(
+ RTCRtpReceiver* receiver,
+ const WebRTCRtpContributingSource& webContributingSource)
+ : m_receiver(receiver),
+ m_timestamp(webContributingSource.timestamp()),
+ m_source(webContributingSource.source()) {
+ DCHECK(m_receiver);
+}
+
+RTCRtpContributingSource& RTCRtpContributingSource::operator=(
+ const WebRTCRtpContributingSource& webContributingSource) {
+ m_timestamp = webContributingSource.timestamp();
+ DCHECK_EQ(webContributingSource.source(), m_source);
+ return *this;
+}
+
+double RTCRtpContributingSource::timestamp() {
+ m_receiver->updateSources();
+ return m_timestamp;
+}
+
+uint32_t RTCRtpContributingSource::source() const {
+ // Skip |m_receiver->updateContributingSources()|, |m_source| is constant.
+ return m_source;
+}
+
+DEFINE_TRACE(RTCRtpContributingSource) {
+ visitor->trace(m_receiver);
+}
+
+} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698