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