ImageCaptureError.cpp (1485B)
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/. */ 6 7 #include "mozilla/dom/ImageCaptureError.h" 8 9 #include "mozilla/dom/ImageCaptureErrorEventBinding.h" 10 11 namespace mozilla::dom { 12 13 NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE(ImageCaptureError, mParent) 14 NS_IMPL_CYCLE_COLLECTING_ADDREF(ImageCaptureError) 15 NS_IMPL_CYCLE_COLLECTING_RELEASE(ImageCaptureError) 16 NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(ImageCaptureError) 17 NS_WRAPPERCACHE_INTERFACE_MAP_ENTRY 18 NS_INTERFACE_MAP_ENTRY(nsISupports) 19 NS_INTERFACE_MAP_END 20 21 ImageCaptureError::ImageCaptureError(nsISupports* aParent, uint16_t aCode, 22 const nsAString& aMessage) 23 : mParent(aParent), mMessage(aMessage), mCode(aCode) {} 24 25 ImageCaptureError::~ImageCaptureError() = default; 26 27 nsISupports* ImageCaptureError::GetParentObject() const { return mParent; } 28 29 JSObject* ImageCaptureError::WrapObject(JSContext* aCx, 30 JS::Handle<JSObject*> aGivenProto) { 31 return ImageCaptureError_Binding::Wrap(aCx, this, aGivenProto); 32 } 33 34 uint16_t ImageCaptureError::Code() const { return mCode; } 35 36 void ImageCaptureError::GetMessage(nsAString& retval) const { 37 retval = mMessage; 38 } 39 40 } // namespace mozilla::dom