This source file includes following definitions.
- reset
- audio
- video
- audioConstraints
- videoConstraints
- securityOrigin
- ownerDocument
- requestSucceeded
- requestDenied
- requestFailedConstraint
- requestFailedUASpecific
- equals
- assign
#include "config.h"
#include "WebUserMediaRequest.h"
#include "WebDocument.h"
#include "WebSecurityOrigin.h"
#include "core/dom/Document.h"
#include "modules/mediastream/UserMediaRequest.h"
#include "platform/mediastream/MediaStreamDescriptor.h"
#include "platform/mediastream/MediaStreamSource.h"
#include "platform/weborigin/SecurityOrigin.h"
#include "public/platform/WebMediaConstraints.h"
#include "public/platform/WebMediaStream.h"
#include "public/platform/WebMediaStreamSource.h"
#include "public/platform/WebString.h"
#include "public/platform/WebVector.h"
#include "wtf/Vector.h"
using namespace WebCore;
namespace blink {
WebUserMediaRequest::WebUserMediaRequest(const PassRefPtr<UserMediaRequest>& request)
: m_private(request)
{
}
WebUserMediaRequest::WebUserMediaRequest(UserMediaRequest* request)
: m_private(request)
{
}
void WebUserMediaRequest::reset()
{
m_private.reset();
}
bool WebUserMediaRequest::audio() const
{
ASSERT(!isNull());
return m_private->audio();
}
bool WebUserMediaRequest::video() const
{
ASSERT(!isNull());
return m_private->video();
}
WebMediaConstraints WebUserMediaRequest::audioConstraints() const
{
ASSERT(!isNull());
return m_private->audioConstraints();
}
WebMediaConstraints WebUserMediaRequest::videoConstraints() const
{
ASSERT(!isNull());
return m_private->videoConstraints();
}
WebSecurityOrigin WebUserMediaRequest::securityOrigin() const
{
ASSERT(!isNull() && m_private->executionContext());
return WebSecurityOrigin(m_private->executionContext()->securityOrigin());
}
WebDocument WebUserMediaRequest::ownerDocument() const
{
ASSERT(!isNull());
return WebDocument(m_private->ownerDocument());
}
void WebUserMediaRequest::requestSucceeded(const WebMediaStream& streamDescriptor)
{
ASSERT(!isNull() && !streamDescriptor.isNull());
m_private->succeed(streamDescriptor);
}
void WebUserMediaRequest::requestDenied(const WebString& description)
{
ASSERT(!isNull());
m_private->failPermissionDenied(description);
}
void WebUserMediaRequest::requestFailedConstraint(const WebString& constraintName, const WebString& description)
{
ASSERT(!isNull());
m_private->failConstraint(constraintName, description);
}
void WebUserMediaRequest::requestFailedUASpecific(const WebString& name, const WebString& constraintName, const WebString& description)
{
ASSERT(!isNull());
m_private->failUASpecific(name, constraintName, description);
}
bool WebUserMediaRequest::equals(const WebUserMediaRequest& other) const
{
if (isNull() || other.isNull())
return false;
return m_private.get() == other.m_private.get();
}
void WebUserMediaRequest::assign(const WebUserMediaRequest& other)
{
m_private = other.m_private;
}
WebUserMediaRequest::operator UserMediaRequest*() const
{
return m_private.get();
}
}