michael@0: /* -*- Mode: IDL; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: #include "nsISupports.idl" michael@0: michael@0: interface nsIStreamListener; michael@0: michael@0: [scriptable, uuid(4ad136fa-83af-4a22-a76e-503642c0f4a8)] michael@0: interface nsIResumableChannel : nsISupports { michael@0: /** michael@0: * Prepare this channel for resuming. The request will not start until michael@0: * asyncOpen or open is called. Calling resumeAt after open or asyncOpen michael@0: * has been called has undefined behaviour. michael@0: * michael@0: * @param startPos the starting offset, in bytes, to use to download michael@0: * @param entityID information about the file, to match before obtaining michael@0: * the file. Pass an empty string to use anything. michael@0: * michael@0: * During OnStartRequest, this channel will have a status of michael@0: * NS_ERROR_NOT_RESUMABLE if the file cannot be resumed, eg because the michael@0: * server doesn't support this. This error may occur even if startPos michael@0: * is 0, so that the front end can warn the user. michael@0: * Similarly, the status of this channel during OnStartRequest may be michael@0: * NS_ERROR_ENTITY_CHANGED, which indicates that the entity has changed, michael@0: * as indicated by a changed entityID. michael@0: * In both of these cases, no OnDataAvailable will be called, and michael@0: * OnStopRequest will immediately follow with the same status code. michael@0: */ michael@0: void resumeAt(in unsigned long long startPos, michael@0: in ACString entityID); michael@0: michael@0: /** michael@0: * The entity id for this URI. Available after OnStartRequest. michael@0: * @throw NS_ERROR_NOT_RESUMABLE if this load is not resumable. michael@0: */ michael@0: readonly attribute ACString entityID; michael@0: };