nsIEncodedChannel.idl 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  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. #include "nsISupports.idl"
  6. interface nsIUTF8StringEnumerator;
  7. interface nsIStreamListener;
  8. interface nsISupports;
  9. /**
  10. * A channel interface which allows special handling of encoded content
  11. */
  12. [scriptable, uuid(29c29ce6-8ce4-45e6-8d60-36c8fa3e255b)]
  13. interface nsIEncodedChannel : nsISupports
  14. {
  15. /**
  16. * This attribute holds the MIME types corresponding to the content
  17. * encodings on the channel. The enumerator returns nsISupportsCString
  18. * objects. The first one corresponds to the outermost encoding on the
  19. * channel and then we work our way inward. "identity" is skipped and not
  20. * represented on the list. Unknown encodings make the enumeration stop.
  21. * If you want the actual Content-Encoding value, use
  22. * getResponseHeader("Content-Encoding").
  23. *
  24. * When there is no Content-Encoding header, this property is null.
  25. *
  26. * Modifying the Content-Encoding header on the channel will cause
  27. * this enumerator to have undefined behavior. Don't do it.
  28. *
  29. * Also note that contentEncodings only exist during or after OnStartRequest.
  30. * Calling contentEncodings before OnStartRequest is an error.
  31. */
  32. readonly attribute nsIUTF8StringEnumerator contentEncodings;
  33. /**
  34. * This attribute controls whether or not content conversion should be
  35. * done per the Content-Encoding response header. applyConversion can only
  36. * be set before or during OnStartRequest. Calling this during
  37. * OnDataAvailable is an error.
  38. *
  39. * TRUE by default.
  40. */
  41. attribute boolean applyConversion;
  42. /**
  43. * This function will start converters if they are available.
  44. * aNewNextListener will be nullptr if no converter is available.
  45. */
  46. void doApplyContentConversions(in nsIStreamListener aNextListener,
  47. out nsIStreamListener aNewNextListener,
  48. in nsISupports aCtxt);
  49. };