LCOV - code coverage report
Current view: top level - toolkit/components/url-classifier - nsUrlClassifierInfo.cpp (source / functions) Hit Total Coverage
Test: output.info Lines: 0 46 0.0 %
Date: 2017-07-14 16:53:18 Functions: 0 19 0.0 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : /* This Source Code Form is subject to the terms of the Mozilla
       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 "nsUrlClassifierInfo.h"
       6             : 
       7           0 : NS_IMPL_ISUPPORTS(nsUrlClassifierPositiveCacheEntry,
       8             :                   nsIUrlClassifierPositiveCacheEntry)
       9             : 
      10           0 : nsUrlClassifierPositiveCacheEntry::nsUrlClassifierPositiveCacheEntry()
      11           0 :   : expirySec(-1)
      12             : {
      13           0 : }
      14             : 
      15             : NS_IMETHODIMP
      16           0 : nsUrlClassifierPositiveCacheEntry::GetExpiry(int64_t* aExpiry)
      17             : {
      18           0 :   if (!aExpiry) {
      19           0 :     return NS_ERROR_NULL_POINTER;
      20             :   }
      21             : 
      22           0 :   *aExpiry = expirySec;
      23           0 :   return NS_OK;
      24             : }
      25             : 
      26             : NS_IMETHODIMP
      27           0 : nsUrlClassifierPositiveCacheEntry::GetFullhash(nsACString& aFullHash)
      28             : {
      29           0 :   aFullHash = fullhash;
      30           0 :   return NS_OK;
      31             : }
      32             : 
      33           0 : NS_IMPL_ISUPPORTS(nsUrlClassifierCacheEntry,
      34             :                   nsIUrlClassifierCacheEntry)
      35             : 
      36           0 : nsUrlClassifierCacheEntry::nsUrlClassifierCacheEntry()
      37           0 :   : expirySec(-1)
      38             : {
      39           0 : }
      40             : 
      41             : NS_IMETHODIMP
      42           0 : nsUrlClassifierCacheEntry::GetPrefix(nsACString& aPrefix)
      43             : {
      44           0 :   aPrefix = prefix;
      45           0 :   return NS_OK;
      46             : }
      47             : 
      48             : NS_IMETHODIMP
      49           0 : nsUrlClassifierCacheEntry::GetExpiry(int64_t* aExpiry)
      50             : {
      51           0 :   if (!aExpiry) {
      52           0 :     return NS_ERROR_NULL_POINTER;
      53             :   }
      54             : 
      55           0 :   *aExpiry = expirySec;
      56           0 :   return NS_OK;
      57             : }
      58             : 
      59             : NS_IMETHODIMP
      60           0 : nsUrlClassifierCacheEntry::GetMatches(nsIArray** aMatches)
      61             : {
      62           0 :   if (!aMatches) {
      63           0 :     return NS_ERROR_NULL_POINTER;
      64             :   }
      65             : 
      66           0 :   nsCOMPtr<nsIMutableArray> array(do_CreateInstance(NS_ARRAY_CONTRACTID));
      67             : 
      68           0 :   for (uint32_t i = 0;i < matches.Length(); i++) {
      69           0 :     array->AppendElement(matches[i], false);
      70             :   }
      71             : 
      72           0 :   NS_ADDREF(*aMatches = array);
      73             : 
      74           0 :   return NS_OK;
      75             : }
      76             : 
      77           0 : NS_IMPL_ISUPPORTS(nsUrlClassifierCacheInfo,
      78             :                   nsIUrlClassifierCacheInfo)
      79             : 
      80           0 : nsUrlClassifierCacheInfo::nsUrlClassifierCacheInfo()
      81             : {
      82           0 : }
      83             : 
      84             : NS_IMETHODIMP
      85           0 : nsUrlClassifierCacheInfo::GetTable(nsACString& aTable)
      86             : {
      87           0 :   aTable = table;
      88           0 :   return NS_OK;
      89             : }
      90             : 
      91             : NS_IMETHODIMP
      92           0 : nsUrlClassifierCacheInfo::GetEntries(nsIArray** aEntries)
      93             : {
      94           0 :   if (!aEntries) {
      95           0 :     return NS_ERROR_NULL_POINTER;
      96             :   }
      97             : 
      98           0 :   nsCOMPtr<nsIMutableArray> array(do_CreateInstance(NS_ARRAY_CONTRACTID));
      99             : 
     100           0 :   for (uint32_t i = 0;i < entries.Length(); i++) {
     101           0 :     array->AppendElement(entries[i], false);
     102             :   }
     103             : 
     104           0 :   NS_ADDREF(*aEntries = array);
     105             : 
     106           0 :   return NS_OK;
     107             : }

Generated by: LCOV version 1.13