nsIRequestObserver.idl 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  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 nsIRequest;
  7. /**
  8. * nsIRequestObserver
  9. */
  10. [scriptable, uuid(fd91e2e0-1481-11d3-9333-00104ba0fd40)]
  11. interface nsIRequestObserver : nsISupports
  12. {
  13. /**
  14. * Called to signify the beginning of an asynchronous request.
  15. *
  16. * @param aRequest request being observed
  17. * @param aContext user defined context
  18. *
  19. * An exception thrown from onStartRequest has the side-effect of
  20. * causing the request to be canceled.
  21. */
  22. void onStartRequest(in nsIRequest aRequest,
  23. in nsISupports aContext);
  24. /**
  25. * Called to signify the end of an asynchronous request. This
  26. * call is always preceded by a call to onStartRequest.
  27. *
  28. * @param aRequest request being observed
  29. * @param aContext user defined context
  30. * @param aStatusCode reason for stopping (NS_OK if completed successfully)
  31. *
  32. * An exception thrown from onStopRequest is generally ignored.
  33. */
  34. void onStopRequest(in nsIRequest aRequest,
  35. in nsISupports aContext,
  36. in nsresult aStatusCode);
  37. };