Source code

Revision control

Other Tools

1
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2
/* This Source Code Form is subject to the terms of the Mozilla Public
3
* License, v. 2.0. If a copy of the MPL was not distributed with this
4
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
5
6
#include "nsISupports.idl"
7
8
interface nsIUTF8StringEnumerator;
9
interface nsIStreamListener;
10
interface nsISupports;
11
12
/**
13
* A channel interface which allows special handling of encoded content
14
*/
15
16
[scriptable, uuid(29c29ce6-8ce4-45e6-8d60-36c8fa3e255b)]
17
interface nsIEncodedChannel : nsISupports
18
{
19
/**
20
* This attribute holds the MIME types corresponding to the content
21
* encodings on the channel. The enumerator returns nsISupportsCString
22
* objects. The first one corresponds to the outermost encoding on the
23
* channel and then we work our way inward. "identity" is skipped and not
24
* represented on the list. Unknown encodings make the enumeration stop.
25
* If you want the actual Content-Encoding value, use
26
* getResponseHeader("Content-Encoding").
27
*
28
* When there is no Content-Encoding header, this property is null.
29
*
30
* Modifying the Content-Encoding header on the channel will cause
31
* this enumerator to have undefined behavior. Don't do it.
32
*
33
* Also note that contentEncodings only exist during or after OnStartRequest.
34
* Calling contentEncodings before OnStartRequest is an error.
35
*/
36
readonly attribute nsIUTF8StringEnumerator contentEncodings;
37
38
/**
39
* This attribute controls whether or not content conversion should be
40
* done per the Content-Encoding response header. applyConversion can only
41
* be set before or during OnStartRequest. Calling this during
42
* OnDataAvailable is an error.
43
*
44
* TRUE by default.
45
*/
46
attribute boolean applyConversion;
47
48
/**
49
* This function will start converters if they are available.
50
* aNewNextListener will be nullptr if no converter is available.
51
*/
52
void doApplyContentConversions(in nsIStreamListener aNextListener,
53
out nsIStreamListener aNewNextListener,
54
in nsISupports aCtxt);
55
};