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