2014-06-06 20:52:15 +00: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_MediaKeyNeededEvent_h__
|
|
|
|
#define mozilla_dom_MediaKeyNeededEvent_h__
|
|
|
|
|
2014-08-27 08:46:56 +00:00
|
|
|
#include "mozilla/dom/MediaEncryptedEventBinding.h"
|
2014-06-06 20:52:15 +00:00
|
|
|
#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 "mozilla/Attributes.h"
|
|
|
|
#include "mozilla/dom/BindingUtils.h"
|
|
|
|
#include "js/TypeDecls.h"
|
|
|
|
|
|
|
|
namespace mozilla {
|
|
|
|
namespace dom {
|
|
|
|
|
2015-03-21 16:28:04 +00:00
|
|
|
class MediaEncryptedEvent final : public Event
|
2014-06-06 20:52:15 +00:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
NS_DECL_ISUPPORTS_INHERITED
|
2014-08-27 08:46:56 +00:00
|
|
|
NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS_INHERITED(MediaEncryptedEvent, Event)
|
2014-06-06 20:52:15 +00:00
|
|
|
protected:
|
2014-08-27 08:46:56 +00:00
|
|
|
virtual ~MediaEncryptedEvent();
|
2014-09-01 03:50:23 +00:00
|
|
|
explicit MediaEncryptedEvent(EventTarget* aOwner);
|
2014-06-06 20:52:15 +00:00
|
|
|
|
|
|
|
nsString mInitDataType;
|
|
|
|
JS::Heap<JSObject*> mInitData;
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
2015-03-21 16:28:04 +00:00
|
|
|
virtual JSObject* WrapObjectInternal(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) override;
|
2014-06-06 20:52:15 +00:00
|
|
|
|
2015-01-29 07:30:38 +00:00
|
|
|
static already_AddRefed<MediaEncryptedEvent>
|
|
|
|
Constructor(EventTarget* aOwner);
|
|
|
|
|
2014-08-27 08:46:56 +00:00
|
|
|
static already_AddRefed<MediaEncryptedEvent>
|
2014-06-06 20:52:15 +00:00
|
|
|
Constructor(EventTarget* aOwner,
|
|
|
|
const nsAString& aInitDataType,
|
|
|
|
const nsTArray<uint8_t>& aInitData);
|
|
|
|
|
2014-08-27 08:46:56 +00:00
|
|
|
static already_AddRefed<MediaEncryptedEvent>
|
2014-06-06 20:52:15 +00:00
|
|
|
Constructor(const GlobalObject& aGlobal,
|
|
|
|
const nsAString& aType,
|
|
|
|
const MediaKeyNeededEventInit& aEventInitDict,
|
|
|
|
ErrorResult& aRv);
|
|
|
|
|
|
|
|
void GetInitDataType(nsString& aRetVal) const;
|
|
|
|
|
2014-06-11 20:26:52 +00:00
|
|
|
void GetInitData(JSContext* cx,
|
|
|
|
JS::MutableHandle<JSObject*> aData,
|
|
|
|
ErrorResult& aRv);
|
2014-06-06 20:52:15 +00:00
|
|
|
private:
|
|
|
|
nsTArray<uint8_t> mRawInitData;
|
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace dom
|
|
|
|
} // namespace mozilla
|
|
|
|
|
|
|
|
#endif // mozilla_dom_MediaKeyNeededEvent_h__
|