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..526933135b5a78512ed856fc2bb60300c65c19fe |
--- /dev/null |
+++ b/third_party/WebKit/Source/modules/peerconnection/RTCRtpContributingSource.cpp |
@@ -0,0 +1,41 @@ |
+// 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_timestampMs(webContributingSource.timestampMs()), |
+ m_source(webContributingSource.source()) { |
+ DCHECK(m_receiver); |
+} |
+ |
+void RTCRtpContributingSource::updateMembers( |
+ const WebRTCRtpContributingSource& webContributingSource) { |
+ m_timestampMs = webContributingSource.timestampMs(); |
+ DCHECK_EQ(webContributingSource.source(), m_source); |
+} |
+ |
+double RTCRtpContributingSource::timestamp() { |
+ m_receiver->updateSourcesIfNeeded(); |
+ return m_timestampMs; |
+} |
+ |
+uint32_t RTCRtpContributingSource::source() const { |
+ // Skip |m_receiver->updateSourcesIfNeeded()|, |m_source| is a constant. |
+ return m_source; |
+} |
+ |
+DEFINE_TRACE(RTCRtpContributingSource) { |
+ visitor->trace(m_receiver); |
+} |
+ |
+} // namespace blink |