2001-09-29 00:14:13 +04:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
2012-05-21 15:12:37 +04:00
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
1999-06-25 02:58:42 +04:00
|
|
|
|
|
|
|
#include "nsIRequest.idl"
|
|
|
|
|
|
|
|
interface nsISimpleEnumerator;
|
2001-04-10 10:01:08 +04:00
|
|
|
interface nsIRequestObserver;
|
|
|
|
interface nsIInterfaceRequestor;
|
2016-04-21 17:59:17 +03:00
|
|
|
interface nsIRequestContext;
|
1999-08-27 02:45:55 +04:00
|
|
|
|
1999-07-01 23:30:20 +04:00
|
|
|
/**
|
2015-09-29 17:49:15 +03:00
|
|
|
* A load group maintains a collection of nsIRequest objects.
|
|
|
|
* This is used in lots of places where groups of requests need to be tracked.
|
|
|
|
* For example, nsIDocument::mDocumentLoadGroup is used to track all requests
|
|
|
|
* made for subdocuments in order to track page load progress and allow all
|
|
|
|
* requests made on behalf of the document to be stopped, etc.
|
1999-07-01 23:30:20 +04:00
|
|
|
*/
|
2015-09-16 19:31:19 +03:00
|
|
|
[scriptable, uuid(f0c87725-7a35-463c-9ceb-2c07f23406cc)]
|
1999-06-25 02:58:42 +04:00
|
|
|
interface nsILoadGroup : nsIRequest
|
|
|
|
{
|
|
|
|
/**
|
2001-04-10 10:01:08 +04:00
|
|
|
* The group observer is notified when requests are added to and removed
|
|
|
|
* from this load group. The groupObserver is weak referenced.
|
1999-06-25 02:58:42 +04:00
|
|
|
*/
|
2001-04-10 10:01:08 +04:00
|
|
|
attribute nsIRequestObserver groupObserver;
|
1999-06-25 02:58:42 +04:00
|
|
|
|
1999-10-12 05:39:37 +04:00
|
|
|
/**
|
2001-04-10 10:01:08 +04:00
|
|
|
* Accesses the default load request for the group. Each time a number
|
|
|
|
* of requests are added to a group, the defaultLoadRequest may be set
|
|
|
|
* to indicate that all of the requests are related to a base request.
|
2001-08-25 02:24:10 +04:00
|
|
|
*
|
|
|
|
* The load group inherits its load flags from the default load request.
|
|
|
|
* If the default load request is NULL, then the group's load flags are
|
|
|
|
* not changed.
|
1999-10-12 05:39:37 +04:00
|
|
|
*/
|
2001-02-21 23:38:08 +03:00
|
|
|
attribute nsIRequest defaultLoadRequest;
|
1999-08-27 02:45:55 +04:00
|
|
|
|
1999-06-25 02:58:42 +04:00
|
|
|
/**
|
2001-04-10 10:01:08 +04:00
|
|
|
* Adds a new request to the group. This will cause the default load
|
2001-08-25 02:24:10 +04:00
|
|
|
* flags to be applied to the request. If this is a foreground
|
2001-04-10 10:01:08 +04:00
|
|
|
* request then the groupObserver's onStartRequest will be called.
|
2001-08-25 02:24:10 +04:00
|
|
|
*
|
|
|
|
* If the request is the default load request or if the default load
|
|
|
|
* request is null, then the load group will inherit its load flags from
|
|
|
|
* the request.
|
1999-06-25 02:58:42 +04:00
|
|
|
*/
|
2002-05-03 11:49:43 +04:00
|
|
|
void addRequest(in nsIRequest aRequest,
|
|
|
|
in nsISupports aContext);
|
1999-06-25 02:58:42 +04:00
|
|
|
|
|
|
|
/**
|
2001-04-10 10:01:08 +04:00
|
|
|
* Removes a request from the group. If this is a foreground request
|
|
|
|
* then the groupObserver's onStopRequest will be called.
|
2006-06-27 21:57:26 +04:00
|
|
|
*
|
|
|
|
* By the time this call ends, aRequest will have been removed from the
|
|
|
|
* loadgroup, even if this function throws an exception.
|
1999-06-25 02:58:42 +04:00
|
|
|
*/
|
2016-02-10 00:33:34 +03:00
|
|
|
void removeRequest(in nsIRequest aRequest,
|
2002-05-03 11:49:43 +04:00
|
|
|
in nsISupports aContext,
|
|
|
|
in nsresult aStatus);
|
1999-06-25 02:58:42 +04:00
|
|
|
|
|
|
|
/**
|
2001-02-21 23:38:08 +03:00
|
|
|
* Returns the requests contained directly in this group.
|
|
|
|
* Enumerator element type: nsIRequest.
|
1999-06-25 02:58:42 +04:00
|
|
|
*/
|
2001-02-21 23:38:08 +03:00
|
|
|
readonly attribute nsISimpleEnumerator requests;
|
1999-06-25 02:58:42 +04:00
|
|
|
|
2001-04-10 10:01:08 +04:00
|
|
|
/**
|
|
|
|
* Returns the count of "active" requests (ie. requests without the
|
|
|
|
* LOAD_BACKGROUND bit set).
|
|
|
|
*/
|
2004-02-10 01:48:53 +03:00
|
|
|
readonly attribute unsigned long activeCount;
|
1999-06-25 02:58:42 +04:00
|
|
|
|
2001-04-10 10:01:08 +04:00
|
|
|
/**
|
|
|
|
* Notification callbacks for the load group.
|
|
|
|
*/
|
|
|
|
attribute nsIInterfaceRequestor notificationCallbacks;
|
2012-12-05 03:06:29 +04:00
|
|
|
|
|
|
|
/**
|
2015-07-31 23:50:08 +03:00
|
|
|
* Context for managing things like js/css connection blocking,
|
|
|
|
* and per-tab connection grouping.
|
2012-12-05 03:06:29 +04:00
|
|
|
*/
|
2017-03-23 17:40:36 +03:00
|
|
|
[noscript] readonly attribute unsigned long long requestContextID;
|
2013-09-06 10:33:29 +04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* The set of load flags that will be added to all new requests added to
|
|
|
|
* this group. Any existing requests in the load group are not modified,
|
|
|
|
* so it is expected these flags will be added before requests are added
|
|
|
|
* to the group - typically via nsIDocShell::defaultLoadFlags on a new
|
|
|
|
* docShell.
|
|
|
|
* Note that these flags are *not* added to the default request for the
|
|
|
|
* load group; it is expected the default request will already have these
|
|
|
|
* flags (again, courtesy of setting nsIDocShell::defaultLoadFlags before
|
|
|
|
* the docShell has created the default request.)
|
|
|
|
*/
|
|
|
|
attribute nsLoadFlags defaultLoadFlags;
|
2016-02-10 00:33:34 +03:00
|
|
|
|
|
|
|
/**
|
|
|
|
* The cached user agent override created by UserAgentOverrides.jsm. Used
|
|
|
|
* for all sub-resource requests in the loadgroup.
|
|
|
|
*/
|
|
|
|
attribute ACString userAgentOverrideCache;
|
2012-12-05 03:06:29 +04:00
|
|
|
};
|