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/. */
6 #include
"nsISupports.idl"
8 interface nsIPrincipal
;
10 interface nsIInterfaceRequestor
;
15 class OriginAttributes
;
20 native OriginAttributes
(mozilla
::OriginAttributes
&&);
22 [scriptable
, builtinclass
, uuid(d74a17ac
-5b8a
-4824-a309
-b1f04a3c4aed
)]
23 interface nsISpeculativeConnect
: nsISupports
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.
31 * No obligation is taken on by the implementer, nor is the submitter obligated
32 * to actually open the new channel.
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.
39 * @param aAnonymous indicates if this is an anonymous connection.
42 void speculativeConnect
(in nsIURI aURI
,
43 in nsIPrincipal aPrincipal
,
44 in nsIInterfaceRequestor aCallbacks
,
45 in boolean aAnonymous
);
48 * This method is similar to speculativeConnect, but it use
49 * the partition key of the originAttributes directly to create the
53 void speculativeConnectWithOriginAttributes
(
55 in jsval originAttributes
,
56 in nsIInterfaceRequestor aCallbacks
,
57 in boolean aAnonymous
);
60 void speculativeConnectWithOriginAttributesNative
(
62 in OriginAttributes originAttributes
,
63 in nsIInterfaceRequestor aCallbacks
,
64 in boolean aAnonymous
);
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
72 [uuid(1040ebe3
-6ed1
-45a6
-8587-995e082518d7
)]
73 interface nsISpeculativeConnectionOverrider
: nsISupports
76 * Used to determine the maximum number of unused speculative connections
77 * we will have open for a host at any one time
79 [infallible
] readonly attribute
unsigned long parallelSpeculativeConnectLimit
;
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
86 [infallible
] readonly attribute
boolean ignoreIdle
;
89 * Used by the Predictor to gather telemetry data on speculative connection
92 [infallible
] readonly attribute
boolean isFromPredictor
;
95 * by default speculative connections are not made to RFC 1918 addresses
97 [infallible
] readonly attribute
boolean allow1918
;