tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

nsISpeculativeConnect.idl (3163B)


      1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
      2 /* This Source Code Form is subject to the terms of the Mozilla Public
      3 * License, v. 2.0. If a copy of the MPL was not distributed with this
      4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
      5 
      6 #include "nsISupports.idl"
      7 
      8 interface nsIPrincipal;
      9 interface nsIURI;
     10 interface nsIInterfaceRequestor;
     11 
     12 %{C++
     13 namespace mozilla {
     14 
     15 class OriginAttributes;
     16 
     17 }
     18 %}
     19 
     20 native OriginAttributes(mozilla::OriginAttributes&&);
     21 
     22 [scriptable, builtinclass, uuid(d74a17ac-5b8a-4824-a309-b1f04a3c4aed)]
     23 interface nsISpeculativeConnect : nsISupports
     24 {
     25    /**
     26     * Called as a hint to indicate a new transaction for the URI is likely coming
     27     * soon. The implementer may use this information to start a TCP
     28     * and/or SSL level handshake for that resource immediately so that it is
     29     * ready and/or progressed when the transaction is actually submitted.
     30     *
     31     * No obligation is taken on by the implementer, nor is the submitter obligated
     32     * to actually open the new channel.
     33     *
     34     * @param aURI the URI of the hinted transaction
     35     * @param aPrincipal the principal that will be used for opening the
     36     *        channel of the hinted transaction.
     37     * @param aCallbacks any security callbacks for use with SSL for interfaces.
     38     *        May be null.
     39     * @param aAnonymous indicates if this is an anonymous connection.
     40     *
     41     */
     42    void speculativeConnect(in nsIURI aURI,
     43                            in nsIPrincipal aPrincipal,
     44                            in nsIInterfaceRequestor aCallbacks,
     45                            in boolean aAnonymous);
     46 
     47    /**
     48     * This method is similar to speculativeConnect, but it use
     49     * the partition key of the originAttributes directly to create the
     50     * connection.
     51     */
     52    [implicit_jscontext]
     53    void speculativeConnectWithOriginAttributes(
     54        in nsIURI aURI,
     55        in jsval originAttributes,
     56        in nsIInterfaceRequestor aCallbacks,
     57        in boolean aAnonymous);
     58 
     59    [notxpcom]
     60    void speculativeConnectWithOriginAttributesNative(
     61        in nsIURI aURI,
     62        in OriginAttributes originAttributes,
     63        in nsIInterfaceRequestor aCallbacks,
     64        in boolean aAnonymous);
     65 };
     66 
     67 /**
     68 * This is used to override the default values for various values (documented
     69 * inline) to determine whether or not to actually make a speculative
     70 * connection.
     71 */
     72 [uuid(1040ebe3-6ed1-45a6-8587-995e082518d7)]
     73 interface nsISpeculativeConnectionOverrider : nsISupports
     74 {
     75    /**
     76     * Used to determine the maximum number of unused speculative connections
     77     * we will have open for a host at any one time
     78     */
     79    [infallible] readonly attribute unsigned long parallelSpeculativeConnectLimit;
     80 
     81    /**
     82     * Used to determine if we will ignore the existence of any currently idle
     83     * connections when we decide whether or not to make a speculative
     84     * connection.
     85     */
     86    [infallible] readonly attribute boolean ignoreIdle;
     87 
     88    /**
     89     * by default speculative connections are not made to RFC 1918 addresses
     90     */
     91    [infallible] readonly attribute boolean allow1918;
     92 };