tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

TestReportBody.h (1035B)


      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_TestReportBody_h
      8 #define mozilla_dom_TestReportBody_h
      9 
     10 #include "mozilla/dom/Nullable.h"
     11 #include "mozilla/dom/ReportBody.h"
     12 #include "mozilla/dom/SecurityPolicyViolationEvent.h"
     13 
     14 namespace mozilla::dom {
     15 
     16 class TestReportBody final : public ReportBody {
     17 public:
     18  TestReportBody(nsIGlobalObject* aGlobal, const nsString& aBody);
     19 
     20  JSObject* WrapObject(JSContext* aCx,
     21                       JS::Handle<JSObject*> aGivenProto) override;
     22 
     23  void GetMessage(nsAString& aMessage) const;
     24 
     25 protected:
     26  void ToJSON(JSONWriter& aJSONWriter) const override;
     27 
     28 private:
     29  ~TestReportBody();
     30 
     31  const nsString mMessage;
     32 };
     33 
     34 }  // namespace mozilla::dom
     35 
     36 #endif  // mozilla_dom_TestReportBody_h