1 /* This Source Code Form is subject to the terms of the Mozilla Public
2 * License, v. 2.0. If a copy of the MPL was not distributed with this
3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
5 #include
"nsISupports.idl"
6 #include
"nsIContentPolicy.idl"
9 interface nsISimpleEnumerator
;
10 interface nsIReferrerInfo
;
14 [scriptable
, uuid(422a1807
-4e7f
-463d
-b8d7
-ca2ceb9b5d53
)]
15 interface nsIPrefetchService
: nsISupports
18 * Enqueue a request to prefetch the specified URI.
20 * @param aURI the URI of the document to prefetch
21 * @param aReferrerInfo the referrerInfo of the request
22 * @param aSource the DOM node (such as a <link> tag) that requested this
23 * fetch, or null if the prefetch was not requested by a DOM node.
24 * @param aExplicit the link element has an explicit prefetch link type
26 void prefetchURI
(in nsIURI aURI
,
27 in nsIReferrerInfo aReferrerInfo
,
29 in boolean aExplicit
);
32 * Start a preload of the specified URI.
34 * @param aURI the URI of the document to preload
35 * @param aReferrerInfo the referrerInfo of the request
36 * @param aSource the DOM node (such as a <link> tag) that requested this
37 * fetch, or null if the prefetch was not requested by a DOM node.
38 * @param aPolicyType content policy to be used for this load.
40 void preloadURI
(in nsIURI aURI
,
41 in nsIReferrerInfo aReferrerInfo
,
43 in nsContentPolicyType aPolicyType
);
46 * Find out if there are any prefetches running or queued
48 boolean hasMoreElements
();
51 * Cancel prefetch or preload for a Node.
53 void cancelPrefetchPreloadURI
(in nsIURI aURI
, in Node aSource
);