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