#ifndef WebUserMediaRequest_h
#define WebUserMediaRequest_h
#include "WebSecurityOrigin.h"
#include "public/platform/WebCommon.h"
#include "public/platform/WebPrivatePtr.h"
#include "public/platform/WebString.h"
namespace WebCore {
class UserMediaRequest;
}
namespace blink {
class WebDocument;
class WebMediaConstraints;
class WebMediaStream;
class WebMediaStreamSource;
template <typename T> class WebVector;
class WebUserMediaRequest {
public:
WebUserMediaRequest() { }
WebUserMediaRequest(const WebUserMediaRequest& request) { assign(request); }
~WebUserMediaRequest() { reset(); }
WebUserMediaRequest& operator=(const WebUserMediaRequest& other)
{
assign(other);
return *this;
}
BLINK_EXPORT void reset();
bool isNull() const { return m_private.isNull(); }
BLINK_EXPORT bool equals(const WebUserMediaRequest&) const;
BLINK_EXPORT void assign(const WebUserMediaRequest&);
BLINK_EXPORT bool audio() const;
BLINK_EXPORT bool video() const;
BLINK_EXPORT WebMediaConstraints audioConstraints() const;
BLINK_EXPORT WebMediaConstraints videoConstraints() const;
BLINK_EXPORT WebSecurityOrigin securityOrigin() const;
BLINK_EXPORT WebDocument ownerDocument() const;
BLINK_EXPORT void requestSucceeded(const WebMediaStream&);
BLINK_EXPORT void requestDenied(const WebString& description = WebString());
BLINK_EXPORT void requestFailedConstraint(const WebString& constraintName, const WebString& description = WebString());
BLINK_EXPORT void requestFailedUASpecific(const WebString& name, const WebString& constraintName = WebString(), const WebString& description = WebString());
BLINK_EXPORT void requestFailed(const WebString& description = WebString()) { requestDenied(description); }
#if BLINK_IMPLEMENTATION
WebUserMediaRequest(const PassRefPtr<WebCore::UserMediaRequest>&);
WebUserMediaRequest(WebCore::UserMediaRequest*);
operator WebCore::UserMediaRequest*() const;
#endif
private:
WebPrivatePtr<WebCore::UserMediaRequest> m_private;
};
inline bool operator==(const WebUserMediaRequest& a, const WebUserMediaRequest& b)
{
return a.equals(b);
}
}
#endif