Bug 1147562 - Update remaining callsites of newChannel before landing the shim in b2g/ (r=sicking)
--- a/b2g/components/MailtoProtocolHandler.js
+++ b/b2g/components/MailtoProtocolHandler.js
@@ -26,21 +26,25 @@ MailtoProtocolHandler.prototype = {
allowPort: function() false,
newURI: function Proto_newURI(aSpec, aOriginCharset) {
let uri = Cc["@mozilla.org/network/simple-uri;1"].createInstance(Ci.nsIURI);
uri.spec = aSpec;
return uri;
},
- newChannel: function Proto_newChannel(aURI) {
+ newChannel2: function Proto_newChannel2(aURI, aLoadInfo) {
cpmm.sendAsyncMessage("mail-handler", {
URI: aURI.spec,
type: "mail" });
throw Components.results.NS_ERROR_ILLEGAL_VALUE;
},
+ newChannel: function Proto_newChannel(aURI) {
+ return newChannel2(aURI, null);
+ },
+
classID: Components.ID("{50777e53-0331-4366-a191-900999be386c}"),
QueryInterface: XPCOMUtils.generateQI([Ci.nsIProtocolHandler])
};
this.NSGetFactory = XPCOMUtils.generateNSGetFactory([MailtoProtocolHandler]);
--- a/b2g/components/SmsProtocolHandler.js
+++ b/b2g/components/SmsProtocolHandler.js
@@ -35,17 +35,17 @@ SmsProtocolHandler.prototype = {
allowPort: function() false,
newURI: function Proto_newURI(aSpec, aOriginCharset) {
let uri = Cc["@mozilla.org/network/simple-uri;1"].createInstance(Ci.nsIURI);
uri.spec = aSpec;
return uri;
},
- newChannel: function Proto_newChannel(aURI) {
+ newChannel2: function Proto_newChannel2(aURI, aLoadInfo) {
let number = TelURIParser.parseURI('sms', aURI.spec);
let body = "";
let query = aURI.spec.split("?")[1];
if (query) {
let params = query.split("&");
params.forEach(function(aParam) {
let [name, value] = aParam.split("=");
@@ -60,13 +60,17 @@ SmsProtocolHandler.prototype = {
number: number || "",
type: "websms/sms",
body: body });
}
throw Components.results.NS_ERROR_ILLEGAL_VALUE;
},
+ newChannel: function Proto_newChannel(aURI) {
+ return newChannel2(aURI, null);
+ },
+
classID: Components.ID("{81ca20cb-0dad-4e32-8566-979c8998bd73}"),
QueryInterface: XPCOMUtils.generateQI([Ci.nsIProtocolHandler])
};
this.NSGetFactory = XPCOMUtils.generateNSGetFactory([SmsProtocolHandler]);
--- a/b2g/components/TelProtocolHandler.js
+++ b/b2g/components/TelProtocolHandler.js
@@ -34,25 +34,29 @@ TelProtocolHandler.prototype = {
allowPort: function() false,
newURI: function Proto_newURI(aSpec, aOriginCharset) {
let uri = Cc["@mozilla.org/network/simple-uri;1"].createInstance(Ci.nsIURI);
uri.spec = aSpec;
return uri;
},
- newChannel: function Proto_newChannel(aURI) {
+ newChannel2: function Proto_newChannel(aURI, aLoadInfo) {
let number = TelURIParser.parseURI('tel', aURI.spec);
if (number) {
cpmm.sendAsyncMessage("dial-handler", {
number: number,
type: "webtelephony/number" });
}
throw Components.results.NS_ERROR_ILLEGAL_VALUE;
},
+ newChannel: function Proto_newChannel(aURI) {
+ return newChannel2(aURI, null);
+ },
+
classID: Components.ID("{782775dd-7351-45ea-aff1-0ffa872cfdd2}"),
QueryInterface: XPCOMUtils.generateQI([Ci.nsIProtocolHandler])
};
this.NSGetFactory = XPCOMUtils.generateNSGetFactory([TelProtocolHandler]);