Bug 687332: Fix toolkit/. r=rs

This commit is contained in:
Kyle Huey 2011-09-29 12:06:36 -04:00
Родитель 6ea2ff7966
Коммит 078afbe3a5
6 изменённых файлов: 16 добавлений и 15 удалений

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

@ -103,15 +103,14 @@ PROT_XMLFetcher.prototype = {
// Create a closure
var self = this;
this._request.onreadystatechange = function() {
this._request.addEventListener("readystatechange", function() {
self.readyStateChange(self);
}
}, false);
this._request.send(null);
},
cancel: function() {
this._request.onreadystatechange = null;
this._request.abort();
this._request = null;
},

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

@ -1176,8 +1176,10 @@ var AddonRepository = {
this._request.overrideMimeType("text/xml");
let self = this;
this._request.onerror = function(aEvent) { self._reportFailure(); };
this._request.onload = function(aEvent) {
this._request.addEventListener("error", function(aEvent) {
self._reportFailure();
}, false);
this._request.addEventListener("load", function(aEvent) {
let request = aEvent.target;
let responseXML = request.responseXML;
@ -1196,7 +1198,7 @@ var AddonRepository = {
totalResults = parsedTotalResults;
aHandleResults(elements, totalResults);
};
}, false);
this._request.send(null);
},

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

@ -451,8 +451,8 @@ function UpdateParser(aId, aType, aUpdateKey, aUrl, aObserver) {
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.addEventListener("load", function(event) { self.onLoad() }, false);
this.request.addEventListener("error", function(event) { self.onError() }, false);
this.request.send(null);
}
catch (e) {

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

@ -227,7 +227,7 @@ var LightweightThemeManager = {
req.open("GET", theme.updateURL, true);
var self = this;
req.onload = function () {
req.addEventListener("load", function () {
if (req.status != 200)
return;
@ -240,7 +240,7 @@ var LightweightThemeManager = {
var currentTheme = self.currentTheme;
if (currentTheme && currentTheme.id == theme.id)
self.currentTheme = newData;
};
}, false);
req.send(null);
},

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

@ -546,8 +546,8 @@ Blocklist.prototype = {
request.QueryInterface(Components.interfaces.nsIJSXMLHttpRequest);
var self = this;
request.onerror = function(event) { self.onXMLError(event); };
request.onload = function(event) { self.onXMLLoad(event); };
request.addEventListener("error", function(event) { self.onXMLError(event); }, false);
request.addEventListener("load", function(event) { self.onXMLLoad(event); }, false);
request.send(null);
// When the blocklist loads we need to compare it to the current copy so

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

@ -2155,9 +2155,9 @@ Checker.prototype = {
this._request.setRequestHeader("Cache-Control", "no-cache");
var self = this;
this._request.onerror = function(event) { self.onError(event); };
this._request.onload = function(event) { self.onLoad(event); };
this._request.onprogress = function(event) { self.onProgress(event); };
this._request.addEventListener("error", function(event) { self.onError(event); } ,false);
this._request.addEventListener("load", function(event) { self.onLoad(event); }, false);
this._request.addEventListener("progress", function(event) { self.onProgress(event); }, false);
LOG("Checker:checkForUpdates - sending request to: " + url);
this._request.send(null);