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