1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
3 /* This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
7 #include "mozilla/dom/ImageCaptureError.h"
8 #include "mozilla/dom/ImageCaptureErrorEventBinding.h"
10 namespace mozilla::dom
{
12 NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE(ImageCaptureError
, mParent
)
13 NS_IMPL_CYCLE_COLLECTING_ADDREF(ImageCaptureError
)
14 NS_IMPL_CYCLE_COLLECTING_RELEASE(ImageCaptureError
)
15 NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(ImageCaptureError
)
16 NS_WRAPPERCACHE_INTERFACE_MAP_ENTRY
17 NS_INTERFACE_MAP_ENTRY(nsISupports
)
20 ImageCaptureError::ImageCaptureError(nsISupports
* aParent
, uint16_t aCode
,
21 const nsAString
& aMessage
)
22 : mParent(aParent
), mMessage(aMessage
), mCode(aCode
) {}
24 ImageCaptureError::~ImageCaptureError() = default;
26 nsISupports
* ImageCaptureError::GetParentObject() const { return mParent
; }
28 JSObject
* ImageCaptureError::WrapObject(JSContext
* aCx
,
29 JS::Handle
<JSObject
*> aGivenProto
) {
30 return ImageCaptureError_Binding::Wrap(aCx
, this, aGivenProto
);
33 uint16_t ImageCaptureError::Code() const { return mCode
; }
35 void ImageCaptureError::GetMessage(nsAString
& retval
) const {
39 } // namespace mozilla::dom