This source file includes following definitions.
- create
- m_errorCallback
- requestSucceeded
- requestFailed
- stop
- clear
#include "config.h"
#include "modules/mediastream/RTCSessionDescriptionRequestImpl.h"
#include "modules/mediastream/RTCErrorCallback.h"
#include "modules/mediastream/RTCPeerConnection.h"
#include "modules/mediastream/RTCSessionDescription.h"
#include "modules/mediastream/RTCSessionDescriptionCallback.h"
#include "public/platform/WebRTCSessionDescription.h"
#include "wtf/RefPtr.h"
namespace WebCore {
PassRefPtr<RTCSessionDescriptionRequestImpl> RTCSessionDescriptionRequestImpl::create(ExecutionContext* context, PassOwnPtr<RTCSessionDescriptionCallback> successCallback, PassOwnPtr<RTCErrorCallback> errorCallback)
{
RefPtr<RTCSessionDescriptionRequestImpl> request = adoptRef(new RTCSessionDescriptionRequestImpl(context, successCallback, errorCallback));
request->suspendIfNeeded();
return request.release();
}
RTCSessionDescriptionRequestImpl::RTCSessionDescriptionRequestImpl(ExecutionContext* context, PassOwnPtr<RTCSessionDescriptionCallback> successCallback, PassOwnPtr<RTCErrorCallback> errorCallback)
: ActiveDOMObject(context)
, m_successCallback(successCallback)
, m_errorCallback(errorCallback)
{
}
RTCSessionDescriptionRequestImpl::~RTCSessionDescriptionRequestImpl()
{
}
void RTCSessionDescriptionRequestImpl::requestSucceeded(const blink::WebRTCSessionDescription& webSessionDescription)
{
if (m_successCallback) {
RefPtr<RTCSessionDescription> sessionDescription = RTCSessionDescription::create(webSessionDescription);
m_successCallback->handleEvent(sessionDescription.get());
}
clear();
}
void RTCSessionDescriptionRequestImpl::requestFailed(const String& error)
{
if (m_errorCallback)
m_errorCallback->handleEvent(error);
clear();
}
void RTCSessionDescriptionRequestImpl::stop()
{
clear();
}
void RTCSessionDescriptionRequestImpl::clear()
{
m_successCallback.clear();
m_errorCallback.clear();
}
}