Bug 1525319 - Removing context from OnDataAvailable r=valentin

Differential Revision: https://phabricator.services.mozilla.com/D20881

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Jonathan Kingston 2019-02-24 20:27:55 +00:00
parent 147e351e0b
commit 63ab2bd8aa
189 changed files with 270 additions and 315 deletions

View File

@ -1148,10 +1148,10 @@ nsContextMenu.prototype = {
this.extListener.onStopRequest(aRequest, aStatusCode);
},
onDataAvailable: function saveLinkAs_onDataAvailable(aRequest, aContext,
onDataAvailable: function saveLinkAs_onDataAvailable(aRequest,
aInputStream,
aOffset, aCount) {
this.extListener.onDataAvailable(aRequest, aContext, aInputStream,
this.extListener.onDataAvailable(aRequest, aInputStream,
aOffset, aCount);
},
};

View File

@ -295,8 +295,8 @@ class ChromeActions {
sendResponse(false);
}
},
onDataAvailable(aRequest, aContext, aDataInputStream, aOffset, aCount) {
this.extListener.onDataAvailable(aRequest, aContext, aDataInputStream,
onDataAvailable(aRequest, aDataInputStream, aOffset, aCount) {
this.extListener.onDataAvailable(aRequest, aDataInputStream,
aOffset, aCount);
},
};
@ -847,7 +847,7 @@ PdfStreamConverter.prototype = {
},
// nsIStreamListener::onDataAvailable
onDataAvailable(aRequest, aContext, aInputStream, aOffset, aCount) {
onDataAvailable(aRequest, aInputStream, aOffset, aCount) {
if (!this.dataListener) {
return;
}
@ -942,8 +942,8 @@ PdfStreamConverter.prototype = {
onStartRequest(request) {
listener.onStartRequest(aRequest);
},
onDataAvailable(request, context, inputStream, offset, count) {
listener.onDataAvailable(aRequest, null, inputStream,
onDataAvailable(request, inputStream, offset, count) {
listener.onDataAvailable(aRequest, inputStream,
offset, count);
},
onStopRequest(request, statusCode) {

View File

@ -163,7 +163,7 @@ class FaviconLoad {
onStartRequest(request) {
}
onDataAvailable(request, context, inputStream, offset, count) {
onDataAvailable(request, inputStream, offset, count) {
this.stream.writeFrom(inputStream, count);
}

View File

@ -68,7 +68,7 @@ Converter.prototype = {
this.listener = listener;
},
onDataAvailable: function(request, context, inputStream, offset, count) {
onDataAvailable: function(request, inputStream, offset, count) {
// Decode and insert data.
const buffer = new ArrayBuffer(count);
new BinaryInput(inputStream).readArrayBuffer(count, buffer);
@ -117,7 +117,7 @@ Converter.prototype = {
// Send the initial HTML code.
const buffer = new TextEncoder().encode(initialHTML(win.document)).buffer;
const stream = new BufferStream(buffer, 0, buffer.byteLength);
this.listener.onDataAvailable(request, null, stream, 0, stream.available());
this.listener.onDataAvailable(request, stream, 0, stream.available());
},
onStopRequest: function(request, statusCode) {

View File

@ -16,7 +16,7 @@ function gzipCompressString(string, obs) {
.createInstance(Ci.nsIStringInputStream);
stringStream.data = string;
converter.onStartRequest(null);
converter.onDataAvailable(null, null, stringStream, 0, string.length);
converter.onDataAvailable(null, stringStream, 0, string.length);
converter.onStopRequest(null, null);
}

View File

@ -173,7 +173,7 @@ NetworkResponseListener.prototype = {
* @param unsigned long offset
* @param unsigned long count
*/
onDataAvailable: function(request, context, inputStream, offset, count) {
onDataAvailable: function(request, inputStream, offset, count) {
this._findOpenResponse();
const data = NetUtil.readInputStreamToString(inputStream, count);
@ -490,10 +490,10 @@ NetworkResponseListener.prototype = {
if (available != -1) {
if (available != 0) {
if (this.converter) {
this.converter.onDataAvailable(this.request, null, stream,
this.converter.onDataAvailable(this.request, stream,
this.offset, available);
} else {
this.onDataAvailable(this.request, null, stream, this.offset,
this.onDataAvailable(this.request, stream, this.offset,
available);
}
}

View File

@ -23,7 +23,7 @@ TestStreamListener.prototype = {
this.setState("stop");
},
onDataAvailable: function(request, context, inputStream, offset, count) {
onDataAvailable: function(request, inputStream, offset, count) {
const sin = Cc["@mozilla.org/scriptableinputstream;1"]
.createInstance(nsIScriptableInputStream);
sin.init(inputStream);
@ -125,7 +125,7 @@ add_task(async function() {
);
// onDataAvailable is required to immediately read the data.
listener.onDataAvailable(null, null, testInputStream, 0, 6);
listener.onDataAvailable(null, testInputStream, 0, 6);
equal(testInputStream.available(), 0, "no more data should be available");
equal(testListener.state, "start",
"test listener should not have received data");

View File

@ -75,7 +75,7 @@ NetworkThrottleListener.prototype = {
/**
* @see nsIStreamListener.onDataAvailable.
*/
onDataAvailable: function(request, context, inputStream, offset, count) {
onDataAvailable: function(request, inputStream, offset, count) {
if (this.pendingException) {
throw this.pendingException;
}
@ -87,7 +87,7 @@ NetworkThrottleListener.prototype = {
const stream = new ArrayBufferInputStream();
stream.setData(bytes, 0, count);
this.pendingData.push({request, context, stream, count});
this.pendingData.push({request, stream, count});
this.queue.dataAvailable(this);
},
@ -110,7 +110,7 @@ NetworkThrottleListener.prototype = {
return {length: 0, done: true};
}
const {request, context, stream, count, statusCode} = this.pendingData[0];
const {request, stream, count, statusCode} = this.pendingData[0];
if (statusCode !== undefined) {
this.pendingData.shift();
@ -123,7 +123,7 @@ NetworkThrottleListener.prototype = {
}
try {
this.originalListener.onDataAvailable(request, context, stream,
this.originalListener.onDataAvailable(request, stream,
this.offset, bytesPermitted);
} catch (e) {
this.pendingException = e;

View File

@ -333,7 +333,7 @@ nsPingListener::OnStartRequest(nsIRequest* aRequest) {
}
NS_IMETHODIMP
nsPingListener::OnDataAvailable(nsIRequest* aRequest, nsISupports* aContext,
nsPingListener::OnDataAvailable(nsIRequest* aRequest,
nsIInputStream* aStream, uint64_t aOffset,
uint32_t aCount) {
uint32_t result;

View File

@ -202,7 +202,7 @@ already_AddRefed<Document> DOMParser::ParseFromStream(nsIInputStream* aStream,
parserChannel->GetStatus(&status);
if (NS_SUCCEEDED(rv) && NS_SUCCEEDED(status)) {
rv = listener->OnDataAvailable(parserChannel, nullptr, stream, 0,
rv = listener->OnDataAvailable(parserChannel, stream, 0,
aContentLength);
if (NS_FAILED(rv)) parserChannel->Cancel(rv);
parserChannel->GetStatus(&status);

View File

@ -981,7 +981,6 @@ nsresult ExternalResourceMap::PendingLoad::SetupViewer(
NS_IMETHODIMP
ExternalResourceMap::PendingLoad::OnDataAvailable(nsIRequest* aRequest,
nsISupports* aContext,
nsIInputStream* aStream,
uint64_t aOffset,
uint32_t aCount) {
@ -990,7 +989,7 @@ ExternalResourceMap::PendingLoad::OnDataAvailable(nsIRequest* aRequest,
if (mDisplayDocument->ExternalResourceMap().HaveShutDown()) {
return NS_BINDING_ABORTED;
}
return mTargetListener->OnDataAvailable(aRequest, aContext, aStream, aOffset,
return mTargetListener->OnDataAvailable(aRequest, aStream, aOffset,
aCount);
}

View File

@ -707,7 +707,7 @@ void EventSourceImpl::ParseSegment(const char* aBuffer, uint32_t aLength) {
}
NS_IMETHODIMP
EventSourceImpl::OnDataAvailable(nsIRequest* aRequest, nsISupports* aContext,
EventSourceImpl::OnDataAvailable(nsIRequest* aRequest,
nsIInputStream* aInputStream, uint64_t aOffset,
uint32_t aCount) {
AssertIsOnTargetThread();

View File

@ -1055,7 +1055,7 @@ BeaconStreamListener::OnStopRequest(nsIRequest* aRequest,
}
NS_IMETHODIMP
BeaconStreamListener::OnDataAvailable(nsIRequest* aRequest, nsISupports* ctxt,
BeaconStreamListener::OnDataAvailable(nsIRequest* aRequest,
nsIInputStream* inStr,
uint64_t sourceOffset, uint32_t count) {
MOZ_ASSERT(false);

View File

@ -1047,7 +1047,6 @@ nsObjectLoadingContent::OnStopRequest(nsIRequest* aRequest,
// nsIStreamListener
NS_IMETHODIMP
nsObjectLoadingContent::OnDataAvailable(nsIRequest* aRequest,
nsISupports* aContext,
nsIInputStream* aInputStream,
uint64_t aOffset, uint32_t aCount) {
if (aRequest != mChannel) {
@ -1057,7 +1056,7 @@ nsObjectLoadingContent::OnDataAvailable(nsIRequest* aRequest,
if (mFinalListener) {
// This may re-enter in the case of plugin listeners
nsCOMPtr<nsIStreamListener> listenerGrip(mFinalListener);
return listenerGrip->OnDataAvailable(aRequest, aContext, aInputStream,
return listenerGrip->OnDataAvailable(aRequest, aInputStream,
aOffset, aCount);
}

View File

@ -345,7 +345,7 @@ nsresult nsSyncLoadService::PushSyncStreamToListener(
if (readCount > UINT32_MAX) readCount = UINT32_MAX;
rv = aListener->OnDataAvailable(
aChannel, nullptr, in,
aChannel, in,
(uint32_t)std::min(sourceOffset, (uint64_t)UINT32_MAX),
(uint32_t)readCount);
if (NS_FAILED(rv)) {

View File

@ -56,12 +56,11 @@ CustomChannel.prototype = {
// throws an error if security checks fail
var outListener = contentSecManager.performSecurityCheck(this, listener);
let stream = this.open();
let context = null;
try {
outListener.onStartRequest(this);
} catch (e) {}
try {
outListener.onDataAvailable(this, context, stream, 0, stream.available());
outListener.onDataAvailable(this, stream, 0, stream.available());
} catch (e) {}
try {
outListener.onStopRequest(this, Cr.NS_OK);

View File

@ -11,7 +11,7 @@ function gzipCompressString(string, obs) {
.createInstance(Ci.nsIStringInputStream);
stringStream.data = string;
converter.onStartRequest(null, null);
converter.onDataAvailable(null, null, stringStream, 0, string.length);
converter.onDataAvailable(null, stringStream, 0, string.length);
converter.onStopRequest(null, null, null);
}

View File

@ -253,7 +253,6 @@ AlternativeDataStreamListener::OnStartRequest(nsIRequest* aRequest) {
NS_IMETHODIMP
AlternativeDataStreamListener::OnDataAvailable(nsIRequest* aRequest,
nsISupports* aContext,
nsIInputStream* aInputStream,
uint64_t aOffset,
uint32_t aCount) {
@ -265,7 +264,7 @@ AlternativeDataStreamListener::OnDataAvailable(nsIRequest* aRequest,
}
if (mStatus == AlternativeDataStreamListener::FALLBACK) {
MOZ_ASSERT(mFetchDriver);
return mFetchDriver->OnDataAvailable(aRequest, aContext, aInputStream,
return mFetchDriver->OnDataAvailable(aRequest, aInputStream,
aOffset, aCount);
}
return NS_OK;
@ -1130,7 +1129,7 @@ nsresult CopySegmentToStreamAndSRI(nsIInputStream* aInStr, void* aClosure,
} // anonymous namespace
NS_IMETHODIMP
FetchDriver::OnDataAvailable(nsIRequest* aRequest, nsISupports* aContext,
FetchDriver::OnDataAvailable(nsIRequest* aRequest,
nsIInputStream* aInputStream, uint64_t aOffset,
uint32_t aCount) {
// NB: This can be called on any thread! But we're guaranteed that it is

View File

@ -70,7 +70,6 @@ MutableBlobStreamListener::OnStopRequest(nsIRequest* aRequest,
NS_IMETHODIMP
MutableBlobStreamListener::OnDataAvailable(nsIRequest* aRequest,
nsISupports* aContext,
nsIInputStream* aStream,
uint64_t aSourceOffset,
uint32_t aCount) {

View File

@ -708,7 +708,6 @@ HTMLMediaElement::MediaLoadListener::OnStopRequest(nsIRequest* aRequest,
NS_IMETHODIMP
HTMLMediaElement::MediaLoadListener::OnDataAvailable(nsIRequest* aRequest,
nsISupports* aContext,
nsIInputStream* aStream,
uint64_t aOffset,
uint32_t aCount) {
@ -718,7 +717,7 @@ HTMLMediaElement::MediaLoadListener::OnDataAvailable(nsIRequest* aRequest,
"canceled this request");
return NS_BINDING_ABORTED;
}
return mNextListener->OnDataAvailable(aRequest, aContext, aStream, aOffset,
return mNextListener->OnDataAvailable(aRequest, aStream, aOffset,
aCount);
}

View File

@ -85,12 +85,11 @@ MediaDocumentStreamListener::OnStopRequest(nsIRequest* request,
NS_IMETHODIMP
MediaDocumentStreamListener::OnDataAvailable(nsIRequest* request,
nsISupports* ctxt,
nsIInputStream* inStr,
uint64_t sourceOffset,
uint32_t count) {
if (mNextStream) {
return mNextStream->OnDataAvailable(request, ctxt, inStr, sourceOffset,
return mNextStream->OnDataAvailable(request, inStr, sourceOffset,
count);
}

View File

@ -943,12 +943,12 @@ nsJSChannel::OnStartRequest(nsIRequest* aRequest) {
}
NS_IMETHODIMP
nsJSChannel::OnDataAvailable(nsIRequest* aRequest, nsISupports* aContext,
nsJSChannel::OnDataAvailable(nsIRequest* aRequest,
nsIInputStream* aInputStream, uint64_t aOffset,
uint32_t aCount) {
NS_ENSURE_TRUE(aRequest == mStreamChannel, NS_ERROR_UNEXPECTED);
return mListener->OnDataAvailable(this, aContext, aInputStream, aOffset,
return mListener->OnDataAvailable(this, aInputStream, aOffset,
aCount);
}

View File

@ -67,7 +67,7 @@ nsresult ChannelMediaResource::Listener::OnStopRequest(nsIRequest* aRequest,
}
nsresult ChannelMediaResource::Listener::OnDataAvailable(
nsIRequest* aRequest, nsISupports* aContext, nsIInputStream* aStream,
nsIRequest* aRequest, nsIInputStream* aStream,
uint64_t aOffset, uint32_t aCount) {
// This might happen off the main thread.
RefPtr<ChannelMediaResource> res;

View File

@ -51,7 +51,7 @@ ResourceLoader.load = function(uri, doc) {
};
ResourceLoader.prototype = {
onDataAvailable(request, context, input, offset, count) {
onDataAvailable(request, input, offset, count) {
let stream = Cc["@mozilla.org/scriptableinputstream;1"]
.createInstance(Ci.nsIScriptableInputStream);
stream.init(input);

View File

@ -119,7 +119,7 @@ nsresult WebVTTListener::ParseChunk(nsIInputStream* aInStream, void* aClosure,
}
NS_IMETHODIMP
WebVTTListener::OnDataAvailable(nsIRequest* aRequest, nsISupports* aContext,
WebVTTListener::OnDataAvailable(nsIRequest* aRequest,
nsIInputStream* aStream, uint64_t aOffset,
uint32_t aCount) {
VTT_LOG("WebVTTListener::OnDataAvailable\n");

View File

@ -937,7 +937,7 @@ TCPSocket::OnStartRequest(nsIRequest* aRequest) {
}
NS_IMETHODIMP
TCPSocket::OnDataAvailable(nsIRequest* aRequest, nsISupports* aContext,
TCPSocket::OnDataAvailable(nsIRequest* aRequest,
nsIInputStream* aStream, uint64_t aOffset,
uint32_t aCount) {
if (mUseArrayBuffers) {

View File

@ -280,11 +280,11 @@ class PluginContextProxy final : public nsIStreamListener {
}
NS_IMETHOD
OnDataAvailable(nsIRequest* aRequest, nsISupports* aContext,
OnDataAvailable(nsIRequest* aRequest,
nsIInputStream* aIStream, uint64_t aSourceOffset,
uint32_t aLength) override {
// Proxy OnDataAvailable using the internal context
return mListener->OnDataAvailable(aRequest, mContext, aIStream,
return mListener->OnDataAvailable(aRequest, aIStream,
aSourceOffset, aLength);
}
@ -320,7 +320,7 @@ nsresult nsPluginStreamListenerPeer::SetStreamOffset(int32_t value) {
}
NS_IMETHODIMP nsPluginStreamListenerPeer::OnDataAvailable(
nsIRequest* request, nsISupports* aContext, nsIInputStream* aIStream,
nsIRequest* request, nsIInputStream* aIStream,
uint64_t sourceOffset, uint32_t aLength) {
if (mRequests.IndexOfObject(request) == -1) {
MOZ_ASSERT(false, "Received OnDataAvailable for untracked request.");

View File

@ -537,7 +537,6 @@ PresentationTCPSessionTransport::OnStopRequest(nsIRequest* aRequest,
// nsIStreamListener
NS_IMETHODIMP
PresentationTCPSessionTransport::OnDataAvailable(nsIRequest* aRequest,
nsISupports* aContext,
nsIInputStream* aStream,
uint64_t aOffset,
uint32_t aCount) {

View File

@ -622,7 +622,7 @@ TCPControlChannel.prototype = {
},
// nsIStreamListener (Triggered by nsIInputStreamPump.asyncRead)
onDataAvailable(aRequest, aContext, aInputStream) {
onDataAvailable(aRequest, aInputStream) {
let data = NetUtil.readInputStreamToString(aInputStream,
aInputStream.available());
DEBUG && log("TCPControlChannel - onDataAvailable: " + data); // jshint ignore:line

View File

@ -61,7 +61,7 @@ PushSubscriptionListener.prototype = {
// We do not do anything here.
},
onDataAvailable: function(aRequest, aContext, aStream, aOffset, aCount) {
onDataAvailable: function(aRequest, aStream, aOffset, aCount) {
console.debug("PushSubscriptionListener: onDataAvailable()");
// Nobody should send data, but just to be sure, otherwise necko will
// complain.
@ -115,7 +115,7 @@ PushChannelListener.prototype = {
this._ackUri = aRequest.URI.spec;
},
onDataAvailable: function(aRequest, aContext, aStream, aOffset, aCount) {
onDataAvailable: function(aRequest, aStream, aOffset, aCount) {
console.debug("PushChannelListener: onDataAvailable()");
if (aCount === 0) {
@ -171,7 +171,7 @@ PushServiceDelete.prototype = {
onStartRequest: function(aRequest) {},
onDataAvailable: function(aRequest, aContext, aStream, aOffset, aCount) {
onDataAvailable: function(aRequest, aStream, aOffset, aCount) {
// Nobody should send data, but just to be sure, otherwise necko will
// complain.
if (aCount === 0) {
@ -212,7 +212,7 @@ SubscriptionListener.prototype = {
onStartRequest: function(aRequest) {},
onDataAvailable: function(aRequest, aContext, aStream, aOffset, aCount) {
onDataAvailable: function(aRequest, aStream, aOffset, aCount) {
console.debug("SubscriptionListener: onDataAvailable()");
// We do not expect any data, but necko will complain if we do not consume

View File

@ -102,7 +102,7 @@ void ContentVerifier::FinishSignature() {
break;
}
// let the next listener know that there is data in oInStr
rv = nextListener->OnDataAvailable(mContentRequest, mContentContext, oInStr,
rv = nextListener->OnDataAvailable(mContentRequest, oInStr,
offset, mContent[i].Length());
offset += mContent[i].Length();
if (NS_FAILED(rv)) {
@ -148,7 +148,7 @@ ContentVerifier::OnStopRequest(nsIRequest* aRequest,
}
NS_IMETHODIMP
ContentVerifier::OnDataAvailable(nsIRequest* aRequest, nsISupports* aContext,
ContentVerifier::OnDataAvailable(nsIRequest* aRequest,
nsIInputStream* aInputStream, uint64_t aOffset,
uint32_t aCount) {
// buffer the entire stream

View File

@ -1595,7 +1595,6 @@ nsresult AppendSegmentToString(nsIInputStream* aInputStream, void* aClosure,
NS_IMETHODIMP
CSPViolationReportListener::OnDataAvailable(nsIRequest* aRequest,
nsISupports* aContext,
nsIInputStream* aInputStream,
uint64_t aOffset, uint32_t aCount) {
uint32_t read;

View File

@ -46,7 +46,7 @@ function ChannelListener() {
ChannelListener.prototype = {
onStartRequest(request) { },
onDataAvailable(request, context, stream, offset, count) {
onDataAvailable(request, stream, offset, count) {
do_throw("Should not get any data!");
},
onStopRequest(request, status) {

View File

@ -867,7 +867,7 @@ NS_IMETHODIMP nsWebBrowserPersist::OnStopRequest(nsIRequest *request,
//*****************************************************************************
NS_IMETHODIMP
nsWebBrowserPersist::OnDataAvailable(nsIRequest *request, nsISupports *aContext,
nsWebBrowserPersist::OnDataAvailable(nsIRequest *request,
nsIInputStream *aIStream, uint64_t aOffset,
uint32_t aLength) {
bool cancel = mCancel;

View File

@ -176,11 +176,11 @@ nsXBLStreamListener::~nsXBLStreamListener() {
}
NS_IMETHODIMP
nsXBLStreamListener::OnDataAvailable(nsIRequest* request, nsISupports* aCtxt,
nsXBLStreamListener::OnDataAvailable(nsIRequest* request,
nsIInputStream* aInStr,
uint64_t aSourceOffset, uint32_t aCount) {
if (mInner)
return mInner->OnDataAvailable(request, aCtxt, aInStr, aSourceOffset,
return mInner->OnDataAvailable(request, aInStr, aSourceOffset,
aCount);
return NS_ERROR_FAILURE;
}

View File

@ -1549,7 +1549,7 @@ nsresult XMLHttpRequestMainThread::StreamReaderFunc(
NS_ASSERTION(copyStream, "NS_NewByteInputStream lied");
nsresult parsingResult =
xmlHttpRequest->mXMLParserStreamListener->OnDataAvailable(
xmlHttpRequest->mChannel, xmlHttpRequest->mContext, copyStream,
xmlHttpRequest->mChannel, copyStream,
toOffset, count);
// No use to continue parsing if we failed here, but we
@ -1679,15 +1679,11 @@ void XMLHttpRequestMainThread::LocalFileToBlobCompleted(Blob* aBlob) {
NS_IMETHODIMP
XMLHttpRequestMainThread::OnDataAvailable(nsIRequest* request,
nsISupports* ctxt,
nsIInputStream* inStr,
uint64_t sourceOffset,
uint32_t count) {
NS_ENSURE_ARG_POINTER(inStr);
MOZ_ASSERT(mContext.get() == ctxt,
"start context different from OnDataAvailable context");
mProgressSinceLastProgressEvent = true;
XMLHttpRequest_Binding::ClearCachedResponseTextValue(this);

View File

@ -197,7 +197,7 @@ txStylesheetSink::DidBuildModel(bool aTerminated) {
}
NS_IMETHODIMP
txStylesheetSink::OnDataAvailable(nsIRequest* aRequest, nsISupports* aContext,
txStylesheetSink::OnDataAvailable(nsIRequest* aRequest,
nsIInputStream* aInputStream,
uint64_t aOffset, uint32_t aCount) {
if (!mCheckedForXML) {
@ -216,7 +216,7 @@ txStylesheetSink::OnDataAvailable(nsIRequest* aRequest, nsISupports* aContext,
}
}
return mListener->OnDataAvailable(aRequest, mParser, aInputStream, aOffset,
return mListener->OnDataAvailable(aRequest, aInputStream, aOffset,
aCount);
}

View File

@ -1387,7 +1387,6 @@ XULDocument::CachedChromeStreamListener::OnStopRequest(nsIRequest* request,
NS_IMETHODIMP
XULDocument::CachedChromeStreamListener::OnDataAvailable(nsIRequest* request,
nsISupports* aContext,
nsIInputStream* aInStr,
uint64_t aSourceOffset,
uint32_t aCount) {

View File

@ -67,7 +67,7 @@ nsAutoConfig::OnStartRequest(nsIRequest *request) {
}
NS_IMETHODIMP
nsAutoConfig::OnDataAvailable(nsIRequest *request, nsISupports *context,
nsAutoConfig::OnDataAvailable(nsIRequest *request,
nsIInputStream *aIStream, uint64_t aSourceOffset,
uint32_t aLength) {
uint32_t amt, size;

View File

@ -370,7 +370,7 @@ nsresult gfxSVGGlyphsDocument::ParseDocument(const uint8_t *aBuffer,
nsresult status;
channel->GetStatus(&status);
if (NS_SUCCEEDED(rv) && NS_SUCCEEDED(status)) {
rv = listener->OnDataAvailable(channel, nullptr /* aContext */, stream, 0,
rv = listener->OnDataAvailable(channel, stream, 0,
aBufLen);
if (NS_FAILED(rv)) {
channel->Cancel(rv);

View File

@ -188,10 +188,10 @@ void SVGDocumentWrapper::TickRefreshDriver() {
/** nsIStreamListener methods **/
NS_IMETHODIMP
SVGDocumentWrapper::OnDataAvailable(nsIRequest* aRequest, nsISupports* ctxt,
SVGDocumentWrapper::OnDataAvailable(nsIRequest* aRequest,
nsIInputStream* inStr,
uint64_t sourceOffset, uint32_t count) {
return mListener->OnDataAvailable(aRequest, ctxt, inStr, sourceOffset, count);
return mListener->OnDataAvailable(aRequest, inStr, sourceOffset, count);
}
/** nsIRequestObserver methods **/

View File

@ -451,7 +451,7 @@ nsresult VectorImage::OnImageDataAvailable(nsIRequest* aRequest,
nsIInputStream* aInStr,
uint64_t aSourceOffset,
uint32_t aCount) {
return OnDataAvailable(aRequest, aContext, aInStr, aSourceOffset, aCount);
return OnDataAvailable(aRequest, aInStr, aSourceOffset, aCount);
}
nsresult VectorImage::StartAnimation() {
@ -1468,14 +1468,14 @@ void VectorImage::OnSVGDocumentError() {
//******************************************************************************
NS_IMETHODIMP
VectorImage::OnDataAvailable(nsIRequest* aRequest, nsISupports* aCtxt,
VectorImage::OnDataAvailable(nsIRequest* aRequest,
nsIInputStream* aInStr, uint64_t aSourceOffset,
uint32_t aCount) {
if (mError) {
return NS_ERROR_FAILURE;
}
return mSVGDocumentWrapper->OnDataAvailable(aRequest, aCtxt, aInStr,
return mSVGDocumentWrapper->OnDataAvailable(aRequest, aInStr,
aSourceOffset, aCount);
}

View File

@ -98,10 +98,10 @@ nsIconChannel::OnStopRequest(nsIRequest* aRequest, nsresult aStatus) {
// nsIStreamListener methods
NS_IMETHODIMP
nsIconChannel::OnDataAvailable(nsIRequest* aRequest, nsISupports* aContext, nsIInputStream* aStream,
nsIconChannel::OnDataAvailable(nsIRequest* aRequest, nsIInputStream* aStream,
uint64_t aOffset, uint32_t aCount) {
if (mListener) {
return mListener->OnDataAvailable(this, aContext, aStream, aOffset, aCount);
return mListener->OnDataAvailable(this, aStream, aOffset, aCount);
}
return NS_OK;
}

View File

@ -734,11 +734,11 @@ nsIconChannel::OnStopRequest(nsIRequest* aRequest,
// nsIStreamListener methods
NS_IMETHODIMP
nsIconChannel::OnDataAvailable(nsIRequest* aRequest, nsISupports* aContext,
nsIconChannel::OnDataAvailable(nsIRequest* aRequest,
nsIInputStream* aStream, uint64_t aOffset,
uint32_t aCount) {
if (mListener) {
return mListener->OnDataAvailable(this, aContext, aStream, aOffset, aCount);
return mListener->OnDataAvailable(this, aStream, aOffset, aCount);
}
return NS_OK;
}

View File

@ -2702,14 +2702,14 @@ ProxyListener::OnStopRequest(nsIRequest* aRequest,
/** nsIStreamListener methods **/
NS_IMETHODIMP
ProxyListener::OnDataAvailable(nsIRequest* aRequest, nsISupports* ctxt,
ProxyListener::OnDataAvailable(nsIRequest* aRequest,
nsIInputStream* inStr, uint64_t sourceOffset,
uint32_t count) {
if (!mDestListener) {
return NS_ERROR_FAILURE;
}
return mDestListener->OnDataAvailable(aRequest, ctxt, inStr, sourceOffset,
return mDestListener->OnDataAvailable(aRequest, inStr, sourceOffset,
count);
}
@ -2931,7 +2931,7 @@ imgCacheValidator::OnStopRequest(nsIRequest* aRequest,
/** nsIStreamListener methods **/
NS_IMETHODIMP
imgCacheValidator::OnDataAvailable(nsIRequest* aRequest, nsISupports* ctxt,
imgCacheValidator::OnDataAvailable(nsIRequest* aRequest,
nsIInputStream* inStr, uint64_t sourceOffset,
uint32_t count) {
if (!mDestListener) {
@ -2941,7 +2941,7 @@ imgCacheValidator::OnDataAvailable(nsIRequest* aRequest, nsISupports* ctxt,
return NS_OK;
}
return mDestListener->OnDataAvailable(aRequest, ctxt, inStr, sourceOffset,
return mDestListener->OnDataAvailable(aRequest, inStr, sourceOffset,
count);
}

View File

@ -745,7 +745,7 @@ imgRequest::OnStopRequest(nsIRequest* aRequest,
RefPtr<imgRequest> strongThis = this;
if (mIsMultiPartChannel && mNewPartPending) {
OnDataAvailable(aRequest, nullptr, nullptr, 0, 0);
OnDataAvailable(aRequest, nullptr, 0, 0);
}
// XXXldb What if this is a non-last part of a multipart request?
@ -989,7 +989,7 @@ void imgRequest::FinishPreparingForNewPart(const NewPartResult& aResult) {
}
NS_IMETHODIMP
imgRequest::OnDataAvailable(nsIRequest* aRequest, nsISupports* aContext,
imgRequest::OnDataAvailable(nsIRequest* aRequest,
nsIInputStream* aInStr, uint64_t aOffset,
uint32_t aCount) {
LOG_SCOPE_WITH_PARAM(gImgLog, "imgRequest::OnDataAvailable", "count", aCount);
@ -1062,7 +1062,7 @@ imgRequest::OnDataAvailable(nsIRequest* aRequest, nsISupports* aContext,
// Notify the image that it has new data.
if (aInStr) {
nsresult rv = image->OnImageDataAvailable(aRequest, aContext, aInStr,
nsresult rv = image->OnImageDataAvailable(aRequest, nullptr, aInStr,
aOffset, aCount);
if (NS_FAILED(rv)) {

View File

@ -91,10 +91,10 @@ function ChannelListener()
this.requestStatus |= START_REQUEST;
}
this.onDataAvailable = function onDataAvailable(aRequest, aContext, aInputStream, aOffset, aCount)
this.onDataAvailable = function onDataAvailable(aRequest, aInputStream, aOffset, aCount)
{
if (this.outputListener)
this.outputListener.onDataAvailable(aRequest, aContext, aInputStream, aOffset, aCount);
this.outputListener.onDataAvailable(aRequest, aInputStream, aOffset, aCount);
this.requestStatus |= DATA_AVAILABLE;
}

View File

@ -114,7 +114,7 @@ StreamLoader::OnStopRequest(nsIRequest* aRequest,
/* nsIStreamListener implementation */
NS_IMETHODIMP
StreamLoader::OnDataAvailable(nsIRequest*, nsISupports*,
StreamLoader::OnDataAvailable(nsIRequest*,
nsIInputStream* aInputStream, uint64_t,
uint32_t aCount) {
if (NS_FAILED(mStatus)) {

View File

@ -354,7 +354,7 @@ WebrtcProxyChannel::OnStopRequest(nsIRequest* aRequest,
// nsIStreamListener
NS_IMETHODIMP
WebrtcProxyChannel::OnDataAvailable(nsIRequest* aRequest, nsISupports* aContext,
WebrtcProxyChannel::OnDataAvailable(nsIRequest* aRequest,
nsIInputStream* aInputStream,
uint64_t aOffset, uint32_t aCount) {
LOG(("WebrtcProxyChannel::OnDataAvailable %p count=%u\n", this, aCount));

View File

@ -358,7 +358,7 @@ var CastingApps = {
}
},
onStopRequest: function(request, statusCode) {},
onDataAvailable: function(request, context, stream, offset, count) {},
onDataAvailable: function(request, stream, offset, count) {},
};
if (channel) {

View File

@ -1047,14 +1047,14 @@ nsJARChannel::OnStopRequest(nsIRequest *req,
}
NS_IMETHODIMP
nsJARChannel::OnDataAvailable(nsIRequest *req, nsISupports *ctx,
nsJARChannel::OnDataAvailable(nsIRequest *req,
nsIInputStream *stream, uint64_t offset,
uint32_t count) {
LOG(("nsJARChannel::OnDataAvailable [this=%p %s]\n", this, mSpec.get()));
nsresult rv;
rv = mListener->OnDataAvailable(this, nullptr, stream, offset, count);
rv = mListener->OnDataAvailable(this, stream, offset, count);
// simply report progress here instead of hooking ourselves up as a
// nsITransportEventSink implementation.

View File

@ -34,7 +34,7 @@ Listener.prototype = {
available: -1,
gotStopRequest: false,
QueryInterface: ChromeUtils.generateQI(["nsIRequestObserver"]),
onDataAvailable(request, ctx, stream, offset, count) {
onDataAvailable(request, stream, offset, count) {
try {
this.available = stream.available();
Assert.equal(this.available, count);

View File

@ -93,7 +93,6 @@ NS_IMETHODIMP nsDeflateConverter::AsyncConvertData(const char *aFromType,
}
NS_IMETHODIMP nsDeflateConverter::OnDataAvailable(nsIRequest *aRequest,
nsISupports *aContext,
nsIInputStream *aInputStream,
uint64_t aOffset,
uint32_t aCount) {
@ -116,7 +115,7 @@ NS_IMETHODIMP nsDeflateConverter::OnDataAvailable(nsIRequest *aRequest,
while (mZstream.avail_out == 0) {
// buffer is full, push the data out to the listener
rv = PushAvailableData(aRequest, aContext);
rv = PushAvailableData(aRequest, nullptr);
NS_ENSURE_SUCCESS(rv, rv);
zerr = deflate(&mZstream, Z_NO_FLUSH);
}
@ -161,7 +160,7 @@ nsresult nsDeflateConverter::PushAvailableData(nsIRequest *aRequest,
(char *)mWriteBuffer, bytesToWrite);
NS_ENSURE_SUCCESS(rv, rv);
rv = mListener->OnDataAvailable(aRequest, mContext, stream, mOffset,
rv = mListener->OnDataAvailable(aRequest, stream, mOffset,
bytesToWrite);
// now set the state for 'deflate'

View File

@ -56,7 +56,6 @@ nsresult nsZipDataStream::Init(nsZipWriter *aWriter, nsIOutputStream *aStream,
}
NS_IMETHODIMP nsZipDataStream::OnDataAvailable(nsIRequest *aRequest,
nsISupports *aContext,
nsIInputStream *aInputStream,
uint64_t aOffset,
uint32_t aCount) {
@ -68,7 +67,7 @@ NS_IMETHODIMP nsZipDataStream::OnDataAvailable(nsIRequest *aRequest,
nsresult rv = ZW_ReadData(aInputStream, buffer.get(), aCount);
NS_ENSURE_SUCCESS(rv, rv);
return ProcessData(aRequest, aContext, buffer.get(), aOffset, aCount);
return ProcessData(aRequest, nullptr, buffer.get(), aOffset, aCount);
}
NS_IMETHODIMP nsZipDataStream::OnStartRequest(nsIRequest *aRequest) {
@ -121,7 +120,7 @@ nsresult nsZipDataStream::ProcessData(nsIRequest *aRequest,
nsresult rv = NS_NewByteInputStream(getter_AddRefs(stream), aBuffer, aCount);
NS_ENSURE_SUCCESS(rv, rv);
rv = mOutput->OnDataAvailable(aRequest, aContext, stream, aOffset, aCount);
rv = mOutput->OnDataAvailable(aRequest, stream, aOffset, aCount);
mHeader->mUSize += aCount;
return rv;

View File

@ -31,7 +31,7 @@ BinaryComparer.prototype = {
this.callback();
},
onDataAvailable(aRequest, aContext, aInputStream, aOffset, aCount) {
onDataAvailable(aRequest, aInputStream, aOffset, aCount) {
var stream = Cc["@mozilla.org/binaryinputstream;1"].
createInstance(Ci.nsIBinaryInputStream);
stream.setInputStream(aInputStream);

View File

@ -30,7 +30,7 @@ BinaryComparer.prototype = {
this.callback();
},
onDataAvailable(aRequest, aContext, aInputStream, aOffset, aCount) {
onDataAvailable(aRequest, aInputStream, aOffset, aCount) {
var stream = Cc["@mozilla.org/binaryinputstream;1"].
createInstance(Ci.nsIBinaryInputStream);
stream.setInputStream(aInputStream);

View File

@ -986,7 +986,6 @@ BackgroundFileSaverStreamListener::OnStopRequest(nsIRequest *aRequest,
NS_IMETHODIMP
BackgroundFileSaverStreamListener::OnDataAvailable(nsIRequest *aRequest,
nsISupports *aContext,
nsIInputStream *aInputStream,
uint64_t aOffset,
uint32_t aCount) {

View File

@ -53,7 +53,7 @@ nsresult MemoryDownloader::ConsumeData(nsIInputStream* aIn, void* aClosure,
}
NS_IMETHODIMP
MemoryDownloader::OnDataAvailable(nsIRequest* aRequest, nsISupports* aCtxt,
MemoryDownloader::OnDataAvailable(nsIRequest* aRequest,
nsIInputStream* aInStr,
uint64_t aSourceOffset, uint32_t aCount) {
uint32_t n;

View File

@ -292,7 +292,6 @@ NetworkConnectivityService::OnStopRequest(nsIRequest *aRequest,
NS_IMETHODIMP
NetworkConnectivityService::OnDataAvailable(nsIRequest *aRequest,
nsISupports *aContext,
nsIInputStream *aInputStream,
uint64_t aOffset, uint32_t aCount) {
nsAutoCString data;

View File

@ -2383,7 +2383,6 @@ Predictor::PrefetchListener::OnStopRequest(nsIRequest *aRequest,
// nsIStreamListener
NS_IMETHODIMP
Predictor::PrefetchListener::OnDataAvailable(nsIRequest *aRequest,
nsISupports *aContext,
nsIInputStream *aInputStream,
uint64_t aOffset,
const uint32_t aCount) {

View File

@ -94,7 +94,6 @@ SimpleChannelParent::OnStopRequest(nsIRequest* aRequest,
NS_IMETHODIMP
SimpleChannelParent::OnDataAvailable(nsIRequest* aRequest,
nsISupports* aContext,
nsIInputStream* aInputStream,
uint64_t aOffset, uint32_t aCount) {
// See above.

View File

@ -796,13 +796,13 @@ nsBaseChannel::OnStopRequest(nsIRequest *request,
// nsBaseChannel::nsIStreamListener
NS_IMETHODIMP
nsBaseChannel::OnDataAvailable(nsIRequest *request, nsISupports *ctxt,
nsBaseChannel::OnDataAvailable(nsIRequest *request,
nsIInputStream *stream, uint64_t offset,
uint32_t count) {
SUSPEND_PUMP_FOR_SCOPE();
nsresult rv =
mListener->OnDataAvailable(this, nullptr, stream, offset, count);
mListener->OnDataAvailable(this, stream, offset, count);
if (mSynthProgressEvents && NS_SUCCEEDED(rv)) {
int64_t prog = offset + count;
if (NS_IsMainThread()) {

View File

@ -92,7 +92,7 @@ nsresult nsDownloader::ConsumeData(nsIInputStream *in, void *closure,
}
NS_IMETHODIMP
nsDownloader::OnDataAvailable(nsIRequest *request, nsISupports *ctxt,
nsDownloader::OnDataAvailable(nsIRequest *request,
nsIInputStream *inStr, uint64_t sourceOffset,
uint32_t count) {
uint32_t n;

View File

@ -19,7 +19,6 @@ interface nsIStreamListener : nsIRequestObserver
* must read exactly |aCount| bytes of data before returning.
*
* @param aRequest request corresponding to the source of the data
* @param aContext user defined context
* @param aInputStream input stream containing the data chunk
* @param aOffset
* Number of bytes that were sent in previous onDataAvailable calls
@ -33,7 +32,6 @@ interface nsIStreamListener : nsIRequestObserver
* causing the request to be canceled.
*/
void onDataAvailable(in nsIRequest aRequest,
in nsISupports aContext,
in nsIInputStream aInputStream,
in unsigned long long aOffset,
in unsigned long aCount);

View File

@ -671,7 +671,6 @@ nsIncrementalDownload::OnStopRequest(nsIRequest *request,
NS_IMETHODIMP
nsIncrementalDownload::OnDataAvailable(nsIRequest *request,
nsISupports *context,
nsIInputStream *input, uint64_t offset,
uint32_t count) {
while (count) {

View File

@ -173,7 +173,6 @@ nsresult nsIncrementalStreamLoader::WriteSegmentFun(
NS_IMETHODIMP
nsIncrementalStreamLoader::OnDataAvailable(nsIRequest *request,
nsISupports *ctxt,
nsIInputStream *inStr,
uint64_t sourceOffset,
uint32_t count) {

View File

@ -551,7 +551,7 @@ uint32_t nsInputStreamPump::OnStateTransfer() {
// deadlocks when calls to RetargetDeliveryTo for multiple
// nsInputStreamPumps are needed (e.g. nsHttpChannel).
RecursiveMutexAutoUnlock unlock(mMutex);
rv = mListener->OnDataAvailable(this, nullptr, mAsyncStream,
rv = mListener->OnDataAvailable(this, mAsyncStream,
mStreamOffset, odaAvail);
}

View File

@ -40,7 +40,6 @@ nsSimpleStreamListener::OnStopRequest(nsIRequest *request,
//
NS_IMETHODIMP
nsSimpleStreamListener::OnDataAvailable(nsIRequest *request,
nsISupports *aContext,
nsIInputStream *aSource,
uint64_t aOffset, uint32_t aCount) {
uint32_t writeCount;

View File

@ -46,7 +46,7 @@ nsStreamListenerTee::OnStopRequest(nsIRequest *request,
}
NS_IMETHODIMP
nsStreamListenerTee::OnDataAvailable(nsIRequest *request, nsISupports *context,
nsStreamListenerTee::OnDataAvailable(nsIRequest *request,
nsIInputStream *input, uint64_t offset,
uint32_t count) {
NS_ENSURE_TRUE(mListener, NS_ERROR_NOT_INITIALIZED);
@ -73,7 +73,7 @@ nsStreamListenerTee::OnDataAvailable(nsIRequest *request, nsISupports *context,
tee = mInputTee;
}
return mListener->OnDataAvailable(request, context, tee, offset, count);
return mListener->OnDataAvailable(request, tee, offset, count);
}
NS_IMETHODIMP

View File

@ -127,7 +127,7 @@ nsresult nsStreamLoader::WriteSegmentFun(nsIInputStream *inStr, void *closure,
}
NS_IMETHODIMP
nsStreamLoader::OnDataAvailable(nsIRequest *request, nsISupports *ctxt,
nsStreamLoader::OnDataAvailable(nsIRequest *request,
nsIInputStream *inStr, uint64_t sourceOffset,
uint32_t count) {
uint32_t countRead;

View File

@ -65,7 +65,7 @@ nsSyncStreamListener::OnStartRequest(nsIRequest *request) {
}
NS_IMETHODIMP
nsSyncStreamListener::OnDataAvailable(nsIRequest *request, nsISupports *context,
nsSyncStreamListener::OnDataAvailable(nsIRequest *request,
nsIInputStream *stream, uint64_t offset,
uint32_t count) {
uint32_t bytesWritten;

View File

@ -1015,7 +1015,7 @@ TRR::OnStopRequest(nsIRequest *aRequest,
}
NS_IMETHODIMP
TRR::OnDataAvailable(nsIRequest *aRequest, nsISupports *aContext,
TRR::OnDataAvailable(nsIRequest *aRequest,
nsIInputStream *aInputStream, uint64_t aOffset,
const uint32_t aCount) {
LOG(("TRR:OnDataAvailable %p %s %d failed=%d aCount=%u\n", this, mHost.get(),

View File

@ -512,7 +512,6 @@ nsAboutCacheEntry::Channel::OnStartRequest(nsIRequest *request) {
NS_IMETHODIMP
nsAboutCacheEntry::Channel::OnDataAvailable(nsIRequest *request,
nsISupports *ctx,
nsIInputStream *aInputStream,
uint64_t aOffset, uint32_t aCount) {
uint32_t n;

View File

@ -93,7 +93,7 @@ DataChannelParent::OnStopRequest(nsIRequest *aRequest,
}
NS_IMETHODIMP
DataChannelParent::OnDataAvailable(nsIRequest *aRequest, nsISupports *aContext,
DataChannelParent::OnDataAvailable(nsIRequest *aRequest,
nsIInputStream *aInputStream,
uint64_t aOffset, uint32_t aCount) {
// See above.

View File

@ -93,7 +93,7 @@ FileChannelParent::OnStopRequest(nsIRequest *aRequest,
}
NS_IMETHODIMP
FileChannelParent::OnDataAvailable(nsIRequest *aRequest, nsISupports *aContext,
FileChannelParent::OnDataAvailable(nsIRequest *aRequest,
nsIInputStream *aInputStream,
uint64_t aOffset, uint32_t aCount) {
// See above.

View File

@ -430,7 +430,7 @@ void FTPChannelChild::DoOnDataAvailable(const nsresult& channelStatus,
}
AutoEventEnqueuer ensureSerialDispatch(mEventQ);
rv = mListener->OnDataAvailable(this, nullptr, stringStream, offset, count);
rv = mListener->OnDataAvailable(this, stringStream, offset, count);
if (NS_FAILED(rv)) Cancel(rv);
stringStream->Close();
}

View File

@ -272,7 +272,7 @@ void FTPChannelParent::DivertOnDataAvailable(const nsCString& data,
AutoEventEnqueuer ensureSerialDispatch(mEventQ);
rv = OnDataAvailable(mChannel, nullptr, stringStream, offset, count);
rv = OnDataAvailable(mChannel, stringStream, offset, count);
stringStream->Close();
if (NS_FAILED(rv)) {
@ -463,7 +463,7 @@ FTPChannelParent::OnStopRequest(nsIRequest* aRequest,
//-----------------------------------------------------------------------------
NS_IMETHODIMP
FTPChannelParent::OnDataAvailable(nsIRequest* aRequest, nsISupports* aContext,
FTPChannelParent::OnDataAvailable(nsIRequest* aRequest,
nsIInputStream* aInputStream,
uint64_t aOffset, uint32_t aCount) {
LOG(("FTPChannelParent::OnDataAvailable [this=%p]\n", this));
@ -471,7 +471,7 @@ FTPChannelParent::OnDataAvailable(nsIRequest* aRequest, nsISupports* aContext,
if (mDivertingFromChild) {
MOZ_RELEASE_ASSERT(mDivertToListener,
"Cannot divert if listener is unset!");
return mDivertToListener->OnDataAvailable(aRequest, aContext, aInputStream,
return mDivertToListener->OnDataAvailable(aRequest, aInputStream,
aOffset, aCount);
}

View File

@ -777,7 +777,6 @@ TransactionObserver::OnStartRequest(nsIRequest *aRequest) {
NS_IMETHODIMP
TransactionObserver::OnDataAvailable(nsIRequest *aRequest,
nsISupports *aContext,
nsIInputStream *aStream, uint64_t aOffset,
uint32_t aCount) {
MOZ_ASSERT(NS_IsMainThread());

View File

@ -1163,10 +1163,10 @@ class InterceptFailedOnStop : public nsIStreamListener {
return mNext->OnStopRequest(aRequest, aStatusCode);
}
NS_IMETHOD OnDataAvailable(nsIRequest* aRequest, nsISupports* aContext,
NS_IMETHOD OnDataAvailable(nsIRequest* aRequest,
nsIInputStream* aInputStream, uint64_t aOffset,
uint32_t aCount) override {
return mNext->OnDataAvailable(aRequest, aContext, aInputStream, aOffset,
return mNext->OnDataAvailable(aRequest, aInputStream, aOffset,
aCount);
}
};

View File

@ -111,7 +111,6 @@ InterceptStreamListener::OnProgress(nsIRequest* aRequest, nsISupports* aContext,
NS_IMETHODIMP
InterceptStreamListener::OnDataAvailable(nsIRequest* aRequest,
nsISupports* aContext,
nsIInputStream* aInputStream,
uint64_t aOffset, uint32_t aCount) {
if (!mOwner) {
@ -128,14 +127,14 @@ InterceptStreamListener::OnDataAvailable(nsIRequest* aRequest,
nsAutoCString host;
uri->GetHost(host);
OnStatus(mOwner, aContext, NS_NET_STATUS_READING,
OnStatus(mOwner, nullptr, NS_NET_STATUS_READING,
NS_ConvertUTF8toUTF16(host).get());
int64_t progress = aOffset + aCount;
OnProgress(mOwner, aContext, progress, mOwner->mSynthesizedStreamLength);
OnProgress(mOwner, nullptr, progress, mOwner->mSynthesizedStreamLength);
}
mOwner->DoOnDataAvailable(mOwner, mContext, aInputStream, aOffset, aCount);
mOwner->DoOnDataAvailable(mOwner, nullptr, aInputStream, aOffset, aCount);
return NS_OK;
}
@ -623,7 +622,7 @@ class SyntheticDiversionListener final : public nsIStreamListener {
}
NS_IMETHOD
OnDataAvailable(nsIRequest* aRequest, nsISupports* aContext,
OnDataAvailable(nsIRequest* aRequest,
nsIInputStream* aInputStream, uint64_t aOffset,
uint32_t aCount) override {
if (!mChannel->mIPCOpen) {
@ -962,7 +961,7 @@ void HttpChannelChild::DoOnDataAvailable(nsIRequest* aRequest,
if (mCanceled) return;
nsresult rv =
mListener->OnDataAvailable(aRequest, aContext, aStream, offset, count);
mListener->OnDataAvailable(aRequest, aStream, offset, count);
if (NS_FAILED(rv)) {
CancelOnMainThread(rv);
}

View File

@ -1090,7 +1090,7 @@ void HttpChannelParent::DivertOnDataAvailable(const nsCString& data,
AutoEventEnqueuer ensureSerialDispatch(mEventQ);
rv = mParentListener->OnDataAvailable(mChannel, nullptr, stringStream, offset,
rv = mParentListener->OnDataAvailable(mChannel, stringStream, offset,
count);
stringStream->Close();
if (NS_FAILED(rv)) {
@ -1565,7 +1565,7 @@ HttpChannelParent::OnStopRequest(nsIRequest* aRequest,
//-----------------------------------------------------------------------------
NS_IMETHODIMP
HttpChannelParent::OnDataAvailable(nsIRequest* aRequest, nsISupports* aContext,
HttpChannelParent::OnDataAvailable(nsIRequest* aRequest,
nsIInputStream* aInputStream,
uint64_t aOffset, uint32_t aCount) {
LOG(("HttpChannelParent::OnDataAvailable [this=%p aRequest=%p offset=%" PRIu64

View File

@ -104,7 +104,6 @@ HttpChannelParentListener::OnStopRequest(nsIRequest* aRequest,
NS_IMETHODIMP
HttpChannelParentListener::OnDataAvailable(nsIRequest* aRequest,
nsISupports* aContext,
nsIInputStream* aInputStream,
uint64_t aOffset, uint32_t aCount) {
MOZ_RELEASE_ASSERT(!mSuspendedForDiversion,
@ -113,7 +112,7 @@ HttpChannelParentListener::OnDataAvailable(nsIRequest* aRequest,
if (!mNextListener) return NS_ERROR_UNEXPECTED;
LOG(("HttpChannelParentListener::OnDataAvailable [this=%p]\n", this));
return mNextListener->OnDataAvailable(aRequest, aContext, aInputStream,
return mNextListener->OnDataAvailable(aRequest, aInputStream,
aOffset, aCount);
}

View File

@ -1060,7 +1060,6 @@ InterceptedHttpChannel::OnStopRequest(nsIRequest* aRequest,
NS_IMETHODIMP
InterceptedHttpChannel::OnDataAvailable(nsIRequest* aRequest,
nsISupports* aContext,
nsIInputStream* aInputStream,
uint64_t aOffset, uint32_t aCount) {
// Any thread if the channel has been retargeted.
@ -1079,7 +1078,7 @@ InterceptedHttpChannel::OnDataAvailable(nsIRequest* aRequest,
}
}
return mListener->OnDataAvailable(this, nullptr, aInputStream, aOffset,
return mListener->OnDataAvailable(this, aInputStream, aOffset,
aCount);
}

View File

@ -619,7 +619,6 @@ nsCORSListenerProxy::OnStopRequest(nsIRequest* aRequest,
NS_IMETHODIMP
nsCORSListenerProxy::OnDataAvailable(nsIRequest* aRequest,
nsISupports* aContext,
nsIInputStream* aInputStream,
uint64_t aOffset, uint32_t aCount) {
// NB: This can be called on any thread! But we're guaranteed that it is
@ -636,7 +635,7 @@ nsCORSListenerProxy::OnDataAvailable(nsIRequest* aRequest,
MutexAutoLock lock(mMutex);
listener = mOuterListener;
}
return listener->OnDataAvailable(aRequest, aContext, aInputStream, aOffset,
return listener->OnDataAvailable(aRequest, aInputStream, aOffset,
aCount);
}
@ -1243,7 +1242,6 @@ nsCORSPreflightListener::OnStopRequest(nsIRequest* aRequest,
NS_IMETHODIMP
nsCORSPreflightListener::OnDataAvailable(nsIRequest* aRequest,
nsISupports* ctxt,
nsIInputStream* inStr,
uint64_t sourceOffset,
uint32_t count) {

View File

@ -8008,7 +8008,7 @@ class OnTransportStatusAsyncEvent : public Runnable {
};
NS_IMETHODIMP
nsHttpChannel::OnDataAvailable(nsIRequest *request, nsISupports *ctxt,
nsHttpChannel::OnDataAvailable(nsIRequest *request,
nsIInputStream *input, uint64_t offset,
uint32_t count) {
nsresult rv;
@ -8097,7 +8097,7 @@ nsHttpChannel::OnDataAvailable(nsIRequest *request, nsISupports *ctxt,
}
nsresult rv =
mListener->OnDataAvailable(this, nullptr, input, mLogicalOffset, count);
mListener->OnDataAvailable(this, input, mLogicalOffset, count);
if (NS_SUCCEEDED(rv)) {
// by contract mListener must read all of "count" bytes, but
// nsInputStreamPump is tolerant to seekable streams that violate that

View File

@ -653,12 +653,11 @@ nsViewSourceChannel::OnStopRequest(nsIRequest *aRequest,
// nsIStreamListener methods
NS_IMETHODIMP
nsViewSourceChannel::OnDataAvailable(nsIRequest *aRequest,
nsISupports *aContext,
nsIInputStream *aInputStream,
uint64_t aSourceOffset, uint32_t aLength) {
NS_ENSURE_TRUE(mListener, NS_ERROR_FAILURE);
return mListener->OnDataAvailable(static_cast<nsIViewSourceChannel *>(this),
aContext, aInputStream, aSourceOffset,
aInputStream, aSourceOffset,
aLength);
}

View File

@ -4004,7 +4004,7 @@ WebSocketChannel::OnOutputStreamReady(nsIAsyncOutputStream *aStream) {
// nsIStreamListener
NS_IMETHODIMP
WebSocketChannel::OnDataAvailable(nsIRequest *aRequest, nsISupports *aContext,
WebSocketChannel::OnDataAvailable(nsIRequest *aRequest,
nsIInputStream *aInputStream,
uint64_t aOffset, uint32_t aCount) {
LOG(("WebSocketChannel::OnDataAvailable() %p [%p %p %p %" PRIu64 " %u]\n",

View File

@ -234,7 +234,7 @@ void WyciwygChannelChild::OnDataAvailable(const nsCString& data,
AutoEventEnqueuer ensureSerialDispatch(mEventQ);
rv = mListener->OnDataAvailable(this, nullptr, stringStream, offset,
rv = mListener->OnDataAvailable(this, stringStream, offset,
data.Length());
if (NS_FAILED(rv)) Cancel(rv);

View File

@ -347,7 +347,6 @@ WyciwygChannelParent::OnStopRequest(nsIRequest* aRequest,
NS_IMETHODIMP
WyciwygChannelParent::OnDataAvailable(nsIRequest* aRequest,
nsISupports* aContext,
nsIInputStream* aInputStream,
uint64_t aOffset, uint32_t aCount) {
LOG(("WyciwygChannelParent::OnDataAvailable [this=%p]\n", this));

View File

@ -545,7 +545,7 @@ nsWyciwygChannel::OnCacheEntryAvailable(nsICacheEntry *aCacheEntry, bool aNew,
//-----------------------------------------------------------------------------
NS_IMETHODIMP
nsWyciwygChannel::OnDataAvailable(nsIRequest *request, nsISupports *ctx,
nsWyciwygChannel::OnDataAvailable(nsIRequest *request,
nsIInputStream *input, uint64_t offset,
uint32_t count) {
LOG(("nsWyciwygChannel::OnDataAvailable [this=%p request=%p offset=%" PRIu64
@ -557,7 +557,7 @@ nsWyciwygChannel::OnDataAvailable(nsIRequest *request, nsISupports *ctx,
nsCOMPtr<nsIStreamListener> listener = mListener;
if (listener) {
rv = listener->OnDataAvailable(this, nullptr, input, offset, count);
rv = listener->OnDataAvailable(this, input, offset, count);
} else {
MOZ_ASSERT(false, "We must have a listener!");
rv = NS_ERROR_UNEXPECTED;

View File

@ -1218,7 +1218,7 @@ mozTXTToHTMLConv::AsyncConvertData(const char* aFromType, const char* aToType,
}
NS_IMETHODIMP
mozTXTToHTMLConv::OnDataAvailable(nsIRequest* request, nsISupports* ctxt,
mozTXTToHTMLConv::OnDataAvailable(nsIRequest* request,
nsIInputStream* inStr, uint64_t sourceOffset,
uint32_t count) {
return NS_ERROR_NOT_IMPLEMENTED;

View File

@ -297,7 +297,7 @@ nsresult nsDirIndexParser::ParseData(nsIDirIndex *aIdx, char *aDataStr,
}
NS_IMETHODIMP
nsDirIndexParser::OnDataAvailable(nsIRequest *aRequest, nsISupports *aCtxt,
nsDirIndexParser::OnDataAvailable(nsIRequest *aRequest,
nsIInputStream *aStream,
uint64_t aSourceOffset, uint32_t aCount) {
if (aCount < 1) return NS_OK;
@ -319,7 +319,7 @@ nsDirIndexParser::OnDataAvailable(nsIRequest *aRequest, nsISupports *aCtxt,
// work on other strings.
mBuf.SetLength(len + count);
return ProcessData(aRequest, aCtxt);
return ProcessData(aRequest, nullptr);
}
nsresult nsDirIndexParser::ProcessData(nsIRequest *aRequest,

View File

@ -72,7 +72,7 @@ nsFTPDirListingConv::AsyncConvertData(const char *aFromType,
// nsIStreamListener implementation
NS_IMETHODIMP
nsFTPDirListingConv::OnDataAvailable(nsIRequest *request, nsISupports *ctxt,
nsFTPDirListingConv::OnDataAvailable(nsIRequest *request,
nsIInputStream *inStr,
uint64_t sourceOffset, uint32_t count) {
NS_ASSERTION(request, "FTP dir listing stream converter needs a request");
@ -99,9 +99,9 @@ nsFTPDirListingConv::OnDataAvailable(nsIRequest *request, nsISupports *ctxt,
buffer[streamLen] = '\0';
MOZ_LOG(gFTPDirListConvLog, LogLevel::Debug,
("nsFTPDirListingConv::OnData(request = %p, ctxt = %p, inStr = %p, "
("nsFTPDirListingConv::OnData(request = %p, inStr = %p, "
"sourceOffset = %" PRIu64 ", count = %u)\n",
request, ctxt, inStr, sourceOffset, count));
request, inStr, sourceOffset, count));
if (!mBuffer.IsEmpty()) {
// we have data left over from a previous OnDataAvailable() call.
@ -153,7 +153,7 @@ nsFTPDirListingConv::OnDataAvailable(nsIRequest *request, nsISupports *ctxt,
rv = NS_NewCStringInputStream(getter_AddRefs(inputData), indexFormat);
NS_ENSURE_SUCCESS(rv, rv);
rv = mFinalListener->OnDataAvailable(request, ctxt, inputData, 0,
rv = mFinalListener->OnDataAvailable(request, inputData, 0,
indexFormat.Length());
return rv;

View File

@ -255,7 +255,7 @@ nsHTTPCompressConv::OnStopRequest(nsIRequest *request,
}
NS_IMETHODIMP
nsHTTPCompressConv::OnDataAvailable(nsIRequest *request, nsISupports *aContext,
nsHTTPCompressConv::OnDataAvailable(nsIRequest *request,
nsIInputStream *iStr,
uint64_t aSourceOffset, uint32_t aCount) {
nsresult rv = NS_ERROR_INVALID_CONTENT_ENCODING;
@ -349,7 +349,7 @@ nsHTTPCompressConv::OnDataAvailable(nsIRequest *request, nsISupports *aContext,
if (code == Z_STREAM_END) {
if (bytesWritten) {
rv = do_OnDataAvailable(request, aContext, aSourceOffset,
rv = do_OnDataAvailable(request, nullptr, aSourceOffset,
(char *)mOutBuffer, bytesWritten);
if (NS_FAILED(rv)) {
return rv;
@ -361,7 +361,7 @@ nsHTTPCompressConv::OnDataAvailable(nsIRequest *request, nsISupports *aContext,
break;
} else if (code == Z_OK) {
if (bytesWritten) {
rv = do_OnDataAvailable(request, aContext, aSourceOffset,
rv = do_OnDataAvailable(request, nullptr, aSourceOffset,
(char *)mOutBuffer, bytesWritten);
if (NS_FAILED(rv)) {
return rv;
@ -369,7 +369,7 @@ nsHTTPCompressConv::OnDataAvailable(nsIRequest *request, nsISupports *aContext,
}
} else if (code == Z_BUF_ERROR) {
if (bytesWritten) {
rv = do_OnDataAvailable(request, aContext, aSourceOffset,
rv = do_OnDataAvailable(request, nullptr, aSourceOffset,
(char *)mOutBuffer, bytesWritten);
if (NS_FAILED(rv)) {
return rv;
@ -431,7 +431,7 @@ nsHTTPCompressConv::OnDataAvailable(nsIRequest *request, nsISupports *aContext,
if (code == Z_STREAM_END) {
if (bytesWritten) {
rv = do_OnDataAvailable(request, aContext, aSourceOffset,
rv = do_OnDataAvailable(request, nullptr, aSourceOffset,
(char *)mOutBuffer, bytesWritten);
if (NS_FAILED(rv)) {
return rv;
@ -443,7 +443,7 @@ nsHTTPCompressConv::OnDataAvailable(nsIRequest *request, nsISupports *aContext,
break;
} else if (code == Z_OK) {
if (bytesWritten) {
rv = do_OnDataAvailable(request, aContext, aSourceOffset,
rv = do_OnDataAvailable(request, nullptr, aSourceOffset,
(char *)mOutBuffer, bytesWritten);
if (NS_FAILED(rv)) {
return rv;
@ -451,7 +451,7 @@ nsHTTPCompressConv::OnDataAvailable(nsIRequest *request, nsISupports *aContext,
}
} else if (code == Z_BUF_ERROR) {
if (bytesWritten) {
rv = do_OnDataAvailable(request, aContext, aSourceOffset,
rv = do_OnDataAvailable(request, nullptr, aSourceOffset,
(char *)mOutBuffer, bytesWritten);
if (NS_FAILED(rv)) {
return rv;
@ -471,7 +471,7 @@ nsHTTPCompressConv::OnDataAvailable(nsIRequest *request, nsISupports *aContext,
}
mBrotli->mRequest = request;
mBrotli->mContext = aContext;
mBrotli->mContext = nullptr;
mBrotli->mSourceOffset = aSourceOffset;
uint32_t countRead;
@ -490,7 +490,7 @@ nsHTTPCompressConv::OnDataAvailable(nsIRequest *request, nsISupports *aContext,
MutexAutoLock lock(mMutex);
listener = mListener;
}
rv = listener->OnDataAvailable(request, aContext, iStr, aSourceOffset,
rv = listener->OnDataAvailable(request, iStr, aSourceOffset,
aCount);
if (NS_FAILED(rv)) {
return rv;
@ -527,7 +527,7 @@ nsresult nsHTTPCompressConv::do_OnDataAvailable(nsIRequest *request,
listener = mListener;
}
nsresult rv =
listener->OnDataAvailable(request, context, mStream, offset, count);
listener->OnDataAvailable(request, mStream, offset, count);
// Make sure the stream no longer references |buffer| in case our listener
// is crazy enough to try to read from |mStream| after ODA.

View File

@ -662,15 +662,15 @@ nsresult nsIndexedToHTML::SendToListener(nsIRequest* aRequest,
nsCOMPtr<nsIInputStream> inputData;
nsresult rv = NS_NewCStringInputStream(getter_AddRefs(inputData), aBuffer);
NS_ENSURE_SUCCESS(rv, rv);
return mListener->OnDataAvailable(aRequest, aContext, inputData, 0,
return mListener->OnDataAvailable(aRequest, inputData, 0,
aBuffer.Length());
}
NS_IMETHODIMP
nsIndexedToHTML::OnDataAvailable(nsIRequest* aRequest, nsISupports* aCtxt,
nsIndexedToHTML::OnDataAvailable(nsIRequest* aRequest,
nsIInputStream* aInput, uint64_t aOffset,
uint32_t aCount) {
return mParser->OnDataAvailable(aRequest, aCtxt, aInput, aOffset, aCount);
return mParser->OnDataAvailable(aRequest, aInput, aOffset, aCount);
}
NS_IMETHODIMP

View File

@ -55,7 +55,7 @@ nsresult nsPartChannel::SendOnStartRequest(nsISupports *aContext) {
nsresult nsPartChannel::SendOnDataAvailable(nsISupports *aContext,
nsIInputStream *aStream,
uint64_t aOffset, uint32_t aLen) {
return mListener->OnDataAvailable(this, aContext, aStream, aOffset, aLen);
return mListener->OnDataAvailable(this, aStream, aOffset, aLen);
}
nsresult nsPartChannel::SendOnStopRequest(nsISupports *aContext,
@ -494,7 +494,7 @@ nsMultiMixedConv::OnStartRequest(nsIRequest *request) {
// nsIStreamListener implementation
NS_IMETHODIMP
nsMultiMixedConv::OnDataAvailable(nsIRequest *request, nsISupports *context,
nsMultiMixedConv::OnDataAvailable(nsIRequest *request,
nsIInputStream *inStr, uint64_t sourceOffset,
uint32_t count) {
// Failing these assertions may indicate that some of the target listeners of

View File

@ -54,7 +54,7 @@ nsUnknownDecoder::ConvertedStreamListener::OnStartRequest(
NS_IMETHODIMP
nsUnknownDecoder::ConvertedStreamListener::OnDataAvailable(
nsIRequest* request, nsISupports* context, nsIInputStream* stream,
nsIRequest* request, nsIInputStream* stream,
uint64_t offset, uint32_t count) {
uint32_t read;
nsAutoCString decodedData;
@ -152,7 +152,7 @@ nsUnknownDecoder::AsyncConvertData(const char* aFromType, const char* aToType,
// ----
NS_IMETHODIMP
nsUnknownDecoder::OnDataAvailable(nsIRequest* request, nsISupports* aCtxt,
nsUnknownDecoder::OnDataAvailable(nsIRequest* request,
nsIInputStream* aStream,
uint64_t aSourceOffset, uint32_t aCount) {
nsresult rv = NS_OK;
@ -198,7 +198,7 @@ nsUnknownDecoder::OnDataAvailable(nsIRequest* request, nsISupports* aCtxt,
DetermineContentType(request);
rv = FireListenerNotifications(request, aCtxt);
rv = FireListenerNotifications(request, nullptr);
}
}
@ -227,7 +227,7 @@ nsUnknownDecoder::OnDataAvailable(nsIRequest* request, nsISupports* aCtxt,
MutexAutoLock lock(mMutex);
listener = mNextListener;
}
rv = listener->OnDataAvailable(request, aCtxt, aStream, aSourceOffset,
rv = listener->OnDataAvailable(request, aStream, aSourceOffset,
aCount);
}
@ -749,7 +749,7 @@ nsresult nsUnknownDecoder::FireListenerNotifications(nsIRequest* request,
rv = out->Write(mBuffer, mBufferLen, &len);
if (NS_SUCCEEDED(rv)) {
if (len == mBufferLen) {
rv = listener->OnDataAvailable(request, aCtxt, in, 0, len);
rv = listener->OnDataAvailable(request, in, 0, len);
} else {
NS_ERROR("Unable to write all the data into the pipe.");
rv = NS_ERROR_FAILURE;
@ -798,7 +798,7 @@ nsresult nsUnknownDecoder::ConvertEncodedData(nsIRequest* request,
rv = rawStream->SetData((const char*)data, length);
NS_ENSURE_SUCCESS(rv, rv);
rv = listener->OnDataAvailable(request, nullptr, rawStream, 0, length);
rv = listener->OnDataAvailable(request, rawStream, 0, length);
NS_ENSURE_SUCCESS(rv, rv);
}

View File

@ -176,7 +176,7 @@ document.getElementById('form').submit();
aListener.onStartRequest(this, null);
} catch(e) {}
try {
aListener.onDataAvailable(this, null, stream, 0, stream.available());
aListener.onDataAvailable(this, stream, 0, stream.available());
} catch(e) {}
try {
aListener.onStopRequest(this, null, Cr.NS_OK);

View File

@ -292,7 +292,7 @@ function runHttpTests(testArray, done) {
"called...");
}
},
onDataAvailable(request, cx, inputStream, offset, count) {
onDataAvailable(request, inputStream, offset, count) {
var quantum = 262144; // just above half the argument-count limit
var bis = makeBIS(inputStream);
for (var start = 0; start < count; start += quantum) {

View File

@ -238,7 +238,7 @@ HTTPTestLoader.prototype =
"called...");
}
},
onDataAvailable(request, cx, inputStream, offset, count) {
onDataAvailable(request, inputStream, offset, count) {
dumpn("*** HTTPTestLoader.onDataAvailable for " + this._path);
Array.prototype.push.apply(this._data,

Some files were not shown because too many files have changed in this diff Show More