2002-10-01 03:18:43 +04:00
|
|
|
/* -*- Mode: C++; tab-width: 4; 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/. */
|
2002-10-01 03:18:43 +04:00
|
|
|
|
|
|
|
#include "nsISupports.idl"
|
|
|
|
|
2011-03-24 06:36:53 +03:00
|
|
|
%{C++
|
2013-09-23 07:35:05 +04:00
|
|
|
template<class T> class nsTArray;
|
|
|
|
template<class T> class nsCOMArray;
|
2011-03-24 06:36:53 +03:00
|
|
|
class nsCString;
|
|
|
|
%}
|
|
|
|
[ptr] native StringArray(nsTArray<nsCString>);
|
2015-08-22 00:31:56 +03:00
|
|
|
[ref] native StringArrayRef(const nsTArray<nsCString>);
|
2013-07-26 19:37:03 +04:00
|
|
|
[ref] native securityMessagesArray(nsCOMArray<nsISecurityConsoleMessage>);
|
2011-03-24 06:36:53 +03:00
|
|
|
|
2011-05-20 03:43:37 +04:00
|
|
|
interface nsIAsyncInputStream;
|
|
|
|
interface nsIAsyncOutputStream;
|
2014-05-22 23:58:23 +04:00
|
|
|
interface nsIPrincipal;
|
2004-11-23 10:05:27 +03:00
|
|
|
interface nsIProxyInfo;
|
2013-07-26 19:37:03 +04:00
|
|
|
interface nsISecurityConsoleMessage;
|
2014-05-22 23:58:23 +04:00
|
|
|
interface nsISocketTransport;
|
|
|
|
interface nsIURI;
|
2004-11-23 10:05:27 +03:00
|
|
|
|
2011-05-20 03:43:37 +04:00
|
|
|
/**
|
|
|
|
* The callback interface for nsIHttpChannelInternal::HTTPUpgrade()
|
|
|
|
*/
|
|
|
|
|
2015-08-22 00:31:56 +03:00
|
|
|
[scriptable, uuid(5b515449-ab64-4dba-b3cd-da8fc2f83064)]
|
2011-05-20 03:43:37 +04:00
|
|
|
interface nsIHttpUpgradeListener : nsISupports
|
|
|
|
{
|
|
|
|
void onTransportAvailable(in nsISocketTransport aTransport,
|
|
|
|
in nsIAsyncInputStream aSocketIn,
|
|
|
|
in nsIAsyncOutputStream aSocketOut);
|
|
|
|
};
|
|
|
|
|
2011-04-10 21:33:08 +04:00
|
|
|
/**
|
|
|
|
* Dumping ground for http. This interface will never be frozen. If you are
|
|
|
|
* using any feature exposed by this interface, be aware that this interface
|
2002-10-01 03:18:43 +04:00
|
|
|
* will change and you will be broken. You have been warned.
|
|
|
|
*/
|
2015-10-22 16:23:39 +03:00
|
|
|
[scriptable, uuid(9eabaac6-cc7c-4ca1-9430-65f2daaa578f)]
|
2002-10-01 03:18:43 +04:00
|
|
|
interface nsIHttpChannelInternal : nsISupports
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* An http channel can own a reference to the document URI
|
|
|
|
*/
|
|
|
|
attribute nsIURI documentURI;
|
|
|
|
|
2003-07-09 01:35:54 +04:00
|
|
|
/**
|
|
|
|
* Get the major/minor version numbers for the request
|
|
|
|
*/
|
|
|
|
void getRequestVersion(out unsigned long major, out unsigned long minor);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Get the major/minor version numbers for the response
|
|
|
|
*/
|
|
|
|
void getResponseVersion(out unsigned long major, out unsigned long minor);
|
2003-08-05 05:44:27 +04:00
|
|
|
|
2013-07-26 19:37:03 +04:00
|
|
|
/*
|
|
|
|
* Retrieves all security messages from the security message queue
|
|
|
|
* and empties the queue after retrieval
|
|
|
|
*/
|
|
|
|
[noscript] void takeAllSecurityMessages(in securityMessagesArray aMessages);
|
|
|
|
|
2003-08-05 05:44:27 +04:00
|
|
|
/**
|
|
|
|
* Helper method to set a cookie with a consumer-provided
|
|
|
|
* cookie header, _but_ using the channel's other information
|
|
|
|
* (URI's, prompters, date headers etc).
|
|
|
|
*
|
|
|
|
* @param aCookieHeader
|
|
|
|
* The cookie header to be parsed.
|
|
|
|
*/
|
|
|
|
void setCookie(in string aCookieHeader);
|
2008-09-30 22:34:23 +04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Setup this channel as an application cache fallback channel.
|
|
|
|
*/
|
|
|
|
void setupFallbackChannel(in string aFallbackKey);
|
|
|
|
|
2009-06-16 18:30:25 +04:00
|
|
|
/**
|
2014-10-28 16:23:00 +03:00
|
|
|
* This flag is set to force relevant cookies to be sent with this load
|
|
|
|
* even if normally they wouldn't be.
|
|
|
|
*/
|
|
|
|
const unsigned long THIRD_PARTY_FORCE_ALLOW = 1 << 0;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* This flag is set in the parent if the child has already computed that
|
|
|
|
* it originates from a 3rd party frame (i.e. a 3rd party iframe).
|
|
|
|
*/
|
|
|
|
const unsigned long THIRD_PARTY_PARENT_IS_THIRD_PARTY = 1 << 1;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* This flag is set in the parent if the child has already computed that
|
|
|
|
* it is not a 3rd party request due to iframe parentage. However, if
|
|
|
|
* someone calls mozIThirdPartyUtil::IsThirdPartyChannel with a 3rd-party
|
|
|
|
* URI, the result would be true if the URI is third-party from this
|
|
|
|
* channel's URI.
|
|
|
|
*/
|
|
|
|
const unsigned long THIRD_PARTY_PARENT_IS_SAME_PARTY = 1 << 2;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* When set, these flags modify the algorithm used to decide whether to
|
|
|
|
* send 3rd party cookies for a given channel.
|
|
|
|
*/
|
|
|
|
attribute unsigned long thirdPartyFlags;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* This attribute was added before the "flags" above and is retained here
|
|
|
|
* for compatibility. When set to true, has the same effect as
|
|
|
|
* THIRD_PARTY_FORCE_ALLOW, described above.
|
2009-06-16 18:30:25 +04:00
|
|
|
*/
|
|
|
|
attribute boolean forceAllowThirdPartyCookie;
|
2010-07-28 22:33:06 +04:00
|
|
|
|
|
|
|
/**
|
2011-04-10 21:33:08 +04:00
|
|
|
* True iff the channel has been canceled.
|
2010-07-28 22:33:06 +04:00
|
|
|
*/
|
|
|
|
readonly attribute boolean canceled;
|
2010-09-10 09:22:24 +04:00
|
|
|
|
|
|
|
/**
|
2011-04-10 21:33:08 +04:00
|
|
|
* External handlers may set this to true to notify the channel
|
|
|
|
* that it is open on behalf of a download.
|
2010-09-10 09:22:24 +04:00
|
|
|
*/
|
|
|
|
attribute boolean channelIsForDownload;
|
2011-03-24 06:36:53 +03:00
|
|
|
|
|
|
|
/**
|
2011-04-10 21:33:08 +04:00
|
|
|
* The local IP address to which this channel is bound, in the
|
|
|
|
* format produced by PR_NetAddrToString. May be IPv4 or IPv6.
|
|
|
|
* Note: in the presence of NAT, this may not be the same as the
|
|
|
|
* address that the remote host thinks it's talking to.
|
|
|
|
*
|
|
|
|
* May throw NS_ERROR_NOT_AVAILABLE if accessed when the channel's
|
|
|
|
* endpoints are not yet determined, or in any case when
|
|
|
|
* nsIHttpActivityObserver.isActive is false. See bugs 534698 and 526207.
|
|
|
|
*/
|
|
|
|
readonly attribute AUTF8String localAddress;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The local port number to which this channel is bound.
|
|
|
|
*
|
|
|
|
* May throw NS_ERROR_NOT_AVAILABLE if accessed when the channel's
|
|
|
|
* endpoints are not yet determined, or in any case when
|
|
|
|
* nsIHttpActivityObserver.isActive is false. See bugs 534698 and 526207.
|
|
|
|
*/
|
2012-08-22 19:56:38 +04:00
|
|
|
readonly attribute int32_t localPort;
|
2011-04-10 21:33:08 +04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* The IP address of the remote host that this channel is
|
|
|
|
* connected to, in the format produced by PR_NetAddrToString.
|
|
|
|
*
|
|
|
|
* May throw NS_ERROR_NOT_AVAILABLE if accessed when the channel's
|
|
|
|
* endpoints are not yet determined, or in any case when
|
|
|
|
* nsIHttpActivityObserver.isActive is false. See bugs 534698 and 526207.
|
|
|
|
*/
|
|
|
|
readonly attribute AUTF8String remoteAddress;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The remote port number that this channel is connected to.
|
|
|
|
*
|
|
|
|
* May throw NS_ERROR_NOT_AVAILABLE if accessed when the channel's
|
|
|
|
* endpoints are not yet determined, or in any case when
|
|
|
|
* nsIHttpActivityObserver.isActive is false. See bugs 534698 and 526207.
|
|
|
|
*/
|
2012-08-22 19:56:38 +04:00
|
|
|
readonly attribute int32_t remotePort;
|
2011-04-10 21:33:08 +04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Transfer chain of redirected cache-keys.
|
2011-03-24 06:36:53 +03:00
|
|
|
*/
|
|
|
|
[noscript] void setCacheKeysRedirectChain(in StringArray cacheKeys);
|
2011-05-20 03:43:37 +04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* HTTPUpgrade allows for the use of HTTP to bootstrap another protocol
|
|
|
|
* via the RFC 2616 Upgrade request header in conjunction with a 101 level
|
2013-05-16 17:30:42 +04:00
|
|
|
* response. The nsIHttpUpgradeListener will have its
|
2011-05-20 03:43:37 +04:00
|
|
|
* onTransportAvailable() method invoked if a matching 101 is processed.
|
|
|
|
* The arguments to onTransportAvailable provide the new protocol the low
|
|
|
|
* level tranport streams that are no longer used by HTTP.
|
|
|
|
*
|
|
|
|
* The onStartRequest and onStopRequest events are still delivered and the
|
|
|
|
* listener gets full control over the socket if and when onTransportAvailable
|
|
|
|
* is delievered.
|
|
|
|
*
|
|
|
|
* @param aProtocolName
|
|
|
|
* The value of the HTTP Upgrade request header
|
|
|
|
* @param aListener
|
|
|
|
* The callback object used to handle a successful upgrade
|
|
|
|
*/
|
|
|
|
void HTTPUpgrade(in ACString aProtocolName,
|
|
|
|
in nsIHttpUpgradeListener aListener);
|
|
|
|
|
2011-12-13 19:55:50 +04:00
|
|
|
/**
|
|
|
|
* Enable/Disable Spdy negotiation on per channel basis.
|
|
|
|
* The network.http.spdy.enabled preference is still a pre-requisite
|
|
|
|
* for starting spdy.
|
|
|
|
*/
|
|
|
|
attribute boolean allowSpdy;
|
|
|
|
|
2013-12-19 03:03:48 +04:00
|
|
|
/**
|
|
|
|
* This attribute en/disables the timeout for the first byte of an HTTP
|
|
|
|
* response. Enabled by default.
|
|
|
|
*/
|
|
|
|
attribute boolean responseTimeoutEnabled;
|
|
|
|
|
2015-09-11 22:53:27 +03:00
|
|
|
/**
|
|
|
|
* If the underlying transport supports RWIN manipulation, this is the
|
|
|
|
* intiial window value for the channel. HTTP/2 implements this.
|
|
|
|
* 0 means no override from system default. Set before opening channel.
|
|
|
|
*/
|
|
|
|
attribute unsigned long initialRwin;
|
|
|
|
|
2013-12-05 16:09:11 +04:00
|
|
|
/**
|
|
|
|
* Get value of the URI passed to nsIHttpChannel.redirectTo() if any.
|
|
|
|
* May return null when redirectTo() has not been called.
|
|
|
|
*/
|
|
|
|
readonly attribute nsIURI apiRedirectToURI;
|
2014-05-22 23:58:23 +04:00
|
|
|
|
2015-04-13 19:59:34 +03:00
|
|
|
/**
|
|
|
|
* Enable/Disable use of Alternate Services with this channel.
|
|
|
|
* The network.http.altsvc.enabled preference is still a pre-requisite.
|
|
|
|
*/
|
|
|
|
attribute boolean allowAltSvc;
|
|
|
|
|
2014-07-10 18:13:00 +04:00
|
|
|
readonly attribute PRTime lastModifiedTime;
|
2014-07-10 00:35:02 +04:00
|
|
|
|
2015-10-22 16:23:39 +03:00
|
|
|
/**
|
|
|
|
* Force a channel that has not been AsyncOpen'ed to skip any check for possible
|
|
|
|
* interception and proceed immediately to open a previously-synthesized cache
|
|
|
|
* entry using the provided ID.
|
|
|
|
*/
|
|
|
|
void forceIntercepted(in uint64_t aInterceptionID);
|
|
|
|
|
2015-08-18 22:28:46 +03:00
|
|
|
readonly attribute boolean responseSynthesized;
|
|
|
|
|
2015-03-17 18:47:02 +03:00
|
|
|
/**
|
|
|
|
* Set by nsCORSListenerProxy if credentials should be included in
|
|
|
|
* cross-origin requests. false indicates "same-origin", users should still
|
|
|
|
* check flag LOAD_ANONYMOUS!
|
|
|
|
*/
|
|
|
|
attribute boolean corsIncludeCredentials;
|
|
|
|
|
|
|
|
const unsigned long CORS_MODE_SAME_ORIGIN = 0;
|
|
|
|
const unsigned long CORS_MODE_NO_CORS = 1;
|
|
|
|
const unsigned long CORS_MODE_CORS = 2;
|
|
|
|
/**
|
|
|
|
* Set by nsCORSListenerProxy to indicate CORS load type. Defaults to CORS_MODE_NO_CORS.
|
|
|
|
*/
|
|
|
|
attribute unsigned long corsMode;
|
|
|
|
|
2015-09-01 00:26:29 +03:00
|
|
|
const unsigned long REDIRECT_MODE_FOLLOW = 0;
|
|
|
|
const unsigned long REDIRECT_MODE_ERROR = 1;
|
|
|
|
const unsigned long REDIRECT_MODE_MANUAL = 2;
|
|
|
|
/**
|
|
|
|
* Set to indicate Request.redirect mode exposed during ServiceWorker
|
|
|
|
* interception. No policy enforcement is performed by the channel for this
|
|
|
|
* value.
|
|
|
|
*/
|
|
|
|
attribute unsigned long redirectMode;
|
|
|
|
|
2014-10-30 03:22:22 +03:00
|
|
|
/**
|
|
|
|
* The URI of the top-level window that's associated with this channel.
|
|
|
|
*/
|
|
|
|
readonly attribute nsIURI topWindowURI;
|
2015-01-10 00:25:13 +03:00
|
|
|
|
2015-04-07 18:45:57 +03:00
|
|
|
/**
|
|
|
|
* The network interface id that's associated with this channel.
|
|
|
|
*/
|
|
|
|
attribute ACString networkInterfaceId;
|
|
|
|
|
2015-01-21 23:13:00 +03:00
|
|
|
/**
|
|
|
|
* Read the proxy URI, which, if non-null, will be used to resolve
|
|
|
|
* proxies for this channel.
|
|
|
|
*/
|
|
|
|
readonly attribute nsIURI proxyURI;
|
2015-08-22 00:31:56 +03:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Make cross-origin CORS loads happen with a CORS preflight, and specify
|
|
|
|
* the CORS preflight parameters.
|
|
|
|
*/
|
|
|
|
[noscript]
|
|
|
|
void setCorsPreflightParameters(in StringArrayRef unsafeHeaders,
|
|
|
|
in boolean withCredentials,
|
|
|
|
in nsIPrincipal preflightPrincipal);
|
2002-10-01 03:18:43 +04:00
|
|
|
};
|