2015-05-03 19:32:37 +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: */
|
2012-05-21 11:12:37 +00:00
|
|
|
/* 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/. */
|
2013-02-14 15:59:21 +00:00
|
|
|
|
|
|
|
#ifndef mozilla_dom_MediaError_h
|
|
|
|
#define mozilla_dom_MediaError_h
|
|
|
|
|
2010-08-25 08:43:00 +00:00
|
|
|
#include "nsIDOMMediaError.h"
|
2013-03-19 12:23:54 +00:00
|
|
|
#include "mozilla/dom/HTMLMediaElement.h"
|
2013-02-14 15:59:21 +00:00
|
|
|
#include "nsWrapperCache.h"
|
2008-07-09 08:22:20 +00:00
|
|
|
#include "nsISupports.h"
|
2012-02-15 15:42:34 +00:00
|
|
|
#include "mozilla/Attributes.h"
|
2008-07-09 08:22:20 +00:00
|
|
|
|
2013-02-14 15:59:21 +00:00
|
|
|
namespace mozilla {
|
|
|
|
namespace dom {
|
|
|
|
|
2015-03-21 16:28:04 +00:00
|
|
|
class MediaError final : public nsIDOMMediaError,
|
2015-03-27 18:52:19 +00:00
|
|
|
public nsWrapperCache
|
2008-07-09 08:22:20 +00:00
|
|
|
{
|
2014-06-25 02:09:15 +00:00
|
|
|
~MediaError() {}
|
|
|
|
|
2008-07-09 08:22:20 +00:00
|
|
|
public:
|
2013-03-19 12:23:54 +00:00
|
|
|
MediaError(HTMLMediaElement* aParent, uint16_t aCode);
|
2008-07-09 08:22:20 +00:00
|
|
|
|
|
|
|
// nsISupports
|
2013-02-14 15:59:21 +00:00
|
|
|
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
|
|
|
|
NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(MediaError)
|
2008-07-09 08:22:20 +00:00
|
|
|
|
2010-08-25 08:43:00 +00:00
|
|
|
// nsIDOMMediaError
|
|
|
|
NS_DECL_NSIDOMMEDIAERROR
|
2008-07-09 08:22:20 +00:00
|
|
|
|
2013-03-19 12:23:54 +00:00
|
|
|
HTMLMediaElement* GetParentObject() const
|
2013-02-14 15:59:21 +00:00
|
|
|
{
|
|
|
|
return mParent;
|
|
|
|
}
|
|
|
|
|
2015-03-21 16:28:04 +00:00
|
|
|
virtual JSObject* WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) override;
|
2013-02-14 15:59:21 +00:00
|
|
|
|
|
|
|
uint16_t Code() const
|
|
|
|
{
|
|
|
|
return mCode;
|
|
|
|
}
|
|
|
|
|
2008-07-09 08:22:20 +00:00
|
|
|
private:
|
2015-10-18 05:24:48 +00:00
|
|
|
RefPtr<HTMLMediaElement> mParent;
|
2013-02-14 15:59:21 +00:00
|
|
|
|
2008-07-09 08:22:20 +00:00
|
|
|
// Error code
|
2013-02-14 15:59:21 +00:00
|
|
|
const uint16_t mCode;
|
2008-07-09 08:22:20 +00:00
|
|
|
};
|
2013-02-14 15:59:21 +00:00
|
|
|
|
|
|
|
} // namespace dom
|
|
|
|
} // namespace mozilla
|
|
|
|
|
|
|
|
#endif // mozilla_dom_MediaError_h
|