mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 623134: Add HTTP logging to track down the intermittent request timeouts. r=robstrong
This commit is contained in:
parent
d1bac4c182
commit
37399c2be0
@ -440,16 +440,21 @@ function UpdateParser(aId, aType, aUpdateKey, aUrl, aObserver) {
|
||||
}
|
||||
|
||||
LOG("Requesting " + aUrl);
|
||||
this.request = Cc["@mozilla.org/xmlextras/xmlhttprequest;1"].
|
||||
createInstance(Ci.nsIXMLHttpRequest);
|
||||
this.request.open("GET", aUrl, true);
|
||||
this.request.channel.notificationCallbacks = new BadCertHandler(!requireBuiltIn);
|
||||
this.request.channel.loadFlags |= Ci.nsIRequest.LOAD_BYPASS_CACHE;
|
||||
this.request.overrideMimeType("text/xml");
|
||||
var self = this;
|
||||
this.request.onload = function(event) { self.onLoad() };
|
||||
this.request.onerror = function(event) { self.onError() };
|
||||
this.request.send(null);
|
||||
try {
|
||||
this.request = Cc["@mozilla.org/xmlextras/xmlhttprequest;1"].
|
||||
createInstance(Ci.nsIXMLHttpRequest);
|
||||
this.request.open("GET", aUrl, true);
|
||||
this.request.channel.notificationCallbacks = new BadCertHandler(!requireBuiltIn);
|
||||
this.request.channel.loadFlags |= Ci.nsIRequest.LOAD_BYPASS_CACHE;
|
||||
this.request.overrideMimeType("text/xml");
|
||||
var self = this;
|
||||
this.request.onload = function(event) { self.onLoad() };
|
||||
this.request.onerror = function(event) { self.onError() };
|
||||
this.request.send(null);
|
||||
}
|
||||
catch (e) {
|
||||
ERROR("Failed to request update manifest", e);
|
||||
}
|
||||
}
|
||||
|
||||
UpdateParser.prototype = {
|
||||
|
@ -22,11 +22,29 @@ var gTests = [];
|
||||
var gStart = 0;
|
||||
var gLast = 0;
|
||||
|
||||
var HTTPObserver = {
|
||||
observeActivity: function(aChannel, aType, aSubtype, aTimestamp, aSizeData,
|
||||
aStringData) {
|
||||
aChannel.QueryInterface(Ci.nsIChannel);
|
||||
|
||||
dump("*** HTTP Activity 0x" + aType.toString(16) + " 0x" + aSubtype.toString(16) +
|
||||
" " + aChannel.URI.spec + "\n");
|
||||
}
|
||||
};
|
||||
|
||||
function test() {
|
||||
gStart = Date.now();
|
||||
requestLongerTimeout(4);
|
||||
waitForExplicitFinish();
|
||||
|
||||
let observerService = Cc["@mozilla.org/network/http-activity-distributor;1"].
|
||||
getService(Ci.nsIHttpActivityDistributor);
|
||||
observerService.addObserver(HTTPObserver);
|
||||
|
||||
registerCleanupFunction(function() {
|
||||
observerService.removeObserver(HTTPObserver);
|
||||
});
|
||||
|
||||
run_next_test();
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user