DeprecationReportBody.h (1807B)
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/. */ 6 7 #ifndef mozilla_dom_DeprecationReportBody_h 8 #define mozilla_dom_DeprecationReportBody_h 9 10 #include "mozilla/dom/Nullable.h" 11 #include "mozilla/dom/ReportBody.h" 12 #include "nsString.h" 13 14 namespace mozilla::dom { 15 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); 24 25 JSObject* WrapObject(JSContext* aCx, 26 JS::Handle<JSObject*> aGivenProto) override; 27 28 void GetId(nsAString& aId) const; 29 30 void GetAnticipatedRemoval(JSContext* aCx, 31 JS::MutableHandle<JSObject*> aResult) const; 32 33 void GetMessage(nsAString& aMessage) const; 34 35 void GetSourceFile(nsACString& aSourceFile) const; 36 37 Nullable<uint32_t> GetLineNumber() const; 38 39 Nullable<uint32_t> GetColumnNumber() const; 40 41 protected: 42 void ToJSON(JSONWriter& aJSONWriter) const override; 43 44 private: 45 ~DeprecationReportBody(); 46 47 const nsString mId; 48 const Nullable<uint64_t> mDate; 49 const nsString mMessage; 50 const nsCString mSourceFile; 51 const Nullable<uint32_t> mLineNumber; 52 const Nullable<uint32_t> mColumnNumber; 53 }; 54 55 } // namespace mozilla::dom 56 57 #endif // mozilla_dom_DeprecationReportBody_h