netwerk/base/public/nsIResumableChannel.idl

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/netwerk/base/public/nsIResumableChannel.idl	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,39 @@
     1.4 +/* -*- Mode: IDL; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
     1.5 +/* This Source Code Form is subject to the terms of the Mozilla Public
     1.6 + * License, v. 2.0. If a copy of the MPL was not distributed with this
     1.7 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     1.8 +
     1.9 +#include "nsISupports.idl"
    1.10 + 
    1.11 +interface nsIStreamListener;
    1.12 +
    1.13 +[scriptable, uuid(4ad136fa-83af-4a22-a76e-503642c0f4a8)]
    1.14 +interface nsIResumableChannel : nsISupports {
    1.15 +    /**
    1.16 +     * Prepare this channel for resuming. The request will not start until
    1.17 +     * asyncOpen or open is called. Calling resumeAt after open or asyncOpen
    1.18 +     * has been called has undefined behaviour.
    1.19 +     *
    1.20 +     * @param startPos the starting offset, in bytes, to use to download
    1.21 +     * @param entityID information about the file, to match before obtaining
    1.22 +     *  the file. Pass an empty string to use anything.
    1.23 +     *
    1.24 +     * During OnStartRequest, this channel will have a status of
    1.25 +     *  NS_ERROR_NOT_RESUMABLE if the file cannot be resumed, eg because the
    1.26 +     *  server doesn't support this. This error may occur even if startPos
    1.27 +     *  is 0, so that the front end can warn the user.
    1.28 +     * Similarly, the status of this channel during OnStartRequest may be
    1.29 +     *  NS_ERROR_ENTITY_CHANGED, which indicates that the entity has changed,
    1.30 +     *  as indicated by a changed entityID.
    1.31 +     * In both of these cases, no OnDataAvailable will be called, and
    1.32 +     *  OnStopRequest will immediately follow with the same status code.
    1.33 +     */
    1.34 +    void resumeAt(in unsigned long long startPos,
    1.35 +                  in ACString entityID);
    1.36 +
    1.37 +    /**
    1.38 +     * The entity id for this URI. Available after OnStartRequest.
    1.39 +     * @throw NS_ERROR_NOT_RESUMABLE if this load is not resumable.
    1.40 +     */
    1.41 +    readonly attribute ACString entityID;
    1.42 +};

mercurial