netwerk/base/public/nsIProtocolProxyFilter.idl

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/netwerk/base/public/nsIProtocolProxyFilter.idl	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,74 @@
     1.4 +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
     1.5 +/* vim:set ts=2 sw=2 sts=2 et cindent: */
     1.6 +/* This Source Code Form is subject to the terms of the Mozilla Public
     1.7 + * License, v. 2.0. If a copy of the MPL was not distributed with this
     1.8 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     1.9 +
    1.10 +#include "nsISupports.idl"
    1.11 +
    1.12 +interface nsIChannel;
    1.13 +interface nsIProtocolProxyService;
    1.14 +interface nsIProxyInfo;
    1.15 +interface nsIURI;
    1.16 +
    1.17 +/**
    1.18 + * This interface is used to apply filters to the proxies selected for a given
    1.19 + * URI.  Use nsIProtocolProxyService::registerFilter to hook up instances of
    1.20 + * this interface. See also nsIProtocolProxyChannelFilter.
    1.21 + */
    1.22 +[scriptable, uuid(f424abd3-32b4-456c-9f45-b7e3376cb0d1)]
    1.23 +interface nsIProtocolProxyFilter : nsISupports
    1.24 +{
    1.25 +  /**
    1.26 +   * This method is called to apply proxy filter rules for the given URI
    1.27 +   * and proxy object (or list of proxy objects).
    1.28 +   *
    1.29 +   * @param aProxyService
    1.30 +   *        A reference to the Protocol Proxy Service.  This is passed so that
    1.31 +   *        implementations may easily access methods such as newProxyInfo.
    1.32 +   * @param aURI
    1.33 +   *        The URI for which these proxy settings apply.
    1.34 +   * @param aProxy
    1.35 +   *        The proxy (or list of proxies) that would be used by default for
    1.36 +   *        the given URI.  This may be null.
    1.37 +   *
    1.38 +   * @return The proxy (or list of proxies) that should be used in place of
    1.39 +   *         aProxy.  This can be just be aProxy if the filter chooses not to
    1.40 +   *         modify the proxy.  It can also be null to indicate that a direct
    1.41 +   *         connection should be used.  Use aProxyService.newProxyInfo to
    1.42 +   *         construct nsIProxyInfo objects.
    1.43 +   */
    1.44 +  nsIProxyInfo applyFilter(in nsIProtocolProxyService aProxyService,
    1.45 +                           in nsIURI aURI, in nsIProxyInfo aProxy);
    1.46 +};
    1.47 +
    1.48 +/**
    1.49 + * This interface is used to apply filters to the proxies selected for a given
    1.50 + * channel.  Use nsIProtocolProxyService::registerChannelFilter to hook up instances of
    1.51 + * this interface. See also nsIProtocolProxyFilter.
    1.52 + */
    1.53 +[scriptable, uuid(245b0880-82c5-4e6e-be6d-bc586aa55a90)]
    1.54 +interface nsIProtocolProxyChannelFilter : nsISupports
    1.55 +{
    1.56 +  /**
    1.57 +   * This method is called to apply proxy filter rules for the given channel
    1.58 +   * and proxy object (or list of proxy objects).
    1.59 +   *
    1.60 +   * @param aProxyService
    1.61 +   *        A reference to the Protocol Proxy Service.  This is passed so that
    1.62 +   *        implementations may easily access methods such as newProxyInfo.
    1.63 +   * @param aChannel
    1.64 +   *        The channel for which these proxy settings apply.
    1.65 +   * @param aProxy
    1.66 +   *        The proxy (or list of proxies) that would be used by default for
    1.67 +   *        the given channel. This may be null.
    1.68 +   *
    1.69 +   * @return The proxy (or list of proxies) that should be used in place of
    1.70 +   *         aProxy. This can be just be aProxy if the filter chooses not to
    1.71 +   *         modify the proxy. It can also be null to indicate that a direct
    1.72 +   *         connection should be used.  Use aProxyService.newProxyInfo to
    1.73 +   *         construct nsIProxyInfo objects.
    1.74 +   */
    1.75 +  nsIProxyInfo applyFilter(in nsIProtocolProxyService aProxyService,
    1.76 +                           in nsIChannel aChannel, in nsIProxyInfo aProxy);
    1.77 +};

mercurial