Backed out 2 changesets (bug 1881078, bug 1879806) for causing dt failures @ devtools...
[gecko.git] / netwerk / base / nsIUploadChannel2.idl
blob45f1d766821daab35e124a3bc3813e2c0ab7dff8
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;
9 interface nsIRunnable;
11 [scriptable, uuid(2f712b52-19c5-4e0c-9e8f-b5c7c3b67049)]
12 interface nsIUploadChannel2 : nsISupports
14 /**
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
23 * @param aStream
24 * The stream to be uploaded by this channel.
25 * @param aContentType
26 * This value will replace any existing Content-Type
27 * header on the HTTP request, regardless of whether
28 * or not its empty.
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.
32 * @param aMethod
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,
40 in ACString aMethod,
41 in boolean aStreamHasHeaders);
43 /**
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;
50 /**
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.
55 [noscript]
56 nsIInputStream cloneUploadStream(out long long aContentLength);