nsIResumableChannel.idl 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. /* -*- Mode: IDL; 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. [scriptable, uuid(4ad136fa-83af-4a22-a76e-503642c0f4a8)]
  8. interface nsIResumableChannel : nsISupports {
  9. /**
  10. * Prepare this channel for resuming. The request will not start until
  11. * asyncOpen or open is called. Calling resumeAt after open or asyncOpen
  12. * has been called has undefined behaviour.
  13. *
  14. * @param startPos the starting offset, in bytes, to use to download
  15. * @param entityID information about the file, to match before obtaining
  16. * the file. Pass an empty string to use anything.
  17. *
  18. * During OnStartRequest, this channel will have a status of
  19. * NS_ERROR_NOT_RESUMABLE if the file cannot be resumed, eg because the
  20. * server doesn't support this. This error may occur even if startPos
  21. * is 0, so that the front end can warn the user.
  22. * Similarly, the status of this channel during OnStartRequest may be
  23. * NS_ERROR_ENTITY_CHANGED, which indicates that the entity has changed,
  24. * as indicated by a changed entityID.
  25. * In both of these cases, no OnDataAvailable will be called, and
  26. * OnStopRequest will immediately follow with the same status code.
  27. */
  28. void resumeAt(in unsigned long long startPos,
  29. in ACString entityID);
  30. /**
  31. * The entity id for this URI. Available after OnStartRequest.
  32. * @throw NS_ERROR_NOT_RESUMABLE if this load is not resumable.
  33. */
  34. readonly attribute ACString entityID;
  35. };