Bug 1147562 - Update remaining callsites of newChannel before landing the shim in b2g/ (r=sicking)
authorChristoph Kerschbaumer <mozilla@christophkerschbaumer.com>
Thu, 09 Apr 2015 10:10:51 -0700
changeset 257326 cf9a8e4c49ed7443e723a0351d548ccd9ea6b431
parent 257325 1062c99543efeb581e63340cc96c6ba1a884c122
child 257327 d89476df19319c9bada1cf5d4bca81fd2f079cac
push id8007
push userraliiev@mozilla.com
push dateMon, 11 May 2015 19:23:16 +0000
treeherdermozilla-aurora@e2ce1aac996e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssicking
bugs1147562
milestone40.0a1
Bug 1147562 - Update remaining callsites of newChannel before landing the shim in b2g/ (r=sicking)
b2g/components/MailtoProtocolHandler.js
b2g/components/SmsProtocolHandler.js
b2g/components/TelProtocolHandler.js
--- 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]);