netwerk/base/public/nsILoadGroup.idl

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/netwerk/base/public/nsILoadGroup.idl	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,141 @@
     1.4 +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
     1.5 +/* This Source Code Form is subject to the terms of the Mozilla Public
     1.6 + * License, v. 2.0. If a copy of the MPL was not distributed with this
     1.7 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     1.8 +
     1.9 +#include "nsIRequest.idl"
    1.10 +
    1.11 +interface nsISimpleEnumerator;
    1.12 +interface nsIRequestObserver;
    1.13 +interface nsIInterfaceRequestor;
    1.14 +interface nsILoadGroupConnectionInfo;
    1.15 +
    1.16 +typedef unsigned long nsLoadFlags;
    1.17 +
    1.18 +/**
    1.19 + * A load group maintains a collection of nsIRequest objects. 
    1.20 + */
    1.21 +[scriptable, uuid(afb57ac2-bce5-4ee3-bb34-385089a9ba5c)]
    1.22 +interface nsILoadGroup : nsIRequest
    1.23 +{
    1.24 +    /**
    1.25 +     * The group observer is notified when requests are added to and removed
    1.26 +     * from this load group.  The groupObserver is weak referenced.
    1.27 +     */
    1.28 +    attribute nsIRequestObserver groupObserver;
    1.29 +
    1.30 +    /**
    1.31 +     * Accesses the default load request for the group.  Each time a number
    1.32 +     * of requests are added to a group, the defaultLoadRequest may be set
    1.33 +     * to indicate that all of the requests are related to a base request.
    1.34 +     *
    1.35 +     * The load group inherits its load flags from the default load request.
    1.36 +     * If the default load request is NULL, then the group's load flags are
    1.37 +     * not changed.
    1.38 +     */
    1.39 +    attribute nsIRequest defaultLoadRequest;
    1.40 +
    1.41 +    /**
    1.42 +     * Adds a new request to the group.  This will cause the default load
    1.43 +     * flags to be applied to the request.  If this is a foreground
    1.44 +     * request then the groupObserver's onStartRequest will be called.
    1.45 +     *
    1.46 +     * If the request is the default load request or if the default load
    1.47 +     * request is null, then the load group will inherit its load flags from
    1.48 +     * the request.
    1.49 +     */
    1.50 +    void addRequest(in nsIRequest aRequest,
    1.51 +                    in nsISupports aContext);
    1.52 +
    1.53 +    /**
    1.54 +     * Removes a request from the group.  If this is a foreground request
    1.55 +     * then the groupObserver's onStopRequest will be called.
    1.56 +     *
    1.57 +     * By the time this call ends, aRequest will have been removed from the
    1.58 +     * loadgroup, even if this function throws an exception.
    1.59 +     */
    1.60 +    void removeRequest(in nsIRequest aRequest, 
    1.61 +                       in nsISupports aContext,
    1.62 +                       in nsresult aStatus);
    1.63 +
    1.64 +    /**
    1.65 +     * Returns the requests contained directly in this group.
    1.66 +     * Enumerator element type: nsIRequest.
    1.67 +     */
    1.68 +    readonly attribute nsISimpleEnumerator requests;
    1.69 +
    1.70 +    /**
    1.71 +     * Returns the count of "active" requests (ie. requests without the
    1.72 +     * LOAD_BACKGROUND bit set).
    1.73 +     */
    1.74 +    readonly attribute unsigned long activeCount;
    1.75 +
    1.76 +    /**
    1.77 +     * Notification callbacks for the load group.
    1.78 +     */
    1.79 +    attribute nsIInterfaceRequestor notificationCallbacks;
    1.80 +
    1.81 +    /**
    1.82 +     * Connection information for managing things like js/css
    1.83 +     * connection blocking, and per-tab connection grouping
    1.84 +     */
    1.85 +    readonly attribute nsILoadGroupConnectionInfo connectionInfo;
    1.86 +
    1.87 +    /**
    1.88 +     * The set of load flags that will be added to all new requests added to
    1.89 +     * this group. Any existing requests in the load group are not modified,
    1.90 +     * so it is expected these flags will be added before requests are added
    1.91 +     * to the group - typically via nsIDocShell::defaultLoadFlags on a new
    1.92 +     * docShell.
    1.93 +     * Note that these flags are *not* added to the default request for the
    1.94 +     * load group; it is expected the default request will already have these
    1.95 +     * flags (again, courtesy of setting nsIDocShell::defaultLoadFlags before
    1.96 +     * the docShell has created the default request.)
    1.97 +     */
    1.98 +    attribute nsLoadFlags defaultLoadFlags;
    1.99 +};
   1.100 +
   1.101 +%{C++
   1.102 +// Forward-declare mozilla::net::SpdyPushCache
   1.103 +namespace mozilla {
   1.104 +namespace net {
   1.105 +class SpdyPushCache;
   1.106 +}
   1.107 +}
   1.108 +%}
   1.109 +
   1.110 +[ptr] native SpdyPushCachePtr(mozilla::net::SpdyPushCache);
   1.111 +
   1.112 +/**
   1.113 + * Used to maintain state about the connections of a load group and
   1.114 + * how they interact with blocking items like HEAD css/js loads.
   1.115 + */
   1.116 +
   1.117 +[uuid(fdc9659c-b597-4ac0-9c9e-14b04dbb682f)]
   1.118 +interface nsILoadGroupConnectionInfo : nsISupports
   1.119 +{
   1.120 +    /**
   1.121 +     * Number of active blocking transactions associated with this load group
   1.122 +     */
   1.123 +    readonly attribute unsigned long blockingTransactionCount;
   1.124 +
   1.125 +    /**
   1.126 +     * Increase the number of active blocking transactions associated
   1.127 +     * with this load group by one.
   1.128 +     */
   1.129 +    void addBlockingTransaction();
   1.130 +
   1.131 +    /**
   1.132 +     * Decrease the number of active blocking transactions associated
   1.133 +     * with this load group by one. The return value is the number of remaining
   1.134 +     * blockers.
   1.135 +     */
   1.136 +    unsigned long removeBlockingTransaction();
   1.137 +
   1.138 +    /* reading this attribute gives out weak pointers to the push
   1.139 +     * cache. The nsILoadGroupConnectionInfo implemenation owns the cache
   1.140 +     * and will destroy it when overwritten or when the load group
   1.141 +    *  ends.
   1.142 +    */
   1.143 +    [noscript]  attribute SpdyPushCachePtr spdyPushCache;
   1.144 +};

mercurial