LCOV - code coverage report
Current view: top level - docshell/shistory - nsSHTransaction.cpp (source / functions) Hit Total Coverage
Test: output.info Lines: 37 50 74.0 %
Date: 2017-07-14 16:53:18 Functions: 11 15 73.3 %
Legend: Lines: hit not hit

          Line data    Source code
       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/. */
       6             : 
       7             : #include "nsSHTransaction.h"
       8             : #include "nsISHEntry.h"
       9             : 
      10           1 : nsSHTransaction::nsSHTransaction()
      11             :   : mPrev(nullptr)
      12           1 :   , mPersist(true)
      13             : {
      14           1 : }
      15             : 
      16           0 : nsSHTransaction::~nsSHTransaction()
      17             : {
      18           0 : }
      19             : 
      20          19 : NS_IMPL_ADDREF(nsSHTransaction)
      21          16 : NS_IMPL_RELEASE(nsSHTransaction)
      22             : 
      23          16 : NS_INTERFACE_MAP_BEGIN(nsSHTransaction)
      24          16 :   NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, nsISHTransaction)
      25          14 :   NS_INTERFACE_MAP_ENTRY(nsISHTransaction)
      26           8 : NS_INTERFACE_MAP_END
      27             : 
      28             : NS_IMETHODIMP
      29           1 : nsSHTransaction::Create(nsISHEntry* aSHEntry, nsISHTransaction* aPrev)
      30             : {
      31           1 :   SetSHEntry(aSHEntry);
      32           1 :   if (aPrev) {
      33           0 :     aPrev->SetNext(this);
      34             :   }
      35             : 
      36           1 :   SetPrev(aPrev);
      37           1 :   return NS_OK;
      38             : }
      39             : 
      40             : NS_IMETHODIMP
      41           5 : nsSHTransaction::GetSHEntry(nsISHEntry** aResult)
      42             : {
      43           5 :   NS_ENSURE_ARG_POINTER(aResult);
      44           5 :   *aResult = mSHEntry;
      45           5 :   NS_IF_ADDREF(*aResult);
      46           5 :   return NS_OK;
      47             : }
      48             : 
      49             : NS_IMETHODIMP
      50           1 : nsSHTransaction::SetSHEntry(nsISHEntry* aSHEntry)
      51             : {
      52           1 :   mSHEntry = aSHEntry;
      53           1 :   return NS_OK;
      54             : }
      55             : 
      56             : NS_IMETHODIMP
      57           5 : nsSHTransaction::GetNext(nsISHTransaction** aResult)
      58             : {
      59           5 :   NS_ENSURE_ARG_POINTER(aResult);
      60           5 :   *aResult = mNext;
      61           5 :   NS_IF_ADDREF(*aResult);
      62           5 :   return NS_OK;
      63             : }
      64             : 
      65             : NS_IMETHODIMP
      66           0 : nsSHTransaction::SetNext(nsISHTransaction* aNext)
      67             : {
      68           0 :   if (aNext) {
      69           0 :     NS_ENSURE_SUCCESS(aNext->SetPrev(this), NS_ERROR_FAILURE);
      70             :   }
      71             : 
      72           0 :   mNext = aNext;
      73           0 :   return NS_OK;
      74             : }
      75             : 
      76             : NS_IMETHODIMP
      77           1 : nsSHTransaction::SetPrev(nsISHTransaction* aPrev)
      78             : {
      79             :   /* This is weak reference to parent. Do not Addref it */
      80           1 :   mPrev = aPrev;
      81           1 :   return NS_OK;
      82             : }
      83             : 
      84             : nsresult
      85           0 : nsSHTransaction::GetPrev(nsISHTransaction** aResult)
      86             : {
      87           0 :   NS_ENSURE_ARG_POINTER(aResult);
      88           0 :   *aResult = mPrev;
      89           0 :   NS_IF_ADDREF(*aResult);
      90           0 :   return NS_OK;
      91             : }
      92             : 
      93             : NS_IMETHODIMP
      94           1 : nsSHTransaction::SetPersist(bool aPersist)
      95             : {
      96           1 :   mPersist = aPersist;
      97           1 :   return NS_OK;
      98             : }
      99             : 
     100             : NS_IMETHODIMP
     101           2 : nsSHTransaction::GetPersist(bool* aPersist)
     102             : {
     103           2 :   NS_ENSURE_ARG_POINTER(aPersist);
     104             : 
     105           2 :   *aPersist = mPersist;
     106           2 :   return NS_OK;
     107             : }

Generated by: LCOV version 1.13