netwerk/protocol/http/nsIHttpChannelInternal.idl

Thu, 15 Jan 2015 21:03:48 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 15 Jan 2015 21:03:48 +0100
branch
TOR_BUG_9701
changeset 11
deefc01c0e14
permissions
-rw-r--r--

Integrate friendly tips from Tor colleagues to make (or not) 4.5 alpha 3;
This includes removal of overloaded (but unused) methods, and addition of
a overlooked call to DataStruct::SetData(nsISupports, uint32_t, bool.)

michael@0 1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
michael@0 2 /* This Source Code Form is subject to the terms of the Mozilla Public
michael@0 3 * License, v. 2.0. If a copy of the MPL was not distributed with this
michael@0 4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
michael@0 5
michael@0 6 #include "nsISupports.idl"
michael@0 7
michael@0 8 %{C++
michael@0 9 template<class T> class nsTArray;
michael@0 10 template<class T> class nsCOMArray;
michael@0 11 class nsCString;
michael@0 12 %}
michael@0 13 [ptr] native StringArray(nsTArray<nsCString>);
michael@0 14 [ref] native securityMessagesArray(nsCOMArray<nsISecurityConsoleMessage>);
michael@0 15
michael@0 16 interface nsISocketTransport;
michael@0 17 interface nsIAsyncInputStream;
michael@0 18 interface nsIAsyncOutputStream;
michael@0 19 interface nsIURI;
michael@0 20 interface nsIProxyInfo;
michael@0 21 interface nsISecurityConsoleMessage;
michael@0 22
michael@0 23 /**
michael@0 24 * The callback interface for nsIHttpChannelInternal::HTTPUpgrade()
michael@0 25 */
michael@0 26
michael@0 27 [scriptable, uuid(4b967b6d-cd1c-49ae-a457-23ff76f5a2e8)]
michael@0 28 interface nsIHttpUpgradeListener : nsISupports
michael@0 29 {
michael@0 30 void onTransportAvailable(in nsISocketTransport aTransport,
michael@0 31 in nsIAsyncInputStream aSocketIn,
michael@0 32 in nsIAsyncOutputStream aSocketOut);
michael@0 33 };
michael@0 34
michael@0 35 /**
michael@0 36 * Dumping ground for http. This interface will never be frozen. If you are
michael@0 37 * using any feature exposed by this interface, be aware that this interface
michael@0 38 * will change and you will be broken. You have been warned.
michael@0 39 */
michael@0 40 [scriptable, uuid(b733194f-6751-4876-a444-bca4ba3f2fcb)]
michael@0 41 interface nsIHttpChannelInternal : nsISupports
michael@0 42 {
michael@0 43 /**
michael@0 44 * An http channel can own a reference to the document URI
michael@0 45 */
michael@0 46 attribute nsIURI documentURI;
michael@0 47
michael@0 48 /**
michael@0 49 * Get the major/minor version numbers for the request
michael@0 50 */
michael@0 51 void getRequestVersion(out unsigned long major, out unsigned long minor);
michael@0 52
michael@0 53 /**
michael@0 54 * Get the major/minor version numbers for the response
michael@0 55 */
michael@0 56 void getResponseVersion(out unsigned long major, out unsigned long minor);
michael@0 57
michael@0 58 /*
michael@0 59 * Retrieves all security messages from the security message queue
michael@0 60 * and empties the queue after retrieval
michael@0 61 */
michael@0 62 [noscript] void takeAllSecurityMessages(in securityMessagesArray aMessages);
michael@0 63
michael@0 64 /**
michael@0 65 * Helper method to set a cookie with a consumer-provided
michael@0 66 * cookie header, _but_ using the channel's other information
michael@0 67 * (URI's, prompters, date headers etc).
michael@0 68 *
michael@0 69 * @param aCookieHeader
michael@0 70 * The cookie header to be parsed.
michael@0 71 */
michael@0 72 void setCookie(in string aCookieHeader);
michael@0 73
michael@0 74 /**
michael@0 75 * Setup this channel as an application cache fallback channel.
michael@0 76 */
michael@0 77 void setupFallbackChannel(in string aFallbackKey);
michael@0 78
michael@0 79 /**
michael@0 80 * Force relevant cookies to be sent with this load even if normally they
michael@0 81 * wouldn't be.
michael@0 82 */
michael@0 83 attribute boolean forceAllowThirdPartyCookie;
michael@0 84
michael@0 85 /**
michael@0 86 * True iff the channel has been canceled.
michael@0 87 */
michael@0 88 readonly attribute boolean canceled;
michael@0 89
michael@0 90 /**
michael@0 91 * External handlers may set this to true to notify the channel
michael@0 92 * that it is open on behalf of a download.
michael@0 93 */
michael@0 94 attribute boolean channelIsForDownload;
michael@0 95
michael@0 96 /**
michael@0 97 * The local IP address to which this channel is bound, in the
michael@0 98 * format produced by PR_NetAddrToString. May be IPv4 or IPv6.
michael@0 99 * Note: in the presence of NAT, this may not be the same as the
michael@0 100 * address that the remote host thinks it's talking to.
michael@0 101 *
michael@0 102 * May throw NS_ERROR_NOT_AVAILABLE if accessed when the channel's
michael@0 103 * endpoints are not yet determined, or in any case when
michael@0 104 * nsIHttpActivityObserver.isActive is false. See bugs 534698 and 526207.
michael@0 105 */
michael@0 106 readonly attribute AUTF8String localAddress;
michael@0 107
michael@0 108 /**
michael@0 109 * The local port number to which this channel is bound.
michael@0 110 *
michael@0 111 * May throw NS_ERROR_NOT_AVAILABLE if accessed when the channel's
michael@0 112 * endpoints are not yet determined, or in any case when
michael@0 113 * nsIHttpActivityObserver.isActive is false. See bugs 534698 and 526207.
michael@0 114 */
michael@0 115 readonly attribute int32_t localPort;
michael@0 116
michael@0 117 /**
michael@0 118 * The IP address of the remote host that this channel is
michael@0 119 * connected to, in the format produced by PR_NetAddrToString.
michael@0 120 *
michael@0 121 * May throw NS_ERROR_NOT_AVAILABLE if accessed when the channel's
michael@0 122 * endpoints are not yet determined, or in any case when
michael@0 123 * nsIHttpActivityObserver.isActive is false. See bugs 534698 and 526207.
michael@0 124 */
michael@0 125 readonly attribute AUTF8String remoteAddress;
michael@0 126
michael@0 127 /**
michael@0 128 * The remote port number that this channel is connected to.
michael@0 129 *
michael@0 130 * May throw NS_ERROR_NOT_AVAILABLE if accessed when the channel's
michael@0 131 * endpoints are not yet determined, or in any case when
michael@0 132 * nsIHttpActivityObserver.isActive is false. See bugs 534698 and 526207.
michael@0 133 */
michael@0 134 readonly attribute int32_t remotePort;
michael@0 135
michael@0 136 /**
michael@0 137 * Transfer chain of redirected cache-keys.
michael@0 138 */
michael@0 139 [noscript] void setCacheKeysRedirectChain(in StringArray cacheKeys);
michael@0 140
michael@0 141 /**
michael@0 142 * HTTPUpgrade allows for the use of HTTP to bootstrap another protocol
michael@0 143 * via the RFC 2616 Upgrade request header in conjunction with a 101 level
michael@0 144 * response. The nsIHttpUpgradeListener will have its
michael@0 145 * onTransportAvailable() method invoked if a matching 101 is processed.
michael@0 146 * The arguments to onTransportAvailable provide the new protocol the low
michael@0 147 * level tranport streams that are no longer used by HTTP.
michael@0 148 *
michael@0 149 * The onStartRequest and onStopRequest events are still delivered and the
michael@0 150 * listener gets full control over the socket if and when onTransportAvailable
michael@0 151 * is delievered.
michael@0 152 *
michael@0 153 * @param aProtocolName
michael@0 154 * The value of the HTTP Upgrade request header
michael@0 155 * @param aListener
michael@0 156 * The callback object used to handle a successful upgrade
michael@0 157 */
michael@0 158 void HTTPUpgrade(in ACString aProtocolName,
michael@0 159 in nsIHttpUpgradeListener aListener);
michael@0 160
michael@0 161 /**
michael@0 162 * Enable/Disable Spdy negotiation on per channel basis.
michael@0 163 * The network.http.spdy.enabled preference is still a pre-requisite
michael@0 164 * for starting spdy.
michael@0 165 */
michael@0 166 attribute boolean allowSpdy;
michael@0 167
michael@0 168 /**
michael@0 169 * Set (e.g., by the docshell) to indicate whether or not the channel
michael@0 170 * corresponds to content that should be given a degree of network exclusivity
michael@0 171 * with respect to other members of its load group.
michael@0 172 * Examples are js from the HTML head and css which are latency
michael@0 173 * sensitive and should not compete with images for bandwidth. Default false.
michael@0 174 */
michael@0 175 attribute boolean loadAsBlocking;
michael@0 176
michael@0 177 /**
michael@0 178 * If set, this channel will load in parallel with the rest of the load
michael@0 179 * group even if a blocking subset of the group would normally be given
michael@0 180 * exclusivity. Default false.
michael@0 181 */
michael@0 182 attribute boolean loadUnblocked;
michael@0 183
michael@0 184 /**
michael@0 185 * This attribute en/disables the timeout for the first byte of an HTTP
michael@0 186 * response. Enabled by default.
michael@0 187 */
michael@0 188 attribute boolean responseTimeoutEnabled;
michael@0 189
michael@0 190 /**
michael@0 191 * Get value of the URI passed to nsIHttpChannel.redirectTo() if any.
michael@0 192 * May return null when redirectTo() has not been called.
michael@0 193 */
michael@0 194 readonly attribute nsIURI apiRedirectToURI;
michael@0 195 };

mercurial