Backed out changeset b462e7b742d8 (bug 1908261) for causing multiple reftest failures...
[gecko.git] / dom / reporting / DeprecationReportBody.h
blobc5441b4be8adf8106a5610c2f9103c7afee1ff93
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_DeprecationReportBody_h
8 #define mozilla_dom_DeprecationReportBody_h
10 #include "mozilla/dom/Nullable.h"
11 #include "mozilla/dom/ReportBody.h"
12 #include "nsString.h"
14 namespace mozilla::dom {
16 class DeprecationReportBody final : public ReportBody {
17 public:
18 DeprecationReportBody(nsIGlobalObject* aGlobal, const nsAString& aId,
19 const Nullable<uint64_t>& aDate,
20 const nsAString& aMessage,
21 const nsACString& aSourceFile,
22 const Nullable<uint32_t>& aLineNumber,
23 const Nullable<uint32_t>& aColumnNumber);
25 JSObject* WrapObject(JSContext* aCx,
26 JS::Handle<JSObject*> aGivenProto) override;
28 void GetId(nsAString& aId) const;
30 Nullable<uint64_t> GetAnticipatedRemoval() const;
32 void GetMessage(nsAString& aMessage) const;
34 void GetSourceFile(nsACString& aSourceFile) const;
36 Nullable<uint32_t> GetLineNumber() const;
38 Nullable<uint32_t> GetColumnNumber() const;
40 protected:
41 void ToJSON(JSONWriter& aJSONWriter) const override;
43 private:
44 ~DeprecationReportBody();
46 const nsString mId;
47 const Nullable<uint64_t> mDate;
48 const nsString mMessage;
49 const nsCString mSourceFile;
50 const Nullable<uint32_t> mLineNumber;
51 const Nullable<uint32_t> mColumnNumber;
54 } // namespace mozilla::dom
56 #endif // mozilla_dom_DeprecationReportBody_h