1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
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 nsIInputStream
;
11 [scriptable
, uuid(2f712b52
-19c5
-4e0c
-9e8f
-b5c7c3b67049
)]
12 interface nsIUploadChannel2
: nsISupports
15 * Sets a stream to be uploaded by this channel with the specified
16 * Content-Type and Content-Length header values.
18 * Most implementations of this interface require that the stream:
19 * (1) implement threadsafe addRef and release
20 * (2) implement nsIInputStream::readSegments
21 * (3) implement nsISeekableStream::seek
24 * The stream to be uploaded by this channel.
26 * This value will replace any existing Content-Type
27 * header on the HTTP request, regardless of whether
29 * @param aContentLength
30 * A value of -1 indicates that the length of the stream should be
31 * determined by calling the stream's |available| method.
33 * The HTTP request method to set on the stream.
34 * @param aStreamHasHeaders
35 * True if the stream already contains headers for the HTTP request.
37 void explicitSetUploadStream
(in nsIInputStream aStream
,
38 in ACString aContentType
,
39 in long long aContentLength
,
41 in boolean aStreamHasHeaders
);
44 * Value of aStreamHasHeaders from the last successful call to
45 * explicitSetUploadStream. TRUE indicates the attached upload stream
46 * contains request headers.
48 readonly attribute
boolean uploadStreamHasHeaders
;
51 * Clones the upload stream. May only be called in the parent process.
52 * aContentLength could be -1 in case the size of the stream is unknown,
53 * otherwise it will contain the known size of the stream.
56 nsIInputStream cloneUploadStream
(out long long aContentLength
);