2008-07-09 01:22:20 -07:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
|
|
/* vim:set ts=2 sw=2 sts=2 et cindent: */
|
2012-05-21 04:12:37 -07: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 07:59:21 -08:00
|
|
|
|
|
|
|
#ifndef mozilla_dom_MediaError_h
|
|
|
|
#define mozilla_dom_MediaError_h
|
|
|
|
|
2010-08-25 01:43:00 -07:00
|
|
|
#include "nsIDOMMediaError.h"
|
2013-03-19 05:23:54 -07:00
|
|
|
#include "mozilla/dom/HTMLMediaElement.h"
|
2013-02-14 07:59:21 -08:00
|
|
|
#include "nsWrapperCache.h"
|
2008-07-09 01:22:20 -07:00
|
|
|
#include "nsISupports.h"
|
2012-02-15 07:42:34 -08:00
|
|
|
#include "mozilla/Attributes.h"
|
2008-07-09 01:22:20 -07:00
|
|
|
|
2013-02-14 07:59:21 -08:00
|
|
|
namespace mozilla {
|
|
|
|
namespace dom {
|
|
|
|
|
2013-02-14 07:59:21 -08:00
|
|
|
class MediaError MOZ_FINAL : public nsIDOMMediaError,
|
|
|
|
public nsWrapperCache
|
2008-07-09 01:22:20 -07:00
|
|
|
{
|
|
|
|
public:
|
2013-03-19 05:23:54 -07:00
|
|
|
MediaError(HTMLMediaElement* aParent, uint16_t aCode);
|
2008-07-09 01:22:20 -07:00
|
|
|
|
|
|
|
// nsISupports
|
2013-02-14 07:59:21 -08:00
|
|
|
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
|
|
|
|
NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(MediaError)
|
2008-07-09 01:22:20 -07:00
|
|
|
|
2010-08-25 01:43:00 -07:00
|
|
|
// nsIDOMMediaError
|
|
|
|
NS_DECL_NSIDOMMEDIAERROR
|
2008-07-09 01:22:20 -07:00
|
|
|
|
2013-03-19 05:23:54 -07:00
|
|
|
HTMLMediaElement* GetParentObject() const
|
2013-02-14 07:59:21 -08:00
|
|
|
{
|
|
|
|
return mParent;
|
|
|
|
}
|
|
|
|
|
2013-04-25 09:29:54 -07:00
|
|
|
virtual JSObject* WrapObject(JSContext* aCx,
|
|
|
|
JS::Handle<JSObject*> aScope) MOZ_OVERRIDE;
|
2013-02-14 07:59:21 -08:00
|
|
|
|
|
|
|
uint16_t Code() const
|
|
|
|
{
|
|
|
|
return mCode;
|
|
|
|
}
|
|
|
|
|
2008-07-09 01:22:20 -07:00
|
|
|
private:
|
2013-03-19 05:23:54 -07:00
|
|
|
nsRefPtr<HTMLMediaElement> mParent;
|
2013-02-14 07:59:21 -08:00
|
|
|
|
2008-07-09 01:22:20 -07:00
|
|
|
// Error code
|
2013-02-14 07:59:21 -08:00
|
|
|
const uint16_t mCode;
|
2008-07-09 01:22:20 -07:00
|
|
|
};
|
2013-02-14 07:59:21 -08:00
|
|
|
|
|
|
|
} // namespace dom
|
|
|
|
} // namespace mozilla
|
|
|
|
|
|
|
|
#endif // mozilla_dom_MediaError_h
|