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

Unified Diff: third_party/WebKit/Source/modules/mediastream/RTCPeerConnection.cpp

Issue 1641113002: Revert of Remove references between RTCPeerConnection and RTCDataChannel. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 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
« no previous file with comments | « third_party/WebKit/Source/modules/mediastream/RTCPeerConnection.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/modules/mediastream/RTCPeerConnection.cpp
diff --git a/third_party/WebKit/Source/modules/mediastream/RTCPeerConnection.cpp b/third_party/WebKit/Source/modules/mediastream/RTCPeerConnection.cpp
index 805d30b2dd5f08df19447586300b124a05fdcc52..063d4345a168cf49a4d1669964eb0608736d8964 100644
--- a/third_party/WebKit/Source/modules/mediastream/RTCPeerConnection.cpp
+++ b/third_party/WebKit/Source/modules/mediastream/RTCPeerConnection.cpp
@@ -796,9 +796,10 @@
DictionaryHelper::get(options, "protocol", protocolString);
init.protocol = protocolString;
- RTCDataChannel* channel = RTCDataChannel::create(executionContext(), m_peerHandler.get(), label, init, exceptionState);
+ RTCDataChannel* channel = RTCDataChannel::create(executionContext(), this, m_peerHandler.get(), label, init, exceptionState);
if (exceptionState.hadException())
return nullptr;
+ m_dataChannels.append(channel);
RTCDataChannel::ReadyState handlerState = channel->getHandlerState();
if (handlerState != RTCDataChannel::ReadyStateConnecting) {
// There was an early state transition. Don't miss it!
@@ -924,7 +925,9 @@
if (m_signalingState == SignalingStateClosed)
return;
- RTCDataChannel* channel = RTCDataChannel::create(executionContext(), adoptPtr(handler));
+ RTCDataChannel* channel = RTCDataChannel::create(executionContext(), this, adoptPtr(handler));
+ m_dataChannels.append(channel);
+
scheduleDispatchEvent(RTCDataChannelEvent::create(EventTypeNames::datachannel, false, false, channel));
}
@@ -967,6 +970,11 @@
m_stopped = true;
m_iceConnectionState = ICEConnectionStateClosed;
m_signalingState = SignalingStateClosed;
+
+ HeapVector<Member<RTCDataChannel>>::iterator i = m_dataChannels.begin();
+ for (; i != m_dataChannels.end(); ++i)
+ (*i)->stop();
+ m_dataChannels.clear();
m_dispatchScheduledEventRunner->stop();
@@ -1049,6 +1057,7 @@
{
visitor->trace(m_localStreams);
visitor->trace(m_remoteStreams);
+ visitor->trace(m_dataChannels);
visitor->trace(m_dispatchScheduledEventRunner);
visitor->trace(m_scheduledEvents);
RefCountedGarbageCollectedEventTargetWithInlineData<RTCPeerConnection>::trace(visitor);
« no previous file with comments | « third_party/WebKit/Source/modules/mediastream/RTCPeerConnection.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698