Bug 1472338: part 2) Change `clipboard.readText()` to read from the clipboard asynchr...
[gecko.git] / dom / reporting / Report.h
blob47b258782f30e3d5f0f312c6adb52a4516b6b5dd
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 {
23 namespace dom {
25 class ReportBody;
27 class Report final : public nsISupports, public nsWrapperCache {
28 public:
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;
48 private:
49 ~Report();
51 nsCOMPtr<nsIGlobalObject> mGlobal;
53 const nsString mType;
54 const nsString mURL;
55 RefPtr<ReportBody> mBody;
58 } // namespace dom
59 } // namespace mozilla
61 #endif // mozilla_dom_Report_h