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

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

Issue 1010393002: Fix issue of localDescription and remoteDescription getter. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: ActiveDomObject. Created 5 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: Source/modules/mediastream/RTCPeerConnection.cpp
diff --git a/Source/modules/mediastream/RTCPeerConnection.cpp b/Source/modules/mediastream/RTCPeerConnection.cpp
index 51a5d99241a3b761e296aeab803183121f94da90..bf4c52ca6f26eab85fddd3eb3c150b62a94b4c18 100644
--- a/Source/modules/mediastream/RTCPeerConnection.cpp
+++ b/Source/modules/mediastream/RTCPeerConnection.cpp
@@ -275,6 +275,8 @@ RTCPeerConnection::RTCPeerConnection(ExecutionContext* context, RTCConfiguration
exceptionState.throwDOMException(NotSupportedError, "Failed to initialize native PeerConnection.");
return;
}
+ m_localDescription = RTCSessionDescription::create(context, m_peerHandler->localDescription());
+ m_remoteDescription = RTCSessionDescription::create(context, m_peerHandler->remoteDescription());
}
RTCPeerConnection::~RTCPeerConnection()
@@ -342,8 +344,8 @@ RTCSessionDescription* RTCPeerConnection::localDescription(ExceptionState& excep
WebRTCSessionDescription webSessionDescription = m_peerHandler->localDescription();
if (webSessionDescription.isNull())
return nullptr;
-
- return RTCSessionDescription::create(webSessionDescription);
+ m_localDescription->setWebSessionDescription(webSessionDescription);
Jens Widell 2015/04/28 10:59:22 I think the semantics might be somewhat incorrect
+ return m_localDescription;
}
void RTCPeerConnection::setRemoteDescription(RTCSessionDescription* sessionDescription, VoidCallback* successCallback, RTCErrorCallback* errorCallback, ExceptionState& exceptionState)
@@ -365,8 +367,9 @@ RTCSessionDescription* RTCPeerConnection::remoteDescription(ExceptionState& exce
WebRTCSessionDescription webSessionDescription = m_peerHandler->remoteDescription();
if (webSessionDescription.isNull())
return nullptr;
+ m_remoteDescription->setWebSessionDescription(webSessionDescription);
- return RTCSessionDescription::create(webSessionDescription);
+ return m_remoteDescription;
}
void RTCPeerConnection::updateIce(const Dictionary& rtcConfiguration, const Dictionary& mediaConstraints, ExceptionState& exceptionState)
@@ -762,6 +765,9 @@ void RTCPeerConnection::stop()
m_dispatchScheduledEventRunner.stop();
+ m_localDescription->stop();
+ m_remoteDescription->stop();
+
m_peerHandler.clear();
}
@@ -824,6 +830,8 @@ DEFINE_TRACE(RTCPeerConnection)
visitor->trace(m_localStreams);
visitor->trace(m_remoteStreams);
visitor->trace(m_dataChannels);
+ visitor->trace(m_localDescription);
+ visitor->trace(m_remoteDescription);
#if ENABLE(OILPAN)
visitor->trace(m_scheduledEvents);
#endif

Powered by Google App Engine
This is Rietveld 408576698