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_ReportDeliver_h
8 #define mozilla_dom_ReportDeliver_h
10 #include "nsIObserver.h"
15 // XXX Avoid including this here by moving function bodies to the cpp file
16 #include "nsIPrincipal.h"
19 class nsPIDOMWindowInner
;
26 class ReportDeliver final
: public nsIObserver
,
27 public nsITimerCallback
,
32 NS_DECL_NSITIMERCALLBACK
39 nsCString mEndpointURL
;
41 TimeStamp mCreationTime
;
42 nsCString mReportBodyJSON
;
43 nsCOMPtr
<nsIPrincipal
> mPrincipal
;
47 static void Record(nsPIDOMWindowInner
* aWindow
, const nsAString
& aType
,
48 const nsAString
& aGroupName
, const nsAString
& aURL
,
51 static void Fetch(const ReportData
& aReportData
);
53 void AppendReportData(const ReportData
& aReportData
);
59 nsTArray
<ReportData
> mReportQueue
;
61 nsCOMPtr
<nsITimer
> mTimer
;
65 } // namespace mozilla
67 #endif // mozilla_dom_ReportDeliver_h