Bug 1329182 - remove trailing newURI null parameters in toolkit/, r=jaws.
authorFlorian Quèze <florian@queze.net>
Mon, 09 Jan 2017 20:27:25 +0100
changeset 328663 ae4a26954062
parent 328662 3e0d77afb2e0
child 328664 fca014f3f8aa
push id31182
push usercbook@mozilla.com
push dateTue, 10 Jan 2017 11:14:56 +0000
treeherdermozilla-central@7011ed1427de [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjaws
bugs1329182
milestone53.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1329182 - remove trailing newURI null parameters in toolkit/, r=jaws.
toolkit/components/contentprefs/ContentPrefService2.jsm
toolkit/components/contentprefs/tests/unit/head_contentPrefs.js
toolkit/components/downloads/test/unit/head_download_manager.js
toolkit/components/extensions/Extension.jsm
toolkit/components/extensions/ExtensionContent.jsm
toolkit/components/extensions/ExtensionTestCommon.jsm
toolkit/components/extensions/test/xpcshell/test_ext_apimanager.js
toolkit/components/extensions/test/xpcshell/test_ext_legacy_extension_embedding.js
toolkit/components/extensions/test/xpcshell/test_getAPILevelForWindow.js
toolkit/components/filepicker/content/filepicker.js
toolkit/components/osfile/tests/xpcshell/test_file_URL_conversion.js
toolkit/components/passwordmgr/InsecurePasswordUtils.jsm
toolkit/components/passwordmgr/LoginHelper.jsm
toolkit/components/passwordmgr/LoginManagerContent.jsm
toolkit/components/passwordmgr/LoginStore.jsm
toolkit/components/passwordmgr/nsLoginManager.js
toolkit/components/passwordmgr/nsLoginManagerPrompter.js
toolkit/components/passwordmgr/storage-mozStorage.js
toolkit/components/passwordmgr/test/unit/test_context_menu.js
toolkit/components/passwordmgr/test/unit/test_storage_mozStorage.js
toolkit/components/places/nsPlacesExpiration.js
toolkit/components/places/nsTaggingService.js
toolkit/components/places/tests/browser/browser_bug680727.js
toolkit/components/places/tests/browser/browser_colorAnalyzer.js
toolkit/components/reader/AboutReader.jsm
toolkit/components/reader/ReaderMode.jsm
toolkit/components/remotebrowserutils/RemoteWebNavigation.js
toolkit/components/search/tests/xpcshell/head_search.js
toolkit/components/search/tests/xpcshell/test_chromeresource_icon1.js
toolkit/components/search/tests/xpcshell/test_json_cache.js
toolkit/components/search/tests/xpcshell/test_pref.js
toolkit/components/search/tests/xpcshell/test_purpose.js
toolkit/components/search/tests/xpcshell/test_require_engines_in_cache.js
toolkit/components/securityreporter/SecurityReporter.js
toolkit/components/telemetry/tests/unit/test_TelemetryEnvironment.js
toolkit/components/thumbnails/test/test_thumbnails_interfaces.js
toolkit/components/url-classifier/content/trtable.js
toolkit/components/url-classifier/tests/mochitest/classifierCommon.js
toolkit/components/url-classifier/tests/unit/head_urlclassifier.js
toolkit/components/url-classifier/tests/unit/test_dbservice.js
toolkit/components/url-classifier/tests/unit/test_digest256.js
toolkit/components/viewsource/content/viewSource-content.js
toolkit/components/viewsource/content/viewSourceUtils.js
toolkit/content/aboutAbout.js
toolkit/content/browser-child.js
toolkit/content/browser-content.js
toolkit/content/tests/chrome/RegisterUnregisterChrome.js
toolkit/crashreporter/content/crashes.js
toolkit/crashreporter/test/unit/test_crashreporter.js
toolkit/identity/IdentityProvider.jsm
toolkit/identity/RelyingParty.jsm
toolkit/identity/Sandbox.jsm
toolkit/modules/BrowserUtils.jsm
toolkit/modules/NewTabUtils.jsm
toolkit/modules/PageMetadata.jsm
toolkit/modules/PermissionsUtils.jsm
toolkit/modules/RemoteWebProgress.jsm
toolkit/modules/WebChannel.jsm
toolkit/modules/secondscreen/RokuApp.jsm
toolkit/modules/secondscreen/SimpleServiceDiscovery.jsm
toolkit/modules/sessionstore/Utils.jsm
toolkit/modules/tests/xpcshell/test_GMPInstallManager.js
toolkit/modules/tests/xpcshell/test_MatchGlobs.js
toolkit/modules/tests/xpcshell/test_MatchPattern.js
toolkit/modules/tests/xpcshell/test_PermissionsUtils.js
toolkit/modules/tests/xpcshell/test_web_channel.js
toolkit/modules/tests/xpcshell/test_web_channel_broker.js
toolkit/mozapps/downloads/DownloadUtils.jsm
toolkit/mozapps/extensions/AddonManager.jsm
toolkit/mozapps/extensions/amInstallTrigger.js
toolkit/mozapps/extensions/content/extensions.js
toolkit/mozapps/extensions/internal/LightweightThemeImageOptimizer.jsm
toolkit/mozapps/extensions/internal/XPIProvider.jsm
toolkit/mozapps/extensions/nsBlocklistService.js
toolkit/mozapps/extensions/test/browser/browser_details.js
toolkit/mozapps/extensions/test/browser/browser_manualupdates.js
toolkit/mozapps/extensions/test/browser/browser_openDialog.js
toolkit/mozapps/extensions/test/browser/browser_recentupdates.js
toolkit/mozapps/extensions/test/xpcshell/test_mapURIToAddonID.js
toolkit/mozapps/handling/content/dialog.js
toolkit/mozapps/installer/precompile_cache.js
toolkit/mozapps/update/nsUpdateService.js
--- a/toolkit/components/contentprefs/ContentPrefService2.jsm
+++ b/toolkit/components/contentprefs/ContentPrefService2.jsm
@@ -771,17 +771,17 @@ ContentPrefService2.prototype = {
    * @return          If groupStr is a valid URL string, returns the domain of
    *                  that URL.  If groupStr is some other nonempty string,
    *                  returns groupStr itself.  Otherwise returns null.
    */
   _parseGroup: function CPS2__parseGroup(groupStr) {
     if (!groupStr)
       return null;
     try {
-      var groupURI = Services.io.newURI(groupStr, null, null);
+      var groupURI = Services.io.newURI(groupStr);
     } catch (err) {
       return groupStr;
     }
     return this._cps._grouper.group(groupURI);
   },
 
   _schedule: function CPS2__schedule(fn) {
     Services.tm.mainThread.dispatch(fn.bind(this),
--- a/toolkit/components/contentprefs/tests/unit/head_contentPrefs.js
+++ b/toolkit/components/contentprefs/tests/unit/head_contentPrefs.js
@@ -67,17 +67,17 @@ var ContentPrefTest = {
     // to suppress those errors.
     throw Cr.NS_ERROR_FAILURE;
   },
 
 
   // Utilities
 
   getURI: function ContentPrefTest_getURI(spec) {
-    return this._ioSvc.newURI(spec, null, null);
+    return this._ioSvc.newURI(spec);
   },
 
   /**
    * Get the profile directory.
    */
   getProfileDir: function ContentPrefTest_getProfileDir() {
     // do_get_profile can be only called from a parent process
     if (runningInParent) {
--- a/toolkit/components/downloads/test/unit/head_download_manager.js
+++ b/toolkit/components/downloads/test/unit/head_download_manager.js
@@ -18,10 +18,10 @@ XPCOMUtils.defineLazyModuleGetter(this, 
                                   "resource://gre/modules/Promise.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "Task",
                                   "resource://gre/modules/Task.jsm");
 
 function createURI(aObj) {
   var ios = Cc["@mozilla.org/network/io-service;1"].
             getService(Ci.nsIIOService);
   return (aObj instanceof Ci.nsIFile) ? ios.newFileURI(aObj) :
-                                        ios.newURI(aObj, null, null);
+                                        ios.newURI(aObj);
 }
--- a/toolkit/components/extensions/Extension.jsm
+++ b/toolkit/components/extensions/Extension.jsm
@@ -708,17 +708,17 @@ this.Extension = class extends Extension
 
   createPrincipal(uri = this.baseURI) {
     return Services.scriptSecurityManager.createCodebasePrincipal(
       uri, {addonId: this.id});
   }
 
   // Checks that the given URL is a child of our baseURI.
   isExtensionURL(url) {
-    let uri = Services.io.newURI(url, null, null);
+    let uri = Services.io.newURI(url);
 
     let common = this.baseURI.getCommonBaseSpec(uri);
     return common == this.baseURI.spec;
   }
 
   readManifest() {
     return super.readManifest().then(manifest => {
       if (AppConstants.RELEASE_OR_BETA) {
--- a/toolkit/components/extensions/ExtensionContent.jsm
+++ b/toolkit/components/extensions/ExtensionContent.jsm
@@ -800,25 +800,25 @@ class BrowserExtensionContent extends Ev
     this.webAccessibleResources = new MatchGlobs(data.webAccessibleResources);
     this.whiteListedHosts = new MatchPattern(data.whiteListedHosts);
     this.permissions = data.permissions;
     this.principal = data.principal;
 
     this.localeData = new LocaleData(data.localeData);
 
     this.manifest = data.manifest;
-    this.baseURI = Services.io.newURI(data.baseURL, null, null);
+    this.baseURI = Services.io.newURI(data.baseURL);
 
     // Only used in addon processes.
     this.views = new Set();
 
     // Only used for devtools views.
     this.devtoolsViews = new Set();
 
-    let uri = Services.io.newURI(data.resourceURL, null, null);
+    let uri = Services.io.newURI(data.resourceURL);
 
     if (Services.appinfo.processType == Services.appinfo.PROCESS_TYPE_CONTENT) {
       // Extension.jsm takes care of this in the parent.
       ExtensionManagement.startupExtension(this.uuid, uri, this);
     }
   }
 
   shutdown() {
--- a/toolkit/components/extensions/ExtensionTestCommon.jsm
+++ b/toolkit/components/extensions/ExtensionTestCommon.jsm
@@ -313,17 +313,17 @@ class ExtensionTestCommon {
    */
   static generate(data) {
     let file = this.generateXPI(data);
 
     flushJarCache(file.path);
     Services.ppmm.broadcastAsyncMessage("Extension:FlushJarCache", {path: file.path});
 
     let fileURI = Services.io.newFileURI(file);
-    let jarURI = Services.io.newURI("jar:" + fileURI.spec + "!/", null, null);
+    let jarURI = Services.io.newURI("jar:" + fileURI.spec + "!/");
 
     // This may be "temporary" or "permanent".
     if (data.useAddonManager) {
       return new MockExtension(file, jarURI, data.useAddonManager);
     }
 
     let id;
     if (data.manifest) {
--- a/toolkit/components/extensions/test/xpcshell/test_ext_apimanager.js
+++ b/toolkit/components/extensions/test/xpcshell/test_ext_apimanager.js
@@ -17,17 +17,17 @@ var gUniqueId = 0;
 // SchemaAPIManager's loadScript uses loadSubScript to load a script. This
 // requires a local (resource://) URL. So create such a temporary URL for
 // testing.
 function toLocalURI(code) {
   let dataUrl = `data:charset=utf-8,${encodeURIComponent(code)}`;
   let uniqueResPart = `need-a-local-uri-for-subscript-loading-${++gUniqueId}`;
   Services.io.getProtocolHandler("resource")
     .QueryInterface(Ci.nsIResProtocolHandler)
-    .setSubstitution(uniqueResPart, Services.io.newURI(dataUrl, null, null));
+    .setSubstitution(uniqueResPart, Services.io.newURI(dataUrl));
   return `resource://${uniqueResPart}`;
 }
 
 add_task(function* test_global_isolation() {
   let manA = new SchemaAPIManager("procA");
   let manB = new SchemaAPIManager("procB");
 
   // The "global" variable should be persistent and shared.
--- a/toolkit/components/extensions/test/xpcshell/test_ext_legacy_extension_embedding.js
+++ b/toolkit/components/extensions/test/xpcshell/test_ext_legacy_extension_embedding.js
@@ -55,17 +55,17 @@ add_task(function* test_embedded_webexte
   // Remove the generated xpi file and flush the its jar cache
   // on cleanup.
   do_register_cleanup(() => {
     Services.obs.notifyObservers(fakeHybridAddonFile, "flush-cache-entry", null);
     fakeHybridAddonFile.remove(false);
   });
 
   let fileURI = Services.io.newFileURI(fakeHybridAddonFile);
-  let resourceURI = Services.io.newURI(`jar:${fileURI.spec}!/`, null, null);
+  let resourceURI = Services.io.newURI(`jar:${fileURI.spec}!/`);
 
   let embeddedExtension = LegacyExtensionsUtils.getEmbeddedExtensionFor({
     id, resourceURI,
   });
 
   ok(embeddedExtension, "Got the embeddedExtension object");
 
   equal(EmbeddedExtensionManager.embeddedExtensionsByAddonId.size, 1,
@@ -117,17 +117,17 @@ function* createManifestErrorTestCase(id
   // Remove the generated xpi file and flush the its jar cache
   // on cleanup.
   do_register_cleanup(() => {
     Services.obs.notifyObservers(xpi, "flush-cache-entry", null);
     xpi.remove(false);
   });
 
   let fileURI = Services.io.newFileURI(xpi);
-  let resourceURI = Services.io.newURI(`jar:${fileURI.spec}!/`, null, null);
+  let resourceURI = Services.io.newURI(`jar:${fileURI.spec}!/`);
 
   let embeddedExtension = LegacyExtensionsUtils.getEmbeddedExtensionFor({
     id, resourceURI,
   });
 
   yield Assert.rejects(embeddedExtension.startup(), expectedError,
                        "embedded extension startup rejected");
 
--- a/toolkit/components/extensions/test/xpcshell/test_getAPILevelForWindow.js
+++ b/toolkit/components/extensions/test/xpcshell/test_getAPILevelForWindow.js
@@ -1,15 +1,15 @@
 "use strict";
 
 Cu.import("resource://gre/modules/ExtensionManagement.jsm");
 Cu.import("resource://gre/modules/Services.jsm");
 
 function createWindowWithAddonId(addonId) {
-  let baseURI = Services.io.newURI("about:blank", null, null);
+  let baseURI = Services.io.newURI("about:blank");
   let originAttributes = {addonId};
   let principal = Services.scriptSecurityManager
                           .createCodebasePrincipal(baseURI, originAttributes);
   let chromeNav = Services.appShell.createWindowlessBrowser(true);
   let interfaceRequestor = chromeNav.QueryInterface(Ci.nsIInterfaceRequestor);
   let docShell = interfaceRequestor.getInterface(Ci.nsIDocShell);
   docShell.createAboutBlankContentViewer(principal);
 
--- a/toolkit/components/filepicker/content/filepicker.js
+++ b/toolkit/components/filepicker/content/filepicker.js
@@ -194,17 +194,17 @@ function selectOnOK() {
   var isFile = false;
 
   retvals.filterIndex = document.getElementById("filterMenuList").selectedIndex;
   retvals.fileURL = null;
 
   if (allowURLs) {
     try {
       var ios = Components.classes[NS_IOSERVICE_CONTRACTID].getService(Components.interfaces.nsIIOService);
-      retvals.fileURL = ios.newURI(textInput.value, null, null);
+      retvals.fileURL = ios.newURI(textInput.value);
       let fileList = [];
       if (retvals.fileURL instanceof Components.interfaces.nsIFileURL)
         fileList.push(retvals.fileURL.file);
       gFilesEnumerator.mFiles = fileList;
       retvals.files = gFilesEnumerator;
       retvals.buttonStatus = ret;
 
       return true;
--- a/toolkit/components/osfile/tests/xpcshell/test_file_URL_conversion.js
+++ b/toolkit/components/osfile/tests/xpcshell/test_file_URL_conversion.js
@@ -93,17 +93,17 @@ function run_test() {
     // behavior of nsIFileURL and OS.File is inconsistent
     if (path != "C:\\") {
       uris.push(uri);
     }
   }
 
   for (let uri of uris) {
     // convert URIs to paths with nsIFileURI, which fromFileURI is trying to model
-    let path = Services.io.newURI(uri, null, null).QueryInterface(Components.interfaces.nsIFileURL).file.path;
+    let path = Services.io.newURI(uri).QueryInterface(Components.interfaces.nsIFileURL).file.path;
     do_check_eq(path, OS.Path.fromFileURI(uri));
   }
 
   // check that non-file URLs aren't allowed
   let thrown = false;
   try {
     OS.Path.fromFileURI('http://test.com')
   } catch (e) {
--- a/toolkit/components/passwordmgr/InsecurePasswordUtils.jsm
+++ b/toolkit/components/passwordmgr/InsecurePasswordUtils.jsm
@@ -45,18 +45,17 @@ this.InsecurePasswordUtils = {
    * @returns {Object} An object with the following boolean values:
    *  isFormSubmitHTTP: if the submit action is an http:// URL
    *  isFormSubmitSecure: if the submit action URL is secure,
    *    either because it is HTTPS or because its origin is considered trustworthy
    */
   _checkFormSecurity(aForm) {
     let isFormSubmitHTTP = false, isFormSubmitSecure = false;
     if (aForm.rootElement instanceof Ci.nsIDOMHTMLFormElement) {
-      let uri = Services.io.newURI(aForm.rootElement.action || aForm.rootElement.baseURI,
-                                   null, null);
+      let uri = Services.io.newURI(aForm.rootElement.action || aForm.rootElement.baseURI);
       let principal = gScriptSecurityManager.getCodebasePrincipal(uri);
 
       if (uri.schemeIs("http")) {
         isFormSubmitHTTP = true;
         if (gContentSecurityManager.isOriginPotentiallyTrustworthy(principal)) {
           isFormSubmitSecure = true;
         }
       } else {
--- a/toolkit/components/passwordmgr/LoginHelper.jsm
+++ b/toolkit/components/passwordmgr/LoginHelper.jsm
@@ -190,18 +190,18 @@ this.LoginHelper = {
     }
 
     if (!aOptions) {
       return false;
     }
 
     if (aOptions.schemeUpgrades) {
       try {
-        let loginURI = Services.io.newURI(aLoginOrigin, null, null);
-        let searchURI = Services.io.newURI(aSearchOrigin, null, null);
+        let loginURI = Services.io.newURI(aLoginOrigin);
+        let searchURI = Services.io.newURI(aSearchOrigin);
         if (loginURI.scheme == "http" && searchURI.scheme == "https" &&
             loginURI.hostPort == searchURI.hostPort) {
           return true;
         }
       } catch (ex) {
         // newURI will throw for some values e.g. chrome://FirefoxAccounts
         return false;
       }
@@ -217,24 +217,24 @@ this.LoginHelper = {
     if (aLogin1.httpRealm != aLogin2.httpRealm ||
         aLogin1.username != aLogin2.username)
       return false;
 
     if (!ignorePassword && aLogin1.password != aLogin2.password)
       return false;
 
     if (ignoreSchemes) {
-      let hostname1URI = Services.io.newURI(aLogin1.hostname, null, null);
-      let hostname2URI = Services.io.newURI(aLogin2.hostname, null, null);
+      let hostname1URI = Services.io.newURI(aLogin1.hostname);
+      let hostname2URI = Services.io.newURI(aLogin2.hostname);
       if (hostname1URI.hostPort != hostname2URI.hostPort)
         return false;
 
       if (aLogin1.formSubmitURL != "" && aLogin2.formSubmitURL != "" &&
-          Services.io.newURI(aLogin1.formSubmitURL, null, null).hostPort !=
-          Services.io.newURI(aLogin2.formSubmitURL, null, null).hostPort)
+          Services.io.newURI(aLogin1.formSubmitURL).hostPort !=
+          Services.io.newURI(aLogin2.formSubmitURL).hostPort)
         return false;
     } else {
       if (aLogin1.hostname != aLogin2.hostname)
         return false;
 
       // If either formSubmitURL is blank (but not null), then match.
       if (aLogin1.formSubmitURL != "" && aLogin2.formSubmitURL != "" &&
           aLogin1.formSubmitURL != aLogin2.formSubmitURL)
@@ -399,17 +399,17 @@ this.LoginHelper = {
     if (!preferredOrigin && resolveBy.includes("scheme")) {
       throw new Error("dedupeLogins: `preferredOrigin` is required in order to " +
                       "prefer schemes which match it.");
     }
 
     let preferredOriginScheme;
     if (preferredOrigin) {
       try {
-        preferredOriginScheme = Services.io.newURI(preferredOrigin, null, null).scheme;
+        preferredOriginScheme = Services.io.newURI(preferredOrigin).scheme;
       } catch (ex) {
         // Handle strings that aren't valid URIs e.g. chrome://FirefoxAccounts
       }
     }
 
     if (!preferredOriginScheme && resolveBy.includes("scheme")) {
       log.warn("dedupeLogins: Deduping with a scheme preference but couldn't " +
                "get the preferred origin scheme.");
@@ -440,18 +440,18 @@ this.LoginHelper = {
         switch (preference) {
           case "scheme": {
             if (!preferredOriginScheme) {
               break;
             }
 
             try {
               // Only `hostname` is currently considered
-              let existingLoginURI = Services.io.newURI(existingLogin.hostname, null, null);
-              let loginURI = Services.io.newURI(login.hostname, null, null);
+              let existingLoginURI = Services.io.newURI(existingLogin.hostname);
+              let loginURI = Services.io.newURI(login.hostname);
               // If the schemes of the two logins are the same or neither match the
               // preferredOriginScheme then we have no preference and look at the next resolveBy.
               if (loginURI.scheme == existingLoginURI.scheme ||
                   (loginURI.scheme != preferredOriginScheme &&
                    existingLoginURI.scheme != preferredOriginScheme)) {
                 break;
               }
 
--- a/toolkit/components/passwordmgr/LoginManagerContent.jsm
+++ b/toolkit/components/passwordmgr/LoginManagerContent.jsm
@@ -1200,17 +1200,17 @@ var LoginManagerContent = {
 var LoginUtils = {
   /**
    * Get the parts of the URL we want for identification.
    * Strip out things like the userPass portion
    */
   _getPasswordOrigin(uriString, allowJS) {
     var realm = "";
     try {
-      var uri = Services.io.newURI(uriString, null, null);
+      var uri = Services.io.newURI(uriString);
 
       if (allowJS && uri.scheme == "javascript")
         return "javascript:";
 
       // Build this manually instead of using prePath to avoid including the userPass portion.
       realm = uri.scheme + "://" + uri.hostPort;
     } catch (e) {
       // bug 159484 - disallow url types that don't support a hostPort.
--- a/toolkit/components/passwordmgr/LoginStore.jsm
+++ b/toolkit/components/passwordmgr/LoginStore.jsm
@@ -120,17 +120,17 @@ LoginStore.prototype._dataPostProcessor 
 };
 
 /**
  * Migrates disabled hosts to the permission manager.
  */
 LoginStore.prototype._migrateDisabledHosts = function(data) {
   for (let host of data.disabledHosts) {
     try {
-      let uri = Services.io.newURI(host, null, null);
+      let uri = Services.io.newURI(host);
       Services.perms.add(uri, PERMISSION_SAVE_LOGINS, Services.perms.DENY_ACTION);
     } catch (e) {
       Cu.reportError(e);
     }
   }
 
   delete data.disabledHosts;
 };
--- a/toolkit/components/passwordmgr/nsLoginManager.js
+++ b/toolkit/components/passwordmgr/nsLoginManager.js
@@ -441,29 +441,29 @@ LoginManager.prototype = {
    * Check to see if user has disabled saving logins for the origin.
    */
   getLoginSavingEnabled(origin) {
     log.debug("Checking if logins to", origin, "can be saved.");
     if (!this._remember) {
       return false;
     }
 
-    let uri = Services.io.newURI(origin, null, null);
+    let uri = Services.io.newURI(origin);
     return Services.perms.testPermission(uri, PERMISSION_SAVE_LOGINS) != Services.perms.DENY_ACTION;
   },
 
 
   /**
    * Enable or disable storing logins for the specified origin.
    */
   setLoginSavingEnabled(origin, enabled) {
     // Throws if there are bogus values.
     LoginHelper.checkHostnameValue(origin);
 
-    let uri = Services.io.newURI(origin, null, null);
+    let uri = Services.io.newURI(origin);
     if (enabled) {
       Services.perms.remove(uri, PERMISSION_SAVE_LOGINS);
     } else {
       Services.perms.add(uri, PERMISSION_SAVE_LOGINS, Services.perms.DENY_ACTION);
     }
 
     log.debug("Login saving for", origin, "now enabled?", enabled);
     LoginHelper.notifyStorageChanged(enabled ? "hostSavingEnabled" : "hostSavingDisabled", origin);
--- a/toolkit/components/passwordmgr/nsLoginManagerPrompter.js
+++ b/toolkit/components/passwordmgr/nsLoginManagerPrompter.js
@@ -519,17 +519,17 @@ LoginManagerPrompter.prototype = {
    * arguments to let callers know the login can't be saved because we don't
    * know whether it's http or https.
    */
   _getRealmInfo(aRealmString) {
     var httpRealm = /^.+ \(.+\)$/;
     if (httpRealm.test(aRealmString))
       return [null, null, null];
 
-    var uri = Services.io.newURI(aRealmString, null, null);
+    var uri = Services.io.newURI(aRealmString);
     var pathname = "";
 
     if (uri.path != "/")
       pathname = uri.path;
 
     var formattedHostname = this._getFormattedHostname(uri);
 
     return [formattedHostname, formattedHostname + pathname, uri.username];
@@ -1543,17 +1543,17 @@ LoginManagerPrompter.prototype = {
    * Returns the hostname to use in a nsILoginInfo object (for example,
    * "http://example.com").
    */
   _getFormattedHostname(aURI) {
     let uri;
     if (aURI instanceof Ci.nsIURI) {
       uri = aURI;
     } else {
-      uri = Services.io.newURI(aURI, null, null);
+      uri = Services.io.newURI(aURI);
     }
 
     return uri.scheme + "://" + uri.hostPort;
   },
 
 
   /**
    * Converts a login's hostname field (a URL) to a short string for
@@ -1563,17 +1563,17 @@ LoginManagerPrompter.prototype = {
   _getShortDisplayHost(aURIString) {
     var displayHost;
 
     var eTLDService = Cc["@mozilla.org/network/effective-tld-service;1"].
                       getService(Ci.nsIEffectiveTLDService);
     var idnService = Cc["@mozilla.org/network/idn-service;1"].
                      getService(Ci.nsIIDNService);
     try {
-      var uri = Services.io.newURI(aURIString, null, null);
+      var uri = Services.io.newURI(aURIString);
       var baseDomain = eTLDService.getBaseDomain(uri);
       displayHost = idnService.convertToDisplayIDN(baseDomain, {});
     } catch (e) {
       this.log("_getShortDisplayHost couldn't process " + aURIString);
     }
 
     if (!displayHost)
       displayHost = aURIString;
--- a/toolkit/components/passwordmgr/storage-mozStorage.js
+++ b/toolkit/components/passwordmgr/storage-mozStorage.js
@@ -460,17 +460,17 @@ LoginManagerStorage_mozStorage.prototype
           }
           // Fall through
         case "hostname":
           if (value != null) {
             condition += `${field} = :${field}`;
             params[field] = value;
             let valueURI;
             try {
-              if (aOptions.schemeUpgrades && (valueURI = Services.io.newURI(value, null, null)) &&
+              if (aOptions.schemeUpgrades && (valueURI = Services.io.newURI(value)) &&
                   valueURI.scheme == "https") {
                 condition += ` OR ${field} = :http${field}`;
                 params["http" + field] = "http://" + valueURI.hostPort;
               }
             } catch (ex) {
               // newURI will throw for some values (e.g. chrome://FirefoxAccounts)
               // but those URLs wouldn't support upgrades anyways.
             }
@@ -1131,17 +1131,17 @@ LoginManagerStorage_mozStorage.prototype
       stmt = this._dbCreateStatement(query);
 
       while (stmt.executeStep()) {
         disabledHosts.push(stmt.row.hostname);
       }
 
       for (let host of disabledHosts) {
         try {
-          let uri = Services.io.newURI(host, null, null);
+          let uri = Services.io.newURI(host);
           Services.perms.add(uri, PERMISSION_SAVE_LOGINS, Services.perms.DENY_ACTION);
         } catch (e) {
           Cu.reportError(e);
         }
       }
     } catch (e) {
       this.log(`_dbMigrateToVersion6 failed: ${e.name} : ${e.message}`);
     } finally {
--- a/toolkit/components/passwordmgr/test/unit/test_context_menu.js
+++ b/toolkit/components/passwordmgr/test/unit/test_context_menu.js
@@ -72,17 +72,17 @@ function createLoginsFragment(url, conte
   let inputElement = document.querySelector(elementQuery);
   MockDocument.mockOwnerDocumentProperty(inputElement, document, url);
 
   // We also need a simple mock Browser object for this test.
   let browser = {
     ownerDocument: document
   };
 
-  let URI = Services.io.newURI(url, null, null);
+  let URI = Services.io.newURI(url);
   return {
     document,
     fragment: LoginManagerContextMenu.addLoginsToMenu(inputElement, browser, URI),
   };
 }
 
 /**
  * Check if every login have it's corresponding menuitem.
--- a/toolkit/components/passwordmgr/test/unit/test_storage_mozStorage.js
+++ b/toolkit/components/passwordmgr/test/unit/test_storage_mozStorage.js
@@ -76,17 +76,17 @@ function getAllDisabledHostsFromPermissi
       disabledHosts.push(perm.principal.URI.prePath);
     }
   }
 
   return disabledHosts;
 }
 
 function setLoginSavingEnabled(origin, enabled) {
-  let uri = Services.io.newURI(origin, null, null);
+  let uri = Services.io.newURI(origin);
 
   if (enabled) {
     Services.perms.remove(uri, PERMISSION_SAVE_LOGINS);
   } else {
     Services.perms.add(uri, PERMISSION_SAVE_LOGINS, Services.perms.DENY_ACTION);
   }
 }
 
--- a/toolkit/components/places/nsPlacesExpiration.js
+++ b/toolkit/components/places/nsPlacesExpiration.js
@@ -656,17 +656,17 @@ nsPlacesExpiration.prototype = {
         if (!("_expectedResultsCount" in this)) {
           this._expectedResultsCount = expectedResults;
         }
         if (this._expectedResultsCount > 0) {
           this._expectedResultsCount--;
         }
       }
 
-      let uri = Services.io.newURI(row.getResultByName("url"), null, null);
+      let uri = Services.io.newURI(row.getResultByName("url"));
       let guid = row.getResultByName("guid");
       let visitDate = row.getResultByName("visit_date");
       let wholeEntry = row.getResultByName("whole_entry");
       let mostRecentExpiredVisit = row.getResultByName("most_recent_expired_visit");
       let reason = Ci.nsINavHistoryObserver.REASON_EXPIRED;
       let observers = PlacesUtils.history.getObservers();
 
       if (mostRecentExpiredVisit) {
--- a/toolkit/components/places/nsTaggingService.js
+++ b/toolkit/components/places/nsTaggingService.js
@@ -276,17 +276,17 @@ TaggingService.prototype = {
       `SELECT h.url FROM moz_places h
        JOIN moz_bookmarks b ON b.fk = h.id
        WHERE b.parent = :tag_id`
     );
     stmt.params.tag_id = tagId;
     try {
       while (stmt.executeStep()) {
         try {
-          uris.push(Services.io.newURI(stmt.row.url, null, null));
+          uris.push(Services.io.newURI(stmt.row.url));
         } catch (ex) {}
       }
     } finally {
       stmt.finalize();
     }
 
     return uris;
   },
--- a/toolkit/components/places/tests/browser/browser_bug680727.js
+++ b/toolkit/components/places/tests/browser/browser_bug680727.js
@@ -1,18 +1,17 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
 /* Ensure that clicking the button in the Offline mode neterror page updates
    global history. See bug 680727. */
 /* TEST_PATH=toolkit/components/places/tests/browser/browser_bug680727.js make -C $(OBJDIR) mochitest-browser-chrome */
 
 
-const kUniqueURI = Services.io.newURI("http://mochi.test:8888/#bug_680727",
-                                      null, null);
+const kUniqueURI = Services.io.newURI("http://mochi.test:8888/#bug_680727");
 var gAsyncHistory =
   Cc["@mozilla.org/browser/history;1"].getService(Ci.mozIAsyncHistory);
 
 var proxyPrefValue;
 var ourTab;
 
 function test() {
   waitForExplicitFinish();
--- a/toolkit/components/places/tests/browser/browser_colorAnalyzer.js
+++ b/toolkit/components/places/tests/browser/browser_colorAnalyzer.js
@@ -19,17 +19,17 @@ const XHTML_NS = "http://www.w3.org/1999
  * Passes the given uri to findRepresentativeColor.
  * If expected is null, you expect it to fail.
  * If expected is a function, it will call that function.
  * If expected is a color, you expect that color to be returned.
  * Message is used in the calls to is().
  */
 function frcTest(uri, expected, message) {
   return new Promise(resolve => {
-    CA.findRepresentativeColor(Services.io.newURI(uri, "", null),
+    CA.findRepresentativeColor(Services.io.newURI(uri, ""),
       function(success, color) {
         if (expected == null) {
           ok(!success, message);
         } else if (typeof expected == "function") {
           expected(color, message);
         } else {
           ok(success, "success: " + message);
           is(color, expected, message);
--- a/toolkit/components/reader/AboutReader.jsm
+++ b/toolkit/components/reader/AboutReader.jsm
@@ -798,17 +798,17 @@ AboutReader.prototype = {
   },
 
   _showContent(article) {
     this._messageElement.style.display = "none";
 
     this._article = article;
 
     this._domainElement.href = article.url;
-    let articleUri = Services.io.newURI(article.url, null, null);
+    let articleUri = Services.io.newURI(article.url);
     this._domainElement.textContent = this._stripHost(articleUri.host);
     this._creditsElement.textContent = article.byline;
 
     this._titleElement.textContent = article.title;
     this._readTimeElement.textContent = this._formatReadTime(article.readingTimeMinsSlow, article.readingTimeMinsFast);
     this._doc.title = article.title;
 
     this._headerElement.style.display = "block";
--- a/toolkit/components/reader/ReaderMode.jsm
+++ b/toolkit/components/reader/ReaderMode.jsm
@@ -141,29 +141,29 @@ this.ReaderMode = {
    */
   getOriginalUrl(url) {
     if (!url.startsWith("about:reader?")) {
       return null;
     }
 
     let outerHash = "";
     try {
-      let uriObj = Services.io.newURI(url, null, null);
+      let uriObj = Services.io.newURI(url);
       url = uriObj.specIgnoringRef;
       outerHash = uriObj.ref;
     } catch (ex) { /* ignore, use the raw string */ }
 
     let searchParams = new URLSearchParams(url.substring("about:reader?".length));
     if (!searchParams.has("url")) {
       return null;
     }
     let originalUrl = searchParams.get("url");
     if (outerHash) {
       try {
-        let uriObj = Services.io.newURI(originalUrl, null, null);
+        let uriObj = Services.io.newURI(originalUrl);
         uriObj = Services.io.newURI('#' + outerHash, null, uriObj);
         originalUrl = uriObj.spec;
       } catch (ex) {}
     }
     return originalUrl;
   },
 
   /**
@@ -173,17 +173,17 @@ this.ReaderMode = {
    * @return boolean Whether or not we should show the reader mode button.
    */
   isProbablyReaderable(doc) {
     // Only care about 'real' HTML documents:
     if (doc.mozSyntheticDocument || !(doc instanceof doc.defaultView.HTMLDocument)) {
       return false;
     }
 
-    let uri = Services.io.newURI(doc.location.href, null, null);
+    let uri = Services.io.newURI(doc.location.href);
     if (!this._shouldCheckUri(uri)) {
       return false;
     }
 
     let utils = this.getUtilsForWin(doc.defaultView);
     // We pass in a helper function to determine if a node is visible, because
     // it uses gecko APIs that the engine-agnostic readability code can't rely
     // upon.
@@ -203,18 +203,18 @@ this.ReaderMode = {
    * Gets an article from a loaded browser's document. This method will not attempt
    * to parse certain URIs (e.g. about: URIs).
    *
    * @param doc A document to parse.
    * @return {Promise}
    * @resolves JS object representing the article, or null if no article is found.
    */
   parseDocument: Task.async(function* (doc) {
-    let documentURI = Services.io.newURI(doc.documentURI, null, null);
-    let baseURI = Services.io.newURI(doc.baseURI, null, null);
+    let documentURI = Services.io.newURI(doc.documentURI);
+    let baseURI = Services.io.newURI(doc.baseURI);
     if (!this._shouldCheckUri(documentURI) || !this._shouldCheckUri(baseURI, true)) {
       this.log("Reader mode disabled for URI");
       return null;
     }
 
     return yield this._readerParse(baseURI, doc);
   }),
 
@@ -222,17 +222,17 @@ this.ReaderMode = {
    * Downloads and parses a document from a URL.
    *
    * @param url URL to download and parse.
    * @return {Promise}
    * @resolves JS object representing the article, or null if no article is found.
    */
   downloadAndParseDocument: Task.async(function* (url) {
     let doc = yield this._downloadDocument(url);
-    let uri = Services.io.newURI(doc.baseURI, null, null);
+    let uri = Services.io.newURI(doc.baseURI);
     if (!this._shouldCheckUri(uri, true)) {
       this.log("Reader mode disabled for URI");
       return null;
     }
 
     return yield this._readerParse(uri, doc);
   }),
 
@@ -259,17 +259,17 @@ this.ReaderMode = {
 
         // Manually follow a meta refresh tag if one exists.
         let meta = doc.querySelector("meta[http-equiv=refresh]");
         if (meta) {
           let content = meta.getAttribute("content");
           if (content) {
             let urlIndex = content.toUpperCase().indexOf("URL=");
             if (urlIndex > -1) {
-              let baseURI = Services.io.newURI(url, null, null);
+              let baseURI = Services.io.newURI(url);
               let newURI = Services.io.newURI(content.substring(urlIndex + 4), null, baseURI);
               let newURL = newURI.spec;
               let ssm = Services.scriptSecurityManager;
               let flags = ssm.LOAD_IS_AUTOMATIC_DOCUMENT_REPLACEMENT |
                           ssm.DISALLOW_INHERIT_PRINCIPAL;
               try {
                 ssm.checkLoadURIStrWithPrincipal(doc.nodePrincipal, newURL, flags);
               } catch (ex) {
@@ -288,20 +288,20 @@ this.ReaderMode = {
             }
           }
         }
         let responseURL = xhr.responseURL;
         let givenURL = url;
         // Convert these to real URIs to make sure the escaping (or lack
         // thereof) is identical:
         try {
-          responseURL = Services.io.newURI(responseURL, null, null).specIgnoringRef;
+          responseURL = Services.io.newURI(responseURL).specIgnoringRef;
         } catch (ex) { /* Ignore errors - we'll use what we had before */ }
         try {
-          givenURL = Services.io.newURI(givenURL, null, null).specIgnoringRef;
+          givenURL = Services.io.newURI(givenURL).specIgnoringRef;
         } catch (ex) { /* Ignore errors - we'll use what we had before */ }
 
         if (responseURL != givenURL) {
           // We were redirected without a meta refresh tag.
           // Force redirect to the correct place:
           reject({newURL: xhr.responseURL});
           return;
         }
--- a/toolkit/components/remotebrowserutils/RemoteWebNavigation.js
+++ b/toolkit/components/remotebrowserutils/RemoteWebNavigation.js
@@ -8,17 +8,17 @@ const { interfaces: Ci, classes: Cc, uti
 Cu.import("resource://gre/modules/XPCOMUtils.jsm");
 
 XPCOMUtils.defineLazyModuleGetter(this, "Services",
   "resource://gre/modules/Services.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "NetUtil",
   "resource://gre/modules/NetUtil.jsm");
 
 function makeURI(url) {
-  return Services.io.newURI(url, null, null);
+  return Services.io.newURI(url);
 }
 
 function readInputStreamToString(aStream) {
   return NetUtil.readInputStreamToString(aStream, aStream.available());
 }
 
 function RemoteWebNavigation() {
   this.wrappedJSObject = this;
--- a/toolkit/components/search/tests/xpcshell/head_search.js
+++ b/toolkit/components/search/tests/xpcshell/head_search.js
@@ -56,17 +56,17 @@ function dumpn(text) {
  * Configure preferences to load engines from
  * chrome://testsearchplugin/locale/searchplugins/
  */
 function configureToLoadJarEngines() {
   let url = "chrome://testsearchplugin/locale/searchplugins/";
   let resProt = Services.io.getProtocolHandler("resource")
                         .QueryInterface(Ci.nsIResProtocolHandler);
   resProt.setSubstitution("search-plugins",
-                          Services.io.newURI(url, null, null));
+                          Services.io.newURI(url));
 
   // Ensure a test engine exists in the app dir anyway.
   let dir = Services.dirsvc.get(NS_APP_SEARCH_DIR, Ci.nsIFile);
   if (!dir.exists())
     dir.create(dir.DIRECTORY_TYPE, FileUtils.PERMS_DIRECTORY);
   do_get_file("data/engine-app.xml").copyTo(dir, "app.xml");
 }
 
--- a/toolkit/components/search/tests/xpcshell/test_chromeresource_icon1.js
+++ b/toolkit/components/search/tests/xpcshell/test_chromeresource_icon1.js
@@ -9,17 +9,17 @@ function run_test() {
   updateAppInfo();
 
   // The test engines used in this test need to be recognized as 'default'
   // engines or the resource URL won't be used
   let url = "resource://test/data/";
   let resProt = Services.io.getProtocolHandler("resource")
                         .QueryInterface(Ci.nsIResProtocolHandler);
   resProt.setSubstitution("search-plugins",
-                          Services.io.newURI(url, null, null));
+                          Services.io.newURI(url));
 
   run_next_test();
 }
 
 add_task(function* test_defaultresourceicon() {
   yield asyncInit();
 
   let engine1 = Services.search.getEngineByName("engine-resourceicon");
--- a/toolkit/components/search/tests/xpcshell/test_json_cache.js
+++ b/toolkit/components/search/tests/xpcshell/test_json_cache.js
@@ -21,17 +21,17 @@ function getDir(aKey, aIFace) {
   if (!_dirSvc) {
     _dirSvc = Cc["@mozilla.org/file/directory_service;1"].
                getService(Ci.nsIProperties);
   }
   return _dirSvc.get(aKey, aIFace || Ci.nsIFile);
 }
 
 function makeURI(uri) {
-  return Services.io.newURI(uri, null, null);
+  return Services.io.newURI(uri);
 }
 
 var cacheTemplate, appPluginsPath, profPlugins;
 
 /**
  * Test reading from search.json.mozlz4
  */
 function run_test() {
--- a/toolkit/components/search/tests/xpcshell/test_pref.js
+++ b/toolkit/components/search/tests/xpcshell/test_pref.js
@@ -10,17 +10,17 @@ function run_test() {
   updateAppInfo();
 
   // The test engines used in this test need to be recognized as 'default'
   // engines, or their MozParams will be ignored.
   let url = "resource://test/data/";
   let resProt = Services.io.getProtocolHandler("resource")
                         .QueryInterface(Ci.nsIResProtocolHandler);
   resProt.setSubstitution("search-plugins",
-                          Services.io.newURI(url, null, null));
+                          Services.io.newURI(url));
 
   run_next_test();
 }
 
 add_task(function* test_pref() {
   let defaultBranch = Services.prefs.getDefaultBranch(BROWSER_SEARCH_PREF);
   defaultBranch.setCharPref("param.code", "good&id=unique");
   Services.prefs.setCharPref(BROWSER_SEARCH_PREF + "param.code", "bad");
--- a/toolkit/components/search/tests/xpcshell/test_purpose.js
+++ b/toolkit/components/search/tests/xpcshell/test_purpose.js
@@ -13,17 +13,17 @@ function run_test() {
   updateAppInfo();
 
   // The test engines used in this test need to be recognized as 'default'
   // engines, or their MozParams used to set the purpose will be ignored.
   let url = "resource://test/data/";
   let resProt = Services.io.getProtocolHandler("resource")
                         .QueryInterface(Ci.nsIResProtocolHandler);
   resProt.setSubstitution("search-plugins",
-                          Services.io.newURI(url, null, null));
+                          Services.io.newURI(url));
 
   run_next_test();
 }
 
 add_task(function* test_purpose() {
   let engine = Services.search.getEngineByName("Test search engine");
 
   function check_submission(aExpected, aSearchTerm, aType, aPurpose) {
--- a/toolkit/components/search/tests/xpcshell/test_require_engines_in_cache.js
+++ b/toolkit/components/search/tests/xpcshell/test_require_engines_in_cache.js
@@ -51,17 +51,17 @@ add_task(function* skip_writing_cache_wi
   let reInitPromise = asyncReInit();
   yield unInitPromise;
 
   // Configure so that no engines will be found.
   do_check_true(removeCacheFile());
   let resProt = Services.io.getProtocolHandler("resource")
                         .QueryInterface(Ci.nsIResProtocolHandler);
   resProt.setSubstitution("search-plugins",
-                          Services.io.newURI("about:blank", null, null));
+                          Services.io.newURI("about:blank"));
 
   // Let the async-reInit happen.
   yield reInitPromise;
   do_check_eq(0, Services.search.getEngines().length);
 
   // Trigger yet another re-init, to flush of any pending cache writing task.
   unInitPromise = waitForSearchNotification("uninit-complete");
   reInitPromise = asyncReInit();
--- a/toolkit/components/securityreporter/SecurityReporter.js
+++ b/toolkit/components/securityreporter/SecurityReporter.js
@@ -48,17 +48,17 @@ SecurityReporter.prototype = {
     if (!Services.prefs.getBoolPref("security.ssl.errorReporting.enabled")) {
       return;
     }
 
     // Don't send a report if the host we're connecting to is the report
     // server (otherwise we'll get loops when this fails)
     let endpoint =
       Services.prefs.getCharPref("security.ssl.errorReporting.url");
-    let reportURI = Services.io.newURI(endpoint, null, null);
+    let reportURI = Services.io.newURI(endpoint);
 
     if (reportURI.host == hostname) {
       return;
     }
 
     // Convert the nsIX509CertList into a format that can be parsed into
     // JSON
     let asciiCertChain = [];
--- a/toolkit/components/telemetry/tests/unit/test_TelemetryEnvironment.js
+++ b/toolkit/components/telemetry/tests/unit/test_TelemetryEnvironment.js
@@ -1326,17 +1326,17 @@ add_task(function* test_defaultSearchEng
   Assert.ok(!("defaultSearchEngineData" in data.settings));
 
   // Load the engines definitions from a custom JAR file: that's needed so that
   // the search provider reports an engine identifier.
   let url = "chrome://testsearchplugin/locale/searchplugins/";
   let resProt = Services.io.getProtocolHandler("resource")
                         .QueryInterface(Ci.nsIResProtocolHandler);
   resProt.setSubstitution("search-plugins",
-                          Services.io.newURI(url, null, null));
+                          Services.io.newURI(url));
 
   // Initialize the search service.
   yield new Promise(resolve => Services.search.init(resolve));
 
   // Our default engine from the JAR file has an identifier. Check if it is correctly
   // reported.
   data = TelemetryEnvironment.currentEnvironment;
   checkEnvironmentData(data);
--- a/toolkit/components/thumbnails/test/test_thumbnails_interfaces.js
+++ b/toolkit/components/thumbnails/test/test_thumbnails_interfaces.js
@@ -13,19 +13,17 @@ do_get_profile();
 
 function run_test() {
   // first check the protocol handler implements the correct interface
   let handler = Services.io.getProtocolHandler("moz-page-thumb");
   ok(handler instanceof Ci.nsISubstitutingProtocolHandler,
      "moz-page-thumb handler provides substituting interface");
 
   // then check that the file URL resolution works
-  let uri = Services.io.newURI("moz-page-thumb://thumbnail/?url=http%3A%2F%2Fwww.mozilla.org%2F",
-                               null, null);
+  let uri = Services.io.newURI("moz-page-thumb://thumbnail/?url=http%3A%2F%2Fwww.mozilla.org%2F");
   ok(uri instanceof Ci.nsIFileURL, "moz-page-thumb:// is a FileURL");
   ok(uri.file, "This moz-page-thumb:// object is backed by a file");
 
   // and check that the error case works as specified
-  let bad = Services.io.newURI("moz-page-thumb://wronghost/?url=http%3A%2F%2Fwww.mozilla.org%2F",
-                               null, null);
+  let bad = Services.io.newURI("moz-page-thumb://wronghost/?url=http%3A%2F%2Fwww.mozilla.org%2F");
   Assert.throws(() => handler.resolveURI(bad), /NS_ERROR_NOT_AVAILABLE/i,
                 "moz-page-thumb object with wrong host must not resolve to a file path");
 }
--- a/toolkit/components/url-classifier/content/trtable.js
+++ b/toolkit/components/url-classifier/content/trtable.js
@@ -89,17 +89,17 @@ UrlClassifierTableDomain.inherits(UrlCla
  * Look up a URL in a domain table
  * We also try to lookup domain + first path component (e.g.,
  * www.mozilla.org/products).
  *
  * @returns Boolean true if the url domain is in the table
  */
 UrlClassifierTableDomain.prototype.exists = function(url, callback) {
   var canonicalized = this.enchashDecrypter_.getCanonicalUrl(url);
-  var urlObj = this.ioService_.newURI(canonicalized, null, null);
+  var urlObj = this.ioService_.newURI(canonicalized);
   var host = '';
   try {
     host = urlObj.host;
   } catch (e) { }
   var hostComponents = host.split(".");
 
   // Try to get the path of the URL.  Pseudo urls (like wyciwyg:) throw
   // errors when trying to convert to an nsIURL so we wrap in a try/catch
--- a/toolkit/components/url-classifier/tests/mochitest/classifierCommon.js
+++ b/toolkit/components/url-classifier/tests/mochitest/classifierCommon.js
@@ -73,17 +73,17 @@ function waitForInit() {
   const url = "http://itisatrap.org/firefox/its-a-trap.html";
 
   let secMan = Cc["@mozilla.org/scriptsecuritymanager;1"]
                .getService(Ci.nsIScriptSecurityManager);
   let iosvc = Cc["@mozilla.org/network/io-service;1"]
               .getService(Ci.nsIIOService);
 
   let principal = secMan.createCodebasePrincipal(
-    iosvc.newURI(url, null, null), {});
+    iosvc.newURI(url), {});
 
   let listener = {
     QueryInterface: function(iid)
     {
       if (iid.equals(Ci.nsISupports) ||
         iid.equals(Ci.nsIUrlClassifierUpdateObserver))
         return this;
       throw Cr.NS_ERROR_NO_INTERFACE;
--- a/toolkit/components/url-classifier/tests/unit/head_urlclassifier.js
+++ b/toolkit/components/url-classifier/tests/unit/head_urlclassifier.js
@@ -227,32 +227,32 @@ tableData : function(expectedTables, cb)
 checkUrls: function(urls, expected, cb, useMoz = false)
 {
   // work with a copy of the list.
   urls = urls.slice(0);
   var doLookup = function() {
     if (urls.length > 0) {
       var tables = useMoz ? mozTables : allTables;
       var fragment = urls.shift();
-      var principal = secMan.createCodebasePrincipal(iosvc.newURI("http://" + fragment, null, null), {});
+      var principal = secMan.createCodebasePrincipal(iosvc.newURI("http://" + fragment), {});
       dbservice.lookup(principal, tables,
                                 function(arg) {
                                   do_check_eq(expected, arg);
                                   doLookup();
                                 }, true);
     } else {
       cb();
     }
   };
   doLookup();
 },
 
 checkTables: function(url, expected, cb)
 {
-  var principal = secMan.createCodebasePrincipal(iosvc.newURI("http://" + url, null, null), {});
+  var principal = secMan.createCodebasePrincipal(iosvc.newURI("http://" + url), {});
   dbservice.lookup(principal, allTables, function(tables) {
     // Rebuild tables in a predictable order.
     var parts = tables.split(",");
     while (parts[parts.length - 1] == '') {
       parts.pop();
     }
     parts.sort();
     tables = parts.join(",");
--- a/toolkit/components/url-classifier/tests/unit/test_dbservice.js
+++ b/toolkit/components/url-classifier/tests/unit/test_dbservice.js
@@ -105,17 +105,17 @@ function testFailure(arg) {
   do_throw(arg);
 }
 
 function checkNoHost()
 {
   // Looking up a no-host uri such as a data: uri should throw an exception.
   var exception;
   try {
-    var principal = secMan.createCodebasePrincipal(iosvc.newURI("data:text/html,<b>test</b>", null, null), {});
+    var principal = secMan.createCodebasePrincipal(iosvc.newURI("data:text/html,<b>test</b>"), {});
     dbservice.lookup(principal, allTables);
 
     exception = false;
   } catch(e) {
     exception = true;
   }
   do_check_true(exception);
 
@@ -218,41 +218,41 @@ function blockedExists(result) {
 }
 
 function checkState()
 {
   numExpecting = 0;
 
 
   for (var key in phishExpected) {
-    var principal = secMan.createCodebasePrincipal(iosvc.newURI("http://" + key, null, null), {});
+    var principal = secMan.createCodebasePrincipal(iosvc.newURI("http://" + key), {});
     dbservice.lookup(principal, allTables, phishExists, true);
     numExpecting++;
   }
 
   for (var key in phishUnexpected) {
-    var principal = secMan.createCodebasePrincipal(iosvc.newURI("http://" + key, null, null), {});
+    var principal = secMan.createCodebasePrincipal(iosvc.newURI("http://" + key), {});
     dbservice.lookup(principal, allTables, phishDoesntExist, true);
     numExpecting++;
   }
 
   for (var key in malwareExpected) {
-    var principal = secMan.createCodebasePrincipal(iosvc.newURI("http://" + key, null, null), {});
+    var principal = secMan.createCodebasePrincipal(iosvc.newURI("http://" + key), {});
     dbservice.lookup(principal, allTables, malwareExists, true);
     numExpecting++;
   }
 
   for (var key in unwantedExpected) {
-    var principal = secMan.createCodebasePrincipal(iosvc.newURI("http://" + key, null, null), {});
+    var principal = secMan.createCodebasePrincipal(iosvc.newURI("http://" + key), {});
     dbservice.lookup(principal, allTables, unwantedExists, true);
     numExpecting++;
   }
 
   for (var key in blockedExpected) {
-    var principal = secMan.createCodebasePrincipal(iosvc.newURI("http://" + key, null, null), {});
+    var principal = secMan.createCodebasePrincipal(iosvc.newURI("http://" + key), {});
     dbservice.lookup(principal, allTables, blockedExists, true);
     numExpecting++;
   }
 }
 
 function testSubSuccess(result)
 {
   do_check_eq(result, "1000");
--- a/toolkit/components/url-classifier/tests/unit/test_digest256.js
+++ b/toolkit/components/url-classifier/tests/unit/test_digest256.js
@@ -86,17 +86,17 @@ function run_test() {
 
   gHttpServ.start(4444);
   run_next_test();
 }
 
 function createURI(s) {
   let service = Cc["@mozilla.org/network/io-service;1"]
     .getService(Ci.nsIIOService);
-  return service.newURI(s, null, null);
+  return service.newURI(s);
 }
 
 // Just throw if we ever get an update or download error.
 function handleError(aEvent) {
   do_throw("We didn't download or update correctly: " + aEvent);
 }
 
 add_test(function test_update() {
--- a/toolkit/components/viewsource/content/viewSource-content.js
+++ b/toolkit/components/viewsource/content/viewSource-content.js
@@ -770,17 +770,17 @@ var ViewSourceContent = {
 
     // all our content is held by the data:URI and URIs are internally stored as utf-8 (see nsIURI.idl)
     let loadFlags = Ci.nsIWebNavigation.LOAD_FLAGS_NONE;
     let referrerPolicy = Ci.nsIHttpChannel.REFERRER_POLICY_UNSET;
     let webNav = docShell.QueryInterface(Ci.nsIWebNavigation);
     webNav.loadURIWithOptions(uri, loadFlags,
                               null, referrerPolicy,  // referrer
                               null, null,  // postData, headers
-                              Services.io.newURI(baseURI, null, null));
+                              Services.io.newURI(baseURI));
   },
 
   /**
    * nsISelectionListener
    */
 
   /**
    * Gets called every time the selection is changed. Coalesces frequent
--- a/toolkit/components/viewsource/content/viewSourceUtils.js
+++ b/toolkit/components/viewsource/content/viewSourceUtils.js
@@ -269,17 +269,17 @@ var gViewSourceUtils = {
         this.handleCallBack(aCallBack, false, data);
         return;
       }
 
       // make a uri
       var ios = Components.classes["@mozilla.org/network/io-service;1"]
                           .getService(Components.interfaces.nsIIOService);
       var charset = data.doc ? data.doc.characterSet : null;
-      var uri = ios.newURI(data.url, charset, null);
+      var uri = ios.newURI(data.url, charset);
       data.uri = uri;
 
       var path;
       var contentType = data.doc ? data.doc.contentType : null;
       if (uri.scheme == "file") {
         // it's a local file; we can open it directly
         path = uri.QueryInterface(Components.interfaces.nsIFileURL).file.path;
 
--- a/toolkit/content/aboutAbout.js
+++ b/toolkit/content/aboutAbout.js
@@ -15,17 +15,17 @@ function findAbouts() {
   var ios = Cc["@mozilla.org/network/io-service;1"].getService(Ci.nsIIOService);
   for (var cid in Cc) {
     var result = cid.match(/@mozilla.org\/network\/protocol\/about;1\?what\=(.*)$/);
     if (result) {
       var aboutType = result[1];
       var contract = "@mozilla.org/network/protocol/about;1?what=" + aboutType;
       try {
         var am = Cc[contract].getService(Ci.nsIAboutModule);
-        var uri = ios.newURI("about:" + aboutType, null, null);
+        var uri = ios.newURI("about:" + aboutType);
         var flags = am.getURIFlags(uri);
         if (!(flags & Ci.nsIAboutModule.HIDE_FROM_ABOUTABOUT)) {
           gProtocols.push(aboutType);
         }
       } catch (e) {
         // getService might have thrown if the component doesn't actually
         // implement nsIAboutModule
       }
--- a/toolkit/content/browser-child.js
+++ b/toolkit/content/browser-child.js
@@ -308,32 +308,32 @@ var WebNavigation =  {
   gotoIndex(index) {
     this._wrapURIChangeCall(() => this.webNavigation.gotoIndex(index));
   },
 
   loadURI(uri, flags, referrer, referrerPolicy, postData, headers, baseURI) {
     if (AppConstants.MOZ_CRASHREPORTER && CrashReporter.enabled) {
       let annotation = uri;
       try {
-        let url = Services.io.newURI(uri, null, null);
+        let url = Services.io.newURI(uri);
         // If the current URI contains a username/password, remove it.
         url.userPass = "";
         annotation = url.spec;
       } catch (ex) { /* Ignore failures to parse and failures
                       on about: URIs. */ }
       CrashReporter.annotateCrashReport("URL", annotation);
     }
     if (referrer)
-      referrer = Services.io.newURI(referrer, null, null);
+      referrer = Services.io.newURI(referrer);
     if (postData)
       postData = makeInputStream(postData);
     if (headers)
       headers = makeInputStream(headers);
     if (baseURI)
-      baseURI = Services.io.newURI(baseURI, null, null);
+      baseURI = Services.io.newURI(baseURI);
     this._wrapURIChangeCall(() => {
       return this.webNavigation.loadURIWithOptions(uri, flags, referrer, referrerPolicy,
                                                    postData, headers, baseURI);
     });
   },
 
   setOriginAttributes(originAttributes) {
     if (originAttributes) {
--- a/toolkit/content/browser-content.js
+++ b/toolkit/content/browser-content.js
@@ -600,17 +600,17 @@ var Printing = {
       controlContentStyle.textContent = "@import url(\"chrome://global/skin/aboutReaderContent.css\");";
       contentElement.appendChild(controlContentStyle);
 
       // Jam the article's content into content div
       let readerContent = content.document.createElement("div");
       readerContent.setAttribute("id", "moz-reader-content");
       contentElement.appendChild(readerContent);
 
-      let articleUri = Services.io.newURI(article.url, null, null);
+      let articleUri = Services.io.newURI(article.url);
       let parserUtils = Cc["@mozilla.org/parserutils;1"].getService(Ci.nsIParserUtils);
       let contentFragment = parserUtils.parseFragment(article.content,
         Ci.nsIParserUtils.SanitizerDropForms | Ci.nsIParserUtils.SanitizerAllowStyle,
         false, articleUri, readerContent);
 
       readerContent.appendChild(contentFragment);
 
       // Display reader content element
--- a/toolkit/content/tests/chrome/RegisterUnregisterChrome.js
+++ b/toolkit/content/tests/chrome/RegisterUnregisterChrome.js
@@ -24,17 +24,17 @@ function copyToTemporaryFile(f) {
   tmpf.remove(false);
   f.copyTo(tmpd, tmpf.leafName);
   return tmpf;
 }
 
 function* dirIter(directory) {
   var ioSvc = Cc["@mozilla.org/network/io-service;1"].
               getService(Ci.nsIIOService);
-  var testsDir = ioSvc.newURI(directory, null, null)
+  var testsDir = ioSvc.newURI(directory)
                   .QueryInterface(Ci.nsIFileURL).file;
 
   let en = testsDir.directoryEntries;
   while (en.hasMoreElements()) {
     let file = en.getNext();
     yield file.QueryInterface(Ci.nsIFile);
   }
 }
@@ -72,17 +72,17 @@ function copyDirToTempProfile(path, subd
     files[f].copyTo(tmpdir, "");
   }
   return tmpdir;
 
 }
 
 function convertChromeURI(chromeURI) {
   let uri = Cc["@mozilla.org/network/io-service;1"].
-    getService(Ci.nsIIOService).newURI(chromeURI, null, null);
+    getService(Ci.nsIIOService).newURI(chromeURI);
   return gChromeReg.convertChromeURL(uri);
 }
 
 function chromeURIToFile(chromeURI) {
   var jar = getJar(chromeURI);
   if (jar) {
     var tmpDir = extractJarToTmp(jar);
     let parts = chromeURI.split('/');
--- a/toolkit/crashreporter/content/crashes.js
+++ b/toolkit/crashreporter/content/crashes.js
@@ -99,17 +99,17 @@ function populateReportList() {
     timeFormatter = {
       format(date) {
         return date.toLocaleTimeString();
       }
     }
   }
   var ios = Cc["@mozilla.org/network/io-service;1"].
             getService(Ci.nsIIOService);
-  var reportURI = ios.newURI(reportURL, null, null);
+  var reportURI = ios.newURI(reportURL);
   // resolving this URI relative to /report/index
   var aboutThrottling = ios.newURI("../../about/throttling", null, reportURI);
 
   for (var i = 0; i < reports.length; i++) {
     var row = document.createElement("tr");
     var cell = document.createElement("td");
     row.appendChild(cell);
     var link = document.createElement("a");
--- a/toolkit/crashreporter/test/unit/test_crashreporter.js
+++ b/toolkit/crashreporter/test/unit/test_crashreporter.js
@@ -16,23 +16,23 @@ function run_test() {
   // check setting/getting serverURL
   var ios = Components.classes["@mozilla.org/network/io-service;1"]
                       .getService(Components.interfaces.nsIIOService);
 
   // try it with two different URLs, just for kicks
   var testspecs = ["http://example.com/submit",
                    "https://example.org/anothersubmit"];
   for (var i = 0; i < testspecs.length; ++i) {
-    cr.serverURL = ios.newURI(testspecs[i], null, null);
+    cr.serverURL = ios.newURI(testspecs[i]);
     do_check_eq(cr.serverURL.spec, testspecs[i]);
   }
 
   // should not allow setting non-http/https URLs
   try {
-    cr.serverURL = ios.newURI("ftp://example.com/submit", null, null);
+    cr.serverURL = ios.newURI("ftp://example.com/submit");
     do_throw("Setting serverURL to a non-http(s) URL should have thrown!");
   } catch (ex) {
     do_check_eq(ex.result, Components.results.NS_ERROR_INVALID_ARG);
   }
 
   // check getting/setting minidumpPath
   // it should be $TEMP by default, but I'm not sure if we can exactly test that
   // this will at least test that it doesn't throw
--- a/toolkit/identity/IdentityProvider.jsm
+++ b/toolkit/identity/IdentityProvider.jsm
@@ -118,17 +118,17 @@ IdentityProviderService.prototype = {
    *        (object) parameters of the IdP
    *
    * @param aCallback
    *        (function) callback to invoke on completion
    *                   with first-positional parameter the error.
    */
   _provisionIdentity: function _provisionIdentity(aIdentity, aIDPParams, aProvId, aCallback) {
     let provPath = aIDPParams.idpParams.provisioning;
-    let url = Services.io.newURI("https://" + aIDPParams.domain, null, null).resolve(provPath);
+    let url = Services.io.newURI("https://" + aIDPParams.domain).resolve(provPath);
     log("_provisionIdentity: identity:", aIdentity, "url:", url);
 
     // If aProvId is not null, then we already have a flow
     // with a sandbox.  Otherwise, get a sandbox and create a
     // new provision flow.
 
     if (aProvId) {
       // Re-use an existing sandbox
@@ -310,17 +310,17 @@ IdentityProviderService.prototype = {
    */
   _doAuthentication: function _doAuthentication(aProvId, aIDPParams) {
     log("_doAuthentication: provId:", aProvId, "idpParams:", aIDPParams);
     // create an authentication caller and its identifier AuthId
     // stash aIdentity, idpparams, and callback in it.
 
     // extract authentication URL from idpParams
     let authPath = aIDPParams.idpParams.authentication;
-    let authURI = Services.io.newURI("https://" + aIDPParams.domain, null, null).resolve(authPath);
+    let authURI = Services.io.newURI("https://" + aIDPParams.domain).resolve(authPath);
 
     // beginAuthenticationFlow causes the "identity-auth" topic to be
     // observed.  Since it's sending a notification to the DOM, there's
     // no callback.  We wait for the DOM to trigger the next phase of
     // provisioning.
     this._beginAuthenticationFlow(aProvId, authURI);
 
     // either we bind the AuthID to the sandbox ourselves, or UX does that,
--- a/toolkit/identity/RelyingParty.jsm
+++ b/toolkit/identity/RelyingParty.jsm
@@ -211,17 +211,17 @@ IdentityRelyingParty.prototype = {
     let rp = this._rpFlows[aRPId];
 
     // Notify UX to display identity picker.
     // Pass the doc id to UX so it can pass it back to us later.
     let options = {rpId: aRPId, origin: rp.origin};
     objectCopy(aOptions, options);
 
     // Append URLs after resolving
-    let baseURI = Services.io.newURI(rp.origin, null, null);
+    let baseURI = Services.io.newURI(rp.origin);
     for (let optionName of ["privacyPolicy", "termsOfService"]) {
       if (aOptions[optionName]) {
         options[optionName] = baseURI.resolve(aOptions[optionName]);
       }
     }
 
     Services.obs.notifyObservers({wrappedJSObject: options}, "identity-request", null);
   },
--- a/toolkit/identity/Sandbox.jsm
+++ b/toolkit/identity/Sandbox.jsm
@@ -28,17 +28,17 @@ XPCOMUtils.defineLazyModuleGetter(this,
  * @param aURL
  *        (string) URL to load in the sandbox.
  *
  * @param aCallback
  *        (function) Callback to be invoked with a Sandbox, when ready.
  */
 this.Sandbox = function Sandbox(aURL, aCallback) {
   // Normalize the URL so the comparison in _makeSandboxContentLoaded works
-  this._url = Services.io.newURI(aURL, null, null).spec;
+  this._url = Services.io.newURI(aURL).spec;
   this._log("Creating sandbox for:", this._url);
   this._createFrame();
   this._createSandbox(aCallback);
 };
 
 this.Sandbox.prototype = {
 
   /**
--- a/toolkit/modules/BrowserUtils.jsm
+++ b/toolkit/modules/BrowserUtils.jsm
@@ -133,17 +133,17 @@ this.BrowserUtils = {
     return Services.io.newURI(aURL, aOriginCharset, aBaseURI);
   },
 
   makeFileURI(aFile) {
     return Services.io.newFileURI(aFile);
   },
 
   makeURIFromCPOW(aCPOWURI) {
-    return Services.io.newURI(aCPOWURI.spec, aCPOWURI.originCharset, null);
+    return Services.io.newURI(aCPOWURI.spec, aCPOWURI.originCharset);
   },
 
   /**
    * For a given DOM element, returns its position in "screen"
    * coordinates. In a content process, the coordinates returned will
    * be relative to the left/top of the tab. In the chrome process,
    * the coordinates are relative to the user's screen.
    */
--- a/toolkit/modules/NewTabUtils.jsm
+++ b/toolkit/modules/NewTabUtils.jsm
@@ -19,17 +19,17 @@ XPCOMUtils.defineLazyModuleGetter(this, 
 
 XPCOMUtils.defineLazyModuleGetter(this, "PageThumbs",
   "resource://gre/modules/PageThumbs.jsm");
 
 XPCOMUtils.defineLazyModuleGetter(this, "BinarySearch",
   "resource://gre/modules/BinarySearch.jsm");
 
 XPCOMUtils.defineLazyGetter(this, "gPrincipal", function() {
-  let uri = Services.io.newURI("about:newtab", null, null);
+  let uri = Services.io.newURI("about:newtab");
   return Services.scriptSecurityManager.createCodebasePrincipal(uri, {});
 });
 
 XPCOMUtils.defineLazyGetter(this, "gCryptoHash", function() {
   return Cc["@mozilla.org/security/hash;1"].createInstance(Ci.nsICryptoHash);
 });
 
 XPCOMUtils.defineLazyGetter(this, "gUnicodeConverter", function() {
@@ -1399,17 +1399,17 @@ this.NewTabUtils = {
    * @param aUrl Url spec string
    * @return The "site" string or null
    */
   extractSite: function Links_extractSite(url) {
     let host;
     try {
       // Note that nsIURI.asciiHost throws NS_ERROR_FAILURE for some types of
       // URIs, including jar and moz-icon URIs.
-      host = Services.io.newURI(url, null, null).asciiHost;
+      host = Services.io.newURI(url).asciiHost;
     } catch (ex) {
       return null;
     }
 
     // Strip off common subdomains of the same site (e.g., www, load balancer)
     return host.replace(/^(m|mobile|www\d*)\./, "");
   },
 
--- a/toolkit/modules/PageMetadata.jsm
+++ b/toolkit/modules/PageMetadata.jsm
@@ -278,18 +278,18 @@ this.PageMetadata = {
    * document location, ensuring it's using an expected scheme, and stripping
    * the userPass portion of the URL.
    *
    * @param {Document} document - Document to use as the root location for a relative URL.
    * @param {string} url - URL to validate.
    * @return {string} Result URL.
    */
   _validateURL(document, url) {
-    let docURI = Services.io.newURI(document.documentURI, null, null);
-    let uri = Services.io.newURI(docURI.resolve(url), null, null);
+    let docURI = Services.io.newURI(document.documentURI);
+    let uri = Services.io.newURI(docURI.resolve(url));
 
     if (["http", "https"].indexOf(uri.scheme) < 0) {
       return null;
     }
 
     uri.userPass = "";
 
     return uri.spec;
--- a/toolkit/modules/PermissionsUtils.jsm
+++ b/toolkit/modules/PermissionsUtils.jsm
@@ -30,18 +30,18 @@ function importPrefBranch(aPrefBranch, a
       let principals = [];
       try {
         principals = [ Services.scriptSecurityManager.createCodebasePrincipalFromOrigin(origin) ];
       } catch (e) {
         // This preference used to contain a list of hosts. For back-compat
         // reasons, we convert these hosts into http:// and https:// permissions
         // on default ports.
         try {
-          let httpURI = Services.io.newURI("http://" + origin, null, null);
-          let httpsURI = Services.io.newURI("https://" + origin, null, null);
+          let httpURI = Services.io.newURI("http://" + origin);
+          let httpsURI = Services.io.newURI("https://" + origin);
 
           principals = [
             Services.scriptSecurityManager.createCodebasePrincipal(httpURI, {}),
             Services.scriptSecurityManager.createCodebasePrincipal(httpsURI, {})
           ];
         } catch (e2) {}
       }
 
--- a/toolkit/modules/RemoteWebProgress.jsm
+++ b/toolkit/modules/RemoteWebProgress.jsm
@@ -7,18 +7,18 @@ this.EXPORTED_SYMBOLS = ["RemoteWebProgr
 
 const Ci = Components.interfaces;
 const Cc = Components.classes;
 const Cu = Components.utils;
 
 Cu.import("resource://gre/modules/XPCOMUtils.jsm");
 
 function newURI(spec) {
-    return Cc["@mozilla.org/network/io-service;1"].getService(Ci.nsIIOService)
-                                                    .newURI(spec, null, null);
+  return Cc["@mozilla.org/network/io-service;1"].getService(Ci.nsIIOService)
+                                                .newURI(spec);
 }
 
 function RemoteWebProgressRequest(spec, originalSpec, requestCPOW) {
   this.wrappedJSObject = this;
 
   this._uri = newURI(spec);
   this._originalURI = newURI(originalSpec);
   this._requestCPOW = requestCPOW;
--- a/toolkit/modules/WebChannel.jsm
+++ b/toolkit/modules/WebChannel.jsm
@@ -172,17 +172,17 @@ this.WebChannel = function(id, originOrP
   // originOrPermission can be either an nsIURI or a string representing a
   // permission name.
   if (typeof originOrPermission == "string") {
     this._originCheckCallback = requestPrincipal => {
       // Accept events from any secure origin having the named permission.
       // The permission manager operates on domain names rather than true
       // origins (bug 1066517).  To mitigate that, we explicitly check that
       // the scheme is https://.
-      let uri = Services.io.newURI(requestPrincipal.originNoSuffix, null, null);
+      let uri = Services.io.newURI(requestPrincipal.originNoSuffix);
       if (uri.scheme != "https") {
         return false;
       }
       // OK - we have https - now we can check the permission.
       let perm = Services.perms.testExactPermissionFromPrincipal(requestPrincipal,
                                                                  originOrPermission);
       return perm == Ci.nsIPermissionManager.ALLOW_ACTION;
     }
--- a/toolkit/modules/secondscreen/RokuApp.jsm
+++ b/toolkit/modules/secondscreen/RokuApp.jsm
@@ -139,17 +139,17 @@ RokuApp.prototype = {
 /* RemoteMedia provides a wrapper for using TCP socket to control Roku apps.
  * The server implementation must be built into the Roku receiver app.
  */
 function RemoteMedia(url, listener) {
   this._url = url;
   this._listener = listener;
   this._status = "uninitialized";
 
-  let serverURI = Services.io.newURI(this._url, null, null);
+  let serverURI = Services.io.newURI(this._url);
   this._socket = Cc["@mozilla.org/network/socket-transport-service;1"].getService(Ci.nsISocketTransportService).createTransport(null, 0, serverURI.host, 9191, null);
   this._outputStream = this._socket.openOutputStream(0, 0, 0);
 
   this._scriptableStream = Cc["@mozilla.org/scriptableinputstream;1"].createInstance(Ci.nsIScriptableInputStream);
 
   this._inputStream = this._socket.openInputStream(0, 0, 0);
   this._pump = Cc["@mozilla.org/network/input-stream-pump;1"].createInstance(Ci.nsIInputStreamPump);
   this._pump.init(this._inputStream, -1, -1, 0, 0, true);
--- a/toolkit/modules/secondscreen/SimpleServiceDiscovery.jsm
+++ b/toolkit/modules/secondscreen/SimpleServiceDiscovery.jsm
@@ -57,17 +57,17 @@ var SimpleServiceDiscovery = {
   _searchTimestamp: 0,
   _searchTimeout: Cc["@mozilla.org/timer;1"].createInstance(Ci.nsITimer),
   _searchRepeat: Cc["@mozilla.org/timer;1"].createInstance(Ci.nsITimer),
   _discoveryMethods: [],
 
   _forceTrailingSlash(aURL) {
     // Cleanup the URL to make it consistent across devices
     try {
-      aURL = Services.io.newURI(aURL, null, null).spec;
+      aURL = Services.io.newURI(aURL).spec;
     } catch (e) {}
     return aURL;
   },
 
   // nsIUDPSocketListener implementation
   onPacketReceived(aSocket, aMessage) {
     // Listen for responses from specific devices. There could be more than one
     // available.
--- a/toolkit/modules/sessionstore/Utils.jsm
+++ b/toolkit/modules/sessionstore/Utils.jsm
@@ -14,17 +14,17 @@ Cu.import("resource://gre/modules/Servic
 Cu.import("resource://gre/modules/XPCOMUtils.jsm", this);
 
 XPCOMUtils.defineLazyServiceGetter(this, "serializationHelper",
                                    "@mozilla.org/network/serialization-helper;1",
                                    "nsISerializationHelper");
 
 this.Utils = Object.freeze({
   makeURI(url) {
-    return Services.io.newURI(url, null, null);
+    return Services.io.newURI(url);
   },
 
   makeInputStream(aString) {
     let stream = Cc["@mozilla.org/io/string-input-stream;1"].
                  createInstance(Ci.nsISupportsCString);
     stream.data = aString;
     return stream; // XPConnect will QI this to nsIInputStream for us.
   },
--- a/toolkit/modules/tests/xpcshell/test_GMPInstallManager.js
+++ b/toolkit/modules/tests/xpcshell/test_GMPInstallManager.js
@@ -645,17 +645,17 @@ function xhr(inputStatus, inputResponse,
   this._options = options || {};
 }
 xhr.prototype = {
   overrideMimeType(aMimetype) { },
   setRequestHeader(aHeader, aValue) { },
   status: null,
   channel: { set notificationCallbacks(aVal) { } },
   open(aMethod, aUrl) {
-    this.channel.originalURI = Services.io.newURI(aUrl, null, null);
+    this.channel.originalURI = Services.io.newURI(aUrl);
     this._method = aMethod; this._url = aUrl;
   },
   abort() {
     this._dropRequest = true;
     this._notify(["abort", "loadend"]);
   },
   responseXML: null,
   responseText: null,
--- a/toolkit/modules/tests/xpcshell/test_MatchGlobs.js
+++ b/toolkit/modules/tests/xpcshell/test_MatchGlobs.js
@@ -2,17 +2,17 @@
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
 "use strict";
 
 Components.utils.import("resource://gre/modules/MatchPattern.jsm");
 Components.utils.import("resource://gre/modules/Services.jsm");
 
 function test(url, pattern) {
-  let uri = Services.io.newURI(url, null, null);
+  let uri = Services.io.newURI(url);
   let m = new MatchGlobs(pattern);
   return m.matches(uri.spec);
 }
 
 function pass({url, pattern}) {
   ok(test(url, pattern), `Expected match: ${JSON.stringify(pattern)}, ${url}`);
 }
 
--- a/toolkit/modules/tests/xpcshell/test_MatchPattern.js
+++ b/toolkit/modules/tests/xpcshell/test_MatchPattern.js
@@ -2,17 +2,17 @@
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
 "use strict";
 
 Components.utils.import("resource://gre/modules/MatchPattern.jsm");
 Components.utils.import("resource://gre/modules/Services.jsm");
 
 function test(url, pattern) {
-  let uri = Services.io.newURI(url, null, null);
+  let uri = Services.io.newURI(url);
   let m = new MatchPattern(pattern);
   return m.matches(uri);
 }
 
 function pass({url, pattern}) {
   do_check_true(test(url, pattern), `Expected match: ${JSON.stringify(pattern)}, ${url}`);
 }
 
--- a/toolkit/modules/tests/xpcshell/test_PermissionsUtils.js
+++ b/toolkit/modules/tests/xpcshell/test_PermissionsUtils.js
@@ -49,37 +49,37 @@ function test_importfromPrefs() {
   let untouched = ["https://whitelist.example.com",
                    "https://blacklist.example.com",
                    "http://whitelist2-1.example.com",
                    "http://blacklist2-1.example.com",
                    "https://whitelist2-2.example.com:8080",
                    "https://blacklist2-2.example.com:8080"];
   let unknown = whitelisted.concat(blacklisted).concat(untouched);
   for (let url of unknown) {
-    let uri = Services.io.newURI(url, null, null);
+    let uri = Services.io.newURI(url);
     do_check_eq(Services.perms.testPermission(uri, TEST_PERM), Services.perms.UNKNOWN_ACTION);
   }
 
   // Import them
   PermissionsUtils.importFromPrefs(PREF_ROOT, TEST_PERM);
 
   // Get list of preferences to check
   let preferences = Services.prefs.getChildList(PREF_ROOT, {});
 
   // Check preferences were emptied
   for (let pref of preferences) {
     do_check_eq(Services.prefs.getCharPref(pref), "");
   }
 
   // Check they were imported into the permissions manager
   for (let url of whitelisted) {
-    let uri = Services.io.newURI(url, null, null);
+    let uri = Services.io.newURI(url);
     do_check_eq(Services.perms.testPermission(uri, TEST_PERM), Services.perms.ALLOW_ACTION);
   }
   for (let url of blacklisted) {
-    let uri = Services.io.newURI(url, null, null);
+    let uri = Services.io.newURI(url);
     do_check_eq(Services.perms.testPermission(uri, TEST_PERM), Services.perms.DENY_ACTION);
   }
   for (let url of untouched) {
-    let uri = Services.io.newURI(url, null, null);
+    let uri = Services.io.newURI(url);
     do_check_eq(Services.perms.testPermission(uri, TEST_PERM), Services.perms.UNKNOWN_ACTION);
   }
 }
--- a/toolkit/modules/tests/xpcshell/test_web_channel.js
+++ b/toolkit/modules/tests/xpcshell/test_web_channel.js
@@ -6,17 +6,17 @@
 var Cu = Components.utils;
 
 Cu.import("resource://gre/modules/Services.jsm");
 Cu.import("resource://gre/modules/WebChannel.jsm");
 
 const ERROR_ID_ORIGIN_REQUIRED = "WebChannel id and originOrPermission are required.";
 const VALID_WEB_CHANNEL_ID = "id";
 const URL_STRING = "http://example.com";
-const VALID_WEB_CHANNEL_ORIGIN = Services.io.newURI(URL_STRING, null, null);
+const VALID_WEB_CHANNEL_ORIGIN = Services.io.newURI(URL_STRING);
 const TEST_PERMISSION_NAME = "test-webchannel-permissions";
 
 var MockWebChannelBroker = {
   _channelMap: new Map(),
   registerChannel(channel) {
     if (!this._channelMap.has(channel)) {
       this._channelMap.set(channel);
     }
--- a/toolkit/modules/tests/xpcshell/test_web_channel_broker.js
+++ b/toolkit/modules/tests/xpcshell/test_web_channel_broker.js
@@ -5,17 +5,17 @@
 
 var Cu = Components.utils;
 
 Cu.import("resource://gre/modules/Services.jsm");
 Cu.import("resource://gre/modules/WebChannel.jsm");
 
 const VALID_WEB_CHANNEL_ID = "id";
 const URL_STRING = "http://example.com";
-const VALID_WEB_CHANNEL_ORIGIN = Services.io.newURI(URL_STRING, null, null);
+const VALID_WEB_CHANNEL_ORIGIN = Services.io.newURI(URL_STRING);
 
 function run_test() {
   run_next_test();
 }
 
 /**
  * Test WebChannelBroker channel map
  */
--- a/toolkit/mozapps/downloads/DownloadUtils.jsm
+++ b/toolkit/mozapps/downloads/DownloadUtils.jsm
@@ -409,17 +409,17 @@ this.DownloadUtils = {
     let eTLDService = Cc["@mozilla.org/network/effective-tld-service;1"].
                       getService(Ci.nsIEffectiveTLDService);
     let idnService = Cc["@mozilla.org/network/idn-service;1"].
                      getService(Ci.nsIIDNService);
 
     // Get a URI that knows about its components
     let uri;
     try {
-      uri = ioService.newURI(aURIString, null, null);
+      uri = ioService.newURI(aURIString);
     } catch (ex) {
       return ["", ""];
     }
 
     // Get the inner-most uri for schemes like jar:
     if (uri instanceof Ci.nsINestedURI)
       uri = uri.innermostURI;
 
--- a/toolkit/mozapps/extensions/AddonManager.jsm
+++ b/toolkit/mozapps/extensions/AddonManager.jsm
@@ -2990,17 +2990,17 @@ var AddonManagerInternal = {
       info.install.removeListener(info.listener);
       this.installs.delete(id);
     },
 
     createInstall(target, options) {
       // Throw an appropriate error if the given URL is not valid
       // as an installation source.  Return silently if it is okay.
       function checkInstallUrl(url) {
-        let host = Services.io.newURI(options.url, null, null).host;
+        let host = Services.io.newURI(options.url).host;
         if (WEBAPI_INSTALL_HOSTS.includes(host)) {
           return;
         }
         if (Services.prefs.getBoolPref(PREF_WEBAPI_TESTING)
             && WEBAPI_TEST_INSTALL_HOSTS.includes(host)) {
           return;
         }
 
--- a/toolkit/mozapps/extensions/amInstallTrigger.js
+++ b/toolkit/mozapps/extensions/amInstallTrigger.js
@@ -191,17 +191,17 @@ InstallTrigger.prototype = {
       name: item.name,
       icon: iconUrl ? iconUrl.spec : null,
     };
 
     return this._mediator.install(installData, this._principal, callback, this._window);
   },
 
   startSoftwareUpdate(url, flags) {
-    let filename = Services.io.newURI(url, null, null)
+    let filename = Services.io.newURI(url)
                               .QueryInterface(Ci.nsIURL)
                               .filename;
     let args = {};
     args[filename] = { "URL": url };
     return this.install(args);
   },
 
   installChrome(type, url, skin) {
--- a/toolkit/mozapps/extensions/content/extensions.js
+++ b/toolkit/mozapps/extensions/content/extensions.js
@@ -2137,17 +2137,17 @@ var gDiscoverView = {
       compatMode = "strict";
 
     var url = Services.prefs.getCharPref(PREF_DISCOVERURL);
     url = url.replace("%COMPATIBILITY_MODE%", compatMode);
     url = Services.urlFormatter.formatURL(url);
 
     let setURL = (aURL) => {
       try {
-        this.homepageURL = Services.io.newURI(aURL, null, null);
+        this.homepageURL = Services.io.newURI(aURL);
       } catch (e) {
         this.showError();
         notifyInitialized();
         return;
       }
 
       this._browser.homePage = this.homepageURL.spec;
       this._browser.addProgressListener(this);
--- a/toolkit/mozapps/extensions/internal/LightweightThemeImageOptimizer.jsm
+++ b/toolkit/mozapps/extensions/internal/LightweightThemeImageOptimizer.jsm
@@ -55,17 +55,17 @@ var ImageCropper = {
   getCroppedImageURL(aImageURL, aScreen, aOrigin) {
     // We can crop local files, only.
     if (!aImageURL.startsWith("file://")) {
       return aImageURL;
     }
 
     // Generate the cropped image's file name using its
     // base name and the current screen size.
-    let uri = Services.io.newURI(aImageURL, null, null);
+    let uri = Services.io.newURI(aImageURL);
     let file = uri.QueryInterface(Ci.nsIFileURL).file;
 
     // Make sure the source file exists.
     if (!file.exists()) {
       return aImageURL;
     }
 
     let fileName = file.leafName + "-" + aScreen.width + "x" + aScreen.height;
--- a/toolkit/mozapps/extensions/internal/XPIProvider.jsm
+++ b/toolkit/mozapps/extensions/internal/XPIProvider.jsm
@@ -2574,22 +2574,21 @@ this.XPIProvider = {
         }
         return aURI;
 
       case "chrome":
         aURI = ChromeRegistry.convertChromeURL(aURI);
         return this._resolveURIToFile(aURI);
 
       case "resource":
-        aURI = Services.io.newURI(ResProtocolHandler.resolveURI(aURI), null,
-                                  null);
+        aURI = Services.io.newURI(ResProtocolHandler.resolveURI(aURI));
         return this._resolveURIToFile(aURI);
 
       case "view-source":
-        aURI = Services.io.newURI(aURI.path, null, null);
+        aURI = Services.io.newURI(aURI.path);
         return this._resolveURIToFile(aURI);
 
       case "about":
         if (aURI.spec == "about:blank") {
           // Do not attempt to map about:blank
           return null;
         }
 
--- a/toolkit/mozapps/extensions/nsBlocklistService.js
+++ b/toolkit/mozapps/extensions/nsBlocklistService.js
@@ -188,17 +188,17 @@ function getPref(func, preference, defau
  * Constructs a URI to a spec.
  * @param   spec
  *          The spec to construct a URI to
  * @returns The nsIURI constructed.
  */
 function newURI(spec) {
   var ioServ = Cc["@mozilla.org/network/io-service;1"].
                getService(Ci.nsIIOService);
-  return ioServ.newURI(spec, null, null);
+  return ioServ.newURI(spec);
 }
 
 // Restarts the application checking in with observers first
 function restartApp() {
   // Notify all windows that an application quit has been requested.
   var os = Cc["@mozilla.org/observer-service;1"].
            getService(Ci.nsIObserverService);
   var cancelQuit = Cc["@mozilla.org/supports-PRBool;1"].
--- a/toolkit/mozapps/extensions/test/browser/browser_details.js
+++ b/toolkit/mozapps/extensions/test/browser/browser_details.js
@@ -61,17 +61,17 @@ function test() {
     version: "2.1",
     description: "Short description",
     fullDescription: "Longer description",
     type: "extension",
     iconURL: "chrome://foo/skin/icon.png",
     icon64URL: "chrome://foo/skin/icon64.png",
     contributionURL: "http://foo.com",
     contributionAmount: "$0.99",
-    sourceURI: Services.io.newURI("http://example.com/foo", null, null),
+    sourceURI: Services.io.newURI("http://example.com/foo"),
     averageRating: 4,
     reviewCount: 5,
     reviewURL: "http://example.com/reviews",
     homepageURL: "http://example.com/addon1",
     applyBackgroundUpdates: AddonManager.AUTOUPDATE_ENABLE
   }, {
     id: "addon2@tests.mozilla.org",
     name: "Test add-on 2",
@@ -90,17 +90,17 @@ function test() {
       height: 150
     }],
   }, {
     id: "addon3@tests.mozilla.org",
     name: "Test add-on 3",
     description: "Short description",
     creator: { name: "Mozilla", url: "http://www.mozilla.org" },
     type: "extension",
-    sourceURI: Services.io.newURI("http://example.com/foo", null, null),
+    sourceURI: Services.io.newURI("http://example.com/foo"),
     updateDate: gDate,
     reviewCount: 1,
     reviewURL: "http://example.com/reviews",
     applyBackgroundUpdates: AddonManager.AUTOUPDATE_DISABLE,
     isActive: false,
     isCompatible: false,
     appDisabled: true,
     permissions: AddonManager.PERM_CAN_ENABLE |
@@ -976,17 +976,17 @@ add_test(function() {
       id: "addon1@tests.mozilla.org",
       name: "Test add-on replacement",
       version: "2.5",
       description: "Short description replacement",
       fullDescription: "Longer description replacement",
       type: "extension",
       iconURL: "chrome://foo/skin/icon.png",
       icon64URL: "chrome://foo/skin/icon264.png",
-      sourceURI: Services.io.newURI("http://example.com/foo", null, null),
+      sourceURI: Services.io.newURI("http://example.com/foo"),
       averageRating: 2,
       optionsURL: "chrome://foo/content/options.xul",
       applyBackgroundUpdates: AddonManager.AUTOUPDATE_ENABLE,
       operationsRequiringRestart: AddonManager.OP_NEEDS_RESTART_NONE
     }]);
 
     is(get("detail-name").textContent, "Test add-on replacement", "Name should be correct");
     is_element_visible(get("detail-version"), "Version should not be hidden");
--- a/toolkit/mozapps/extensions/test/browser/browser_manualupdates.js
+++ b/toolkit/mozapps/extensions/test/browser/browser_manualupdates.js
@@ -68,17 +68,17 @@ add_test(function() {
     maybeRunNext();
   }, false);
 
   gCategoryUtilities.openType("extension", function() {
     gProvider.createInstalls([{
       name: "manually updating addon (new and improved!)",
       existingAddon: gProvider.addons[1],
       version: "1.1",
-      releaseNotesURI: Services.io.newURI(TESTROOT + "thereIsNoFileHere.xhtml", null, null)
+      releaseNotesURI: Services.io.newURI(TESTROOT + "thereIsNoFileHere.xhtml")
     }]);
 
     var item = get_addon_element(gManagerWindow, "addon2@tests.mozilla.org");
     get_tooltip_info(item).then(({ version }) => {
       is(version, "1.0", "Should still show the old version in the tooltip");
       maybeRunNext();
     });
   });
@@ -128,17 +128,17 @@ add_test(function() {
       is_element_visible(item._relNotesError, "Release notes error message should be visible");
       is(item._relNotes.childElementCount, 0, "Release notes should be empty");
 
       info("Closing release notes");
       item.addEventListener("RelNotesToggle", function() {
         item.removeEventListener("RelNotesToggle", arguments.callee, false);
         info("Release notes now closed");
         info("Setting Release notes URI to something that should load");
-        gProvider.installs[0].releaseNotesURI = Services.io.newURI(TESTROOT + "releaseNotes.xhtml", null, null)
+        gProvider.installs[0].releaseNotesURI = Services.io.newURI(TESTROOT + "releaseNotes.xhtml")
 
         info("Re-opening release notes");
         item.addEventListener("RelNotesToggle", function() {
           item.removeEventListener("RelNotesToggle", arguments.callee, false);
           info("Release notes now open");
 
           is_element_hidden(item._relNotesLoading, "Release notes loading message should be hidden");
           is_element_hidden(item._relNotesError, "Release notes error message should be hidden");
@@ -236,11 +236,11 @@ add_test(function() {
       aAddon.applyBackgroundUpdates = AddonManager.AUTOUPDATE_ENABLE;
     });
   }, false);
 
   gProvider.createInstalls([{
     name: "manually updating addon (new and even more improved!)",
     existingAddon: gProvider.addons[1],
     version: "1.2",
-    releaseNotesURI: Services.io.newURI(TESTROOT + "thereIsNoFileHere.xhtml", null, null)
+    releaseNotesURI: Services.io.newURI(TESTROOT + "thereIsNoFileHere.xhtml")
   }]);
 });
--- a/toolkit/mozapps/extensions/test/browser/browser_openDialog.js
+++ b/toolkit/mozapps/extensions/test/browser/browser_openDialog.js
@@ -16,17 +16,17 @@ var CustomChromeProtocol = {
   newURI: function CCP_newURI(aSpec, aOriginCharset, aBaseUri) {
     let uri = Cc["@mozilla.org/network/simple-uri;1"].
               createInstance(Ci.nsIURI);
     uri.spec = aSpec;
     return uri;
   },
 
   newChannel2: function CCP_newChannel2(aURI, aLoadInfo) {
-    let url = Services.io.newURI("chrome:" + aURI.path, null, null);
+    let url = Services.io.newURI("chrome:" + aURI.path);
     let ch = Services.io.newChannelFromURIWithLoadInfo(url, aLoadInfo);
     ch.originalURI = aURI;
     return ch;
   },
 
   newChannel: function CCP_newChannel(aURI) {
     return this.newChannel2(aURI, null);
   },
--- a/toolkit/mozapps/extensions/test/browser/browser_recentupdates.js
+++ b/toolkit/mozapps/extensions/test/browser/browser_recentupdates.js
@@ -13,17 +13,17 @@ function test() {
 
   gProvider = new MockProvider();
 
   gProvider.createAddons([{
     id: "addon1@tests.mozilla.org",
     name: "updated 6 hours ago",
     version: "1.0",
     updateDate: new Date(Date.now() - (1000 * 60 * 60 * 6)),
-    releaseNotesURI: Services.io.newURI(TESTROOT + "releaseNotes.xhtml", null, null)
+    releaseNotesURI: Services.io.newURI(TESTROOT + "releaseNotes.xhtml")
   }, {
     id: "addon2@tests.mozilla.org",
     name: "updated 5 seconds ago",
     version: "1.0",
     updateDate: new Date(Date.now() - (1000 * 5))
   }, {
     id: "addon3@tests.mozilla.org",
     name: "updated 1 month ago",
--- a/toolkit/mozapps/extensions/test/xpcshell/test_mapURIToAddonID.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/test_mapURIToAddonID.js
@@ -20,17 +20,17 @@ userExtDir.append(gAppInfo.ID);
 registerDirectory("XREUSysExt", userExtDir.parent);
 
 BootstrapMonitor.init();
 
 function TestProvider(result) {
   this.result = result;
 }
 TestProvider.prototype = {
-  uri: Services.io.newURI("hellow://world", null, null),
+  uri: Services.io.newURI("hellow://world"),
   id: "valid@id",
   startup() {},
   shutdown() {},
   mapURIToAddonID(aURI) {
     if (aURI.spec === this.uri.spec) {
       return this.id;
     }
     throw Components.Exception("Not mapped", this.result);
--- a/toolkit/mozapps/handling/content/dialog.js
+++ b/toolkit/mozapps/handling/content/dialog.js
@@ -115,17 +115,17 @@ var dialog = {
       elm.setAttribute("name", app.name);
       elm.obj = app;
 
       if (app instanceof Ci.nsILocalHandlerApp) {
         // See if we have an nsILocalHandlerApp and set the icon
         let uri = ios.newFileURI(app.executable);
         elm.setAttribute("image", "moz-icon://" + uri.spec + "?size=32");
       } else if (app instanceof Ci.nsIWebHandlerApp) {
-        let uri = ios.newURI(app.uriTemplate, null, null);
+        let uri = ios.newURI(app.uriTemplate);
         if (/^https?/.test(uri.scheme)) {
           // Unfortunately we can't use the favicon service to get the favicon,
           // because the service looks for a record with the exact URL we give
           // it, and users won't have such records for URLs they don't visit,
           // and users won't visit the handler's URL template, they'll only
           // visit URLs derived from that template (i.e. with %s in the template
           // replaced by the URL of the content being handled).
           elm.setAttribute("image", uri.prePath + "/favicon.ico");
--- a/toolkit/mozapps/installer/precompile_cache.js
+++ b/toolkit/mozapps/installer/precompile_cache.js
@@ -73,15 +73,15 @@ function load_modules_under(spec, uri) {
     try {
       dump(spec + entry + "\n");
       Cu.import(spec + entry, null);
     } catch (e) {}
   }
 }
 
 function resolveResource(spec) {
-  var uri = Services.io.newURI(spec, null, null);
-  return Services.io.newURI(rph.resolveURI(uri), null, null);
+  var uri = Services.io.newURI(spec);
+  return Services.io.newURI(rph.resolveURI(uri));
 }
 
 function precompile_startupcache(uri) {
   load_modules_under(uri, resolveResource(uri));
 }
--- a/toolkit/mozapps/update/nsUpdateService.js
+++ b/toolkit/mozapps/update/nsUpdateService.js
@@ -3816,17 +3816,17 @@ Downloader.prototype = {
         }
       }
     }
 
     update.QueryInterface(Ci.nsIPropertyBag);
     let interval = this.background ? update.getProperty("backgroundInterval")
                                    : DOWNLOAD_FOREGROUND_INTERVAL;
 
-    var uri = Services.io.newURI(this._patch.URL, null, null);
+    var uri = Services.io.newURI(this._patch.URL);
     LOG("Downloader:downloadUpdate - url: " + uri.spec + ", path: " +
         patchFile.path + ", interval: " + interval);
 
     this._request = Cc["@mozilla.org/network/incremental-download;1"].
                     createInstance(Ci.nsIIncrementalDownload);
     this._request.init(uri, patchFile, DOWNLOAD_CHUNK_SIZE, interval);
     this._request.start(this, null);