Fixed an 'outstanding callbacks' warning and simplified the code a tiny bit.

This commit is contained in:
Atul Varma 2008-06-13 15:39:06 -07:00
parent b12f3d03db
commit 92583fc5ff

View File

@ -123,12 +123,12 @@ DAVCollection.prototype = {
path = this._defaultPrefix + path;
let request = Cc["@mozilla.org/xmlextras/xmlhttprequest;1"].createInstance();
request = request.QueryInterface(Ci.nsIDOMEventTarget);
let request = Cc["@mozilla.org/xmlextras/xmlhttprequest;1"].createInstance(Ci.nsIXMLHttpRequest);
request.addEventListener("load", new Utils.EventListener(self.cb, "load"), false);
request.addEventListener("error", new Utils.EventListener(self.cb, "error"), false);
request = request.QueryInterface(Ci.nsIXMLHttpRequest);
let xhrCb = self.cb;
request.onload = new Utils.EventListener(xhrCb, "load");
request.onerror = new Utils.EventListener(xhrCb, "error");
request.mozBackgroundRequest = true;
request.open(op, this._baseURL + path, true);