nsIInputStreamChannel.idl 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. /* This Source Code Form is subject to the terms of the Mozilla Public
  2. * License, v. 2.0. If a copy of the MPL was not distributed with this
  3. * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
  4. #include "nsISupports.idl"
  5. interface nsIInputStream;
  6. interface nsIURI;
  7. /**
  8. * nsIInputStreamChannel
  9. *
  10. * This interface provides methods to initialize an input stream channel.
  11. * The input stream channel serves as a data pump for an input stream.
  12. */
  13. [scriptable, uuid(ea730238-4bfd-4015-8489-8f264d05b343)]
  14. interface nsIInputStreamChannel : nsISupports
  15. {
  16. /**
  17. * Sets the URI for this channel. This must be called before the
  18. * channel is opened, and it may only be called once.
  19. */
  20. void setURI(in nsIURI aURI);
  21. /**
  22. * Get/set the content stream
  23. *
  24. * This stream contains the data that will be pushed to the channel's
  25. * stream listener. If the stream is non-blocking and supports the
  26. * nsIAsyncInputStream interface, then the stream will be read directly.
  27. * Otherwise, the stream will be read on a background thread.
  28. *
  29. * This attribute must be set before the channel is opened, and it may
  30. * only be set once.
  31. *
  32. * @throws NS_ERROR_IN_PROGRESS if the setter is called after the channel
  33. * has been opened.
  34. */
  35. attribute nsIInputStream contentStream;
  36. /**
  37. * Get/set the srcdoc data string. When the input stream channel is
  38. * created to load a srcdoc iframe, this is set to hold the value of the
  39. * srcdoc attribute.
  40. *
  41. * This should be the same value used to create contentStream, but this is
  42. * not checked.
  43. *
  44. * Changing the value of this attribute will not otherwise affect the
  45. * functionality of the channel or input stream.
  46. */
  47. attribute AString srcdocData;
  48. /**
  49. * Returns true if srcdocData has been set within the channel.
  50. */
  51. readonly attribute boolean isSrcdocChannel;
  52. /**
  53. * The base URI to be used for the channel. Used when the base URI cannot
  54. * be inferred by other means, for example when this is a srcdoc channel.
  55. */
  56. attribute nsIURI baseURI;
  57. };