1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/netwerk/protocol/http/nsIHttpChannelInternal.idl Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,195 @@ 1.4 +/* -*- Mode: C++; tab-width: 4; 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 "nsISupports.idl" 1.10 + 1.11 +%{C++ 1.12 +template<class T> class nsTArray; 1.13 +template<class T> class nsCOMArray; 1.14 +class nsCString; 1.15 +%} 1.16 +[ptr] native StringArray(nsTArray<nsCString>); 1.17 +[ref] native securityMessagesArray(nsCOMArray<nsISecurityConsoleMessage>); 1.18 + 1.19 +interface nsISocketTransport; 1.20 +interface nsIAsyncInputStream; 1.21 +interface nsIAsyncOutputStream; 1.22 +interface nsIURI; 1.23 +interface nsIProxyInfo; 1.24 +interface nsISecurityConsoleMessage; 1.25 + 1.26 +/** 1.27 + * The callback interface for nsIHttpChannelInternal::HTTPUpgrade() 1.28 + */ 1.29 + 1.30 +[scriptable, uuid(4b967b6d-cd1c-49ae-a457-23ff76f5a2e8)] 1.31 +interface nsIHttpUpgradeListener : nsISupports 1.32 +{ 1.33 + void onTransportAvailable(in nsISocketTransport aTransport, 1.34 + in nsIAsyncInputStream aSocketIn, 1.35 + in nsIAsyncOutputStream aSocketOut); 1.36 +}; 1.37 + 1.38 +/** 1.39 + * Dumping ground for http. This interface will never be frozen. If you are 1.40 + * using any feature exposed by this interface, be aware that this interface 1.41 + * will change and you will be broken. You have been warned. 1.42 + */ 1.43 +[scriptable, uuid(b733194f-6751-4876-a444-bca4ba3f2fcb)] 1.44 +interface nsIHttpChannelInternal : nsISupports 1.45 +{ 1.46 + /** 1.47 + * An http channel can own a reference to the document URI 1.48 + */ 1.49 + attribute nsIURI documentURI; 1.50 + 1.51 + /** 1.52 + * Get the major/minor version numbers for the request 1.53 + */ 1.54 + void getRequestVersion(out unsigned long major, out unsigned long minor); 1.55 + 1.56 + /** 1.57 + * Get the major/minor version numbers for the response 1.58 + */ 1.59 + void getResponseVersion(out unsigned long major, out unsigned long minor); 1.60 + 1.61 + /* 1.62 + * Retrieves all security messages from the security message queue 1.63 + * and empties the queue after retrieval 1.64 + */ 1.65 + [noscript] void takeAllSecurityMessages(in securityMessagesArray aMessages); 1.66 + 1.67 + /** 1.68 + * Helper method to set a cookie with a consumer-provided 1.69 + * cookie header, _but_ using the channel's other information 1.70 + * (URI's, prompters, date headers etc). 1.71 + * 1.72 + * @param aCookieHeader 1.73 + * The cookie header to be parsed. 1.74 + */ 1.75 + void setCookie(in string aCookieHeader); 1.76 + 1.77 + /** 1.78 + * Setup this channel as an application cache fallback channel. 1.79 + */ 1.80 + void setupFallbackChannel(in string aFallbackKey); 1.81 + 1.82 + /** 1.83 + * Force relevant cookies to be sent with this load even if normally they 1.84 + * wouldn't be. 1.85 + */ 1.86 + attribute boolean forceAllowThirdPartyCookie; 1.87 + 1.88 + /** 1.89 + * True iff the channel has been canceled. 1.90 + */ 1.91 + readonly attribute boolean canceled; 1.92 + 1.93 + /** 1.94 + * External handlers may set this to true to notify the channel 1.95 + * that it is open on behalf of a download. 1.96 + */ 1.97 + attribute boolean channelIsForDownload; 1.98 + 1.99 + /** 1.100 + * The local IP address to which this channel is bound, in the 1.101 + * format produced by PR_NetAddrToString. May be IPv4 or IPv6. 1.102 + * Note: in the presence of NAT, this may not be the same as the 1.103 + * address that the remote host thinks it's talking to. 1.104 + * 1.105 + * May throw NS_ERROR_NOT_AVAILABLE if accessed when the channel's 1.106 + * endpoints are not yet determined, or in any case when 1.107 + * nsIHttpActivityObserver.isActive is false. See bugs 534698 and 526207. 1.108 + */ 1.109 + readonly attribute AUTF8String localAddress; 1.110 + 1.111 + /** 1.112 + * The local port number to which this channel is bound. 1.113 + * 1.114 + * May throw NS_ERROR_NOT_AVAILABLE if accessed when the channel's 1.115 + * endpoints are not yet determined, or in any case when 1.116 + * nsIHttpActivityObserver.isActive is false. See bugs 534698 and 526207. 1.117 + */ 1.118 + readonly attribute int32_t localPort; 1.119 + 1.120 + /** 1.121 + * The IP address of the remote host that this channel is 1.122 + * connected to, in the format produced by PR_NetAddrToString. 1.123 + * 1.124 + * May throw NS_ERROR_NOT_AVAILABLE if accessed when the channel's 1.125 + * endpoints are not yet determined, or in any case when 1.126 + * nsIHttpActivityObserver.isActive is false. See bugs 534698 and 526207. 1.127 + */ 1.128 + readonly attribute AUTF8String remoteAddress; 1.129 + 1.130 + /** 1.131 + * The remote port number that this channel is connected to. 1.132 + * 1.133 + * May throw NS_ERROR_NOT_AVAILABLE if accessed when the channel's 1.134 + * endpoints are not yet determined, or in any case when 1.135 + * nsIHttpActivityObserver.isActive is false. See bugs 534698 and 526207. 1.136 + */ 1.137 + readonly attribute int32_t remotePort; 1.138 + 1.139 + /** 1.140 + * Transfer chain of redirected cache-keys. 1.141 + */ 1.142 + [noscript] void setCacheKeysRedirectChain(in StringArray cacheKeys); 1.143 + 1.144 + /** 1.145 + * HTTPUpgrade allows for the use of HTTP to bootstrap another protocol 1.146 + * via the RFC 2616 Upgrade request header in conjunction with a 101 level 1.147 + * response. The nsIHttpUpgradeListener will have its 1.148 + * onTransportAvailable() method invoked if a matching 101 is processed. 1.149 + * The arguments to onTransportAvailable provide the new protocol the low 1.150 + * level tranport streams that are no longer used by HTTP. 1.151 + * 1.152 + * The onStartRequest and onStopRequest events are still delivered and the 1.153 + * listener gets full control over the socket if and when onTransportAvailable 1.154 + * is delievered. 1.155 + * 1.156 + * @param aProtocolName 1.157 + * The value of the HTTP Upgrade request header 1.158 + * @param aListener 1.159 + * The callback object used to handle a successful upgrade 1.160 + */ 1.161 + void HTTPUpgrade(in ACString aProtocolName, 1.162 + in nsIHttpUpgradeListener aListener); 1.163 + 1.164 + /** 1.165 + * Enable/Disable Spdy negotiation on per channel basis. 1.166 + * The network.http.spdy.enabled preference is still a pre-requisite 1.167 + * for starting spdy. 1.168 + */ 1.169 + attribute boolean allowSpdy; 1.170 + 1.171 + /** 1.172 + * Set (e.g., by the docshell) to indicate whether or not the channel 1.173 + * corresponds to content that should be given a degree of network exclusivity 1.174 + * with respect to other members of its load group. 1.175 + * Examples are js from the HTML head and css which are latency 1.176 + * sensitive and should not compete with images for bandwidth. Default false. 1.177 + */ 1.178 + attribute boolean loadAsBlocking; 1.179 + 1.180 + /** 1.181 + * If set, this channel will load in parallel with the rest of the load 1.182 + * group even if a blocking subset of the group would normally be given 1.183 + * exclusivity. Default false. 1.184 + */ 1.185 + attribute boolean loadUnblocked; 1.186 + 1.187 + /** 1.188 + * This attribute en/disables the timeout for the first byte of an HTTP 1.189 + * response. Enabled by default. 1.190 + */ 1.191 + attribute boolean responseTimeoutEnabled; 1.192 + 1.193 + /** 1.194 + * Get value of the URI passed to nsIHttpChannel.redirectTo() if any. 1.195 + * May return null when redirectTo() has not been called. 1.196 + */ 1.197 + readonly attribute nsIURI apiRedirectToURI; 1.198 +};