LCOV - code coverage report
Current view: top level - netwerk/base - nsProxyInfo.cpp (source / functions) Hit Total Coverage
Test: output.info Lines: 0 44 0.0 %
Date: 2017-07-14 16:53:18 Functions: 0 17 0.0 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
       2             : /* vim:set ts=2 sw=2 sts=2 et cindent: */
       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 "nsProxyInfo.h"
       8             : #include "nsCOMPtr.h"
       9             : 
      10             : namespace mozilla {
      11             : namespace net {
      12             : 
      13             : // Yes, we support QI to nsProxyInfo
      14           0 : NS_IMPL_ISUPPORTS(nsProxyInfo, nsProxyInfo, nsIProxyInfo)
      15             : 
      16             : NS_IMETHODIMP
      17           0 : nsProxyInfo::GetHost(nsACString &result)
      18             : {
      19           0 :   result = mHost;
      20           0 :   return NS_OK;
      21             : }
      22             : 
      23             : NS_IMETHODIMP
      24           0 : nsProxyInfo::GetPort(int32_t *result)
      25             : {
      26           0 :   *result = mPort;
      27           0 :   return NS_OK;
      28             : }
      29             : 
      30             : NS_IMETHODIMP
      31           0 : nsProxyInfo::GetType(nsACString &result)
      32             : {
      33           0 :   result = mType;
      34           0 :   return NS_OK;
      35             : }
      36             : 
      37             : NS_IMETHODIMP
      38           0 : nsProxyInfo::GetFlags(uint32_t *result)
      39             : {
      40           0 :   *result = mFlags;
      41           0 :   return NS_OK;
      42             : }
      43             : 
      44             : NS_IMETHODIMP
      45           0 : nsProxyInfo::GetResolveFlags(uint32_t *result)
      46             : {
      47           0 :   *result = mResolveFlags;
      48           0 :   return NS_OK;
      49             : }
      50             : 
      51             : NS_IMETHODIMP
      52           0 : nsProxyInfo::GetUsername(nsACString &result)
      53             : {
      54           0 :   result = mUsername;
      55           0 :   return NS_OK;
      56             : }
      57             : 
      58             : NS_IMETHODIMP
      59           0 : nsProxyInfo::GetPassword(nsACString &result)
      60             : {
      61           0 :   result = mPassword;
      62           0 :   return NS_OK;
      63             : }
      64             : 
      65             : NS_IMETHODIMP
      66           0 : nsProxyInfo::GetFailoverTimeout(uint32_t *result)
      67             : {
      68           0 :   *result = mTimeout;
      69           0 :   return NS_OK;
      70             : }
      71             : 
      72             : NS_IMETHODIMP
      73           0 : nsProxyInfo::GetFailoverProxy(nsIProxyInfo **result)
      74             : {
      75           0 :   NS_IF_ADDREF(*result = mNext);
      76           0 :   return NS_OK;
      77             : }
      78             : 
      79             : NS_IMETHODIMP
      80           0 : nsProxyInfo::SetFailoverProxy(nsIProxyInfo *proxy)
      81             : {
      82           0 :   nsCOMPtr<nsProxyInfo> pi = do_QueryInterface(proxy);
      83           0 :   NS_ENSURE_ARG(pi);
      84             : 
      85           0 :   pi.swap(mNext);
      86           0 :   return NS_OK;
      87             : }
      88             : 
      89             : // These pointers are declared in nsProtocolProxyService.cpp and
      90             : // comparison of mType by string pointer is valid within necko
      91             :   extern const char kProxyType_HTTP[];
      92             :   extern const char kProxyType_HTTPS[];
      93             :   extern const char kProxyType_SOCKS[];
      94             :   extern const char kProxyType_SOCKS4[];
      95             :   extern const char kProxyType_SOCKS5[];
      96             :   extern const char kProxyType_DIRECT[];
      97             : 
      98             : bool
      99           0 : nsProxyInfo::IsDirect()
     100             : {
     101           0 :   if (!mType)
     102           0 :     return true;
     103           0 :   return mType == kProxyType_DIRECT;
     104             : }
     105             : 
     106             : bool
     107           0 : nsProxyInfo::IsHTTP()
     108             : {
     109           0 :   return mType == kProxyType_HTTP;
     110             : }
     111             : 
     112             : bool
     113           0 : nsProxyInfo::IsHTTPS()
     114             : {
     115           0 :   return mType == kProxyType_HTTPS;
     116             : }
     117             : 
     118             : bool
     119           0 : nsProxyInfo::IsSOCKS()
     120             : {
     121           0 :   return mType == kProxyType_SOCKS ||
     122           0 :     mType == kProxyType_SOCKS4 || mType == kProxyType_SOCKS5;
     123             : }
     124             : 
     125             : } // namespace net
     126             : } // namespace mozilla

Generated by: LCOV version 1.13