 Chromium Code Reviews
 Chromium Code Reviews Issue 1010393002:
  Fix issue of localDescription and remoteDescription getter.  (Closed) 
  Base URL: https://chromium.googlesource.com/chromium/blink.git@master
    
  
    Issue 1010393002:
  Fix issue of localDescription and remoteDescription getter.  (Closed) 
  Base URL: https://chromium.googlesource.com/chromium/blink.git@master| 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 |