Bug 1329182 - remove trailing newURI null parameters in browser/, r=jaws.
authorFlorian Quèze <florian@queze.net>
Mon, 09 Jan 2017 20:27:25 +0100
changeset 328551 3e0d77afb2e0
parent 328550 35cb8eb1856d
child 328552 ae4a26954062
push id85477
push userflorian@queze.net
push dateMon, 09 Jan 2017 19:28:21 +0000
treeherdermozilla-inbound@79c7e3434630 [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 browser/, r=jaws.
browser/base/content/abouthealthreport/abouthealth.js
browser/base/content/browser-social.js
browser/base/content/browser-trackingprotection.js
browser/base/content/browser.js
browser/base/content/newtab/sites.js
browser/base/content/pageinfo/pageInfo.js
browser/base/content/tab-content.js
browser/base/content/test/general/browser_aboutCertError.js
browser/base/content/test/general/browser_blockHPKP.js
browser/base/content/test/general/browser_bug578534.js
browser/base/content/test/general/browser_fxa_web_channel.js
browser/base/content/test/general/browser_gZipOfflineChild.js
browser/base/content/test/general/browser_offlineQuotaNotification.js
browser/base/content/test/general/browser_parsable_css.js
browser/base/content/test/general/browser_remoteTroubleshoot.js
browser/base/content/test/general/browser_web_channel.js
browser/base/content/test/general/parsingTestHelpers.jsm
browser/base/content/test/social/head.js
browser/base/content/test/urlbar/browser_bug623155.js
browser/base/content/test/webrtc/browser_devices_get_user_media_in_frame.js
browser/base/content/utilityOverlay.js
browser/components/contextualidentity/test/browser/browser_aboutURLs.js
browser/components/contextualidentity/test/browser/browser_forgetaboutsite.js
browser/components/distribution.js
browser/components/downloads/content/allDownloadsViewOverlay.js
browser/components/extensions/ext-contextMenus.js
browser/components/extensions/ext-tabs.js
browser/components/feeds/FeedConverter.js
browser/components/feeds/FeedWriter.js
browser/components/feeds/test/unit/test_355473.js
browser/components/feeds/test/unit/test_758990.js
browser/components/migration/EdgeProfileMigrator.js
browser/components/migration/MSMigrationUtils.jsm
browser/components/migration/tests/unit/test_IE7_passwords.js
browser/components/migration/tests/unit/test_automigration.js
browser/components/newtab/NewTabWebChannel.jsm
browser/components/newtab/PlacesProvider.jsm
browser/components/originattributes/test/browser/browser_permissions.js
browser/components/places/tests/browser/browser_410196_paste_into_tags.js
browser/components/places/tests/unit/test_clearHistory_shutdown.js
browser/components/preferences/SiteDataManager.jsm
browser/components/preferences/in-content/advanced.js
browser/components/preferences/in-content/applications.js
browser/components/preferences/in-content/tests/browser_bug705422.js
browser/components/preferences/in-content/tests/browser_cookies_exceptions.js
browser/components/preferences/permissions.js
browser/components/privatebrowsing/test/browser/browser_privatebrowsing_DownloadLastDirWithCPS.js
browser/components/privatebrowsing/test/browser/browser_privatebrowsing_downloadLastDir.js
browser/components/privatebrowsing/test/browser/browser_privatebrowsing_placesTitleNoUpdate.js
browser/components/search/test/browser_contextmenu.js
browser/components/sessionstore/SessionStorage.jsm
browser/components/sessionstore/content/content-sessionStore.js
browser/components/sessionstore/test/browser_491168.js
browser/components/sessionstore/test/browser_parentProcessRestoreHash.js
browser/components/uitour/content-UITour.js
browser/components/uitour/test/browser_no_tabs.js
browser/components/uitour/test/head.js
browser/extensions/flyweb/bootstrap.js
browser/extensions/pdfjs/content/PdfStreamConverter.jsm
browser/extensions/pocket/bootstrap.js
browser/extensions/pocket/content/AboutPocket.jsm
browser/modules/ContentClick.jsm
browser/modules/DirectoryLinksProvider.jsm
browser/modules/E10SUtils.jsm
browser/modules/LaterRun.jsm
browser/modules/PluginContent.jsm
browser/modules/SocialService.jsm
browser/modules/WindowsJumpLists.jsm
browser/modules/test/browser_SelfSupportBackend.js
browser/modules/test/unit/social/test_SocialService.js
browser/modules/test/xpcshell/test_SitePermissions.js
browser/modules/webrtcUI.jsm
browser/tools/mozscreenshots/head.js
browser/tools/mozscreenshots/mozscreenshots/extension/configurations/ControlCenter.jsm
--- a/browser/base/content/abouthealthreport/abouthealth.js
+++ b/browser/base/content/abouthealthreport/abouthealth.js
@@ -23,17 +23,17 @@ var healthReportWrapper = {
   },
 
   uninit() {
     prefs.ignore("uploadEnabled", this.updatePrefState, healthReportWrapper);
   },
 
   _getReportURI() {
     let url = Services.urlFormatter.formatURLPref(PREF_REPORTING_URL);
-    return Services.io.newURI(url, null, null);
+    return Services.io.newURI(url);
   },
 
   setDataSubmission(enabled) {
     MozSelfSupport.healthReportDataSubmissionEnabled = enabled;
     this.updatePrefState();
   },
 
   updatePrefState() {
--- a/browser/base/content/browser-social.js
+++ b/browser/base/content/browser-social.js
@@ -389,17 +389,17 @@ SocialShare = {
     let iframe = this.iframe;
 
     // graphData is an optional param that either defines the full set of data
     // to be shared, or partial data about the current page. It is set by a call
     // in mozSocial API, or via nsContentMenu calls. If it is present, it MUST
     // define at least url. If it is undefined, we're sharing the current url in
     // the browser tab.
     let pageData = graphData ? graphData : this.currentShare;
-    let sharedURI = pageData ? Services.io.newURI(pageData.url, null, null) :
+    let sharedURI = pageData ? Services.io.newURI(pageData.url) :
                                 gBrowser.currentURI;
     if (!SocialUI.canSharePage(sharedURI))
       return;
 
     let browserMM = gBrowser.selectedBrowser.messageManager;
 
     // the point of this action type is that we can use existing share
     // endpoints (e.g. oexchange) that do not support additional
@@ -469,17 +469,17 @@ SocialShare = {
     } else {
       iframe.parentNode.setAttribute("loading", "true");
     }
     // if the user switched between share providers we do not want that history
     // available.
     iframe.purgeSessionHistory();
 
     // always ensure that origin belongs to the endpoint
-    let uri = Services.io.newURI(shareEndpoint, null, null);
+    let uri = Services.io.newURI(shareEndpoint);
     iframe.setAttribute("origin", provider.origin);
     iframe.setAttribute("src", shareEndpoint);
     this._openPanel(anchor);
   },
 
   showDirectory: function(anchor) {
     this._createFrame();
     let iframe = this.iframe;
--- a/browser/base/content/browser-trackingprotection.js
+++ b/browser/base/content/browser-trackingprotection.js
@@ -136,18 +136,17 @@ var TrackingProtection = {
     this.eventsHistogramAdd(0);
   },
 
   disableForCurrentPage() {
     // Convert document URI into the format used by
     // nsChannelClassifier::ShouldEnableTrackingProtection.
     // Any scheme turned into https is correct.
     let normalizedUrl = Services.io.newURI(
-      "https://" + gBrowser.selectedBrowser.currentURI.hostPort,
-      null, null);
+      "https://" + gBrowser.selectedBrowser.currentURI.hostPort);
 
     // Add the current host in the 'trackingprotection' consumer of
     // the permission manager using a normalized URI. This effectively
     // places this host on the tracking protection allowlist.
     if (PrivateBrowsingUtils.isBrowserPrivate(gBrowser.selectedBrowser)) {
       PrivateBrowsingUtils.addToTrackingAllowlist(normalizedUrl);
     } else {
       Services.perms.add(normalizedUrl,
@@ -163,18 +162,17 @@ var TrackingProtection = {
     BrowserReload();
   },
 
   enableForCurrentPage() {
     // Remove the current host from the 'trackingprotection' consumer
     // of the permission manager. This effectively removes this host
     // from the tracking protection allowlist.
     let normalizedUrl = Services.io.newURI(
-      "https://" + gBrowser.selectedBrowser.currentURI.hostPort,
-      null, null);
+      "https://" + gBrowser.selectedBrowser.currentURI.hostPort);
 
     if (PrivateBrowsingUtils.isBrowserPrivate(gBrowser.selectedBrowser)) {
       PrivateBrowsingUtils.removeFromTrackingAllowlist(normalizedUrl);
     } else {
       Services.perms.remove(normalizedUrl, "trackingprotection");
     }
 
     // Telemetry for enable protection.
--- a/browser/base/content/browser.js
+++ b/browser/base/content/browser.js
@@ -3270,17 +3270,17 @@ function getDetailedCertErrorInfo(locati
   const sss = Cc["@mozilla.org/ssservice;1"]
                  .getService(Ci.nsISiteSecurityService);
   // SiteSecurityService uses different storage if the channel is
   // private. Thus we must give isSecureHost correct flags or we
   // might get incorrect results.
   let flags = PrivateBrowsingUtils.isWindowPrivate(window) ?
               Ci.nsISocketProvider.NO_PERMANENT_STORAGE : 0;
 
-  let uri = Services.io.newURI(location, null, null);
+  let uri = Services.io.newURI(location);
 
   let hasHSTS = sss.isSecureHost(sss.HEADER_HSTS, uri.host, flags);
   let hasHPKP = sss.isSecureHost(sss.HEADER_HPKP, uri.host, flags);
   certErrorDetails += "\r\n\r\n" +
                       gNavigatorBundle.getFormattedString("certErrorDetailsHSTS.label",
                                                           [hasHSTS]);
   certErrorDetails += "\r\n" +
                       gNavigatorBundle.getFormattedString("certErrorDetailsKeyPinning.label",
@@ -6040,17 +6040,17 @@ var OfflineApps = {
         groups = cacheService.getGroups();
       } catch (ex) {
         return 0;
       }
     }
 
     let usage = 0;
     for (let group of groups) {
-      let uri = Services.io.newURI(group, null, null);
+      let uri = Services.io.newURI(group);
       if (uri.asciiHost == host) {
         let cache = cacheService.getActiveCache(group);
         usage += cache.usage;
       }
     }
 
     return usage;
   },
@@ -7711,17 +7711,17 @@ function switchToTabHavingURI(aURI, aOpe
         return true;
       }
     }
     return false;
   }
 
   // This can be passed either nsIURI or a string.
   if (!(aURI instanceof Ci.nsIURI))
-    aURI = Services.io.newURI(aURI, null, null);
+    aURI = Services.io.newURI(aURI);
 
   let isBrowserWindow = !!window.gBrowser;
 
   // Prioritise this window.
   if (isBrowserWindow && switchIfURIInWindow(window))
     return true;
 
   for (let browserWin of browserWindows()) {
--- a/browser/base/content/newtab/sites.js
+++ b/browser/base/content/newtab/sites.js
@@ -147,17 +147,17 @@ Site.prototype = {
 
   /**
    * Checks for and modifies link at campaign end time
    */
   _checkLinkEndTime: function Site_checkLinkEndTime() {
     if (this.link.endTime && this.link.endTime < Date.now()) {
        let oldUrl = this.url;
        // chop off the path part from url
-       this.link.url = Services.io.newURI(this.url, null, null).resolve("/");
+       this.link.url = Services.io.newURI(this.url).resolve("/");
        // clear supplied images - this triggers thumbnail download for new url
        delete this.link.imageURI;
        delete this.link.enhancedImageURI;
        // remove endTime to avoid further time checks
        delete this.link.endTime;
        // clear enhanced-content image that may still exist in preloaded page
        this._querySelector(".enhanced-content").style.backgroundImage = "";
        gPinnedLinks.replace(oldUrl, this.link);
@@ -304,17 +304,17 @@ Site.prototype = {
     this._ignoreHoverEvents(suggested);
   },
 
   /**
    * Speculatively opens a connection to the current site.
    */
   _speculativeConnect: function Site_speculativeConnect() {
     let sc = Services.io.QueryInterface(Ci.nsISpeculativeConnect);
-    let uri = Services.io.newURI(this.url, null, null);
+    let uri = Services.io.newURI(this.url);
     try {
       // This can throw for certain internal URLs, when they wind up in
       // about:newtab. Be sure not to propagate the error.
       sc.speculativeConnect(uri, null);
     } catch (e) {}
   },
 
   /**
--- a/browser/base/content/pageinfo/pageInfo.js
+++ b/browser/base/content/pageinfo/pageInfo.js
@@ -496,17 +496,17 @@ function openCacheEntry(key, cb) {
   var checkCacheListener = {
     onCacheEntryCheck(entry, appCache) {
       return Components.interfaces.nsICacheEntryOpenCallback.ENTRY_WANTED;
     },
     onCacheEntryAvailable(entry, isNew, appCache, status) {
       cb(entry);
     }
   };
-  diskStorage.asyncOpenURI(Services.io.newURI(key, null, null), "", nsICacheStorage.OPEN_READONLY, checkCacheListener);
+  diskStorage.asyncOpenURI(Services.io.newURI(key), "", nsICacheStorage.OPEN_READONLY, checkCacheListener);
 }
 
 function makeGeneralTab(metaViewRows, docInfo) {
   var title = (docInfo.title) ? docInfo.title : gBundle.getString("noPageTitle");
   document.getElementById("titletext").value = title;
 
   var url = docInfo.location;
   setItemValue("urltext", url);
--- a/browser/base/content/tab-content.js
+++ b/browser/base/content/tab-content.js
@@ -534,17 +534,17 @@ var PageStyleHandler = {
         }
       }
 
       let URI;
       try {
         if (!currentStyleSheet.ownerNode ||
             // special-case style nodes, which have no href
             currentStyleSheet.ownerNode.nodeName.toLowerCase() != "style") {
-          URI = Services.io.newURI(currentStyleSheet.href, null, null);
+          URI = Services.io.newURI(currentStyleSheet.href);
         }
       } catch (e) {
         if (e.result != Cr.NS_ERROR_MALFORMED_URI) {
           throw e;
         }
         continue;
       }
 
--- a/browser/base/content/test/general/browser_aboutCertError.js
+++ b/browser/base/content/test/general/browser_aboutCertError.js
@@ -282,17 +282,17 @@ add_task(function* checkAdvancedDetailsF
     return {
       ecTextContent: ec.textContent,
       ecTagName: ec.tagName,
       cdlTextContent: cdl.textContent,
       cdlTagName: cdl.tagName
     };
   });
 
-  const badStsUri = Services.io.newURI(BAD_STS_CERT, null, null);
+  const badStsUri = Services.io.newURI(BAD_STS_CERT);
   is(message.ecTextContent, "SSL_ERROR_BAD_CERT_DOMAIN",
      "Correct error message found");
   is(message.ecTagName, "a", "Error message is a link");
   const url = badStsUri.prePath.slice(badStsUri.prePath.indexOf(".") + 1);
   is(message.cdlTextContent, url,
      "Correct cert_domain_link contents found");
   is(message.cdlTagName, "a", "cert_domain_link is a link");
 
--- a/browser/base/content/test/general/browser_blockHPKP.js
+++ b/browser/base/content/test/general/browser_blockHPKP.js
@@ -36,17 +36,17 @@ function test() {
   waitForExplicitFinish();
   // Enable enforcing strict pinning and processing headers from
   // non-builtin roots.
   Services.prefs.setIntPref(kpkpEnforcementPref, 2);
   Services.prefs.setBoolPref(khpkpPinninEnablePref, true);
   registerCleanupFunction(function() {
     Services.prefs.clearUserPref(kpkpEnforcementPref);
     Services.prefs.clearUserPref(khpkpPinninEnablePref);
-    let uri = gIOService.newURI("https://" + kPinningDomain, null, null);
+    let uri = gIOService.newURI("https://" + kPinningDomain);
     gSSService.removeState(Ci.nsISiteSecurityService.HEADER_HPKP, uri, 0);
   });
   whenNewTabLoaded(window, loadPinningPage);
 }
 
 // Start by making a successful connection to a domain that will pin a site
 function loadPinningPage() {
 
--- a/browser/base/content/test/general/browser_bug578534.js
+++ b/browser/base/content/test/general/browser_bug578534.js
@@ -1,16 +1,16 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 function test() {
   let uriString = "http://example.com/";
   let cookieBehavior = "network.cookie.cookieBehavior";
-  let uriObj = Services.io.newURI(uriString, null, null)
+  let uriObj = Services.io.newURI(uriString)
   let cp = Components.classes["@mozilla.org/cookie/permission;1"]
                      .getService(Components.interfaces.nsICookiePermission);
 
   Services.prefs.setIntPref(cookieBehavior, 2);
 
   cp.setAccess(uriObj, cp.ACCESS_ALLOW);
   gBrowser.selectedTab = gBrowser.addTab(uriString);
   waitForExplicitFinish();
--- a/browser/base/content/test/general/browser_fxa_web_channel.js
+++ b/browser/base/content/test/general/browser_fxa_web_channel.js
@@ -81,17 +81,17 @@ var gTests = [
   },
   {
     desc: "fxa web channel - can_link_account messages should respond",
     *run() {
       let properUrl = TEST_BASE_URL + "?can_link_account";
 
       let promiseEcho = new Promise((resolve, reject) => {
 
-        let webChannelOrigin = Services.io.newURI(properUrl, null, null);
+        let webChannelOrigin = Services.io.newURI(properUrl);
         // responses sent to content are echoed back over the
         // `fxaccounts_webchannel_response_echo` channel. Ensure the
         // fxaccounts:can_link_account message is responded to.
         let echoWebChannel = new WebChannel('fxaccounts_webchannel_response_echo', webChannelOrigin);
         echoWebChannel.listen((webChannelId, message, target) => {
           Assert.equal(message.command, 'fxaccounts:can_link_account');
           Assert.equal(message.messageId, 2);
           Assert.equal(message.data.ok, true);
--- a/browser/base/content/test/general/browser_gZipOfflineChild.js
+++ b/browser/base/content/test/general/browser_gZipOfflineChild.js
@@ -2,17 +2,17 @@
  * Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/
  */
 
 const URL = "http://mochi.test:8888/browser/browser/base/content/test/general/test_offline_gzip.html"
 
 registerCleanupFunction(function() {
   // Clean up after ourself
-  let uri = Services.io.newURI(URL, null, null);
+  let uri = Services.io.newURI(URL);
   let principal = Services.scriptSecurityManager.createCodebasePrincipal(uri, {});
   Services.perms.removeFromPrincipal(principal, "offline-app");
   Services.prefs.clearUserPref("offline-apps.allow_by_default");
 });
 
 var cacheCount = 0;
 var intervalID = 0;
 
--- a/browser/base/content/test/general/browser_offlineQuotaNotification.js
+++ b/browser/base/content/test/general/browser_offlineQuotaNotification.js
@@ -5,17 +5,17 @@
 
 // Test offline quota warnings - must be run as a mochitest-browser test or
 // else the test runner gets in the way of notifications due to bug 857897.
 
 const URL = "http://mochi.test:8888/browser/browser/base/content/test/general/offlineQuotaNotification.html";
 
 registerCleanupFunction(function() {
   // Clean up after ourself
-  let uri = Services.io.newURI(URL, null, null);
+  let uri = Services.io.newURI(URL);
   let principal = Services.scriptSecurityManager.createCodebasePrincipal(uri, {});
   Services.perms.removeFromPrincipal(principal, "offline-app");
   Services.prefs.clearUserPref("offline-apps.quota.warn");
   Services.prefs.clearUserPref("offline-apps.allow_by_default");
   let {OfflineAppCacheHelper} = Components.utils.import("resource:///modules/offlineAppCache.jsm", {});
   OfflineAppCacheHelper.clear();
 });
 
--- a/browser/base/content/test/general/browser_parsable_css.js
+++ b/browser/base/content/test/general/browser_parsable_css.js
@@ -127,17 +127,17 @@ function fetchFile(uri) {
 }
 
 var gChromeReg = Cc["@mozilla.org/chrome/chrome-registry;1"]
                  .getService(Ci.nsIChromeRegistry);
 var gChromeMap = new Map();
 
 function getBaseUriForChromeUri(chromeUri) {
   let chromeFile = chromeUri + "gobbledygooknonexistentfile.reallynothere";
-  let uri = Services.io.newURI(chromeFile, null, null);
+  let uri = Services.io.newURI(chromeFile);
   let fileUri = gChromeReg.convertChromeURL(uri);
   return fileUri.resolve(".");
 }
 
 function parseManifest(manifestUri) {
   return fetchFile(manifestUri.spec).then(data => {
     for (let line of data.split('\n')) {
       let [type, ...argv] = line.split(/\s+/);
@@ -163,17 +163,17 @@ function convertToChromeUri(fileUri) {
       info(`File not accessible from chrome protocol: ${fileUri.path}`);
       return fileUri;
     }
     path = baseUri.slice(slashPos + 1) + path;
     baseUri = baseUri.slice(0, slashPos + 1);
     if (gChromeMap.has(baseUri)) {
       let chromeBaseUri = gChromeMap.get(baseUri);
       let chromeUri = `${chromeBaseUri}${path}`;
-      return Services.io.newURI(chromeUri, null, null);
+      return Services.io.newURI(chromeUri);
     }
   }
 }
 
 function messageIsCSSError(msg) {
   // Only care about CSS errors generated by our iframe:
   if ((msg instanceof Ci.nsIScriptError) &&
       msg.category.includes("CSS") &&
@@ -210,17 +210,17 @@ function processCSSRules(sheet) {
 
     for (let url of urls) {
       // Remove the url(" prefix and the ") suffix.
       url = url.replace(/url\("(.*)"\)/, "$1");
       if (url.startsWith("data:"))
         continue;
 
       // Make the url absolute and remove the ref.
-      let baseURI = Services.io.newURI(rule.parentStyleSheet.href, null, null);
+      let baseURI = Services.io.newURI(rule.parentStyleSheet.href);
       url = Services.io.newURI(url, null, baseURI).specIgnoringRef;
 
       // Store the image url along with the css file referencing it.
       let baseUrl = baseURI.spec.split("?always-parse-css")[0];
       if (!imageURIsToReferencesMap.has(url)) {
         imageURIsToReferencesMap.set(url, new Set([baseUrl]));
       } else {
         imageURIsToReferencesMap.get(url).add(baseUrl);
--- a/browser/base/content/test/general/browser_remoteTroubleshoot.js
+++ b/browser/base/content/test/general/browser_remoteTroubleshoot.js
@@ -1,18 +1,18 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 var {WebChannel} = Cu.import("resource://gre/modules/WebChannel.jsm", {});
 
 const TEST_URL_TAIL = "example.com/browser/browser/base/content/test/general/test_remoteTroubleshoot.html"
-const TEST_URI_GOOD = Services.io.newURI("https://" + TEST_URL_TAIL, null, null);
-const TEST_URI_BAD = Services.io.newURI("http://" + TEST_URL_TAIL, null, null);
-const TEST_URI_GOOD_OBJECT = Services.io.newURI("https://" + TEST_URL_TAIL + "?object", null, null);
+const TEST_URI_GOOD = Services.io.newURI("https://" + TEST_URL_TAIL);
+const TEST_URI_BAD = Services.io.newURI("http://" + TEST_URL_TAIL);
+const TEST_URI_GOOD_OBJECT = Services.io.newURI("https://" + TEST_URL_TAIL + "?object");
 
 // Creates a one-shot web-channel for the test data to be sent back from the test page.
 function promiseChannelResponse(channelID, originOrPermission) {
   return new Promise((resolve, reject) => {
     let channel = new WebChannel(channelID, originOrPermission);
     channel.listen((id, data, target) => {
       channel.stopListening();
       resolve(data);
--- a/browser/base/content/test/general/browser_web_channel.js
+++ b/browser/base/content/test/general/browser_web_channel.js
@@ -20,34 +20,34 @@ requestLongerTimeout(2); // timeouts in 
 // as much as possible.  (We only have that since we can't run browser chrome
 // tests on Android.  Yet?)
 var gTests = [
   {
     desc: "WebChannel generic message",
     *run() {
       return new Promise(function(resolve, reject) {
         let tab;
-        let channel = new WebChannel("generic", Services.io.newURI(HTTP_PATH, null, null));
+        let channel = new WebChannel("generic", Services.io.newURI(HTTP_PATH));
         channel.listen(function(id, message, target) {
           is(id, "generic");
           is(message.something.nested, "hello");
           channel.stopListening();
           gBrowser.removeTab(tab);
           resolve();
         });
 
         tab = gBrowser.addTab(HTTP_PATH + HTTP_ENDPOINT + "?generic");
       });
     }
   },
   {
     desc: "WebChannel generic message in a private window.",
     *run() {
       let promiseTestDone = new Promise(function(resolve, reject) {
-        let channel = new WebChannel("generic", Services.io.newURI(HTTP_PATH, null, null));
+        let channel = new WebChannel("generic", Services.io.newURI(HTTP_PATH));
         channel.listen(function(id, message, target) {
           is(id, "generic");
           is(message.something.nested, "hello");
           channel.stopListening();
           resolve();
         });
       });
 
@@ -58,17 +58,17 @@ var gTests = [
       yield BrowserTestUtils.closeWindow(privateWindow);
     }
   },
   {
     desc: "WebChannel two way communication",
     *run() {
       return new Promise(function(resolve, reject) {
         let tab;
-        let channel = new WebChannel("twoway", Services.io.newURI(HTTP_PATH, null, null));
+        let channel = new WebChannel("twoway", Services.io.newURI(HTTP_PATH));
 
         channel.listen(function(id, message, sender) {
           is(id, "twoway", "bad id");
           ok(message.command, "command not ok");
 
           if (message.command === "one") {
             channel.send({ data: { nested: true } }, sender);
           }
@@ -83,18 +83,18 @@ var gTests = [
 
         tab = gBrowser.addTab(HTTP_PATH + HTTP_ENDPOINT + "?twoway");
       });
     }
   },
   {
     desc: "WebChannel two way communication in an iframe",
     *run() {
-      let parentChannel = new WebChannel("echo", Services.io.newURI(HTTP_PATH, null, null));
-      let iframeChannel = new WebChannel("twoway", Services.io.newURI(HTTP_IFRAME_PATH, null, null));
+      let parentChannel = new WebChannel("echo", Services.io.newURI(HTTP_PATH));
+      let iframeChannel = new WebChannel("twoway", Services.io.newURI(HTTP_IFRAME_PATH));
       let promiseTestDone = new Promise(function(resolve, reject) {
         parentChannel.listen(function(id, message, sender) {
           reject(new Error("WebChannel message incorrectly sent to parent"));
         });
 
         iframeChannel.listen(function(id, message, sender) {
           is(id, "twoway", "bad id (2)");
           ok(message.command, "command not ok (2)");
@@ -140,18 +140,18 @@ var gTests = [
        *    WebChannel does not perform a valid origin check, the response
        *    will be received by origin B. If the WebChannel does perform
        *    a valid origin check, the response will not be sent.
        * 6. the test parent sends a `done` message to origin B, which origin
        *    B echoes back. If the response to origin A is not echoed but
        *    the message to origin B is, then hooray, the test passes.
        */
 
-      let preRedirectChannel = new WebChannel("pre_redirect", Services.io.newURI(HTTP_IFRAME_PATH, null, null));
-      let postRedirectChannel = new WebChannel("post_redirect", Services.io.newURI(HTTP_REDIRECTED_IFRAME_PATH, null, null));
+      let preRedirectChannel = new WebChannel("pre_redirect", Services.io.newURI(HTTP_IFRAME_PATH));
+      let postRedirectChannel = new WebChannel("post_redirect", Services.io.newURI(HTTP_REDIRECTED_IFRAME_PATH));
 
       let promiseTestDone = new Promise(function(resolve, reject) {
         preRedirectChannel.listen(function(id, message, preRedirectSender) {
           if (message.command === "redirecting") {
 
             postRedirectChannel.listen(function(aId, aMessage, aPostRedirectSender) {
               is(aId, "post_redirect");
               isnot(aMessage.command, "no_response_expected");
@@ -183,32 +183,32 @@ var gTests = [
       });
     }
   },
   {
     desc: "WebChannel multichannel",
     *run() {
       return new Promise(function(resolve, reject) {
         let tab;
-        let channel = new WebChannel("multichannel", Services.io.newURI(HTTP_PATH, null, null));
+        let channel = new WebChannel("multichannel", Services.io.newURI(HTTP_PATH));
 
         channel.listen(function(id, message, sender) {
           is(id, "multichannel");
           gBrowser.removeTab(tab);
           resolve();
         });
 
         tab = gBrowser.addTab(HTTP_PATH + HTTP_ENDPOINT + "?multichannel");
       });
     }
   },
   {
     desc: "WebChannel unsolicited send, using system principal",
     *run() {
-      let channel = new WebChannel("echo", Services.io.newURI(HTTP_PATH, null, null));
+      let channel = new WebChannel("echo", Services.io.newURI(HTTP_PATH));
 
       // an unsolicted message is sent from Chrome->Content which is then
       // echoed back. If the echo is received here, then the content
       // received the message.
       let messagePromise = new Promise(function(resolve, reject) {
         channel.listen(function(id, message, sender) {
           is(id, "echo");
           is(message.command, "unsolicited");
@@ -228,17 +228,17 @@ var gTests = [
         yield messagePromise;
         channel.stopListening();
       });
     }
   },
   {
     desc: "WebChannel unsolicited send, using target origin's principal",
     *run() {
-      let targetURI = Services.io.newURI(HTTP_PATH, null, null);
+      let targetURI = Services.io.newURI(HTTP_PATH);
       let channel = new WebChannel("echo", targetURI);
 
       // an unsolicted message is sent from Chrome->Content which is then
       // echoed back. If the echo is received here, then the content
       // received the message.
       let messagePromise = new Promise(function(resolve, reject) {
         channel.listen(function(id, message, sender) {
           is(id, "echo");
@@ -261,17 +261,17 @@ var gTests = [
         yield messagePromise;
         channel.stopListening();
       });
     }
   },
   {
     desc: "WebChannel unsolicited send with principal mismatch",
     *run() {
-      let targetURI = Services.io.newURI(HTTP_PATH, null, null);
+      let targetURI = Services.io.newURI(HTTP_PATH);
       let channel = new WebChannel("echo", targetURI);
 
       // two unsolicited messages are sent from Chrome->Content. The first,
       // `unsolicited_no_response_expected` is sent to the wrong principal
       // and should not be echoed back. The second, `done`, is sent to the
       // correct principal and should be echoed back.
       let messagePromise = new Promise(function(resolve, reject) {
         channel.listen(function(id, message, sender) {
@@ -285,17 +285,17 @@ var gTests = [
         });
       });
 
       yield BrowserTestUtils.withNewTab({
         gBrowser,
         url: HTTP_PATH + HTTP_ENDPOINT + "?unsolicited"
       }, function* (targetBrowser) {
 
-        let mismatchURI = Services.io.newURI(HTTP_MISMATCH_PATH, null, null);
+        let mismatchURI = Services.io.newURI(HTTP_MISMATCH_PATH);
         let mismatchPrincipal = Services.scriptSecurityManager.getNoAppCodebasePrincipal(mismatchURI);
 
         // send a message to the wrong principal. It should not be delivered
         // to content, and should not be echoed back.
         channel.send({ command: "unsolicited_no_response_expected" }, {
           browser: targetBrowser,
           principal: mismatchPrincipal
         });
@@ -322,17 +322,17 @@ var gTests = [
        * sent to non-window elements.
        *
        * First wait for the non-window element to send a "start" message.
        * Then send the non-window element a "done" message.
        * The non-window element will echo the "done" message back, if it
        * receives the message.
        * Listen for the response. If received, good to go!
        */
-      let channel = new WebChannel("not_a_window", Services.io.newURI(HTTP_PATH, null, null));
+      let channel = new WebChannel("not_a_window", Services.io.newURI(HTTP_PATH));
 
       let testDonePromise = new Promise(function(resolve, reject) {
         channel.listen(function(id, message, sender) {
           if (message.command === "start") {
             channel.send({ command: "done" }, sender);
           } else if (message.command === "done") {
             resolve();
           } else {
@@ -355,17 +355,17 @@ var gTests = [
     *run() {
       /**
        * This test ensures that non-string messages can't be sent via WebChannels.
        * We create a page (on a non-whitelisted origin) which should send us two
        * messages immediately. The first message has an object for it's detail,
        * and the second has a string. We check that we only get the second
        * message.
        */
-      let channel = new WebChannel("objects", Services.io.newURI(HTTP_PATH, null, null));
+      let channel = new WebChannel("objects", Services.io.newURI(HTTP_PATH));
       let testDonePromise = new Promise((resolve, reject) => {
         channel.listen((id, message, sender) => {
           is(id, "objects");
           is(message.type, "string");
           resolve();
         });
       });
       yield BrowserTestUtils.withNewTab({
@@ -379,17 +379,17 @@ var gTests = [
   },
   {
     desc: "WebChannel allows both string and non-string message from whitelisted origin",
     *run() {
       /**
        * Same process as above, but we whitelist the origin before loading the page,
        * and expect to get *both* messages back (each exactly once).
        */
-      let channel = new WebChannel("objects", Services.io.newURI(HTTP_PATH, null, null));
+      let channel = new WebChannel("objects", Services.io.newURI(HTTP_PATH));
 
       let testDonePromise = new Promise((resolve, reject) => {
         let sawObject = false;
         let sawString = false;
         channel.listen((id, message, sender) => {
           is(id, "objects");
           if (message.type === "object") {
             ok(!sawObject);
@@ -420,19 +420,19 @@ var gTests = [
     }
   },
   {
     desc: "WebChannel errors handling the message are delivered back to content",
     *run() {
       const ERRNO_UNKNOWN_ERROR              = 999; // WebChannel.jsm doesn't export this.
 
       // The channel where we purposely fail responding to a command.
-      let channel = new WebChannel("error", Services.io.newURI(HTTP_PATH, null, null));
+      let channel = new WebChannel("error", Services.io.newURI(HTTP_PATH));
       // The channel where we see the response when the content sees the error
-      let echoChannel = new WebChannel("echo", Services.io.newURI(HTTP_PATH, null, null));
+      let echoChannel = new WebChannel("echo", Services.io.newURI(HTTP_PATH));
 
       let testDonePromise = new Promise((resolve, reject) => {
         // listen for the confirmation that content saw the error.
         echoChannel.listen((id, message, sender) => {
           is(id, "echo");
           is(message.error, "oh no");
           is(message.errno, ERRNO_UNKNOWN_ERROR);
           resolve();
@@ -455,17 +455,17 @@ var gTests = [
       });
     }
   },
   {
     desc: "WebChannel errors due to an invalid channel are delivered back to content",
     *run() {
       const ERRNO_NO_SUCH_CHANNEL            = 2; // WebChannel.jsm doesn't export this.
       // The channel where we see the response when the content sees the error
-      let echoChannel = new WebChannel("echo", Services.io.newURI(HTTP_PATH, null, null));
+      let echoChannel = new WebChannel("echo", Services.io.newURI(HTTP_PATH));
 
       let testDonePromise = new Promise((resolve, reject) => {
         // listen for the confirmation that content saw the error.
         echoChannel.listen((id, message, sender) => {
           is(id, "echo");
           is(message.error, "No Such Channel");
           is(message.errno, ERRNO_NO_SUCH_CHANNEL);
           resolve();
--- a/browser/base/content/test/general/parsingTestHelpers.jsm
+++ b/browser/base/content/test/general/parsingTestHelpers.jsm
@@ -63,17 +63,17 @@ function iterateOverPath(path, extension
       subdirs.push(entry.path);
     } else if (extensions.some((extension) => entry.name.endsWith(extension))) {
       let file = parentDir.clone();
       file.append(entry.name);
       // the build system might leave dead symlinks hanging around, which are
       // returned as part of the directory iterator, but don't actually exist:
       if (file.exists()) {
         let uriSpec = getURLForFile(file);
-        files.push(Services.io.newURI(uriSpec, null, null));
+        files.push(Services.io.newURI(uriSpec));
       }
     } else if (entry.name.endsWith(".ja") || entry.name.endsWith(".jar") ||
                entry.name.endsWith(".zip") || entry.name.endsWith(".xpi")) {
       let file = parentDir.clone();
       file.append(entry.name);
       for (let extension of extensions) {
         let jarEntryIterator = generateEntriesFromJarFile(file, extension);
         files.push(...jarEntryIterator);
@@ -118,14 +118,14 @@ function* generateEntriesFromJarFile(jar
   const kURIStart = getURLForFile(jarFile);
   while (entryEnumerator.hasMore()) {
     let entry = entryEnumerator.getNext();
     // Ignore the JS cache which is stored in omni.ja
     if (entry.startsWith("jsloader") || entry.startsWith("jssubloader")) {
       continue;
     }
     let entryURISpec = "jar:" + kURIStart + "!/" + entry;
-    yield Services.io.newURI(entryURISpec, null, null);
+    yield Services.io.newURI(entryURISpec);
   }
   zr.close();
 }
 
 
--- a/browser/base/content/test/social/head.js
+++ b/browser/base/content/test/social/head.js
@@ -19,17 +19,17 @@ function promiseObserverNotified(aTopic)
     }, aTopic, false);
   });
 }
 
 // Check that a specified (string) URL hasn't been "remembered" (ie, is not
 // in history, will not appear in about:newtab or auto-complete, etc.)
 function promiseSocialUrlNotRemembered(url) {
   return new Promise(resolve => {
-    let uri = Services.io.newURI(url, null, null);
+    let uri = Services.io.newURI(url);
     PlacesUtils.asyncHistory.isURIVisited(uri, function(aURI, aIsVisited) {
       ok(!aIsVisited, "social URL " + url + " should not be in global history");
       resolve();
     });
   });
 }
 
 var gURLsNotRemembered = [];
@@ -206,17 +206,17 @@ function setManifestPref(name, manifest)
   let string = Cc["@mozilla.org/supports-string;1"].
                createInstance(Ci.nsISupportsString);
   string.data = JSON.stringify(manifest);
   Services.prefs.setComplexValue(name, Ci.nsISupportsString, string);
 }
 
 function getManifestPrefname(aManifest) {
   // is same as the generated name in SocialServiceInternal.getManifestPrefname
-  let originUri = Services.io.newURI(aManifest.origin, null, null);
+  let originUri = Services.io.newURI(aManifest.origin);
   return "social.manifest." + originUri.hostPort.replace('.', '-');
 }
 
 function ensureFrameLoaded(frame, uri) {
   return new Promise(resolve => {
     if (frame.contentDocument && frame.contentDocument.readyState == "complete" &&
         (!uri || frame.contentDocument.location.href == uri)) {
       resolve();
--- a/browser/base/content/test/urlbar/browser_bug623155.js
+++ b/browser/base/content/test/urlbar/browser_bug623155.js
@@ -2,22 +2,22 @@
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
 const REDIRECT_FROM = "https://example.com/browser/browser/base/content/test/urlbar/" +
                       "redirect_bug623155.sjs";
 
 const REDIRECT_TO = "https://www.bank1.com/"; // Bad-cert host.
 
 function isRedirectedURISpec(aURISpec) {
-  return isRedirectedURI(Services.io.newURI(aURISpec, null, null));
+  return isRedirectedURI(Services.io.newURI(aURISpec));
 }
 
 function isRedirectedURI(aURI) {
   // Compare only their before-hash portion.
-  return Services.io.newURI(REDIRECT_TO, null, null)
+  return Services.io.newURI(REDIRECT_TO)
                  .equalsExceptRef(aURI);
 }
 
 /*
    Test.
 
 1. Load
 https://example.com/browser/browser/base/content/test/urlbar/redirect_bug623155.sjs#BG
--- a/browser/base/content/test/webrtc/browser_devices_get_user_media_in_frame.js
+++ b/browser/base/content/test/webrtc/browser_devices_get_user_media_in_frame.js
@@ -65,17 +65,17 @@ var gTests = [
     yield expectObserverCalled("recording-device-events");
     Assert.deepEqual((yield getMediaCaptureState()), {audio: true, video: true},
                      "expected camera and microphone to be shared");
 
     yield indicator;
     yield checkSharingUI({video: true, audio: true});
 
     let Perms = Services.perms;
-    let uri = Services.io.newURI("https://example.com/", null, null);
+    let uri = Services.io.newURI("https://example.com/");
     is(Perms.testExactPermission(uri, "microphone"), Perms.ALLOW_ACTION,
                                  "microphone persistently allowed");
     is(Perms.testExactPermission(uri, "camera"), Perms.ALLOW_ACTION,
                                  "camera persistently allowed");
 
     yield stopSharing();
 
     // The persistent permissions for the frame should have been removed.
--- a/browser/base/content/utilityOverlay.js
+++ b/browser/base/content/utilityOverlay.js
@@ -318,17 +318,17 @@ function openLinkIn(url, where, params) 
   let loadInBackground;
   let uriObj;
 
   if (where == "current") {
     targetBrowser = params.targetBrowser || w.gBrowser.selectedBrowser;
     loadInBackground = false;
 
     try {
-      uriObj = Services.io.newURI(url, null, null);
+      uriObj = Services.io.newURI(url);
     } catch (e) {}
 
     if (w.gBrowser.getTabForBrowser(targetBrowser).pinned &&
         !aAllowPinnedTabHostChange) {
       try {
         // nsIURI.host can throw for non-nsStandardURL nsIURIs.
         if (!uriObj || (!uriObj.schemeIs("javascript") &&
                         targetBrowser.currentURI.host != uriObj.host)) {
--- a/browser/components/contextualidentity/test/browser/browser_aboutURLs.js
+++ b/browser/components/contextualidentity/test/browser/browser_aboutURLs.js
@@ -20,17 +20,17 @@ add_task(function* () {
     if (!result) {
       continue;
     }
 
     let aboutType = result[1];
     let contract = "@mozilla.org/network/protocol/about;1?what=" + aboutType;
     try {
       let am = Cc[contract].getService(Ci.nsIAboutModule);
-      let uri = ios.newURI("about:" + aboutType, null, null);
+      let uri = ios.newURI("about:" + aboutType);
       let flags = am.getURIFlags(uri);
       if (!(flags & Ci.nsIAboutModule.HIDE_FROM_ABOUTABOUT) &&
           networkURLs.indexOf(aboutType) == -1) {
         aboutURLs.push(aboutType);
       }
     } catch (e) {
       // getService might have thrown if the component doesn't actually
       // implement nsIAboutModule
--- a/browser/components/contextualidentity/test/browser/browser_forgetaboutsite.js
+++ b/browser/components/contextualidentity/test/browser/browser_forgetaboutsite.js
@@ -69,17 +69,17 @@ function* openTabInUserContext(uri, user
 
 function getCookiesForOA(host, userContextId) {
   return Services.cookies.getCookiesFromHost(host, {userContextId});
 }
 
 function createURI(uri) {
   let ioServ = Cc["@mozilla.org/network/io-service;1"]
                   .getService(Components.interfaces.nsIIOService);
-  return ioServ.newURI(uri, null, null);
+  return ioServ.newURI(uri);
 }
 
 function getCacheStorage(where, lci, appcache) {
   if (!lci) lci = LoadContextInfo.default;
   switch (where) {
     case "disk": return css.diskCacheStorage(lci, false);
     case "memory": return css.memoryCacheStorage(lci);
     case "appcache": return css.appCacheStorage(lci, appcache);
--- a/browser/components/distribution.js
+++ b/browser/components/distribution.js
@@ -92,17 +92,17 @@ DistributionCustomizer.prototype = {
   get _ioSvc() {
     let svc = Cc["@mozilla.org/network/io-service;1"].
               getService(Ci.nsIIOService);
     this.__defineGetter__("_ioSvc", () => svc);
     return this._ioSvc;
   },
 
   _makeURI: function DIST__makeURI(spec) {
-    return this._ioSvc.newURI(spec, null, null);
+    return this._ioSvc.newURI(spec);
   },
 
   _parseBookmarksSection: Task.async(function* (parentGuid, section) {
     let keys = Array.from(enumerate(this._ini.getKeys(section))).sort();
     let re = /^item\.(\d+)\.(\w+)\.?(\w*)/;
     let items = {};
     let defaultIndex = -1;
     let maxIndex = -1;
--- a/browser/components/downloads/content/allDownloadsViewOverlay.js
+++ b/browser/components/downloads/content/allDownloadsViewOverlay.js
@@ -1210,17 +1210,17 @@ DownloadsPlacesView.prototype = {
 
     // Getting the data or creating the nsIURI might fail.
     try {
       let data = {};
       trans.getAnyTransferData({}, data, {});
       let [url, name] = data.value.QueryInterface(Ci.nsISupportsString)
                             .data.split("\n");
       if (url) {
-        return [NetUtil.newURI(url, null, null).spec, name];
+        return [NetUtil.newURI(url).spec, name];
       }
     } catch (ex) {}
 
     return ["", ""];
   },
 
   _canDownloadClipboardURL() {
     let [url, name] = this._getURLFromClipboardData();
--- a/browser/components/extensions/ext-contextMenus.js
+++ b/browser/components/extensions/ext-contextMenus.js
@@ -497,17 +497,17 @@ MenuItem.prototype = {
 
   enabledForContext(contextData) {
     let contexts = getContexts(contextData);
     if (!this.contexts.some(n => contexts.has(n))) {
       return false;
     }
 
     let docPattern = this.documentUrlMatchPattern;
-    let pageURI = Services.io.newURI(contextData.pageUrl, null, null);
+    let pageURI = Services.io.newURI(contextData.pageUrl);
     if (docPattern && !docPattern.matches(pageURI)) {
       return false;
     }
 
     let targetPattern = this.targetUrlMatchPattern;
     if (targetPattern) {
       let targetUrls = [];
       if (contextData.onImage || contextData.onAudio || contextData.onVideo) {
--- a/browser/components/extensions/ext-tabs.js
+++ b/browser/components/extensions/ext-tabs.js
@@ -698,17 +698,17 @@ extensions.registerSchemaAPI("tabs", "ad
             }
           }
 
           if (queryInfo.cookieStoreId !== null &&
               tab.cookieStoreId != queryInfo.cookieStoreId) {
             return false;
           }
 
-          if (pattern && !pattern.matches(Services.io.newURI(tab.url, null, null))) {
+          if (pattern && !pattern.matches(Services.io.newURI(tab.url))) {
             return false;
           }
 
           return true;
         }
 
         let result = [];
         for (let window of WindowListManager.browserWindows()) {
--- a/browser/components/feeds/FeedConverter.js
+++ b/browser/components/feeds/FeedConverter.js
@@ -246,17 +246,17 @@ FeedConverter.prototype = {
       // if the parser returned a document.
       if (result.doc) {
 
         // Store the result in the result service so that the display
         // page can access it.
         feedService.addFeedResult(result);
 
         // Now load the actual XUL document.
-        let aboutFeedsURI = ios.newURI("about:feeds", null, null);
+        let aboutFeedsURI = ios.newURI("about:feeds");
         chromeChannel = ios.newChannelFromURIWithLoadInfo(aboutFeedsURI, loadInfo);
         chromeChannel.originalURI = result.uri;
 
         // carry the origin attributes from the channel that loaded the feed.
         chromeChannel.owner =
           Services.scriptSecurityManager.createCodebasePrincipal(aboutFeedsURI,
                                                                  loadInfo.originAttributes);
       } else {
--- a/browser/components/feeds/FeedWriter.js
+++ b/browser/components/feeds/FeedWriter.js
@@ -34,17 +34,17 @@ function LOG(str) {
  * @param aURLSpec
  *        The URL string from which to create an nsIURI.
  * @returns an nsIURI object, or null if the creation of the URI failed.
  */
 function makeURI(aURLSpec, aCharset) {
   let ios = Cc["@mozilla.org/network/io-service;1"].
             getService(Ci.nsIIOService);
   try {
-    return ios.newURI(aURLSpec, aCharset, null);
+    return ios.newURI(aURLSpec, aCharset);
   } catch (ex) { }
 
   return null;
 }
 
 const XML_NS = "http://www.w3.org/XML/1998/namespace";
 const HTML_NS = "http://www.w3.org/1999/xhtml";
 const XUL_NS = "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul";
--- a/browser/components/feeds/test/unit/test_355473.js
+++ b/browser/components/feeds/test/unit/test_355473.js
@@ -1,19 +1,19 @@
 var Cu = Components.utils;
 Cu.import("resource://gre/modules/NetUtil.jsm");
 
 function run_test() {
-  var feedFeedURI = ios.newURI("feed://example.com/feed.xml", null, null);
-  var httpFeedURI = ios.newURI("feed:http://example.com/feed.xml", null, null);
-  var httpURI = ios.newURI("http://example.com/feed.xml", null, null);
+  var feedFeedURI = ios.newURI("feed://example.com/feed.xml");
+  var httpFeedURI = ios.newURI("feed:http://example.com/feed.xml");
+  var httpURI = ios.newURI("http://example.com/feed.xml");
 
   var httpsFeedURI =
-    ios.newURI("feed:https://example.com/feed.xml", null, null);
-  var httpsURI = ios.newURI("https://example.com/feed.xml", null, null);
+    ios.newURI("feed:https://example.com/feed.xml");
+  var httpsURI = ios.newURI("https://example.com/feed.xml");
 
   var feedChannel = NetUtil.newChannel({
     uri: feedFeedURI,
     loadUsingSystemPrincipal: true
   });
 
   var httpChannel = NetUtil.newChannel({
     uri: httpFeedURI,
@@ -31,13 +31,13 @@ function run_test() {
   do_check_true(httpsFeedURI.equals(httpsChannel.originalURI));
 
   // actually using the horrible mess that's a feed: URI is suicidal
   do_check_true(httpURI.equals(feedChannel.URI));
   do_check_true(httpURI.equals(httpChannel.URI));
   do_check_true(httpsURI.equals(httpsChannel.URI));
 
   // check that we throw creating feed: URIs from file and ftp
-  Assert.throws(function() { ios.newURI("feed:ftp://example.com/feed.xml", null, null); },
+  Assert.throws(function() { ios.newURI("feed:ftp://example.com/feed.xml"); },
       "Should throw an exception when trying to create a feed: URI with an ftp: inner");
-  Assert.throws(function() { ios.newURI("feed:file:///var/feed.xml", null, null); },
+  Assert.throws(function() { ios.newURI("feed:file:///var/feed.xml"); },
       "Should throw an exception when trying to create a feed: URI with a file: inner");
 }
--- a/browser/components/feeds/test/unit/test_758990.js
+++ b/browser/components/feeds/test/unit/test_758990.js
@@ -1,38 +1,38 @@
 function run_test() {
   var success = false;
   try {
-    ios.newURI("feed:javascript:alert('hi');", null, null);
+    ios.newURI("feed:javascript:alert('hi');");
   } catch (e) {
     success = e.result == Cr.NS_ERROR_MALFORMED_URI;
   }
   if (!success)
     do_throw("We didn't throw NS_ERROR_MALFORMED_URI creating a feed:javascript: URI");
 
   success = false;
   try {
-    ios.newURI("feed:data:text/html,hi", null, null);
+    ios.newURI("feed:data:text/html,hi");
   } catch (e) {
     success = e.result == Cr.NS_ERROR_MALFORMED_URI;
   }
   if (!success)
     do_throw("We didn't throw NS_ERROR_MALFORMED_URI creating a feed:data: URI");
 
   success = false;
   try {
-    ios.newURI("pcast:javascript:alert('hi');", null, null);
+    ios.newURI("pcast:javascript:alert('hi');");
   } catch (e) {
     success = e.result == Cr.NS_ERROR_MALFORMED_URI;
   }
   if (!success)
     do_throw("We didn't throw NS_ERROR_MALFORMED_URI creating a pcast:javascript: URI");
 
   success = false;
   try {
-    ios.newURI("pcast:data:text/html,hi", null, null);
+    ios.newURI("pcast:data:text/html,hi");
   } catch (e) {
     success = e.result == Cr.NS_ERROR_MALFORMED_URI;
   }
   if (!success)
     do_throw("We didn't throw NS_ERROR_MALFORMED_URI creating a pcast:data: URI");
 
 }
--- a/browser/components/migration/EdgeProfileMigrator.js
+++ b/browser/components/migration/EdgeProfileMigrator.js
@@ -108,17 +108,17 @@ EdgeTypedURLMigrator.prototype = {
   },
 
   migrate(aCallback) {
     let typedURLs = this._typedURLs;
     let places = [];
     for (let [urlString, time] of typedURLs) {
       let uri;
       try {
-        uri = Services.io.newURI(urlString, null, null);
+        uri = Services.io.newURI(urlString);
         if (["http", "https", "ftp"].indexOf(uri.scheme) == -1) {
           continue;
         }
       } catch (ex) {
         Cu.reportError(ex);
         continue;
       }
 
--- a/browser/components/migration/MSMigrationUtils.jsm
+++ b/browser/components/migration/MSMigrationUtils.jsm
@@ -786,17 +786,17 @@ WindowsVaultFormPasswords.prototype = {
         try {
           // if it's not an ie/edge password, skip it
           if (!_isIEOrEdgePassword(item.contents.schemaId.id)) {
             continue;
           }
           let url = item.contents.pResourceElement.contents.itemValue.readString();
           let realURL;
           try {
-            realURL = Services.io.newURI(url, null, null);
+            realURL = Services.io.newURI(url);
           } catch (ex) { /* leave realURL as null */ }
           if (!realURL || ["http", "https", "ftp"].indexOf(realURL.scheme) == -1) {
             // Ignore items for non-URLs or URLs that aren't HTTP(S)/FTP
             continue;
           }
 
           // if aOnlyCheckExists is set to true, the purpose of the call is to return true if there is at
           // least a password which is true in this case because a password was by now already found
--- a/browser/components/migration/tests/unit/test_IE7_passwords.js
+++ b/browser/components/migration/tests/unit/test_IE7_passwords.js
@@ -278,17 +278,17 @@ function getFirstResourceOfType(type) {
     if (m.name == IE7_FORM_PASSWORDS_MIGRATOR_NAME && m.type == type) {
       return m;
     }
   }
   throw new Error("failed to find the " + type + " migrator");
 }
 
 function makeURI(aURL) {
-  return Services.io.newURI(aURL, null, null);
+  return Services.io.newURI(aURL);
 }
 
 add_task(function* setup() {
   if (AppConstants.isPlatformAndVersionAtLeast("win", "6.2")) {
     Assert.throws(() => getFirstResourceOfType(MigrationUtils.resourceTypes.PASSWORDS),
                   "The migrator doesn't exist for win8+");
     return;
   }
--- a/browser/components/migration/tests/unit/test_automigration.js
+++ b/browser/components/migration/tests/unit/test_automigration.js
@@ -205,17 +205,17 @@ add_task(function* checkUndoRemoval() {
   });
 
   let bookmark = yield PlacesUtils.bookmarks.fetch({url: "http://www.example.org/"});
   Assert.ok(bookmark, "Should have a bookmark before undo");
   Assert.equal(bookmark.title, "Some example bookmark", "Should have correct bookmark before undo.");
 
   // Insert 2 history visits
   let now_uSec = Date.now() * 1000;
-  let visitedURI = Services.io.newURI("http://www.example.com/", null, null);
+  let visitedURI = Services.io.newURI("http://www.example.com/");
   let frecencyUpdatePromise = new Promise(resolve => {
     let expectedChanges = 2;
     let observer = {
       onFrecencyChanged() {
         if (!--expectedChanges) {
           PlacesUtils.history.removeObserver(observer);
           resolve();
         }
--- a/browser/components/newtab/NewTabWebChannel.jsm
+++ b/browser/components/newtab/NewTabWebChannel.jsm
@@ -258,17 +258,17 @@ NewTabWebChannelImpl.prototype = {
     if (!(mode in NewTabRemoteResources.MODE_CHANNEL_MAP)) {
       mode = "production";
     }
     this._prefs.mode = mode;
     this._principals = new WeakMap();
     this._browsers = new Set();
 
     if (this._prefs.enabled) {
-      this._channel = new WebChannel(this.chanId, Services.io.newURI(this.origin, null, null));
+      this._channel = new WebChannel(this.chanId, Services.io.newURI(this.origin));
       this._channel.listen(this._incomingMessage);
     }
   },
 
   tearDownState() {
     if (this._channel) {
       this._channel.stopListening();
     }
--- a/browser/components/newtab/PlacesProvider.jsm
+++ b/browser/components/newtab/PlacesProvider.jsm
@@ -18,17 +18,17 @@ XPCOMUtils.defineLazyModuleGetter(this, 
   "resource://gre/modules/PlacesUtils.jsm");
 
 XPCOMUtils.defineLazyGetter(this, "EventEmitter", function() {
   const {EventEmitter} = Cu.import("resource://devtools/shared/event-emitter.js", {});
   return EventEmitter;
 });
 
 XPCOMUtils.defineLazyGetter(this, "gPrincipal", function() {
-  let uri = Services.io.newURI("about:newtab", null, null);
+  let uri = Services.io.newURI("about:newtab");
   return Services.scriptSecurityManager.getNoAppCodebasePrincipal(uri);
 });
 
 XPCOMUtils.defineLazyModuleGetter(this, "Task",
                                   "resource://gre/modules/Task.jsm");
 
 // The maximum number of results PlacesProvider retrieves from history.
 const HISTORY_RESULTS_LIMIT = 100;
--- a/browser/components/originattributes/test/browser/browser_permissions.js
+++ b/browser/components/originattributes/test/browser/browser_permissions.js
@@ -1,16 +1,16 @@
 /**
  * Bug 1282655 - Test if site permissions are universal across origin attributes.
  *
  * This test is testing the cookie "permission" for a specific URI.
  */
 
 const TEST_PAGE = "http://example.net";
-const uri = Services.io.newURI(TEST_PAGE, null, null);
+const uri = Services.io.newURI(TEST_PAGE);
 
 function disableCookies() {
   Services.cookies.removeAll();
   Services.perms.add(uri, "cookie", Services.perms.DENY_ACTION);
 }
 
 function ensureCookieNotSet(aBrowser) {
   ContentTask.spawn(aBrowser, null, function*() {
--- a/browser/components/places/tests/browser/browser_410196_paste_into_tags.js
+++ b/browser/components/places/tests/browser/browser_410196_paste_into_tags.js
@@ -1,16 +1,16 @@
 /* Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/
  */
 
 "use strict";
 
-const TEST_URL = Services.io.newURI("http://example.com/", null, null);
-const MOZURISPEC = Services.io.newURI("http://mozilla.com/", null, null);
+const TEST_URL = Services.io.newURI("http://example.com/");
+const MOZURISPEC = Services.io.newURI("http://mozilla.com/");
 
 add_task(function* () {
   let organizer = yield promiseLibrary();
 
   ok(PlacesUtils, "PlacesUtils in scope");
   ok(PlacesUIUtils, "PlacesUIUtils in scope");
 
   let PlacesOrganizer = organizer.PlacesOrganizer;
--- a/browser/components/places/tests/unit/test_clearHistory_shutdown.js
+++ b/browser/components/places/tests/unit/test_clearHistory_shutdown.js
@@ -150,17 +150,17 @@ function storeCache(aURL, aContent) {
                    "  Actual: " + aContent.length + "\n");
         }
         os.close();
         entry.close();
         resolve();
       }
     };
 
-    storage.asyncOpenURI(Services.io.newURI(aURL, null, null), "",
+    storage.asyncOpenURI(Services.io.newURI(aURL), "",
                          Ci.nsICacheStorage.OPEN_NORMALLY,
                          storeCacheListener);
   });
 }
 
 
 function checkCache(aURL) {
   let cache = Services.cache2;
@@ -169,13 +169,13 @@ function checkCache(aURL) {
   return new Promise(resolve => {
     let checkCacheListener = {
       onCacheEntryAvailable(entry, isnew, appcache, status) {
         do_check_eq(status, Cr.NS_ERROR_CACHE_KEY_NOT_FOUND);
         resolve();
       }
     };
 
-    storage.asyncOpenURI(Services.io.newURI(aURL, null, null), "",
-                        Ci.nsICacheStorage.OPEN_READONLY,
-                        checkCacheListener);
+    storage.asyncOpenURI(Services.io.newURI(aURL), "",
+                         Ci.nsICacheStorage.OPEN_READONLY,
+                         checkCacheListener);
   });
 }
--- a/browser/components/preferences/SiteDataManager.jsm
+++ b/browser/components/preferences/SiteDataManager.jsm
@@ -102,17 +102,17 @@ this.SiteDataManager = {
       this._quotaUsageRequests = null;
     }
   },
 
   _updateAppCache() {
     let groups = this._appCache.getGroups();
     for (let site of this._sites.values()) {
       for (let group of groups) {
-        let uri = Services.io.newURI(group, null, null);
+        let uri = Services.io.newURI(group);
         if (site.perm.matchesURI(uri, true)) {
           let cache = this._appCache.getActiveCache(group);
           site.appCacheList.push(cache);
         }
       }
     }
   },
 
--- a/browser/components/preferences/in-content/advanced.js
+++ b/browser/components/preferences/in-content/advanced.js
@@ -528,17 +528,17 @@ var gAdvancedPane = {
         groups = cacheService.getGroups();
       } catch (ex) {
         return 0;
       }
     }
 
     let usage = 0;
     for (let group of groups) {
-      let uri = Services.io.newURI(group, null, null);
+      let uri = Services.io.newURI(group);
       if (perm.matchesURI(uri, true)) {
         let cache = cacheService.getActiveCache(group);
         usage += cache.usage;
       }
     }
 
     return usage;
   },
@@ -622,17 +622,17 @@ var gAdvancedPane = {
     var perm = pm.getPermissionObject(principal, "offline-app", true);
     if (perm) {
       // clear offline cache entries
       try {
         var cacheService = Components.classes["@mozilla.org/network/application-cache-service;1"].
                            getService(Components.interfaces.nsIApplicationCacheService);
         var groups = cacheService.getGroups();
         for (var i = 0; i < groups.length; i++) {
-          var uri = Services.io.newURI(groups[i], null, null);
+          var uri = Services.io.newURI(groups[i]);
           if (perm.matchesURI(uri, true)) {
             var cache = cacheService.getActiveCache(groups[i]);
             cache.discard();
           }
         }
       } catch (e) {}
 
       pm.removePermission(perm);
--- a/browser/components/preferences/in-content/applications.js
+++ b/browser/components/preferences/in-content/applications.js
@@ -1844,17 +1844,17 @@ var gApplicationsPane = {
     var fph = this._ioSvc.getProtocolHandler("file").
               QueryInterface(Ci.nsIFileProtocolHandler);
     var urlSpec = fph.getURLSpecFromFile(aFile);
 
     return "moz-icon://" + urlSpec + "?size=16";
   },
 
   _getIconURLForWebApp(aWebAppURITemplate) {
-    var uri = this._ioSvc.newURI(aWebAppURITemplate, null, null);
+    var uri = this._ioSvc.newURI(aWebAppURITemplate);
 
     // Unfortunately we can't use the favicon service to get the favicon,
     // because the service looks in the annotations table 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 web app'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).
 
--- a/browser/components/preferences/in-content/tests/browser_bug705422.js
+++ b/browser/components/preferences/in-content/tests/browser_bug705422.js
@@ -32,17 +32,17 @@ function initTest() {
     var ios = Components.classes["@mozilla.org/network/io-service;1"]
                         .getService(Components.interfaces.nsIIOService);
     var cookieSvc = Components.classes["@mozilla.org/cookieService;1"]
                               .getService(Components.interfaces.nsICookieService);
     var v;
     // inject cookies
     for (v in vals) {
         let [host, name, value] = vals[v];
-        var cookieUri = ios.newURI("http://" + host, null, null);
+        var cookieUri = ios.newURI("http://" + host);
         cookieSvc.setCookieString(cookieUri, null, name + "=" + value + ";", null);
     }
 
     // open cookie manager
     var cmd = window.openDialog("chrome://browser/content/preferences/cookies.xul",
                                 "Browser:Cookies", "", {});
 
     // when it has loaded, run actual tests
--- a/browser/components/preferences/in-content/tests/browser_cookies_exceptions.js
+++ b/browser/components/preferences/in-content/tests/browser_cookies_exceptions.js
@@ -60,25 +60,25 @@ var testRunner = {
           is(params.tree.view.rowCount, 0, "exception should be removed");
           params.btnApplyChanges.doCommand();
         },
         observances: [{ type: "cookie", origin: "http://test.com", data: "deleted" }],
       },
       {
         expectPermObservancesDuringTestFunction: true,
         test(params) {
-          let uri = params.ioService.newURI("http://test.com", null, null);
+          let uri = params.ioService.newURI("http://test.com");
           params.pm.add(uri, "popup", Ci.nsIPermissionManager.DENY_ACTION);
           is(params.tree.view.rowCount, 0, "adding unrelated permission should not change display");
           params.btnApplyChanges.doCommand();
         },
         observances: [{ type: "popup", origin: "http://test.com", data: "added",
                         capability: Ci.nsIPermissionManager.DENY_ACTION }],
         cleanUp(params) {
-          let uri = params.ioService.newURI("http://test.com", null, null);
+          let uri = params.ioService.newURI("http://test.com");
           params.pm.remove(uri, "popup");
         },
       },
       {
         test(params) {
           params.url.value = "https://test.com:12345";
           params.btnAllow.doCommand();
           is(params.tree.view.rowCount, 1, "added exception shows up in treeview");
@@ -174,17 +174,17 @@ var testRunner = {
           params.btnApplyChanges.doCommand();
         },
         observances: [{ type: "cookie", origin: "http://localhost:12345", data: "deleted" }],
       },
       {
         expectPermObservancesDuringTestFunction: true,
         test(params) {
           for (let URL of ["http://a", "http://z", "http://b"]) {
-            let URI = params.ioService.newURI(URL, null, null);
+            let URI = params.ioService.newURI(URL);
             params.pm.add(URI, "cookie", Ci.nsIPermissionManager.ALLOW_ACTION);
           }
 
           is(params.tree.view.rowCount, 3, "Three permissions should be present");
           is(params.tree.view.getCellText(0, params.nameCol), "http://a",
              "site should be sorted. 'a' should be first");
           is(params.tree.view.getCellText(1, params.nameCol), "http://b",
              "site should be sorted. 'b' should be second");
@@ -206,17 +206,17 @@ var testRunner = {
           is(params.tree.view.getCellText(0, params.nameCol), "http://z",
              "site should be sorted. 'z' should be first");
           is(params.tree.view.getCellText(1, params.nameCol), "http://b",
              "site should be sorted. 'b' should be second");
           is(params.tree.view.getCellText(2, params.nameCol), "http://a",
              "site should be sorted. 'a' should be third");
 
           for (let URL of ["http://a", "http://z", "http://b"]) {
-            let uri = params.ioService.newURI(URL, null, null);
+            let uri = params.ioService.newURI(URL);
             params.pm.remove(uri, "cookie");
           }
         },
       },
     ],
 
   _currentTest: -1,
 
--- a/browser/components/preferences/permissions.js
+++ b/browser/components/preferences/permissions.js
@@ -87,22 +87,22 @@ var gPermissionManager = {
       // principal doesn't have a canonical origin representation. This will
       // help catch cases where the URI parser parsed something like
       // `localhost:8080` as having the scheme `localhost`, rather than being
       // an invalid URI. A canonical origin representation is required by the
       // permission manager for storage, so this won't prevent any valid
       // permissions from being entered by the user.
       let uri;
       try {
-        uri = Services.io.newURI(input_url, null, null);
+        uri = Services.io.newURI(input_url);
         principal = Services.scriptSecurityManager.createCodebasePrincipal(uri, {});
         // If we have ended up with an unknown scheme, the following will throw.
         principal.origin;
       } catch (ex) {
-        uri = Services.io.newURI("http://" + input_url, null, null);
+        uri = Services.io.newURI("http://" + input_url);
         principal = Services.scriptSecurityManager.createCodebasePrincipal(uri, {});
         // If we have ended up with an unknown scheme, the following will throw.
         principal.origin;
       }
     } catch (ex) {
       var message = this._bundle.getString("invalidURI");
       var title = this._bundle.getString("invalidURITitle");
       Services.prompt.alert(window, title, message);
--- a/browser/components/privatebrowsing/test/browser/browser_privatebrowsing_DownloadLastDirWithCPS.js
+++ b/browser/components/privatebrowsing/test/browser/browser_privatebrowsing_DownloadLastDirWithCPS.js
@@ -59,20 +59,20 @@ function runTest() {
   let DownloadLastDir =
     Cu.import("resource://gre/modules/DownloadLastDir.jsm", {}).DownloadLastDir;
 
   let tmpDir = FileUtils.getDir("TmpD", [], true);
   let dir1 = newDirectory();
   let dir2 = newDirectory();
   let dir3 = newDirectory();
 
-  let uri1 = Services.io.newURI("http://test1.com/", null, null);
-  let uri2 = Services.io.newURI("http://test2.com/", null, null);
-  let uri3 = Services.io.newURI("http://test3.com/", null, null);
-  let uri4 = Services.io.newURI("http://test4.com/", null, null);
+  let uri1 = Services.io.newURI("http://test1.com/");
+  let uri2 = Services.io.newURI("http://test2.com/");
+  let uri3 = Services.io.newURI("http://test3.com/");
+  let uri4 = Services.io.newURI("http://test4.com/");
 
   // cleanup functions registration
   registerCleanupFunction(function () {
     Services.prefs.clearUserPref("browser.download.lastDir.savePerSite");
     Services.prefs.clearUserPref("browser.download.lastDir");
     [dir1, dir2, dir3].forEach(dir => dir.remove(true));
     win.close();
     pbWin.close();
--- a/browser/components/privatebrowsing/test/browser/browser_privatebrowsing_downloadLastDir.js
+++ b/browser/components/privatebrowsing/test/browser/browser_privatebrowsing_downloadLastDir.js
@@ -7,17 +7,17 @@ function test() {
   waitForExplicitFinish();
 
   let FileUtils =
     Cu.import("resource://gre/modules/FileUtils.jsm", {}).FileUtils;
   let DownloadLastDir =
     Cu.import("resource://gre/modules/DownloadLastDir.jsm", {}).DownloadLastDir;
   let MockFilePicker = SpecialPowers.MockFilePicker;
   let launcher = {
-    source: Services.io.newURI("http://test1.com/file", null, null)
+    source: Services.io.newURI("http://test1.com/file")
   };
 
   MockFilePicker.init(window);
   MockFilePicker.returnValue = Ci.nsIFilePicker.returnOK;
 
   let prefs = Services.prefs.getBranch("browser.download.");
   let launcherDialog =
     Cc["@mozilla.org/helperapplauncherdialog;1"].
--- a/browser/components/privatebrowsing/test/browser/browser_privatebrowsing_placesTitleNoUpdate.js
+++ b/browser/components/privatebrowsing/test/browser/browser_privatebrowsing_placesTitleNoUpdate.js
@@ -6,17 +6,17 @@
 // private browsing mode.
 "use strict";
 
 Cu.import("resource://gre/modules/Services.jsm");
 Cu.import("resource://gre/modules/PlacesUtils.jsm");
 
 add_task(function* test() {
   const TEST_URL = "http://mochi.test:8888/browser/browser/components/privatebrowsing/test/browser/browser_privatebrowsing_placesTitleNoUpdate.html"
-  const TEST_URI = Services.io.newURI(TEST_URL, null, null);
+  const TEST_URI = Services.io.newURI(TEST_URL);
   const TITLE_1 = "Title 1";
   const TITLE_2 = "Title 2";
 
   function waitForTitleChanged() {
     return new Promise(resolve => {
       let historyObserver = {
         onTitleChanged: function(uri, pageTitle) {
           PlacesUtils.history.removeObserver(historyObserver, false);
--- a/browser/components/search/test/browser_contextmenu.js
+++ b/browser/components/search/test/browser_contextmenu.js
@@ -16,17 +16,17 @@ add_task(function* () {
   let originalValue = envService.get("XPCSHELL_TEST_PROFILE_DIR");
   envService.set("XPCSHELL_TEST_PROFILE_DIR", "1");
 
   let url = "chrome://mochitests/content/browser/browser/components/search/test/";
   let resProt = Services.io.getProtocolHandler("resource")
                         .QueryInterface(Ci.nsIResProtocolHandler);
   let originalSubstitution = resProt.getSubstitution("search-plugins");
   resProt.setSubstitution("search-plugins",
-                          Services.io.newURI(url, null, null));
+                          Services.io.newURI(url));
 
   let searchDonePromise;
   yield new Promise(resolve => {
     function observer(aSub, aTopic, aData) {
       switch (aData) {
         case "engine-added":
           var engine = ss.getEngineByName(ENGINE_NAME);
           ok(engine, "Engine was added.");
--- a/browser/components/sessionstore/SessionStorage.jsm
+++ b/browser/components/sessionstore/SessionStorage.jsm
@@ -104,17 +104,17 @@ var SessionStorageInternal = {
   restore: function (aDocShell, aStorageData) {
     for (let origin of Object.keys(aStorageData)) {
       let data = aStorageData[origin];
 
       let principal;
 
       try {
         let attrs = aDocShell.getOriginAttributes();
-        let originURI = Services.io.newURI(origin, null, null);
+        let originURI = Services.io.newURI(origin);
         principal = Services.scriptSecurityManager.createCodebasePrincipal(originURI, attrs);
       } catch (e) {
         console.error(e);
         continue;
       }
 
       let storageManager = aDocShell.QueryInterface(Ci.nsIDOMStorageManager);
       let window = aDocShell.QueryInterface(Ci.nsIInterfaceRequestor).getInterface(Ci.nsIDOMWindow);
--- a/browser/components/sessionstore/content/content-sessionStore.js
+++ b/browser/components/sessionstore/content/content-sessionStore.js
@@ -596,17 +596,17 @@ var SessionStorageListener = {
   resetChanges: function () {
     this._changes = undefined;
   },
 
   collectFromEvent: function (event) {
     // TODO: we should take browser.sessionstore.dom_storage_limit into an account here.
     if (docShell) {
       let {url, key, newValue} = event;
-      let uri = Services.io.newURI(url, null, null);
+      let uri = Services.io.newURI(url);
       let domain = uri.prePath;
       if (!this._changes) {
         this._changes = {};
       }
       if (!this._changes[domain]) {
         this._changes[domain] = {};
       }
       this._changes[domain][key] = newValue;
--- a/browser/components/sessionstore/test/browser_491168.js
+++ b/browser/components/sessionstore/test/browser_491168.js
@@ -11,17 +11,17 @@ add_task(function* () {
   }
 
   // Add a new tab.
   let tab = gBrowser.selectedTab = gBrowser.addTab("about:blank");
   let browser = tab.linkedBrowser;
   yield promiseBrowserLoaded(browser);
 
   // Load a new URI with a specific referrer.
-  let referrerURI = Services.io.newURI(REFERRER1, null, null);
+  let referrerURI = Services.io.newURI(REFERRER1);
   browser.loadURI("http://example.org", referrerURI, null);
   yield promiseBrowserLoaded(browser);
 
   yield TabStateFlusher.flush(browser);
   let tabState = JSON.parse(ss.getTabState(tab));
   is(tabState.entries[0].referrer,  REFERRER1,
      "Referrer retrieved via getTabState matches referrer set via loadURI.");
 
--- a/browser/components/sessionstore/test/browser_parentProcessRestoreHash.js
+++ b/browser/components/sessionstore/test/browser_parentProcessRestoreHash.js
@@ -17,17 +17,17 @@ let TestAboutPage = {
     // No CAN_ or MUST_LOAD_IN_CHILD means this loads in the parent:
     return Ci.nsIAboutModule.ALLOW_SCRIPT |
            Ci.nsIAboutModule.URI_SAFE_FOR_UNTRUSTED_CONTENT |
            Ci.nsIAboutModule.HIDE_FROM_ABOUTABOUT;
   },
 
   newChannel: function(aURI, aLoadInfo) {
     // about: page inception!
-    let newURI = Services.io.newURI(SELFCHROMEURL, null, null);
+    let newURI = Services.io.newURI(SELFCHROMEURL);
     let channel = Services.io.newChannelFromURIWithLoadInfo(newURI,
                                                             aLoadInfo);
     channel.originalURI = aURI;
     return channel;
   },
 
   createInstance: function(outer, iid) {
     if (outer != null) {
--- a/browser/components/uitour/content-UITour.js
+++ b/browser/components/uitour/content-UITour.js
@@ -27,17 +27,17 @@ var UITourListener = {
   isTestingOrigin(aURI) {
     if (Services.prefs.getPrefType(PREF_TEST_WHITELIST) != Services.prefs.PREF_STRING) {
       return false;
     }
 
     // Add any testing origins (comma-seperated) to the whitelist for the session.
     for (let origin of Services.prefs.getCharPref(PREF_TEST_WHITELIST).split(",")) {
       try {
-        let testingURI = Services.io.newURI(origin, null, null);
+        let testingURI = Services.io.newURI(origin);
         if (aURI.prePath == testingURI.prePath) {
           return true;
         }
       } catch (ex) {
         Cu.reportError(ex);
       }
     }
     return false;
--- a/browser/components/uitour/test/browser_no_tabs.js
+++ b/browser/components/uitour/test/browser_no_tabs.js
@@ -51,17 +51,17 @@ function destroyHiddenBrowser(aFrame, aB
  * browsers).
  */
 add_task(function* test_windowless_UITour() {
   // Get the URL for the test page.
   let pageURL = getRootDirectory(gTestPath) + "uitour.html";
 
   // Allow the URL to use the UITour.
   info("Adding UITour permission to the test page.");
-  let pageURI = Services.io.newURI(pageURL, null, null);
+  let pageURI = Services.io.newURI(pageURL);
   Services.perms.add(pageURI, "uitour", Services.perms.ALLOW_ACTION);
 
   // UITour's ping will resolve this promise.
   let deferredPing = Promise.defer();
 
   // Create a windowless browser and test that UITour works in it.
   let browserPromise = createHiddenBrowser(pageURL);
   browserPromise.then(frameInfo => {
--- a/browser/components/uitour/test/head.js
+++ b/browser/components/uitour/test/head.js
@@ -349,18 +349,18 @@ function loadUITourTestPage(callback, ho
 // Wrapper for UITourTest to be used by add_task tests.
 function* setup_UITourTest() {
   return UITourTest(true);
 }
 
 // Use `add_task(setup_UITourTest);` instead as we will fold this into `setup_UITourTest` once all tests are using `add_UITour_task`.
 function UITourTest(usingAddTask = false) {
   Services.prefs.setBoolPref("browser.uitour.enabled", true);
-  let testHttpsUri = Services.io.newURI("https://example.org", null, null);
-  let testHttpUri = Services.io.newURI("http://example.org", null, null);
+  let testHttpsUri = Services.io.newURI("https://example.org");
+  let testHttpUri = Services.io.newURI("http://example.org");
   Services.perms.add(testHttpsUri, "uitour", Services.perms.ALLOW_ACTION);
   Services.perms.add(testHttpUri, "uitour", Services.perms.ALLOW_ACTION);
 
   // If a test file is using add_task, we don't need to have a test function or
   // call `waitForExplicitFinish`.
   if (!usingAddTask) {
     waitForExplicitFinish();
   }
--- a/browser/extensions/flyweb/bootstrap.js
+++ b/browser/extensions/flyweb/bootstrap.js
@@ -219,17 +219,17 @@ let FlyWebView = {
         panel.appendChild(label);
         panel.appendChild(empty);
         panel.appendChild(items);
 
         panel.addEventListener("command", this);
 
         aDocument.getElementById("PanelUI-multiView").appendChild(panel);
 
-        this._sheetURI = Services.io.newURI("chrome://flyweb/skin/flyweb.css", null, null);
+        this._sheetURI = Services.io.newURI("chrome://flyweb/skin/flyweb.css");
         aDocument.defaultView.QueryInterface(Ci.nsIInterfaceRequestor).
             getInterface(Ci.nsIDOMWindowUtils).loadSheet(this._sheetURI, 1);
       },
 
       onDestroyed(aDocument) {
         aDocument.defaultView.QueryInterface(Ci.nsIInterfaceRequestor).
             getInterface(Ci.nsIDOMWindowUtils).removeSheet(this._sheetURI, 1);
       },
--- a/browser/extensions/pdfjs/content/PdfStreamConverter.jsm
+++ b/browser/extensions/pdfjs/content/PdfStreamConverter.jsm
@@ -1012,17 +1012,17 @@ PdfStreamConverter.prototype = {
     channel.loadGroup = aRequest.loadGroup;
     channel.loadInfo.originAttributes = aRequest.loadInfo.originAttributes;
 
     // We can use the resource principal when data is fetched by the chrome,
     // e.g. useful for NoScript. Make make sure we reuse the origin attributes
     // from the request channel to keep isolation consistent.
     var ssm = Cc['@mozilla.org/scriptsecuritymanager;1']
                 .getService(Ci.nsIScriptSecurityManager);
-    var uri = NetUtil.newURI(PDF_VIEWER_WEB_PAGE, null, null);
+    var uri = NetUtil.newURI(PDF_VIEWER_WEB_PAGE);
     var resourcePrincipal;
     resourcePrincipal =
       ssm.createCodebasePrincipal(uri, aRequest.loadInfo.originAttributes);
     aRequest.owner = resourcePrincipal;
     asyncOpenChannel(channel, proxy, aContext);
   },
 
   // nsIRequestObserver::onStopRequest
--- a/browser/extensions/pocket/bootstrap.js
+++ b/browser/extensions/pocket/bootstrap.js
@@ -21,17 +21,17 @@ XPCOMUtils.defineLazyModuleGetter(this, 
 XPCOMUtils.defineLazyModuleGetter(this, "Pocket",
                                   "chrome://pocket/content/Pocket.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "AboutPocket",
                                   "chrome://pocket/content/AboutPocket.jsm");
 XPCOMUtils.defineLazyGetter(this, "gPocketBundle", function() {
   return Services.strings.createBundle("chrome://pocket/locale/pocket.properties");
 });
 XPCOMUtils.defineLazyGetter(this, "gPocketStyleURI", function() {
-  return Services.io.newURI("chrome://pocket/skin/pocket.css", null, null);
+  return Services.io.newURI("chrome://pocket/skin/pocket.css");
 });
 
 // Due to bug 1051238 frame scripts are cached forever, so we can't update them
 // as a restartless add-on. The Math.random() is the work around for this.
 const PROCESS_SCRIPT = "chrome://pocket/content/pocket-content-process.js?" + Math.random();
 
 const PREF_BRANCH = "extensions.pocket.";
 const PREFS = {
@@ -178,17 +178,17 @@ var PocketContextMenu = {
     let subject = aSubject.wrappedJSObject;
     let document = subject.menu.ownerDocument;
     let pocketEnabled = CustomizableUI.getPlacementOfWidget("pocket-button");
 
     let showSaveCurrentPageToPocket = !(subject.onTextInput || subject.onLink ||
                                         subject.isContentSelected || subject.onImage ||
                                         subject.onCanvas || subject.onVideo || subject.onAudio);
     let targetUrl = subject.onLink ? subject.linkUrl : subject.pageUrl;
-    let targetURI = Services.io.newURI(targetUrl, null, null);
+    let targetURI = Services.io.newURI(targetUrl);
     let canPocket = pocketEnabled && (targetURI.schemeIs("http") || targetURI.schemeIs("https") ||
                     (targetURI.schemeIs("about") && ReaderMode.getOriginalUrl(targetUrl)));
 
     let showSaveLinkToPocket = canPocket && !showSaveCurrentPageToPocket && subject.onLink;
 
     // create menu entries if necessary
     let menu = document.getElementById("context-pocket");
     if (!menu) {
--- a/browser/extensions/pocket/content/AboutPocket.jsm
+++ b/browser/extensions/pocket/content/AboutPocket.jsm
@@ -31,17 +31,17 @@ function AboutPage(chromeURL, aboutHost,
 
 AboutPage.prototype = {
   QueryInterface: XPCOMUtils.generateQI([Ci.nsIAboutModule]),
   getURIFlags(aURI) { // eslint-disable-line no-unused-vars
     return this.uriFlags;
   },
 
   newChannel(aURI, aLoadInfo) {
-    let newURI = Services.io.newURI(this.chromeURL, null, null);
+    let newURI = Services.io.newURI(this.chromeURL);
     let channel = Services.io.newChannelFromURIWithLoadInfo(newURI,
                                                             aLoadInfo);
     channel.originalURI = aURI;
 
     if (this.uriFlags & Ci.nsIAboutModule.URI_SAFE_FOR_UNTRUSTED_CONTENT) {
       let principal = Services.scriptSecurityManager.getNoAppCodebasePrincipal(aURI);
       channel.owner = principal;
     }
--- a/browser/modules/ContentClick.jsm
+++ b/browser/modules/ContentClick.jsm
@@ -44,17 +44,17 @@ var ContentClick = {
     }
 
     if (json.bookmark) {
       // This is the Opera convention for a special link that, when clicked,
       // allows to add a sidebar panel.  The link's title attribute contains
       // the title that should be used for the sidebar panel.
       PlacesUIUtils.showBookmarkDialog({ action: "add"
                                        , type: "bookmark"
-                                       , uri: Services.io.newURI(json.href, null, null)
+                                       , uri: Services.io.newURI(json.href)
                                        , title: json.title
                                        , loadBookmarkInSidebar: true
                                        , hiddenRows: [ "description"
                                                      , "location"
                                                      , "keyword" ]
                                        }, window);
       return;
     }
--- a/browser/modules/DirectoryLinksProvider.jsm
+++ b/browser/modules/DirectoryLinksProvider.jsm
@@ -582,17 +582,17 @@ var DirectoryLinksProvider = {
     // Assume no url is an allowed url
     if (!url) {
       return true;
     }
 
     let scheme = "", base = "";
     try {
       // A malformed url will not be allowed
-      let uri = Services.io.newURI(url, null, null);
+      let uri = Services.io.newURI(url);
       scheme = uri.scheme;
 
       // URIs without base domains will be allowed
       base = Services.eTLD.getBaseDomain(uri);
     } catch (ex) {}
     // Require a scheme match and the base only if desired
     return allowed.has(scheme) && (!checkBase || ALLOWED_URL_BASE.has(base));
   },
--- a/browser/modules/E10SUtils.jsm
+++ b/browser/modules/E10SUtils.jsm
@@ -80,17 +80,17 @@ this.E10SUtils = {
     }
 
     if (aURL.startsWith("about:")) {
       // We need to special case about:blank because it needs to load in any.
       if (aURL == "about:blank") {
         return aPreferredRemoteType;
       }
 
-      let url = Services.io.newURI(aURL, null, null);
+      let url = Services.io.newURI(aURL);
       let module = getAboutModule(url);
       // If the module doesn't exist then an error page will be loading, that
       // should be ok to load in any process
       if (!module) {
         return aPreferredRemoteType;
       }
 
       let flags = module.getURIFlags(url);
@@ -106,17 +106,17 @@ this.E10SUtils = {
       return NOT_REMOTE;
     }
 
     if (aURL.startsWith("chrome:")) {
       let url;
       try {
         // This can fail for invalid Chrome URIs, in which case we will end up
         // not loading anything anyway.
-        url = Services.io.newURI(aURL, null, null);
+        url = Services.io.newURI(aURL);
       } catch (ex) {
         return aPreferredRemoteType;
       }
 
       let chromeReg = Cc["@mozilla.org/chrome/chrome-registry;1"].
                       getService(Ci.nsIXULChromeRegistry);
       if (chromeReg.mustLoadURLRemotely(url)) {
         return DEFAULT_REMOTE_TYPE;
--- a/browser/modules/LaterRun.jsm
+++ b/browser/modules/LaterRun.jsm
@@ -124,17 +124,17 @@ let LaterRun = {
       pageDataStore.get(slug)[prop] = Preferences.get(pref, defaultPrefValue);
     }
     let rv = [];
     for (let [, pageData] of pageDataStore) {
       if (pageData.url) {
         let uri = null;
         try {
           let urlString = Services.urlFormatter.formatURL(pageData.url.trim());
-          uri = Services.io.newURI(urlString, null, null);
+          uri = Services.io.newURI(urlString);
         } catch (ex) {
           Cu.reportError("Invalid LaterRun page URL " + pageData.url + " ignored.");
           continue;
         }
         if (!uri.schemeIs("https")) {
           Cu.reportError("Insecure LaterRun page URL " + uri.spec + " ignored.");
         } else {
           pageData.url = uri.spec;
--- a/browser/modules/PluginContent.jsm
+++ b/browser/modules/PluginContent.jsm
@@ -23,17 +23,17 @@ XPCOMUtils.defineLazyGetter(this, "gNavi
 XPCOMUtils.defineLazyModuleGetter(this, "AppConstants",
   "resource://gre/modules/AppConstants.jsm");
 
 this.PluginContent = function(global) {
   this.init(global);
 }
 
 const FLASH_MIME_TYPE = "application/x-shockwave-flash";
-const REPLACEMENT_STYLE_SHEET = Services.io.newURI("chrome://pluginproblem/content/pluginReplaceBinding.css", null, null);
+const REPLACEMENT_STYLE_SHEET = Services.io.newURI("chrome://pluginproblem/content/pluginReplaceBinding.css");
 
 PluginContent.prototype = {
   init(global) {
     this.global = global;
     // Need to hold onto the content window or else it'll get destroyed
     this.content = this.global.content;
     // Cache of plugin actions for the current page.
     this.pluginData = new Map();
--- a/browser/modules/SocialService.jsm
+++ b/browser/modules/SocialService.jsm
@@ -69,17 +69,17 @@ var SocialServiceInternal = {
         if (manifest.origin == origin) {
           return pref;
         }
       } catch (err) {
         Cu.reportError("SocialService: failed to load manifest: " + pref +
                        ", exception: " + err);
       }
     }
-    let originUri = Services.io.newURI(origin, null, null);
+    let originUri = Services.io.newURI(origin);
     return originUri.hostPort.replace('.', '-');
   },
   orderedProviders(aCallback) {
     if (SocialServiceInternal.providerArray.length < 2) {
       schedule(function() {
         aCallback(SocialServiceInternal.providerArray);
       });
       return;
@@ -147,17 +147,17 @@ XPCOMUtils.defineLazyGetter(SocialServic
                      ", exception: " + err);
     }
   }
   return providers;
 });
 
 function getOriginActivationType(origin) {
   // if this is an about uri, treat it as a directory
-  let URI = Services.io.newURI(origin, null, null);
+  let URI = Services.io.newURI(origin);
   let principal = Services.scriptSecurityManager.createCodebasePrincipal(URI, {});
   if (Services.scriptSecurityManager.isSystemPrincipal(principal) || origin == "moz-safe-about:home") {
     return "internal";
   }
 
   let directories = Services.prefs.getCharPref("social.directories").split(',');
   if (directories.indexOf(origin) >= 0)
     return "directory";
@@ -504,34 +504,34 @@ this.SocialService = {
       // directory provided manifests must have origin in manifest, use that
       if (!data['origin']) {
         Cu.reportError("SocialService.manifestFromData directory service provided manifest without origin.");
         return null;
       }
       installOrigin = data.origin;
     }
     // force/fixup origin
-    let URI = Services.io.newURI(installOrigin, null, null);
+    let URI = Services.io.newURI(installOrigin);
     let principal = Services.scriptSecurityManager.createCodebasePrincipal(URI, {});
     data.origin = principal.origin;
 
     // iconURL and name are required
     let providerHasFeatures = featureURLs.some(url => data[url]);
     if (!providerHasFeatures) {
       Cu.reportError("SocialService.manifestFromData manifest missing required urls.");
       return null;
     }
     if (!data['name'] || !data['iconURL']) {
       Cu.reportError("SocialService.manifestFromData manifest missing name or iconURL.");
       return null;
     }
     for (let url of resolveURLs) {
       if (data[url]) {
         try {
-          let resolved = Services.io.newURI(principal.URI.resolve(data[url]), null, null);
+          let resolved = Services.io.newURI(principal.URI.resolve(data[url]));
           if (!(resolved.schemeIs("http") || resolved.schemeIs("https"))) {
             Cu.reportError("SocialService.manifestFromData unsupported scheme '" + resolved.scheme + "' for " + principal.origin);
             return null;
           }
           data[url] = resolved.spec;
         } catch (e) {
           Cu.reportError("SocialService.manifestFromData unable to resolve '" + url + "' for " + principal.origin);
           return null;
@@ -546,17 +546,17 @@ this.SocialService = {
     let browserBundle = Services.strings.createBundle("chrome://browser/locale/browser.properties");
 
     // internal/directory activations need to use the manifest origin, any other
     // use the domain activation is occurring on
     let url = data.url;
     if (data.installType == "internal" || data.installType == "directory") {
       url = data.manifest.origin;
     }
-    let requestingURI =  Services.io.newURI(url, null, null);
+    let requestingURI =  Services.io.newURI(url);
     let productName = brandBundle.GetStringFromName("brandShortName");
 
     let message = browserBundle.formatStringFromName("service.install.description",
                                                      [requestingURI.host, productName], 2);
 
     let action = {
       label: browserBundle.GetStringFromName("service.install.ok.label"),
       accessKey: browserBundle.GetStringFromName("service.install.ok.accesskey"),
@@ -615,17 +615,17 @@ this.SocialService = {
     if (!data.manifest)
       throw new Error("Cannot install provider without manifest data");
 
     if (data.installType == "foreign" && !Services.prefs.getBoolPref("social.remote-install.enabled"))
       throw new Error("Remote install of services is disabled");
 
     // if installing from any website, the install must happen over https.
     // "internal" are installs from about:home or similar
-    if (data.installType != "internal" && !Services.io.newURI(data.origin, null, null).schemeIs("https")) {
+    if (data.installType != "internal" && !Services.io.newURI(data.origin).schemeIs("https")) {
       throw new Error("attempt to activate provider over unsecured channel: " + data.origin);
     }
 
     let installer = new AddonInstaller(data.url, data.manifest, installCallback);
     let bypassPanel = options.bypassInstallPanel ||
                       (data.installType == "internal" && data.manifest.oneclick);
     if (bypassPanel)
       installer.install();
@@ -697,17 +697,17 @@ function SocialProvider(input) {
 
   this.name = input.name;
   this.iconURL = input.iconURL;
   this.icon32URL = input.icon32URL;
   this.icon64URL = input.icon64URL;
   this.shareURL = input.shareURL;
   this.postActivationURL = input.postActivationURL;
   this.origin = input.origin;
-  let originUri = Services.io.newURI(input.origin, null, null);
+  let originUri = Services.io.newURI(input.origin);
   this.principal = Services.scriptSecurityManager.createCodebasePrincipal(originUri, {});
   this.ambientNotificationIcons = {};
   this.errorState = null;
   this.frecency = 0;
 
   try {
     this.domain = etld.getBaseDomainFromHost(originUri.host);
   } catch (e) {
@@ -769,17 +769,17 @@ SocialProvider.prototype = {
    *
    * @param {URI or string} uri
    */
   isSameOrigin: function isSameOrigin(uri, allowIfInheritsPrincipal) {
     if (!uri)
       return false;
     if (typeof uri == "string") {
       try {
-        uri = Services.io.newURI(uri, null, null);
+        uri = Services.io.newURI(uri);
       } catch (ex) {
         // an invalid URL can't be loaded!
         return false;
       }
     }
     try {
       this.principal.checkMayLoad(
         uri, // the thing to check.
@@ -797,26 +797,26 @@ SocialProvider.prototype = {
    *
    * Returns nsIURI object or null on failure
    *
    * @param {string} url
    */
   resolveUri: function resolveUri(url) {
     try {
       let fullURL = this.principal.URI.resolve(url);
-      return Services.io.newURI(fullURL, null, null);
+      return Services.io.newURI(fullURL);
     } catch (ex) {
       Cu.reportError("mozSocial: failed to resolve window URL: " + url + "; " + ex);
       return null;
     }
   }
 };
 
 function getAddonIDFromOrigin(origin) {
-  let originUri = Services.io.newURI(origin, null, null);
+  let originUri = Services.io.newURI(origin);
   return originUri.host + ID_SUFFIX;
 }
 
 function getPrefnameFromOrigin(origin) {
   return "social.manifest." + SocialServiceInternal.getManifestPrefname(origin);
 }
 
 function AddonInstaller(sourceURI, aManifest, installCallback) {
--- a/browser/modules/WindowsJumpLists.jsm
+++ b/browser/modules/WindowsJumpLists.jsm
@@ -316,17 +316,17 @@ this.WinTaskbarJumpList =
           delete this._pendingStatements[LIST_TYPE.FREQUENT];
           // The are no more results, build the list.
           this._buildCustom(_getString("taskbar.frequent.label"), items);
           this._commitBuild();
           return;
         }
 
         let title = aResult.title || aResult.uri;
-        let faviconPageUri = Services.io.newURI(aResult.uri, null, null);
+        let faviconPageUri = Services.io.newURI(aResult.uri);
         let shortcut = this._getHandlerAppItem(title, title, aResult.uri, 1,
                                                faviconPageUri);
         items.appendElement(shortcut, false);
         this._frequentHashList.push(aResult.uri);
       },
       this
     );
   },
@@ -361,17 +361,17 @@ this.WinTaskbarJumpList =
 
         // Do not add items to recent that have already been added to frequent.
         if (this._frequentHashList &&
             this._frequentHashList.indexOf(aResult.uri) != -1) {
           return;
         }
 
         let title = aResult.title || aResult.uri;
-        let faviconPageUri = Services.io.newURI(aResult.uri, null, null);
+        let faviconPageUri = Services.io.newURI(aResult.uri);
         let shortcut = this._getHandlerAppItem(title, title, aResult.uri, 1,
                                                faviconPageUri);
         items.appendElement(shortcut, false);
         count++;
       },
       this
     );
   },
--- a/browser/modules/test/browser_SelfSupportBackend.js
+++ b/browser/modules/test/browser_SelfSupportBackend.js
@@ -109,17 +109,17 @@ add_task(function* setupEnvironment() {
 
   // Enable the SelfSupport backend and set the page URL. We also make sure UITour
   // is enabled.
   Preferences.set(PREF_SELFSUPPORT_ENABLED, true);
   Preferences.set(PREF_UITOUR_ENABLED, true);
   Preferences.set(PREF_SELFSUPPORT_URL, TEST_PAGE_URL_HTTPS);
 
   // Whitelist the HTTPS page to use UITour.
-  let pageURI = Services.io.newURI(TEST_PAGE_URL_HTTPS, null, null);
+  let pageURI = Services.io.newURI(TEST_PAGE_URL_HTTPS);
   Services.perms.add(pageURI, "uitour", Services.perms.ALLOW_ACTION);
 
   registerCleanupFunction(() => {
     Services.perms.remove(pageURI, "uitour");
     Preferences.set(PREF_SELFSUPPORT_ENABLED, selfSupportEnabled);
     Preferences.set(PREF_UITOUR_ENABLED, uitourEnabled);
     Preferences.set(PREF_SELFSUPPORT_URL, selfSupportURL);
   });
--- a/browser/modules/test/unit/social/test_SocialService.js
+++ b/browser/modules/test/unit/social/test_SocialService.js
@@ -114,25 +114,25 @@ function* testAddRemoveProvider(manifest
   do_check_true(!newProvider);
 }
 
 function* testIsSameOrigin(manifests, next) {
   let providers = yield SocialService.getProviderList(next);
   let provider = providers[0];
   // provider.origin is a string.
   do_check_true(provider.isSameOrigin(provider.origin));
-  do_check_true(provider.isSameOrigin(Services.io.newURI(provider.origin, null, null)));
+  do_check_true(provider.isSameOrigin(Services.io.newURI(provider.origin)));
   do_check_true(provider.isSameOrigin(provider.origin + "/some-sub-page"));
-  do_check_true(provider.isSameOrigin(Services.io.newURI(provider.origin + "/some-sub-page", null, null)));
+  do_check_true(provider.isSameOrigin(Services.io.newURI(provider.origin + "/some-sub-page")));
   do_check_false(provider.isSameOrigin("http://something.com"));
-  do_check_false(provider.isSameOrigin(Services.io.newURI("http://something.com", null, null)));
+  do_check_false(provider.isSameOrigin(Services.io.newURI("http://something.com")));
   do_check_false(provider.isSameOrigin("data:text/html,<p>hi"));
   do_check_true(provider.isSameOrigin("data:text/html,<p>hi", true));
-  do_check_false(provider.isSameOrigin(Services.io.newURI("data:text/html,<p>hi", null, null)));
-  do_check_true(provider.isSameOrigin(Services.io.newURI("data:text/html,<p>hi", null, null), true));
+  do_check_false(provider.isSameOrigin(Services.io.newURI("data:text/html,<p>hi")));
+  do_check_true(provider.isSameOrigin(Services.io.newURI("data:text/html,<p>hi"), true));
   // we explicitly handle null and return false
   do_check_false(provider.isSameOrigin(null));
 }
 
 function* testResolveUri(manifests, next) {
   let providers = yield SocialService.getProviderList(next);
   let provider = providers[0];
   do_check_eq(provider.resolveUri(provider.origin).spec, provider.origin + "/");
@@ -145,17 +145,17 @@ function* testResolveUri(manifests, next
 function* testOrderedProviders(manifests, next) {
   let providers = yield SocialService.getProviderList(next);
 
   // add visits for only one of the providers
   let visits = [];
   let startDate = Date.now() * 1000;
   for (let i = 0; i < 10; i++) {
     visits.push({
-      uri: Services.io.newURI(providers[1].shareURL + i, null, null),
+      uri: Services.io.newURI(providers[1].shareURL + i),
       visitDate: startDate + i
     });
   }
 
   PlacesTestUtils.addVisits(visits).then(next);
   yield;
   let orderedProviders = yield SocialService.getOrderedProviderList(next);
   do_check_eq(orderedProviders[0], providers[1]);
--- a/browser/modules/test/xpcshell/test_SitePermissions.js
+++ b/browser/modules/test/xpcshell/test_SitePermissions.js
@@ -11,20 +11,20 @@ add_task(function* testPermissionsListin
     ["camera", "cookie", "desktop-notification", "geo", "image",
      "indexedDB", "install", "microphone", "popup", "screen"],
     "Correct list of all permissions");
 });
 
 add_task(function* testGetAllByURI() {
   // check that it returns an empty array on an invalid URI
   // like a file URI, which doesn't support site permissions
-  let wrongURI = Services.io.newURI("file:///example.js", null, null)
+  let wrongURI = Services.io.newURI("file:///example.js")
   Assert.deepEqual(SitePermissions.getAllByURI(wrongURI), []);
 
-  let uri = Services.io.newURI("https://example.com", null, null)
+  let uri = Services.io.newURI("https://example.com")
   Assert.deepEqual(SitePermissions.getAllByURI(uri), []);
 
   SitePermissions.set(uri, "camera", SitePermissions.ALLOW);
   Assert.deepEqual(SitePermissions.getAllByURI(uri), [
       { id: "camera", state: SitePermissions.ALLOW }
   ]);
 
   SitePermissions.set(uri, "microphone", SitePermissions.SESSION);
@@ -50,20 +50,20 @@ add_task(function* testGetAllByURI() {
   SitePermissions.set(uri, "addon", SitePermissions.BLOCK);
   Assert.deepEqual(SitePermissions.getAllByURI(uri), []);
   SitePermissions.remove(uri, "addon");
 });
 
 add_task(function* testGetPermissionDetailsByURI() {
   // check that it returns an empty array on an invalid URI
   // like a file URI, which doesn't support site permissions
-  let wrongURI = Services.io.newURI("file:///example.js", null, null)
+  let wrongURI = Services.io.newURI("file:///example.js")
   Assert.deepEqual(SitePermissions.getPermissionDetailsByURI(wrongURI), []);
 
-  let uri = Services.io.newURI("https://example.com", null, null)
+  let uri = Services.io.newURI("https://example.com")
 
   SitePermissions.set(uri, "camera", SitePermissions.ALLOW);
   SitePermissions.set(uri, "cookie", SitePermissions.SESSION);
   SitePermissions.set(uri, "popup", SitePermissions.BLOCK);
 
   let permissions = SitePermissions.getPermissionDetailsByURI(uri);
 
   let camera = permissions.find(({id}) => id === "camera");
--- a/browser/modules/webrtcUI.jsm
+++ b/browser/modules/webrtcUI.jsm
@@ -309,17 +309,17 @@ function denyRequest(aBrowser, aRequest)
                                            {callID: aRequest.callID,
                                             windowID: aRequest.windowID});
 }
 
 function getHost(uri, href) {
   let host;
   try {
     if (!uri) {
-      uri = Services.io.newURI(href, null, null);
+      uri = Services.io.newURI(href);
     }
     host = uri.host;
   } catch (ex) {}
   if (!host) {
     if (uri && uri.scheme.toLowerCase() == "about") {
       // For about URIs, just use the full spec, without any #hash parts.
       host = uri.specIgnoringRef;
     } else {
@@ -331,17 +331,17 @@ function getHost(uri, href) {
   }
   return host;
 }
 
 function prompt(aBrowser, aRequest) {
   let {audioDevices: audioDevices, videoDevices: videoDevices,
        sharingScreen: sharingScreen, sharingAudio: sharingAudio,
        requestTypes: requestTypes} = aRequest;
-  let uri = Services.io.newURI(aRequest.documentURI, null, null);
+  let uri = Services.io.newURI(aRequest.documentURI);
   let host = getHost(uri);
   let chromeDoc = aBrowser.ownerDocument;
   let stringBundle = chromeDoc.defaultView.gNavigatorBundle;
   let stringId = "getUserMedia.share" + requestTypes.join("And") + "2.message";
   let message = stringBundle.getFormattedString(stringId, [host]);
 
   let notification; // Used by action callbacks.
   let mainAction = {
@@ -585,17 +585,17 @@ function prompt(aBrowser, aRequest) {
                 doc.getElementById("bundle_brand").getString("brandShortName");
               string = bundle.getFormattedString("getUserMedia.shareFirefoxWarning.message",
                                                  [brand, learnMore]);
             }
             warning.innerHTML = string;
           }
 
           let perms = Services.perms;
-          let chromeUri = Services.io.newURI(doc.documentURI, null, null);
+          let chromeUri = Services.io.newURI(doc.documentURI);
           perms.add(chromeUri, "MediaManagerVideo", perms.ALLOW_ACTION,
                     perms.EXPIRE_SESSION);
 
           video.deviceId = deviceId;
           let constraints = { video: { mediaSource: type, deviceId: {exact: deviceId } } };
           chromeWin.navigator.mediaDevices.getUserMedia(constraints).then(stream => {
             if (video.deviceId != deviceId) {
               // The user has selected a different device or closed the panel
--- a/browser/tools/mozscreenshots/head.js
+++ b/browser/tools/mozscreenshots/head.js
@@ -12,17 +12,17 @@ const env = Cc["@mozilla.org/process/env
 const EXTENSION_DIR = "chrome://mochitests/content/extensions/mozscreenshots/browser/";
 
 let TestRunner;
 
 function* setup() {
   requestLongerTimeout(10);
 
   info("installing extension temporarily");
-  let chromeURL = Services.io.newURI(EXTENSION_DIR, null, null);
+  let chromeURL = Services.io.newURI(EXTENSION_DIR);
   let dir = chromeRegistry.convertChromeURL(chromeURL).QueryInterface(Ci.nsIFileURL).file;
   yield AddonManager.installTemporaryAddon(dir);
 
   info("Checking for mozscreenshots extension");
   return new Promise((resolve) => {
     AddonManager.getAddonByID("mozscreenshots@mozilla.org", function(aAddon) {
       isnot(aAddon, null, "The mozscreenshots extension should be installed");
       AddonWatcher.ignoreAddonPermanently(aAddon.id);
--- a/browser/tools/mozscreenshots/mozscreenshots/extension/configurations/ControlCenter.jsm
+++ b/browser/tools/mozscreenshots/mozscreenshots/extension/configurations/ControlCenter.jsm
@@ -78,29 +78,29 @@ this.ControlCenter = {
       applyConfig: Task.async(function* () {
         yield loadPage(HTTPS_PAGE);
         yield openIdentityPopup(true);
       }),
     },
 
     singlePermission: {
       applyConfig: Task.async(function* () {
-        let uri = Services.io.newURI(PERMISSIONS_PAGE, null, null)
+        let uri = Services.io.newURI(PERMISSIONS_PAGE)
         SitePermissions.set(uri, "camera", SitePermissions.ALLOW);
 
         yield loadPage(PERMISSIONS_PAGE);
         yield openIdentityPopup();
       }),
     },
 
     allPermissions: {
       applyConfig: Task.async(function* () {
         // there are 3 possible non-default permission states, so we alternate between them
         let states = [SitePermissions.ALLOW, SitePermissions.BLOCK, SitePermissions.SESSION];
-        let uri = Services.io.newURI(PERMISSIONS_PAGE, null, null)
+        let uri = Services.io.newURI(PERMISSIONS_PAGE)
         SitePermissions.listPermissions().forEach(function(permission, index) {
           SitePermissions.set(uri, permission, states[index % 3]);
         });
 
         yield loadPage(PERMISSIONS_PAGE);
         yield openIdentityPopup();
       }),
     },