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
;
27 class Report final
: public nsISupports
, public nsWrapperCache
{
29 NS_DECL_CYCLE_COLLECTING_ISUPPORTS
30 NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(Report
)
32 Report(nsIGlobalObject
* aGlobal
, const nsAString
& aType
,
33 const nsAString
& aURL
, ReportBody
* aBody
);
35 already_AddRefed
<Report
> Clone();
37 JSObject
* WrapObject(JSContext
* aCx
,
38 JS::Handle
<JSObject
*> aGivenProto
) override
;
40 nsIGlobalObject
* GetParentObject() const { return mGlobal
; }
42 void GetType(nsAString
& aType
) const;
44 void GetUrl(nsAString
& aURL
) const;
46 ReportBody
* GetBody() const;
51 nsCOMPtr
<nsIGlobalObject
> mGlobal
;
55 RefPtr
<ReportBody
> mBody
;
59 } // namespace mozilla
61 #endif // mozilla_dom_Report_h