1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
10 #include "mozilla/WeakPtr.h"
11 #include "nsIGlobalObject.h"
13 #include "ObjectModel.h"
22 class Error
: public nsWrapperCache
, public SupportsWeakPtr
{
24 nsCOMPtr
<nsIGlobalObject
> mGlobal
;
28 GPU_DECL_CYCLE_COLLECTION(Error
)
30 Error(nsIGlobalObject
* const aGlobal
, const nsAString
& aMessage
);
31 Error(nsIGlobalObject
* const aGlobal
, const nsACString
& aMessage
);
34 virtual ~Error() = default;
35 virtual void Cleanup() {}
38 void GetMessage(nsAString
& aMessage
) const { aMessage
= mMessage
; }
39 nsIGlobalObject
* GetParentObject() const { return mGlobal
; }
40 virtual JSObject
* WrapObject(JSContext
*, JS::Handle
<JSObject
*>) = 0;
44 } // namespace mozilla
46 #endif // GPU_Error_H_