Skip to content

Commit

Permalink
Backed out 4 changesets (bug 1525319) for Android failures in dom/bas…
Browse files Browse the repository at this point in the history
…e/test/test_progress_events_for_gzip_data.html

Backed out changeset b73f033efb41 (bug 1525319)
Backed out changeset 1d318d5c6b98 (bug 1525319)
Backed out changeset 6d73418988d4 (bug 1525319)
Backed out changeset 84ca79bd2dc3 (bug 1525319)
  • Loading branch information
dgluca committed Feb 25, 2019
1 parent 0bf1976 commit 4a4dcd5
Show file tree
Hide file tree
Showing 263 changed files with 1,236 additions and 1,078 deletions.
4 changes: 2 additions & 2 deletions browser/base/content/aboutDialog-appUpdater.js
Original file line number Diff line number Diff line change
Expand Up @@ -325,13 +325,13 @@ appUpdater.prototype =
/**
* See nsIRequestObserver.idl
*/
onStartRequest(aRequest) {
onStartRequest(aRequest, aContext) {
},

/**
* See nsIRequestObserver.idl
*/
onStopRequest(aRequest, aStatusCode) {
onStopRequest(aRequest, aContext, aStatusCode) {
switch (aStatusCode) {
case Cr.NS_ERROR_UNEXPECTED:
if (this.update.selectedPatch.state == "download-failed" &&
Expand Down
12 changes: 6 additions & 6 deletions browser/base/content/nsContextMenu.js
Original file line number Diff line number Diff line change
Expand Up @@ -1102,7 +1102,7 @@ nsContextMenu.prototype = {
saveAsListener.prototype = {
extListener: null,

onStartRequest: function saveLinkAs_onStartRequest(aRequest) {
onStartRequest: function saveLinkAs_onStartRequest(aRequest, aContext) {
// if the timer fired, the error status will have been caused by that,
// and we'll be restarting in onStopRequest, so no reason to notify
// the user
Expand Down Expand Up @@ -1133,10 +1133,10 @@ nsContextMenu.prototype = {
this.extListener =
extHelperAppSvc.doContent(channel.contentType, aRequest,
null, true, window);
this.extListener.onStartRequest(aRequest);
this.extListener.onStartRequest(aRequest, aContext);
},

onStopRequest: function saveLinkAs_onStopRequest(aRequest,
onStopRequest: function saveLinkAs_onStopRequest(aRequest, aContext,
aStatusCode) {
if (aStatusCode == NS_ERROR_SAVE_LINK_AS_TIMEOUT) {
// do it the old fashioned way, which will pick the best filename
Expand All @@ -1145,13 +1145,13 @@ nsContextMenu.prototype = {
doc, isContentWindowPrivate);
}
if (this.extListener)
this.extListener.onStopRequest(aRequest, aStatusCode);
this.extListener.onStopRequest(aRequest, aContext, aStatusCode);
},

onDataAvailable: function saveLinkAs_onDataAvailable(aRequest,
onDataAvailable: function saveLinkAs_onDataAvailable(aRequest, aContext,
aInputStream,
aOffset, aCount) {
this.extListener.onDataAvailable(aRequest, aInputStream,
this.extListener.onDataAvailable(aRequest, aContext, aInputStream,
aOffset, aCount);
},
};
Expand Down
32 changes: 16 additions & 16 deletions browser/extensions/pdfjs/content/PdfStreamConverter.jsm
Original file line number Diff line number Diff line change
Expand Up @@ -277,26 +277,26 @@ class ChromeActions {

var listener = {
extListener: null,
onStartRequest(aRequest) {
onStartRequest(aRequest, aContext) {
var loadContext = self.domWindow.docShell
.QueryInterface(Ci.nsILoadContext);
this.extListener = extHelperAppSvc.doContent(
(data.isAttachment ? "application/octet-stream" :
"application/pdf"),
aRequest, loadContext, false);
this.extListener.onStartRequest(aRequest);
this.extListener.onStartRequest(aRequest, aContext);
},
onStopRequest(aRequest, aStatusCode) {
onStopRequest(aRequest, aContext, aStatusCode) {
if (this.extListener) {
this.extListener.onStopRequest(aRequest, aStatusCode);
this.extListener.onStopRequest(aRequest, aContext, aStatusCode);
}
// Notify the content code we're done downloading.
if (sendResponse) {
sendResponse(false);
}
},
onDataAvailable(aRequest, aDataInputStream, aOffset, aCount) {
this.extListener.onDataAvailable(aRequest, aDataInputStream,
onDataAvailable(aRequest, aContext, aDataInputStream, aOffset, aCount) {
this.extListener.onDataAvailable(aRequest, aContext, aDataInputStream,
aOffset, aCount);
},
};
Expand Down Expand Up @@ -847,7 +847,7 @@ PdfStreamConverter.prototype = {
},

// nsIStreamListener::onDataAvailable
onDataAvailable(aRequest, aInputStream, aOffset, aCount) {
onDataAvailable(aRequest, aContext, aInputStream, aOffset, aCount) {
if (!this.dataListener) {
return;
}
Expand All @@ -860,7 +860,7 @@ PdfStreamConverter.prototype = {
},

// nsIRequestObserver::onStartRequest
onStartRequest(aRequest) {
onStartRequest(aRequest, aContext) {
// Setup the request so we can use it below.
var isHttpRequest = false;
try {
Expand Down Expand Up @@ -939,19 +939,19 @@ PdfStreamConverter.prototype = {
// request(aRequest) below so we don't overwrite the original channel and
// trigger an assertion.
var proxy = {
onStartRequest(request) {
listener.onStartRequest(aRequest);
onStartRequest(request, context) {
listener.onStartRequest(aRequest, aContext);
},
onDataAvailable(request, inputStream, offset, count) {
listener.onDataAvailable(aRequest, inputStream,
onDataAvailable(request, context, inputStream, offset, count) {
listener.onDataAvailable(aRequest, aContext, inputStream,
offset, count);
},
onStopRequest(request, statusCode) {
onStopRequest(request, context, statusCode) {
var domWindow = getDOMWindow(channel, resourcePrincipal);
if (!Components.isSuccessCode(statusCode) || !domWindow) {
// The request may have been aborted and the document may have been
// replaced with something that is not PDF.js, abort attaching.
listener.onStopRequest(aRequest, statusCode);
listener.onStopRequest(aRequest, context, statusCode);
return;
}
var actions;
Expand All @@ -971,7 +971,7 @@ PdfStreamConverter.prototype = {
var findEventManager = new FindEventManager(domWindow);
findEventManager.bind();
}
listener.onStopRequest(aRequest, statusCode);
listener.onStopRequest(aRequest, aContext, statusCode);

if (domWindow.frameElement) {
var isObjectEmbed = domWindow.frameElement.tagName !== "IFRAME" ||
Expand Down Expand Up @@ -999,7 +999,7 @@ PdfStreamConverter.prototype = {
},

// nsIRequestObserver::onStopRequest
onStopRequest(aRequest, aStatusCode) {
onStopRequest(aRequest, aContext, aStatusCode) {
if (!this.dataListener) {
// Do nothing
return;
Expand Down
6 changes: 3 additions & 3 deletions browser/modules/FaviconLoader.jsm
Original file line number Diff line number Diff line change
Expand Up @@ -160,10 +160,10 @@ class FaviconLoad {
this.channel.cancel(Cr.NS_BINDING_ABORTED);
}

onStartRequest(request) {
onStartRequest(request, context) {
}

onDataAvailable(request, inputStream, offset, count) {
onDataAvailable(request, context, inputStream, offset, count) {
this.stream.writeFrom(inputStream, count);
}

Expand All @@ -175,7 +175,7 @@ class FaviconLoad {
callback.onRedirectVerifyCallback(Cr.NS_OK);
}

async onStopRequest(request, statusCode) {
async onStopRequest(request, context, statusCode) {
if (request != this.channel) {
// Indicates that a redirect has occurred. We don't care about the result
// of the original channel.
Expand Down
12 changes: 6 additions & 6 deletions devtools/client/jsonview/converter-child.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,14 +68,14 @@ Converter.prototype = {
this.listener = listener;
},

onDataAvailable: function(request, inputStream, offset, count) {
onDataAvailable: function(request, context, inputStream, offset, count) {
// Decode and insert data.
const buffer = new ArrayBuffer(count);
new BinaryInput(inputStream).readArrayBuffer(count, buffer);
this.decodeAndInsertBuffer(buffer);
},

onStartRequest: function(request) {
onStartRequest: function(request, context) {
// Set the content type to HTML in order to parse the doctype, styles
// and scripts. The JSON will be manually inserted as text.
request.QueryInterface(Ci.nsIChannel);
Expand Down Expand Up @@ -105,7 +105,7 @@ Converter.prototype = {
request.loadInfo.resetPrincipalToInheritToNullPrincipal();

// Start the request.
this.listener.onStartRequest(request);
this.listener.onStartRequest(request, context);

// Initialize stuff.
const win = NetworkHelper.getWindowForRequest(request);
Expand All @@ -117,15 +117,15 @@ 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, stream, 0, stream.available());
this.listener.onDataAvailable(request, context, stream, 0, stream.available());
},

onStopRequest: function(request, statusCode) {
onStopRequest: function(request, context, statusCode) {
// Flush data.
this.decodeAndInsertBuffer(new ArrayBuffer(0), true);

// Stop the request.
this.listener.onStopRequest(request, statusCode);
this.listener.onStopRequest(request, context, statusCode);
this.listener = null;
this.decoder = null;
this.data = null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ function gzipCompressString(string, obs) {
let stringStream = Cc["@mozilla.org/io/string-input-stream;1"]
.createInstance(Ci.nsIStringInputStream);
stringStream.data = string;
converter.onStartRequest(null);
converter.onDataAvailable(null, stringStream, 0, string.length);
converter.onStopRequest(null, null);
converter.onStartRequest(null, null);
converter.onDataAvailable(null, null, stringStream, 0, string.length);
converter.onStopRequest(null, null, null);
}

function doubleGzipCompressString(string, observer) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ NetworkResponseListener.prototype = {
* @param unsigned long offset
* @param unsigned long count
*/
onDataAvailable: function(request, inputStream, offset, count) {
onDataAvailable: function(request, context, inputStream, offset, count) {
this._findOpenResponse();
const data = NetUtil.readInputStreamToString(inputStream, count);

Expand Down Expand Up @@ -490,10 +490,10 @@ NetworkResponseListener.prototype = {
if (available != -1) {
if (available != 0) {
if (this.converter) {
this.converter.onDataAvailable(this.request, stream,
this.converter.onDataAvailable(this.request, null, stream,
this.offset, available);
} else {
this.onDataAvailable(this.request, stream, this.offset,
this.onDataAvailable(this.request, null, stream, this.offset,
available);
}
}
Expand Down
8 changes: 4 additions & 4 deletions devtools/shared/webconsole/test/unit/test_throttle.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ TestStreamListener.prototype = {
this.setState("stop");
},

onDataAvailable: function(request, inputStream, offset, count) {
onDataAvailable: function(request, context, inputStream, offset, count) {
const sin = Cc["@mozilla.org/scriptableinputstream;1"]
.createInstance(nsIScriptableInputStream);
sin.init(inputStream);
Expand Down Expand Up @@ -98,7 +98,7 @@ add_task(async function() {
equal(testListener.state, "initial", "test listener in initial state");

// This method must be passed through immediately.
listener.onStartRequest(null);
listener.onStartRequest(null, null);
equal(testListener.state, "start", "test listener started");

const TEST_INPUT = "hi bob";
Expand All @@ -125,7 +125,7 @@ add_task(async function() {
);

// onDataAvailable is required to immediately read the data.
listener.onDataAvailable(null, testInputStream, 0, 6);
listener.onDataAvailable(null, 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");
Expand All @@ -137,7 +137,7 @@ add_task(async function() {
equal(activitySeen, true, "activity has been distributed");

const onChange = testListener.onStateChanged();
listener.onStopRequest(null, null);
listener.onStopRequest(null, null, null);
newState = await onChange;
equal(newState, "stop", "onStateChanged reported");
});
18 changes: 9 additions & 9 deletions devtools/shared/webconsole/throttle.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,23 +59,23 @@ NetworkThrottleListener.prototype = {
/**
* @see nsIStreamListener.onStartRequest.
*/
onStartRequest: function(request) {
this.originalListener.onStartRequest(request);
onStartRequest: function(request, context) {
this.originalListener.onStartRequest(request, context);
this.queue.start(this);
},

/**
* @see nsIStreamListener.onStopRequest.
*/
onStopRequest: function(request, statusCode) {
this.pendingData.push({request, statusCode});
onStopRequest: function(request, context, statusCode) {
this.pendingData.push({request, context, statusCode});
this.queue.dataAvailable(this);
},

/**
* @see nsIStreamListener.onDataAvailable.
*/
onDataAvailable: function(request, inputStream, offset, count) {
onDataAvailable: function(request, context, inputStream, offset, count) {
if (this.pendingException) {
throw this.pendingException;
}
Expand All @@ -87,7 +87,7 @@ NetworkThrottleListener.prototype = {
const stream = new ArrayBufferInputStream();
stream.setData(bytes, 0, count);

this.pendingData.push({request, stream, count});
this.pendingData.push({request, context, stream, count});
this.queue.dataAvailable(this);
},

Expand All @@ -110,11 +110,11 @@ NetworkThrottleListener.prototype = {
return {length: 0, done: true};
}

const {request, stream, count, statusCode} = this.pendingData[0];
const {request, context, stream, count, statusCode} = this.pendingData[0];

if (statusCode !== undefined) {
this.pendingData.shift();
this.originalListener.onStopRequest(request, statusCode);
this.originalListener.onStopRequest(request, context, statusCode);
return {length: 0, done: true};
}

Expand All @@ -123,7 +123,7 @@ NetworkThrottleListener.prototype = {
}

try {
this.originalListener.onDataAvailable(request, stream,
this.originalListener.onDataAvailable(request, context, stream,
this.offset, bytesPermitted);
} catch (e) {
this.pendingException = e;
Expand Down
6 changes: 3 additions & 3 deletions docshell/base/nsPingListener.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -328,20 +328,20 @@ nsresult nsPingListener::StartTimeout(DocGroup* aDocGroup) {
}

NS_IMETHODIMP
nsPingListener::OnStartRequest(nsIRequest* aRequest) {
nsPingListener::OnStartRequest(nsIRequest* aRequest, nsISupports* aContext) {
return NS_OK;
}

NS_IMETHODIMP
nsPingListener::OnDataAvailable(nsIRequest* aRequest,
nsPingListener::OnDataAvailable(nsIRequest* aRequest, nsISupports* aContext,
nsIInputStream* aStream, uint64_t aOffset,
uint32_t aCount) {
uint32_t result;
return aStream->ReadSegments(NS_DiscardSegment, nullptr, aCount, &result);
}

NS_IMETHODIMP
nsPingListener::OnStopRequest(nsIRequest* aRequest,
nsPingListener::OnStopRequest(nsIRequest* aRequest, nsISupports* aContext,
nsresult aStatus) {
mLoadGroup = nullptr;

Expand Down
6 changes: 3 additions & 3 deletions dom/base/DOMParser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -197,18 +197,18 @@ already_AddRefed<Document> DOMParser::ParseFromStream(nsIInputStream* aStream,
// Now start pumping data to the listener
nsresult status;

rv = listener->OnStartRequest(parserChannel);
rv = listener->OnStartRequest(parserChannel, nullptr);
if (NS_FAILED(rv)) parserChannel->Cancel(rv);
parserChannel->GetStatus(&status);

if (NS_SUCCEEDED(rv) && NS_SUCCEEDED(status)) {
rv = listener->OnDataAvailable(parserChannel, stream, 0,
rv = listener->OnDataAvailable(parserChannel, nullptr, stream, 0,
aContentLength);
if (NS_FAILED(rv)) parserChannel->Cancel(rv);
parserChannel->GetStatus(&status);
}

rv = listener->OnStopRequest(parserChannel, status);
rv = listener->OnStopRequest(parserChannel, nullptr, status);
// Failure returned from OnStopRequest does not affect the final status of
// the channel, so we do not need to call Cancel(rv) as we do above.

Expand Down
Loading

0 comments on commit 4a4dcd5

Please sign in to comment.