Source code

Revision control

Other Tools

1
/* This Source Code Form is subject to the terms of the Mozilla Public
2
* License, v. 2.0. If a copy of the MPL was not distributed with this
3
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
4
5
#include "VisitInfo.h"
6
#include "nsIURI.h"
7
8
namespace mozilla {
9
namespace places {
10
11
////////////////////////////////////////////////////////////////////////////////
12
//// VisitInfo
13
14
VisitInfo::VisitInfo(int64_t aVisitId, PRTime aVisitDate,
15
uint32_t aTransitionType,
16
already_AddRefed<nsIURI> aReferrer)
17
: mVisitId(aVisitId),
18
mVisitDate(aVisitDate),
19
mTransitionType(aTransitionType),
20
mReferrer(aReferrer) {}
21
22
VisitInfo::~VisitInfo() {}
23
24
////////////////////////////////////////////////////////////////////////////////
25
//// mozIVisitInfo
26
27
NS_IMETHODIMP
28
VisitInfo::GetVisitId(int64_t* _visitId) {
29
*_visitId = mVisitId;
30
return NS_OK;
31
}
32
33
NS_IMETHODIMP
34
VisitInfo::GetVisitDate(PRTime* _visitDate) {
35
*_visitDate = mVisitDate;
36
return NS_OK;
37
}
38
39
NS_IMETHODIMP
40
VisitInfo::GetTransitionType(uint32_t* _transitionType) {
41
*_transitionType = mTransitionType;
42
return NS_OK;
43
}
44
45
NS_IMETHODIMP
46
VisitInfo::GetReferrerURI(nsIURI** _referrer) {
47
NS_IF_ADDREF(*_referrer = mReferrer);
48
return NS_OK;
49
}
50
51
////////////////////////////////////////////////////////////////////////////////
52
//// nsISupports
53
54
NS_IMPL_ISUPPORTS(VisitInfo, mozIVisitInfo)
55
56
} // namespace places
57
} // namespace mozilla