netwerk/base/public/nsIUploadChannel2.idl

Thu, 22 Jan 2015 13:21:57 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 22 Jan 2015 13:21:57 +0100
branch
TOR_BUG_9701
changeset 15
b8a032363ba2
permissions
-rw-r--r--

Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6

michael@0 1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
michael@0 2 /* This Source Code Form is subject to the terms of the Mozilla Public
michael@0 3 * License, v. 2.0. If a copy of the MPL was not distributed with this
michael@0 4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
michael@0 5
michael@0 6 #include "nsISupports.idl"
michael@0 7
michael@0 8 interface nsIInputStream;
michael@0 9
michael@0 10 [scriptable, uuid(AD9D3F1C-A8DE-4d0b-9714-1B922297AD65)]
michael@0 11 interface nsIUploadChannel2 : nsISupports
michael@0 12 {
michael@0 13 /**
michael@0 14 * Sets a stream to be uploaded by this channel with the specified
michael@0 15 * Content-Type and Content-Length header values.
michael@0 16 *
michael@0 17 * Most implementations of this interface require that the stream:
michael@0 18 * (1) implement threadsafe addRef and release
michael@0 19 * (2) implement nsIInputStream::readSegments
michael@0 20 * (3) implement nsISeekableStream::seek
michael@0 21 *
michael@0 22 * @param aStream
michael@0 23 * The stream to be uploaded by this channel.
michael@0 24 * @param aContentType
michael@0 25 * This value will replace any existing Content-Type
michael@0 26 * header on the HTTP request, regardless of whether
michael@0 27 * or not its empty.
michael@0 28 * @param aContentLength
michael@0 29 * A value of -1 indicates that the length of the stream should be
michael@0 30 * determined by calling the stream's |available| method.
michael@0 31 * @param aMethod
michael@0 32 * The HTTP request method to set on the stream.
michael@0 33 * @param aStreamHasHeaders
michael@0 34 * True if the stream already contains headers for the HTTP request.
michael@0 35 */
michael@0 36 void explicitSetUploadStream(in nsIInputStream aStream,
michael@0 37 in ACString aContentType,
michael@0 38 in long long aContentLength,
michael@0 39 in ACString aMethod,
michael@0 40 in boolean aStreamHasHeaders);
michael@0 41
michael@0 42 /**
michael@0 43 * Value of aStreamHasHeaders from the last successful call to
michael@0 44 * explicitSetUploadStream. TRUE indicates the attached upload stream
michael@0 45 * contians request headers.
michael@0 46 */
michael@0 47 readonly attribute boolean uploadStreamHasHeaders;
michael@0 48 };

mercurial