This source file includes following definitions.
- extraData
- assign
- reset
- requestSucceeded
- requestFailed
- extraData
- setExtraData
#include "config.h"
#include "public/platform/WebRTCSessionDescriptionRequest.h"
#include "platform/mediastream/RTCSessionDescriptionRequest.h"
#include "public/platform/WebRTCSessionDescription.h"
#include "wtf/PassOwnPtr.h"
using namespace WebCore;
namespace blink {
namespace {
class ExtraDataContainer : public RTCSessionDescriptionRequest::ExtraData {
public:
ExtraDataContainer(PassOwnPtr<WebRTCSessionDescriptionRequest::ExtraData> extraData) : m_extraData(extraData) { }
WebRTCSessionDescriptionRequest::ExtraData* extraData() { return m_extraData.get(); }
private:
OwnPtr<WebRTCSessionDescriptionRequest::ExtraData> m_extraData;
};
}
WebRTCSessionDescriptionRequest::WebRTCSessionDescriptionRequest(const PassRefPtr<RTCSessionDescriptionRequest>& constraints)
: m_private(constraints)
{
}
void WebRTCSessionDescriptionRequest::assign(const WebRTCSessionDescriptionRequest& other)
{
m_private = other.m_private;
}
void WebRTCSessionDescriptionRequest::reset()
{
m_private.reset();
}
void WebRTCSessionDescriptionRequest::requestSucceeded(const WebRTCSessionDescription& sessionDescription) const
{
ASSERT(m_private.get());
m_private->requestSucceeded(sessionDescription);
}
void WebRTCSessionDescriptionRequest::requestFailed(const WebString& error) const
{
ASSERT(m_private.get());
m_private->requestFailed(error);
}
WebRTCSessionDescriptionRequest::ExtraData* WebRTCSessionDescriptionRequest::extraData() const
{
RTCSessionDescriptionRequest::ExtraData* data = m_private->extraData();
if (!data)
return 0;
return static_cast<ExtraDataContainer*>(data)->extraData();
}
void WebRTCSessionDescriptionRequest::setExtraData(ExtraData* extraData)
{
m_private->setExtraData(adoptPtr(new ExtraDataContainer(adoptPtr(extraData))));
}
}