2014-10-27 19:53:10 +03:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
|
|
/* vim:set ts=2 sw=2 sts=2 et cindent: */
|
|
|
|
/* 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_MediaStreamError_h
|
|
|
|
#define mozilla_dom_MediaStreamError_h
|
|
|
|
|
|
|
|
#include "mozilla/Attributes.h"
|
|
|
|
#include "mozilla/ErrorResult.h"
|
|
|
|
#include "nsWrapperCache.h"
|
|
|
|
#include "js/TypeDecls.h"
|
|
|
|
#include "nsPIDOMWindow.h"
|
2015-10-18 08:24:48 +03:00
|
|
|
#include "mozilla/RefPtr.h"
|
2014-10-27 19:53:10 +03:00
|
|
|
|
|
|
|
#if defined(XP_WIN) && defined(GetMessage)
|
|
|
|
#undef GetMessage
|
|
|
|
#endif
|
|
|
|
|
|
|
|
namespace mozilla {
|
|
|
|
namespace dom {
|
|
|
|
|
2014-10-27 22:42:56 +03:00
|
|
|
#define MOZILLA_DOM_MEDIASTREAMERROR_IMPLEMENTATION_IID \
|
|
|
|
{ 0x95fa29aa, 0x0cc2, 0x4698, \
|
|
|
|
{ 0x9d, 0xa9, 0xf2, 0xeb, 0x03, 0x91, 0x0b, 0xd1 } }
|
|
|
|
|
|
|
|
class MediaStreamError;
|
2015-07-13 18:25:42 +03:00
|
|
|
} // namespace dom
|
2014-10-27 22:42:56 +03:00
|
|
|
|
|
|
|
class BaseMediaMgrError
|
|
|
|
{
|
|
|
|
friend class dom::MediaStreamError;
|
|
|
|
protected:
|
|
|
|
BaseMediaMgrError(const nsAString& aName,
|
|
|
|
const nsAString& aMessage,
|
2015-09-18 21:03:30 +03:00
|
|
|
const nsAString& aConstraint);
|
2014-10-27 22:42:56 +03:00
|
|
|
const nsString mName;
|
|
|
|
nsString mMessage;
|
2015-09-18 21:03:30 +03:00
|
|
|
const nsString mConstraint;
|
2014-10-27 22:42:56 +03:00
|
|
|
};
|
|
|
|
|
2015-03-21 19:28:04 +03:00
|
|
|
class MediaMgrError final : public nsISupports,
|
2015-03-27 21:52:19 +03:00
|
|
|
public BaseMediaMgrError
|
2014-10-27 22:42:56 +03:00
|
|
|
{
|
|
|
|
public:
|
2014-12-11 01:49:09 +03:00
|
|
|
explicit MediaMgrError(const nsAString& aName,
|
|
|
|
const nsAString& aMessage = EmptyString(),
|
2015-09-18 21:03:30 +03:00
|
|
|
const nsAString& aConstraint = EmptyString())
|
|
|
|
: BaseMediaMgrError(aName, aMessage, aConstraint) {}
|
2014-10-27 22:42:56 +03:00
|
|
|
|
|
|
|
NS_DECL_THREADSAFE_ISUPPORTS
|
|
|
|
|
|
|
|
private:
|
|
|
|
~MediaMgrError() {}
|
|
|
|
};
|
|
|
|
|
|
|
|
namespace dom {
|
2015-03-21 19:28:04 +03:00
|
|
|
class MediaStreamError final : public nsISupports,
|
2015-03-27 21:52:19 +03:00
|
|
|
public BaseMediaMgrError,
|
|
|
|
public nsWrapperCache
|
2014-10-27 19:53:10 +03:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
MediaStreamError(nsPIDOMWindow* aParent,
|
|
|
|
const nsAString& aName,
|
2014-10-27 22:42:56 +03:00
|
|
|
const nsAString& aMessage = EmptyString(),
|
2015-09-18 21:03:30 +03:00
|
|
|
const nsAString& aConstraint = EmptyString());
|
2014-10-27 22:42:56 +03:00
|
|
|
|
|
|
|
MediaStreamError(nsPIDOMWindow* aParent,
|
|
|
|
const BaseMediaMgrError& aOther)
|
2015-09-18 21:03:30 +03:00
|
|
|
: BaseMediaMgrError(aOther.mName, aOther.mMessage, aOther.mConstraint)
|
2014-10-27 22:42:56 +03:00
|
|
|
, mParent(aParent) {}
|
2014-10-27 19:53:10 +03:00
|
|
|
|
|
|
|
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
|
|
|
|
NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(MediaStreamError)
|
2014-10-27 22:42:56 +03:00
|
|
|
NS_DECLARE_STATIC_IID_ACCESSOR(MOZILLA_DOM_MEDIASTREAMERROR_IMPLEMENTATION_IID)
|
2014-10-27 19:53:10 +03:00
|
|
|
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual JSObject* WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) override;
|
2014-10-27 19:53:10 +03:00
|
|
|
|
|
|
|
nsPIDOMWindow* GetParentObject() const
|
|
|
|
{
|
|
|
|
return mParent;
|
|
|
|
}
|
|
|
|
void GetName(nsAString& aName) const;
|
|
|
|
void GetMessage(nsAString& aMessage) const;
|
2015-09-18 21:03:30 +03:00
|
|
|
void GetConstraint(nsAString& aConstraint) const;
|
2014-10-27 19:53:10 +03:00
|
|
|
|
|
|
|
private:
|
|
|
|
virtual ~MediaStreamError() {}
|
|
|
|
|
2015-10-18 08:24:48 +03:00
|
|
|
RefPtr<nsPIDOMWindow> mParent;
|
2014-10-27 19:53:10 +03:00
|
|
|
};
|
|
|
|
|
2014-10-27 22:42:56 +03:00
|
|
|
NS_DEFINE_STATIC_IID_ACCESSOR(MediaStreamError,
|
|
|
|
MOZILLA_DOM_MEDIASTREAMERROR_IMPLEMENTATION_IID)
|
2014-10-27 19:53:10 +03:00
|
|
|
} // namespace dom
|
|
|
|
} // namespace mozilla
|
|
|
|
|
|
|
|
#endif
|