mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-24 21:31:04 +00:00
Bug 1538812 - Remove the dangerous default 'NS_ASSIGNMENT_DEPEND' of argument 'assignment' on NS_NewByteInputStream to let it be defined expicitly and thus visibly, r=michal
Differential Revision: https://phabricator.services.mozilla.com/D25462 --HG-- extra : moz-landing-system : lando
This commit is contained in:
parent
1b37794a98
commit
1296f23329
@ -1536,7 +1536,8 @@ nsresult XMLHttpRequestMainThread::StreamReaderFunc(
|
||||
// stream is not supported.
|
||||
nsCOMPtr<nsIInputStream> copyStream;
|
||||
rv = NS_NewByteInputStream(getter_AddRefs(copyStream),
|
||||
MakeSpan(fromRawSegment, count));
|
||||
MakeSpan(fromRawSegment, count),
|
||||
NS_ASSIGNMENT_DEPEND);
|
||||
|
||||
if (NS_SUCCEEDED(rv) && xmlHttpRequest->mXMLParserStreamListener) {
|
||||
NS_ASSERTION(copyStream, "NS_NewByteInputStream lied");
|
||||
|
@ -157,7 +157,8 @@ nsresult nsDeflateConverter::PushAvailableData(nsIRequest *aRequest,
|
||||
MOZ_ASSERT(bytesToWrite <= INT32_MAX);
|
||||
nsCOMPtr<nsIInputStream> stream;
|
||||
nsresult rv = NS_NewByteInputStream(
|
||||
getter_AddRefs(stream), MakeSpan((char *)mWriteBuffer, bytesToWrite));
|
||||
getter_AddRefs(stream), MakeSpan((char *)mWriteBuffer, bytesToWrite),
|
||||
NS_ASSIGNMENT_DEPEND);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
rv = mListener->OnDataAvailable(aRequest, stream, mOffset, bytesToWrite);
|
||||
|
@ -117,8 +117,8 @@ nsresult nsZipDataStream::ProcessData(nsIRequest *aRequest,
|
||||
|
||||
MOZ_ASSERT(aCount <= INT32_MAX);
|
||||
nsCOMPtr<nsIInputStream> stream;
|
||||
nsresult rv =
|
||||
NS_NewByteInputStream(getter_AddRefs(stream), MakeSpan(aBuffer, aCount));
|
||||
nsresult rv = NS_NewByteInputStream(
|
||||
getter_AddRefs(stream), MakeSpan(aBuffer, aCount), NS_ASSIGNMENT_DEPEND);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
rv = mOutput->OnDataAvailable(aRequest, stream, aOffset, aCount);
|
||||
|
@ -378,7 +378,8 @@ nsresult nsHttpTransaction::Init(
|
||||
// a non-owning reference to the request header data, so we MUST keep
|
||||
// mReqHeaderBuf around).
|
||||
nsCOMPtr<nsIInputStream> headers;
|
||||
rv = NS_NewByteInputStream(getter_AddRefs(headers), mReqHeaderBuf);
|
||||
rv = NS_NewByteInputStream(getter_AddRefs(headers), mReqHeaderBuf,
|
||||
NS_ASSIGNMENT_DEPEND);
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
|
||||
mHasRequestBody = !!requestBody;
|
||||
|
@ -361,7 +361,8 @@ nsresult StreamFilterParent::Write(Data& aData) {
|
||||
nsCOMPtr<nsIInputStream> stream;
|
||||
nsresult rv = NS_NewByteInputStream(
|
||||
getter_AddRefs(stream),
|
||||
MakeSpan(reinterpret_cast<char*>(aData.Elements()), aData.Length()));
|
||||
MakeSpan(reinterpret_cast<char*>(aData.Elements()), aData.Length()),
|
||||
NS_ASSIGNMENT_DEPEND);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
rv =
|
||||
|
@ -47,9 +47,9 @@
|
||||
* If aLength is less than zero, then the length of aStringToRead will be
|
||||
* determined by scanning the buffer for the first null byte.
|
||||
*/
|
||||
extern nsresult NS_NewByteInputStream(
|
||||
nsIInputStream** aStreamResult, mozilla::Span<const char> aStringToRead,
|
||||
nsAssignmentType aAssignment = NS_ASSIGNMENT_DEPEND);
|
||||
extern nsresult NS_NewByteInputStream(nsIInputStream** aStreamResult,
|
||||
mozilla::Span<const char> aStringToRead,
|
||||
nsAssignmentType aAssignment);
|
||||
|
||||
/**
|
||||
* Factory method to get an nsInputStream from an nsACString. Result will
|
||||
|
@ -85,7 +85,8 @@ static void TestUncompressCorrupt(const char* aCorruptData,
|
||||
uint32_t aCorruptLength) {
|
||||
nsCOMPtr<nsIInputStream> source;
|
||||
nsresult rv = NS_NewByteInputStream(getter_AddRefs(source),
|
||||
MakeSpan(aCorruptData, aCorruptLength));
|
||||
MakeSpan(aCorruptData, aCorruptLength),
|
||||
NS_ASSIGNMENT_DEPEND);
|
||||
ASSERT_TRUE(NS_SUCCEEDED(rv));
|
||||
|
||||
nsCOMPtr<nsIInputStream> uncompress = new SnappyUncompressInputStream(source);
|
||||
|
Loading…
Reference in New Issue
Block a user