|
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, |
|
15 PRTime aVisitDate, |
|
16 uint32_t aTransitionType, |
|
17 already_AddRefed<nsIURI> aReferrer) |
|
18 : mVisitId(aVisitId) |
|
19 , mVisitDate(aVisitDate) |
|
20 , mTransitionType(aTransitionType) |
|
21 , mReferrer(aReferrer) |
|
22 { |
|
23 } |
|
24 |
|
25 //////////////////////////////////////////////////////////////////////////////// |
|
26 //// mozIVisitInfo |
|
27 |
|
28 NS_IMETHODIMP |
|
29 VisitInfo::GetVisitId(int64_t* _visitId) |
|
30 { |
|
31 *_visitId = mVisitId; |
|
32 return NS_OK; |
|
33 } |
|
34 |
|
35 NS_IMETHODIMP |
|
36 VisitInfo::GetVisitDate(PRTime* _visitDate) |
|
37 { |
|
38 *_visitDate = mVisitDate; |
|
39 return NS_OK; |
|
40 } |
|
41 |
|
42 NS_IMETHODIMP |
|
43 VisitInfo::GetTransitionType(uint32_t* _transitionType) |
|
44 { |
|
45 *_transitionType = mTransitionType; |
|
46 return NS_OK; |
|
47 } |
|
48 |
|
49 NS_IMETHODIMP |
|
50 VisitInfo::GetReferrerURI(nsIURI** _referrer) |
|
51 { |
|
52 NS_IF_ADDREF(*_referrer = mReferrer); |
|
53 return NS_OK; |
|
54 } |
|
55 |
|
56 //////////////////////////////////////////////////////////////////////////////// |
|
57 //// nsISupports |
|
58 |
|
59 NS_IMPL_ISUPPORTS( |
|
60 VisitInfo |
|
61 , mozIVisitInfo |
|
62 ) |
|
63 |
|
64 } // namespace places |
|
65 } // namespace mozilla |