#ifndef MediaKeyEvent_h
#define MediaKeyEvent_h
#include "core/events/Event.h"
#include "core/html/MediaKeyError.h"
namespace WebCore {
struct MediaKeyEventInit : public EventInit {
MediaKeyEventInit();
String keySystem;
String sessionId;
RefPtr<Uint8Array> initData;
RefPtr<Uint8Array> message;
String defaultURL;
RefPtr<MediaKeyError> errorCode;
unsigned short systemCode;
};
class MediaKeyEvent FINAL : public Event {
public:
virtual ~MediaKeyEvent();
static PassRefPtrWillBeRawPtr<MediaKeyEvent> create()
{
return adoptRefWillBeNoop(new MediaKeyEvent);
}
static PassRefPtrWillBeRawPtr<MediaKeyEvent> create(const AtomicString& type, const MediaKeyEventInit& initializer)
{
return adoptRefWillBeNoop(new MediaKeyEvent(type, initializer));
}
virtual const AtomicString& interfaceName() const OVERRIDE;
String keySystem() const { return m_keySystem; }
String sessionId() const { return m_sessionId; }
Uint8Array* initData() const { return m_initData.get(); }
Uint8Array* message() const { return m_message.get(); }
String defaultURL() const { return m_defaultURL; }
MediaKeyError* errorCode() const { return m_errorCode.get(); }
MediaKeyError* errorCode(bool& isNull) const { isNull = !m_errorCode; return m_errorCode.get(); }
unsigned short systemCode() const { return m_systemCode; }
virtual void trace(Visitor*) OVERRIDE;
private:
MediaKeyEvent();
MediaKeyEvent(const AtomicString& type, const MediaKeyEventInit& initializer);
String m_keySystem;
String m_sessionId;
RefPtr<Uint8Array> m_initData;
RefPtr<Uint8Array> m_message;
String m_defaultURL;
RefPtr<MediaKeyError> m_errorCode;
unsigned short m_systemCode;
};
}
#endif