netwerk/base/public/nsIUploadChannel2.idl

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/netwerk/base/public/nsIUploadChannel2.idl	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,48 @@
     1.4 +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
     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 nsIInputStream;
    1.12 +
    1.13 +[scriptable, uuid(AD9D3F1C-A8DE-4d0b-9714-1B922297AD65)]
    1.14 +interface nsIUploadChannel2 : nsISupports
    1.15 +{
    1.16 +    /**
    1.17 +     * Sets a stream to be uploaded by this channel with the specified
    1.18 +     * Content-Type and Content-Length header values.
    1.19 +     *
    1.20 +     * Most implementations of this interface require that the stream:
    1.21 +     *   (1) implement threadsafe addRef and release
    1.22 +     *   (2) implement nsIInputStream::readSegments
    1.23 +     *   (3) implement nsISeekableStream::seek
    1.24 +     *
    1.25 +     * @param aStream
    1.26 +     *        The stream to be uploaded by this channel.
    1.27 +     * @param aContentType
    1.28 +     *        This value will replace any existing Content-Type
    1.29 +     *        header on the HTTP request, regardless of whether
    1.30 +     *        or not its empty.
    1.31 +     * @param aContentLength
    1.32 +     *        A value of -1 indicates that the length of the stream should be
    1.33 +     *        determined by calling the stream's |available| method.
    1.34 +     * @param aMethod
    1.35 +     *        The HTTP request method to set on the stream.
    1.36 +     * @param aStreamHasHeaders
    1.37 +     *        True if the stream already contains headers for the HTTP request.
    1.38 +     */
    1.39 +    void explicitSetUploadStream(in nsIInputStream aStream,
    1.40 +                                 in ACString aContentType,
    1.41 +                                 in long long aContentLength,
    1.42 +                                 in ACString aMethod,
    1.43 +                                 in boolean aStreamHasHeaders);
    1.44 +
    1.45 +    /**
    1.46 +     * Value of aStreamHasHeaders from the last successful call to
    1.47 +     * explicitSetUploadStream.  TRUE indicates the attached upload stream
    1.48 +     * contians request headers.
    1.49 +     */
    1.50 +    readonly attribute boolean uploadStreamHasHeaders;
    1.51 +};

mercurial