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 #ifndef mozilla_dom_Report_h
8 #define mozilla_dom_Report_h
10 #include "js/TypeDecls.h"
11 #include "mozilla/AlreadyAddRefed.h"
12 #include "mozilla/Assertions.h"
13 #include "mozilla/RefPtr.h"
15 #include "nsCycleCollectionParticipant.h"
16 #include "nsISupports.h"
18 #include "nsWrapperCache.h"
20 class nsIGlobalObject
;
22 namespace mozilla::dom
{
26 class Report final
: public nsISupports
, public nsWrapperCache
{
28 NS_DECL_CYCLE_COLLECTING_ISUPPORTS
29 NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(Report
)
31 Report(nsIGlobalObject
* aGlobal
, const nsAString
& aType
,
32 const nsAString
& aURL
, ReportBody
* aBody
);
34 already_AddRefed
<Report
> Clone();
36 JSObject
* WrapObject(JSContext
* aCx
,
37 JS::Handle
<JSObject
*> aGivenProto
) override
;
39 nsIGlobalObject
* GetParentObject() const { return mGlobal
; }
41 void GetType(nsAString
& aType
) const;
43 void GetUrl(nsAString
& aURL
) const;
45 ReportBody
* GetBody() const;
50 nsCOMPtr
<nsIGlobalObject
> mGlobal
;
54 RefPtr
<ReportBody
> mBody
;
57 } // namespace mozilla::dom
59 #endif // mozilla_dom_Report_h