2014-06-07 00:52:15 +04:00
|
|
|
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
|
|
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
|
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
|
|
|
|
* You can obtain one at http://mozilla.org/MPL/2.0/. */
|
|
|
|
|
|
|
|
#ifndef mozilla_dom_MediaKeyMessageEvent_h__
|
|
|
|
#define mozilla_dom_MediaKeyMessageEvent_h__
|
|
|
|
|
|
|
|
#include "mozilla/Attributes.h"
|
|
|
|
#include "mozilla/ErrorResult.h"
|
|
|
|
#include "nsCycleCollectionParticipant.h"
|
|
|
|
#include "nsWrapperCache.h"
|
|
|
|
#include "nsCOMPtr.h"
|
|
|
|
#include "mozilla/dom/Event.h"
|
|
|
|
#include "mozilla/dom/TypedArray.h"
|
|
|
|
#include "js/TypeDecls.h"
|
|
|
|
#include "mozilla/dom/MediaKeyMessageEventBinding.h"
|
|
|
|
|
|
|
|
namespace mozilla {
|
|
|
|
namespace dom {
|
|
|
|
|
2014-06-19 04:57:51 +04:00
|
|
|
struct MediaKeyMessageEventInit;
|
2014-06-07 00:52:15 +04:00
|
|
|
|
2015-03-21 19:28:04 +03:00
|
|
|
class MediaKeyMessageEvent final : public Event
|
2014-06-07 00:52:15 +04:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
NS_DECL_ISUPPORTS_INHERITED
|
|
|
|
NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS_INHERITED(MediaKeyMessageEvent, Event)
|
|
|
|
protected:
|
2014-07-09 01:23:17 +04:00
|
|
|
virtual ~MediaKeyMessageEvent();
|
2014-09-02 02:26:43 +04:00
|
|
|
explicit MediaKeyMessageEvent(EventTarget* aOwner);
|
2014-06-07 00:52:15 +04:00
|
|
|
|
2015-01-15 01:25:47 +03:00
|
|
|
MediaKeyMessageType mMessageType;
|
2014-06-07 00:52:15 +04:00
|
|
|
JS::Heap<JSObject*> mMessage;
|
|
|
|
|
|
|
|
public:
|
|
|
|
virtual MediaKeyMessageEvent* AsMediaKeyMessageEvent();
|
|
|
|
|
2016-01-18 06:29:21 +03:00
|
|
|
JSObject* WrapObjectInternal(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) override;
|
2014-06-07 00:52:15 +04:00
|
|
|
|
|
|
|
static already_AddRefed<MediaKeyMessageEvent>
|
2015-01-15 01:25:47 +03:00
|
|
|
Constructor(EventTarget* aOwner,
|
|
|
|
MediaKeyMessageType aMessageType,
|
|
|
|
const nsTArray<uint8_t>& aMessage);
|
2014-06-07 00:52:15 +04:00
|
|
|
|
|
|
|
static already_AddRefed<MediaKeyMessageEvent>
|
|
|
|
Constructor(const GlobalObject& aGlobal,
|
|
|
|
const nsAString& aType,
|
|
|
|
const MediaKeyMessageEventInit& aEventInitDict,
|
|
|
|
ErrorResult& aRv);
|
|
|
|
|
2015-01-15 01:25:47 +03:00
|
|
|
MediaKeyMessageType MessageType() const { return mMessageType; }
|
|
|
|
|
2014-06-12 00:26:52 +04:00
|
|
|
void GetMessage(JSContext* cx,
|
|
|
|
JS::MutableHandle<JSObject*> aMessage,
|
|
|
|
ErrorResult& aRv);
|
2014-06-07 00:52:15 +04:00
|
|
|
|
|
|
|
private:
|
|
|
|
nsTArray<uint8_t> mRawMessage;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
} // namespace dom
|
|
|
|
} // namespace mozilla
|
|
|
|
|
|
|
|
#endif // mozilla_dom_MediaKeyMessageEvent_h__
|