diff --git a/BREAKING_CHANGES b/BREAKING_CHANGES index 8b137891..6cd25644 100644 --- a/BREAKING_CHANGES +++ b/BREAKING_CHANGES @@ -1 +1,2 @@ - +1.0b8: + • The chrome-data: protocol has been removed. diff --git a/common/modules/base.jsm b/common/modules/base.jsm index 7c72334a..9c612984 100644 --- a/common/modules/base.jsm +++ b/common/modules/base.jsm @@ -1033,11 +1033,12 @@ function XPCOM(interfaces, superClass) { let shim = interfaces.reduce(function (shim, iface) shim.QueryInterface(iface), XPCOMShim()); - let res = Class("XPCOM(" + interfaces + ")", superClass || Class, update( - iter.toObject([k, v === undefined || callable(v) ? function stub() null : v] - for ([k, v] in Iterator(shim))), - { QueryInterface: XPCOMUtils.generateQI(interfaces) })); - shim = interfaces = null; + let res = Class("XPCOM(" + interfaces + ")", superClass || Class, + update(iter([k, + v === undefined || callable(v) ? stub : v] + for ([k, v] in Iterator(shim))).toObject(), + { QueryInterface: XPCOMUtils.generateQI(interfaces) })); + return res; } function XPCOMShim() { @@ -1052,6 +1053,7 @@ function XPCOMShim() { }); return ip.data; }; +function stub() null; /** * An abstract base class for classes that wish to inherit from Error. diff --git a/common/modules/protocol.jsm b/common/modules/protocol.jsm index 23b6801c..de4dbc1e 100644 --- a/common/modules/protocol.jsm +++ b/common/modules/protocol.jsm @@ -13,7 +13,6 @@ defineModule("protocol", { var systemPrincipal = Cc["@mozilla.org/systemprincipal;1"].getService(Ci.nsIPrincipal); var DNE = "resource://gre/does/not/exist"; -var _DNE; function Channel(url, orig, noFake) { try { @@ -60,7 +59,7 @@ function Protocol(scheme, classID, contentBase) { contentBase: contentBase, - _xpcom_factory: JSMLoader.Factory(Protocol), + _xpcom_factory: JSMLoader.Factory(Protocol), }; return Protocol; } @@ -83,13 +82,10 @@ ProtocolBase.prototype = { | Ci.nsIProtocolHandler.URI_IS_LOCAL_RESOURCE, newURI: function newURI(spec, charset, baseURI) { - var uri = Cc["@mozilla.org/network/standard-url;1"] - .createInstance(Ci.nsIStandardURL) - .QueryInterface(Ci.nsIURI); if (baseURI && baseURI.host === "data") baseURI = null; - uri.init(uri.URLTYPE_STANDARD, this.defaultPort, spec, charset, baseURI); - return uri; + return services.URL(services.URL.URLTYPE_STANDARD, + this.defaultPort, spec, charset, baseURI); }, newChannel: function newChannel(uri) { diff --git a/common/modules/services.jsm b/common/modules/services.jsm index d699d699..53581741 100644 --- a/common/modules/services.jsm +++ b/common/modules/services.jsm @@ -87,6 +87,7 @@ var Services = Module("Services", { this.addClass("StringStream", "@mozilla.org/io/string-input-stream;1", "nsIStringInputStream", "data"); this.addClass("Transfer", "@mozilla.org/transfer;1", "nsITransfer", "init"); this.addClass("Timer", "@mozilla.org/timer;1", "nsITimer", "initWithCallback"); + this.addClass("URL", "@mozilla.org/network/standard-url;1", ["nsIStandardURL", "nsIURL"], "init"); this.addClass("Xmlhttp", "@mozilla.org/xmlextras/xmlhttprequest;1", "nsIXMLHttpRequest"); this.addClass("XPathEvaluator", "@mozilla.org/dom/xpath-evaluator;1", "nsIDOMXPathEvaluator"); this.addClass("XMLDocument", "@mozilla.org/xml/xml-document;1", ["nsIDOMXMLDocument", "nsIDOMNodeSelector"]);