gecko/netwerk/base/nsISchedulingContext.idl

91 lines
2.8 KiB
Plaintext

/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/* 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/. */
#include "nsISupports.idl"
%{C++
// Forward-declare mozilla::net::SpdyPushCache
namespace mozilla {
namespace net {
class SpdyPushCache;
}
}
%}
[ptr] native SpdyPushCachePtr(mozilla::net::SpdyPushCache);
/**
* The nsISchedulingContext is used to maintain state about connections
* that are in some way associated with each other (often by being part
* of the same load group) and how they interact with blocking items like
* HEAD css/js loads.
*
* This used to be known as nsILoadGroupConnectionInfo.
*/
[scriptable, uuid(658e3e6e-8633-4b1a-8d66-fa9f72293e63)]
interface nsISchedulingContext : nsISupports
{
/**
* A unique identifier for this scheduling context
*/
[noscript] readonly attribute nsID ID;
/**
* Number of active blocking transactions associated with this context
*/
readonly attribute unsigned long blockingTransactionCount;
/**
* Increase the number of active blocking transactions associated
* with this context by one.
*/
void addBlockingTransaction();
/**
* Decrease the number of active blocking transactions associated
* with this context by one. The return value is the number of remaining
* blockers.
*/
unsigned long removeBlockingTransaction();
/**
* This gives out a weak pointer to the push cache.
* The nsISchedulingContext implementation owns the cache
* and will destroy it when overwritten or when the context
* ends.
*/
[noscript] attribute SpdyPushCachePtr spdyPushCache;
};
/**
* The nsISchedulingContextService is how anyone gets access to a scheduling
* context when they haven't been explicitly given a strong reference to an
* existing one. It is responsible for creating and handing out strong
* references to nsISchedulingContexts, but only keeps weak references itself.
* The shared scheduling context will go away once no one else is keeping a
* reference to it. If you ask for a scheduling context that has no one else
* holding a reference to it, you'll get a brand new scheduling context. Anyone
* who asks for the same scheduling context while you're holding a reference
* will get a reference to the same scheduling context you have.
*/
[uuid(7fcbf4da-d828-4acc-b144-e5435198f727)]
interface nsISchedulingContextService : nsISupports
{
/**
* Get an existing scheduling context from its ID
*/
nsISchedulingContext getSchedulingContext(in nsIDRef id);
/**
* Create a new scheduling context identifier
*/
nsID newSchedulingContextID();
/**
* Remove an existing scheduling context from its ID
*/
void removeSchedulingContext(in nsIDRef id);
};