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_BounceTrackingMapEntry_h
8 #define mozilla_BounceTrackingMapEntry_h
10 #include "mozilla/OriginAttributes.h"
11 #include "nsIBounceTrackingMapEntry.h"
17 * Represents an entry in the global bounce tracker or user activation map.
21 OriginAttributes
& OriginAttributesRef() { return mOriginAttributes
; }
23 nsACString
& SiteHostRef() { return mSiteHost
; }
25 PRTime
& TimeStampRef() { return mTimeStamp
; }
28 BTPMapEntry(const OriginAttributes
& aOriginAttributes
,
29 const nsACString
& aSiteHost
, PRTime aTimeStamp
)
30 : mOriginAttributes(aOriginAttributes
),
32 mTimeStamp(aTimeStamp
) {}
34 OriginAttributes mOriginAttributes
;
35 nsAutoCString mSiteHost
;
39 class BounceTrackingMapEntry final
: public BTPMapEntry
,
40 public nsIBounceTrackingMapEntry
{
43 NS_DECL_NSIBOUNCETRACKINGMAPENTRY
45 BounceTrackingMapEntry(const OriginAttributes
& aOriginAttributes
,
46 const nsACString
& aSiteHost
, PRTime aTimeStamp
)
47 : BTPMapEntry(aOriginAttributes
, aSiteHost
, aTimeStamp
) {}
50 ~BounceTrackingMapEntry() = default;
54 * Represents a log entry for a purged bounce tracker. Extends
55 * BounceTrackingMapEntry with the time of purge.
57 class BounceTrackingPurgeEntry final
: public BTPMapEntry
,
58 public nsIBounceTrackingPurgeEntry
{
61 NS_DECL_NSIBOUNCETRACKINGMAPENTRY
62 NS_DECL_NSIBOUNCETRACKINGPURGEENTRY
63 BounceTrackingPurgeEntry(const OriginAttributes
& aOriginAttributes
,
64 const nsACString
& aSiteHost
, PRTime aBounceTime
,
66 : BTPMapEntry(aOriginAttributes
, aSiteHost
, aBounceTime
),
67 mPurgeTime(aPurgeTime
) {}
69 PRTime
& BounceTimeRef() { return mTimeStamp
; }
71 PRTime
& PurgeTimeRef() { return mPurgeTime
; }
73 const PRTime
& PurgeTimeRefConst() const { return mPurgeTime
; }
76 ~BounceTrackingPurgeEntry() = default;
77 // Timestamp of when the purge completed. mTimeStamp is the time of when the
82 } // namespace mozilla