Bug 1389723 - Remove @deprecated nsIMIMEInputStream.addContentLength. r=dragana

MozReview-Commit-ID: 9b45aozatin

--HG--
extra : rebase_source : 636da171929fe6ecd69de5c68d9ed4064a3a7b09
This commit is contained in:
Masatoshi Kimura 2017-08-12 13:34:02 +09:00
Родитель 5c5de1568b
Коммит 9ab81a1042
8 изменённых файлов: 0 добавлений и 39 удалений

Просмотреть файл

@ -2485,7 +2485,6 @@ function getPostDataStream(aPostDataString,
let mimeStream = Cc["@mozilla.org/network/mime-input-stream;1"]
.createInstance(Ci.nsIMIMEInputStream);
mimeStream.addHeader("Content-Type", aType);
mimeStream.addContentLength = true;
mimeStream.setData(dataStream);
return mimeStream.QueryInterface(Ci.nsIInputStream);
}

Просмотреть файл

@ -21,7 +21,6 @@ function test() {
var postStream = Cc["@mozilla.org/network/mime-input-stream;1"].
createInstance(Ci.nsIMIMEInputStream);
postStream.addHeader("Content-Type", "application/x-www-form-urlencoded");
postStream.addContentLength = true;
postStream.setData(dataStream);
tab.linkedBrowser.loadURIWithFlags("http://mochi.test:8888/browser/docshell/test/browser/print_postdata.sjs", 0, null, null, postStream);

Просмотреть файл

@ -309,7 +309,6 @@ FSURLEncoded::GetEncodedSubmission(nsIURI* aURI,
mimeStream->AddHeader("Content-Type",
"application/x-www-form-urlencoded");
mimeStream->SetAddContentLength(true);
mimeStream->SetData(dataStream);
*aPostDataStream = mimeStream;
@ -623,7 +622,6 @@ FSMultipartFormData::GetEncodedSubmission(nsIURI* aURI,
nsAutoCString contentType;
GetContentType(contentType);
mimeStream->AddHeader("Content-Type", contentType.get());
mimeStream->SetAddContentLength(true);
uint64_t unused;
mimeStream->SetData(GetSubmissionBody(&unused));
@ -765,7 +763,6 @@ FSTextPlain::GetEncodedSubmission(nsIURI* aURI,
NS_ENSURE_SUCCESS(rv, rv);
mimeStream->AddHeader("Content-Type", "text/plain");
mimeStream->SetAddContentLength(true);
mimeStream->SetData(bodyStream);
CallQueryInterface(mimeStream, aPostDataStream);
}

Просмотреть файл

@ -14,19 +14,6 @@
[scriptable, uuid(dcbce63c-1dd1-11b2-b94d-91f6d49a3161)]
interface nsIMIMEInputStream : nsIInputStream
{
/**
* When true a "Content-Length" header is automatically added to the
* stream. The value of the content-length is automatically calculated
* using the available() method on the data stream. The value is
* recalculated every time the stream is rewinded to the start.
* Not allowed to be changed once the stream has been started to be read.
*
* @deprecated A Content-Length header is automatically added when
* attaching the stream to a channel, so this setting no longer has any
* effect, and may not be set to false.
*/
attribute boolean addContentLength;
/**
* Adds an additional header to the stream on the form "name: value". May
* not be called once the stream has been started to be read.

Просмотреть файл

@ -91,24 +91,6 @@ nsMIMEInputStream::~nsMIMEInputStream()
{
}
NS_IMETHODIMP
nsMIMEInputStream::GetAddContentLength(bool *aAddContentLength)
{
*aAddContentLength = true;
return NS_OK;
}
NS_IMETHODIMP
nsMIMEInputStream::SetAddContentLength(bool aAddContentLength)
{
NS_ENSURE_FALSE(mStartedReading, NS_ERROR_FAILURE);
if (!aAddContentLength) {
// Content-Length is automatically added by the channel when setting the
// upload stream, so setting this to false has no practical effect.
return NS_ERROR_FAILURE;
}
return NS_OK;
}
NS_IMETHODIMP
nsMIMEInputStream::AddHeader(const char *aName, const char *aValue)
{

Просмотреть файл

@ -78,7 +78,6 @@ function run_test() {
createInstance(Ci.nsIMIMEInputStream);
mime.addHeader("Content-Type", "multipart/form-data; boundary="+BOUNDARY);
mime.setData(multi);
mime.addContentLength = true;
httpserver.registerPathHandler(testpath, serverHandler);
httpserver.start(-1);

Просмотреть файл

@ -31,7 +31,6 @@ function run_test() {
createInstance(Ci.nsIMIMEInputStream);
mime.addHeader("Content-Type", "multipart/form-data; boundary=zzzzz");
mime.setData(sstream);
mime.addContentLength = true;
let tq = Cc["@mozilla.org/network/throttlequeue;1"]
.createInstance(Ci.nsIInputChannelThrottleQueue);

Просмотреть файл

@ -1120,7 +1120,6 @@ EngineURL.prototype = {
postData = Cc["@mozilla.org/network/mime-input-stream;1"].
createInstance(Ci.nsIMIMEInputStream);
postData.addHeader("Content-Type", "application/x-www-form-urlencoded");
postData.addContentLength = true;
postData.setData(stringStream);
}