michael@0: /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: #include "nsISupports.idl" michael@0: michael@0: %{C++ michael@0: template class nsTArray; michael@0: template class nsCOMArray; michael@0: class nsCString; michael@0: %} michael@0: [ptr] native StringArray(nsTArray); michael@0: [ref] native securityMessagesArray(nsCOMArray); michael@0: michael@0: interface nsISocketTransport; michael@0: interface nsIAsyncInputStream; michael@0: interface nsIAsyncOutputStream; michael@0: interface nsIURI; michael@0: interface nsIProxyInfo; michael@0: interface nsISecurityConsoleMessage; michael@0: michael@0: /** michael@0: * The callback interface for nsIHttpChannelInternal::HTTPUpgrade() michael@0: */ michael@0: michael@0: [scriptable, uuid(4b967b6d-cd1c-49ae-a457-23ff76f5a2e8)] michael@0: interface nsIHttpUpgradeListener : nsISupports michael@0: { michael@0: void onTransportAvailable(in nsISocketTransport aTransport, michael@0: in nsIAsyncInputStream aSocketIn, michael@0: in nsIAsyncOutputStream aSocketOut); michael@0: }; michael@0: michael@0: /** michael@0: * Dumping ground for http. This interface will never be frozen. If you are michael@0: * using any feature exposed by this interface, be aware that this interface michael@0: * will change and you will be broken. You have been warned. michael@0: */ michael@0: [scriptable, uuid(b733194f-6751-4876-a444-bca4ba3f2fcb)] michael@0: interface nsIHttpChannelInternal : nsISupports michael@0: { michael@0: /** michael@0: * An http channel can own a reference to the document URI michael@0: */ michael@0: attribute nsIURI documentURI; michael@0: michael@0: /** michael@0: * Get the major/minor version numbers for the request michael@0: */ michael@0: void getRequestVersion(out unsigned long major, out unsigned long minor); michael@0: michael@0: /** michael@0: * Get the major/minor version numbers for the response michael@0: */ michael@0: void getResponseVersion(out unsigned long major, out unsigned long minor); michael@0: michael@0: /* michael@0: * Retrieves all security messages from the security message queue michael@0: * and empties the queue after retrieval michael@0: */ michael@0: [noscript] void takeAllSecurityMessages(in securityMessagesArray aMessages); michael@0: michael@0: /** michael@0: * Helper method to set a cookie with a consumer-provided michael@0: * cookie header, _but_ using the channel's other information michael@0: * (URI's, prompters, date headers etc). michael@0: * michael@0: * @param aCookieHeader michael@0: * The cookie header to be parsed. michael@0: */ michael@0: void setCookie(in string aCookieHeader); michael@0: michael@0: /** michael@0: * Setup this channel as an application cache fallback channel. michael@0: */ michael@0: void setupFallbackChannel(in string aFallbackKey); michael@0: michael@0: /** michael@0: * Force relevant cookies to be sent with this load even if normally they michael@0: * wouldn't be. michael@0: */ michael@0: attribute boolean forceAllowThirdPartyCookie; michael@0: michael@0: /** michael@0: * True iff the channel has been canceled. michael@0: */ michael@0: readonly attribute boolean canceled; michael@0: michael@0: /** michael@0: * External handlers may set this to true to notify the channel michael@0: * that it is open on behalf of a download. michael@0: */ michael@0: attribute boolean channelIsForDownload; michael@0: michael@0: /** michael@0: * The local IP address to which this channel is bound, in the michael@0: * format produced by PR_NetAddrToString. May be IPv4 or IPv6. michael@0: * Note: in the presence of NAT, this may not be the same as the michael@0: * address that the remote host thinks it's talking to. michael@0: * michael@0: * May throw NS_ERROR_NOT_AVAILABLE if accessed when the channel's michael@0: * endpoints are not yet determined, or in any case when michael@0: * nsIHttpActivityObserver.isActive is false. See bugs 534698 and 526207. michael@0: */ michael@0: readonly attribute AUTF8String localAddress; michael@0: michael@0: /** michael@0: * The local port number to which this channel is bound. michael@0: * michael@0: * May throw NS_ERROR_NOT_AVAILABLE if accessed when the channel's michael@0: * endpoints are not yet determined, or in any case when michael@0: * nsIHttpActivityObserver.isActive is false. See bugs 534698 and 526207. michael@0: */ michael@0: readonly attribute int32_t localPort; michael@0: michael@0: /** michael@0: * The IP address of the remote host that this channel is michael@0: * connected to, in the format produced by PR_NetAddrToString. michael@0: * michael@0: * May throw NS_ERROR_NOT_AVAILABLE if accessed when the channel's michael@0: * endpoints are not yet determined, or in any case when michael@0: * nsIHttpActivityObserver.isActive is false. See bugs 534698 and 526207. michael@0: */ michael@0: readonly attribute AUTF8String remoteAddress; michael@0: michael@0: /** michael@0: * The remote port number that this channel is connected to. michael@0: * michael@0: * May throw NS_ERROR_NOT_AVAILABLE if accessed when the channel's michael@0: * endpoints are not yet determined, or in any case when michael@0: * nsIHttpActivityObserver.isActive is false. See bugs 534698 and 526207. michael@0: */ michael@0: readonly attribute int32_t remotePort; michael@0: michael@0: /** michael@0: * Transfer chain of redirected cache-keys. michael@0: */ michael@0: [noscript] void setCacheKeysRedirectChain(in StringArray cacheKeys); michael@0: michael@0: /** michael@0: * HTTPUpgrade allows for the use of HTTP to bootstrap another protocol michael@0: * via the RFC 2616 Upgrade request header in conjunction with a 101 level michael@0: * response. The nsIHttpUpgradeListener will have its michael@0: * onTransportAvailable() method invoked if a matching 101 is processed. michael@0: * The arguments to onTransportAvailable provide the new protocol the low michael@0: * level tranport streams that are no longer used by HTTP. michael@0: * michael@0: * The onStartRequest and onStopRequest events are still delivered and the michael@0: * listener gets full control over the socket if and when onTransportAvailable michael@0: * is delievered. michael@0: * michael@0: * @param aProtocolName michael@0: * The value of the HTTP Upgrade request header michael@0: * @param aListener michael@0: * The callback object used to handle a successful upgrade michael@0: */ michael@0: void HTTPUpgrade(in ACString aProtocolName, michael@0: in nsIHttpUpgradeListener aListener); michael@0: michael@0: /** michael@0: * Enable/Disable Spdy negotiation on per channel basis. michael@0: * The network.http.spdy.enabled preference is still a pre-requisite michael@0: * for starting spdy. michael@0: */ michael@0: attribute boolean allowSpdy; michael@0: michael@0: /** michael@0: * Set (e.g., by the docshell) to indicate whether or not the channel michael@0: * corresponds to content that should be given a degree of network exclusivity michael@0: * with respect to other members of its load group. michael@0: * Examples are js from the HTML head and css which are latency michael@0: * sensitive and should not compete with images for bandwidth. Default false. michael@0: */ michael@0: attribute boolean loadAsBlocking; michael@0: michael@0: /** michael@0: * If set, this channel will load in parallel with the rest of the load michael@0: * group even if a blocking subset of the group would normally be given michael@0: * exclusivity. Default false. michael@0: */ michael@0: attribute boolean loadUnblocked; michael@0: michael@0: /** michael@0: * This attribute en/disables the timeout for the first byte of an HTTP michael@0: * response. Enabled by default. michael@0: */ michael@0: attribute boolean responseTimeoutEnabled; michael@0: michael@0: /** michael@0: * Get value of the URI passed to nsIHttpChannel.redirectTo() if any. michael@0: * May return null when redirectTo() has not been called. michael@0: */ michael@0: readonly attribute nsIURI apiRedirectToURI; michael@0: };