toolkit/components/places/VisitInfo.cpp

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/toolkit/components/places/VisitInfo.cpp	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,65 @@
     1.4 +/* This Source Code Form is subject to the terms of the Mozilla Public
     1.5 + * License, v. 2.0. If a copy of the MPL was not distributed with this
     1.6 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     1.7 +
     1.8 +#include "VisitInfo.h"
     1.9 +#include "nsIURI.h"
    1.10 +
    1.11 +namespace mozilla {
    1.12 +namespace places {
    1.13 +
    1.14 +////////////////////////////////////////////////////////////////////////////////
    1.15 +//// VisitInfo
    1.16 +
    1.17 +VisitInfo::VisitInfo(int64_t aVisitId,
    1.18 +                     PRTime aVisitDate,
    1.19 +                     uint32_t aTransitionType,
    1.20 +                     already_AddRefed<nsIURI> aReferrer)
    1.21 +: mVisitId(aVisitId)
    1.22 +, mVisitDate(aVisitDate)
    1.23 +, mTransitionType(aTransitionType)
    1.24 +, mReferrer(aReferrer)
    1.25 +{
    1.26 +}
    1.27 +
    1.28 +////////////////////////////////////////////////////////////////////////////////
    1.29 +//// mozIVisitInfo
    1.30 +
    1.31 +NS_IMETHODIMP
    1.32 +VisitInfo::GetVisitId(int64_t* _visitId)
    1.33 +{
    1.34 +  *_visitId = mVisitId;
    1.35 +  return NS_OK;
    1.36 +}
    1.37 +
    1.38 +NS_IMETHODIMP
    1.39 +VisitInfo::GetVisitDate(PRTime* _visitDate)
    1.40 +{
    1.41 +  *_visitDate = mVisitDate;
    1.42 +  return NS_OK;
    1.43 +}
    1.44 +
    1.45 +NS_IMETHODIMP
    1.46 +VisitInfo::GetTransitionType(uint32_t* _transitionType)
    1.47 +{
    1.48 +  *_transitionType = mTransitionType;
    1.49 +  return NS_OK;
    1.50 +}
    1.51 +
    1.52 +NS_IMETHODIMP
    1.53 +VisitInfo::GetReferrerURI(nsIURI** _referrer)
    1.54 +{
    1.55 +  NS_IF_ADDREF(*_referrer = mReferrer);
    1.56 +  return NS_OK;
    1.57 +}
    1.58 +
    1.59 +////////////////////////////////////////////////////////////////////////////////
    1.60 +//// nsISupports
    1.61 +
    1.62 +NS_IMPL_ISUPPORTS(
    1.63 +  VisitInfo
    1.64 +, mozIVisitInfo
    1.65 +)
    1.66 +
    1.67 +} // namespace places
    1.68 +} // namespace mozilla

mercurial