LCOV - code coverage report
Current view: directory - netwerk/base/src - nsProxyInfo.cpp (source / functions) Found Hit Coverage
Test: app.info Lines: 27 27 100.0 %
Date: 2012-06-02 Functions: 11 11 100.0 %

       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                 : /* ***** BEGIN LICENSE BLOCK *****
       4                 :  * Version: MPL 1.1/GPL 2.0/LGPL 2.1
       5                 :  *
       6                 :  * The contents of this file are subject to the Mozilla Public License Version
       7                 :  * 1.1 (the "License"); you may not use this file except in compliance with
       8                 :  * the License. You may obtain a copy of the License at
       9                 :  * http://www.mozilla.org/MPL/
      10                 :  *
      11                 :  * Software distributed under the License is distributed on an "AS IS" basis,
      12                 :  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
      13                 :  * for the specific language governing rights and limitations under the
      14                 :  * License.
      15                 :  *
      16                 :  * The Original Code is mozilla.org code.
      17                 :  *
      18                 :  * The Initial Developer of the Original Code is Google Inc.
      19                 :  * Portions created by the Initial Developer are Copyright (C) 2005
      20                 :  * the Initial Developer. All Rights Reserved.
      21                 :  *
      22                 :  * Contributor(s):
      23                 :  *  Darin Fisher <darin@meer.net>
      24                 :  *
      25                 :  * Alternatively, the contents of this file may be used under the terms of
      26                 :  * either the GNU General Public License Version 2 or later (the "GPL"), or
      27                 :  * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
      28                 :  * in which case the provisions of the GPL or the LGPL are applicable instead
      29                 :  * of those above. If you wish to allow use of your version of this file only
      30                 :  * under the terms of either the GPL or the LGPL, and not to allow others to
      31                 :  * use your version of this file under the terms of the MPL, indicate your
      32                 :  * decision by deleting the provisions above and replace them with the notice
      33                 :  * and other provisions required by the GPL or the LGPL. If you do not delete
      34                 :  * the provisions above, a recipient may use your version of this file under
      35                 :  * the terms of any one of the MPL, the GPL or the LGPL.
      36                 :  *
      37                 :  * ***** END LICENSE BLOCK ***** */
      38                 : 
      39                 : #include "nsProxyInfo.h"
      40                 : #include "nsCOMPtr.h"
      41                 : 
      42                 : // Yes, we support QI to nsProxyInfo
      43           22469 : NS_IMPL_THREADSAFE_ISUPPORTS2(nsProxyInfo, nsProxyInfo, nsIProxyInfo) 
      44                 : 
      45                 : NS_IMETHODIMP
      46              20 : nsProxyInfo::GetHost(nsACString &result)
      47                 : {
      48              20 :   result = mHost;
      49              20 :   return NS_OK;
      50                 : }
      51                 : 
      52                 : NS_IMETHODIMP
      53              20 : nsProxyInfo::GetPort(PRInt32 *result)
      54                 : {
      55              20 :   *result = mPort;
      56              20 :   return NS_OK;
      57                 : }
      58                 : 
      59                 : NS_IMETHODIMP
      60              38 : nsProxyInfo::GetType(nsACString &result)
      61                 : {
      62              38 :   result = mType;
      63              38 :   return NS_OK;
      64                 : }
      65                 : 
      66                 : NS_IMETHODIMP
      67              18 : nsProxyInfo::GetFlags(PRUint32 *result)
      68                 : {
      69              18 :   *result = mFlags;
      70              18 :   return NS_OK;
      71                 : }
      72                 : 
      73                 : NS_IMETHODIMP
      74              91 : nsProxyInfo::GetResolveFlags(PRUint32 *result)
      75                 : {
      76              91 :   *result = mResolveFlags;
      77              91 :   return NS_OK;
      78                 : }
      79                 : 
      80                 : NS_IMETHODIMP
      81               7 : nsProxyInfo::GetFailoverTimeout(PRUint32 *result)
      82                 : {
      83               7 :   *result = mTimeout;
      84               7 :   return NS_OK;
      85                 : }
      86                 : 
      87                 : NS_IMETHODIMP
      88              25 : nsProxyInfo::GetFailoverProxy(nsIProxyInfo **result)
      89                 : {
      90              25 :   NS_IF_ADDREF(*result = mNext);
      91              25 :   return NS_OK;
      92                 : }
      93                 : 
      94                 : NS_IMETHODIMP
      95               1 : nsProxyInfo::SetFailoverProxy(nsIProxyInfo *proxy)
      96                 : {
      97               2 :   nsCOMPtr<nsProxyInfo> pi = do_QueryInterface(proxy);
      98               1 :   NS_ENSURE_ARG(pi);
      99                 : 
     100               1 :   pi.swap(mNext);
     101               1 :   return NS_OK;
     102                 : }

Generated by: LCOV version 1.7