nsITraceableChannel.idl 1.4 KB

1234567891011121314151617181920212223242526272829303132333435
  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 nsIStreamListener;
  7. /**
  8. * A channel implementing this interface allows one to intercept its data by
  9. * inserting intermediate stream listeners.
  10. */
  11. [scriptable, uuid(68167b0b-ef34-4d79-a09a-8045f7c5140e)]
  12. interface nsITraceableChannel : nsISupports
  13. {
  14. /*
  15. * Replace the channel's listener with a new one, and return the listener
  16. * the channel used to have. The new listener intercepts OnStartRequest,
  17. * OnDataAvailable and OnStopRequest calls and must pass them to
  18. * the original listener after examination. If multiple callers replace
  19. * the channel's listener, a chain of listeners is created.
  20. * The caller of setNewListener has no way to control at which place
  21. * in the chain its listener is placed.
  22. *
  23. * Note: The caller of setNewListener must not delay passing
  24. * OnStartRequest to the original listener.
  25. *
  26. * Note2: A channel may restrict when the listener can be replaced.
  27. * It is not recommended to allow listener replacement after OnStartRequest
  28. * has been called.
  29. */
  30. nsIStreamListener setNewListener(in nsIStreamListener aListener);
  31. };