Bug 1854550 - pt 10. Allow LOG() with zero extra arguments r=glandium
[gecko.git] / dom / reporting / Report.h
blobe139e27858c4ae46d7ce02c8ed2dbb10cf3bc552
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"
14 #include "nsCOMPtr.h"
15 #include "nsCycleCollectionParticipant.h"
16 #include "nsISupports.h"
17 #include "nsString.h"
18 #include "nsWrapperCache.h"
20 class nsIGlobalObject;
22 namespace mozilla::dom {
24 class ReportBody;
26 class Report final : public nsISupports, public nsWrapperCache {
27 public:
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;
47 private:
48 ~Report();
50 nsCOMPtr<nsIGlobalObject> mGlobal;
52 const nsString mType;
53 const nsString mURL;
54 RefPtr<ReportBody> mBody;
57 } // namespace mozilla::dom
59 #endif // mozilla_dom_Report_h