Bug 1329958 - remove trailing newURI null parameters in comm-central. r=philipp,aleth
authorFlorian Quèze <florian@queze.net>
Tue, 10 Jan 2017 14:16:22 +0100
changeset 20990 48fcd36a39e793b2c92a76a0128c936762757b5e
parent 20989 5f8d4bef1cb09e0bbe8f704d3839ea94bcbf26c6
child 20991 a5407b27ddc02622e90ca7278c78d8db5145ab77
push id12732
push usermozilla@jorgk.com
push dateTue, 10 Jan 2017 18:01:38 +0000
treeherdercomm-central@a5407b27ddc0 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersphilipp, aleth
bugs1329958
Bug 1329958 - remove trailing newURI null parameters in comm-central. r=philipp,aleth
calendar/base/content/calendar-dnd-listener.js
calendar/base/content/preferences/alarms.js
calendar/base/modules/calAuthUtils.jsm
calendar/base/src/calApplicationUtils.js
calendar/base/src/calTimezoneService.js
calendar/base/src/calUtils.js
calendar/providers/gdata/components/calGoogleCalendar.js
calendar/providers/gdata/content/gdata-calendar-creation.js
calendar/providers/gdata/content/gdata-list-tree.xml
calendar/providers/gdata/modules/gdataRequest.jsm
calendar/providers/gdata/modules/gdataSession.jsm
calendar/providers/gdata/modules/gdataUtils.jsm
calendar/providers/wcap/calWcapRequest.js
calendar/test/unit/test_alarmservice.js
calendar/test/unit/test_attachment.js
calendar/test/unit/test_calmgr.js
calendar/test/unit/test_deleted_items.js
calendar/test/unit/test_gdata_provider.js
calendar/test/unit/test_webcal.js
chat/components/src/smileProtocolHandler.js
chat/content/convbrowser.xml
chat/modules/imThemes.jsm
chat/modules/socket.jsm
editor/ui/composer/content/ComposerCommands.js
editor/ui/composer/content/editorApplicationOverlay.js
editor/ui/composer/content/editorUtilities.js
editor/ui/composer/content/publishprefs.js
editor/ui/dialogs/content/EdImageOverlay.js
editor/ui/dialogs/content/EdLinkChecker.js
im/content/aboutPanel.xml
im/content/accountWizard.js
im/content/engineManager.js
im/content/extensions-discover.js
im/content/extensions.js
im/content/nsContextMenu.js
im/content/preferences/applications.js
im/content/preferences/themes.js
im/modules/ibCore.jsm
ldap/xpcom/tests/unit/test_nsLDAPURL.js
mail/base/content/contentAreaClick.js
mail/base/content/mailCore.js
mail/base/content/mailWindow.js
mail/base/content/mailWindowOverlay.js
mail/base/content/msgHdrViewOverlay.js
mail/base/content/msgMail3PaneWindow.js
mail/base/content/nsContextMenu.js
mail/base/content/nsDragAndDrop.js
mail/base/content/phishingDetector.js
mail/base/content/specialTabs.js
mail/components/aboutRedirector.js
mail/components/addrbook/content/abCardOverlay.js
mail/components/addrbook/content/abCardViewOverlay.js
mail/components/addrbook/content/abCommon.js
mail/components/cloudfile/content/addAccountDialog.js
mail/components/compose/content/MsgComposeCommands.js
mail/components/im/content/imAccountWizard.js
mail/components/im/content/imContextMenu.js
mail/components/newmailaccount/content/accountProvisioner.js
mail/components/preferences/applications.js
mail/components/preferences/chat.js
mail/components/preferences/general.js
mail/components/preferences/permissions.js
mail/test/mozmill/content-policy/test-general-content-policy.js
mail/test/mozmill/newmailaccount/test-newmailaccount.js
mail/test/mozmill/shared-modules/test-nntp-helpers.js
mail/test/resources/mozmill/mozmill/extension/resource/stdlib/httpd.js
mail/test/resources/mozmill/mozmill/extension/resource/stdlib/securable-module.js
mailnews/addrbook/prefs/content/pref-directory-add.js
mailnews/base/prefs/content/accountcreation/sanitizeDatatypes.js
mailnews/base/prefs/content/accountcreation/util.js
mailnews/base/src/nsMailNewsCommandLineHandler.js
mailnews/base/test/unit/test_accountMigration.js
mailnews/base/test/unit/test_nsIMsgContentPolicy.js
mailnews/base/test/unit/test_searchChaining.js
mailnews/base/util/mailnewsMigrator.js
mailnews/compose/test/unit/test_mailtoURL.js
mailnews/compose/test/unit/test_smtpProtocols.js
mailnews/compose/test/unit/test_smtpURL.js
mailnews/extensions/newsblog/content/Feed.js
mailnews/extensions/newsblog/content/FeedItem.js
mailnews/extensions/newsblog/content/FeedUtils.jsm
mailnews/extensions/newsblog/content/feed-parser.js
mailnews/extensions/newsblog/content/feed-subscriptions.js
mailnews/extensions/newsblog/content/newsblogOverlay.js
mailnews/extensions/smime/content/certFetchingStatus.js
mailnews/imap/test/unit/head_server.js
mailnews/imap/test/unit/test_compactOfflineStore.js
mailnews/imap/test/unit/test_dontStatNoSelect.js
mailnews/imap/test/unit/test_downloadOffline.js
mailnews/imap/test/unit/test_imapAttachmentSaves.js
mailnews/imap/test/unit/test_imapAutoSync.js
mailnews/imap/test/unit/test_imapContentLength.js
mailnews/imap/test/unit/test_imapCopyTimeout.js
mailnews/imap/test/unit/test_imapFlagChange.js
mailnews/imap/test/unit/test_imapHdrChunking.js
mailnews/imap/test/unit/test_imapHighWater.js
mailnews/imap/test/unit/test_imapProtocols.js
mailnews/imap/test/unit/test_imapProxy.js
mailnews/imap/test/unit/test_imapStoreMsgOffline.js
mailnews/imap/test/unit/test_largeOfflineStore.js
mailnews/imap/test/unit/test_offlinePlayback.js
mailnews/imap/test/unit/test_offlineStoreLocking.js
mailnews/imap/test/unit/test_saveTemplate.js
mailnews/imap/test/unit/test_stopMovingToLocalFolder.js
mailnews/imap/test/unit/test_syncChanges.js
mailnews/local/test/unit/test_mailboxContentLength.js
mailnews/local/test/unit/test_mailboxProtocol.js
mailnews/news/test/unit/head_server_setup.js
mailnews/news/test/unit/test_bug37465.js
mailnews/news/test/unit/test_nntpContentLength.js
mailnews/news/test/unit/test_nntpProtocols.js
mailnews/news/test/unit/test_nntpUrl.js
mailnews/news/test/unit/test_server.js
mailnews/news/test/unit/test_uriParser.js
mailnews/test/resources/messageInjection.js
suite/browser/mailNavigatorOverlay.js
suite/browser/navigator.js
suite/browser/pageinfo/pageInfo.js
suite/browser/tabbrowser.xml
suite/browser/test/browser/browser_bug413915.js
suite/browser/test/browser/browser_bug623155.js
suite/common/bindings/notification.xml
suite/common/bookmarks/bookmarksManager.js
suite/common/bookmarks/editBookmarkOverlay.js
suite/common/dataman/dataman.js
suite/common/dataman/tests/browser_dataman_basics.js
suite/common/downloads/downloadmanager.js
suite/common/history/history.js
suite/common/nsContextMenu.js
suite/common/permissions/cookieViewer.js
suite/common/permissions/permissionsManager.js
suite/common/pref/pref-applications.js
suite/common/pref/pref-offlineapps.js
suite/common/pref/pref-popups.js
suite/common/pref/preferences.js
suite/common/src/nsAbout.js
suite/common/src/nsGopherProtocolStubHandler.js
suite/common/src/nsSessionStore.js
suite/common/src/nsSuiteGlue.js
suite/common/tests/browser/browser_491168.js
suite/common/utilityOverlay.js
suite/feeds/src/FeedConverter.js
suite/feeds/src/FeedWriter.js
suite/mailnews/addrbook/abCardOverlay.js
suite/mailnews/addrbook/abCommon.js
suite/mailnews/compose/MsgComposeCommands.js
suite/mailnews/mailWindowOverlay.js
suite/mailnews/msgHdrViewOverlay.js
suite/mailnews/nsDragAndDrop.js
suite/mailnews/phishingDetector.js
suite/modules/WindowsJumpLists.jsm
suite/modules/test/unit/test_browser_sanitizer.js
suite/smile/src/smileApplication.js
suite/smile/test/browser_Bookmarks.js
--- a/calendar/base/content/calendar-dnd-listener.js
+++ b/calendar/base/content/calendar-dnd-listener.js
@@ -276,17 +276,17 @@ calDNDBaseObserver.prototype = {
                 }
                 finally {
                     inputStream.close();
                 }
 
                 break;
             case "application/x-moz-file-promise":
             case "text/x-moz-url":
-                var uri = Services.io.newURI(data.toString(), null, null);
+                var uri = Services.io.newURI(data.toString());
                 var loader = Components.classes["@mozilla.org/network/unichar-stream-loader;1"]
                              .createInstance(Components.interfaces.nsIUnicharStreamLoader);
                 var channel = Services.io.newChannelFromURI2(uri,
                                                              null,
                                                              Services.scriptSecurityManager.getSystemPrincipal(),
                                                              null,
                                                              Components.interfaces.nsILoadInfo.SEC_ALLOW_CROSS_ORIGIN_DATA_IS_NULL,
                                                              Components.interfaces.nsIContentPolicy.TYPE_OTHER);
--- a/calendar/base/content/preferences/alarms.js
+++ b/calendar/base/content/preferences/alarms.js
@@ -101,17 +101,17 @@ var gAlarmsPane = {
     previewAlarm: function() {
         let soundUrl = document.getElementById("alarmSoundFileField").value;
         let soundIfc = Components.classes["@mozilla.org/sound;1"]
                             .createInstance(Components.interfaces.nsISound);
         let url;
         try {
             soundIfc.init();
             if (soundUrl && soundUrl.length && soundUrl.length > 0) {
-                url = Services.io.newURI(soundUrl, null, null);
+                url = Services.io.newURI(soundUrl);
                 soundIfc.play(url);
             } else {
                 soundIfc.beep();
             }
         } catch (ex) {
             dump("alarms.js previewAlarm Exception caught! " + ex + "\n");
         }
     },
--- a/calendar/base/modules/calAuthUtils.jsm
+++ b/calendar/base/modules/calAuthUtils.jsm
@@ -72,17 +72,17 @@ cal.auth = {
      * manager functions require it. This is a fallback for compatibility only
      * and should be removed a few versions after Lightning 5.5
      *
      * @param aOrigin       The hostname or origin to check
      * @return              The origin uri
      */
     _ensureOrigin: function(aOrigin) {
         try {
-            return Services.io.newURI(aOrigin, null, null).spec;
+            return Services.io.newURI(aOrigin).spec;
         } catch (e) {
             return "https://" + aOrigin;
         }
     },
 
     /**
      * Helper to insert/update an entry to the password manager.
      *
--- a/calendar/base/src/calApplicationUtils.js
+++ b/calendar/base/src/calApplicationUtils.js
@@ -27,17 +27,17 @@ function launchBrowser(url, event) {
         Components.utils.reportError("launchBrowser: " +
                                      "Invalid URL provided: " + url +
                                      " Only http:// and https:// URLs are valid.");
         return;
     }
 
     Components.classes["@mozilla.org/uriloader/external-protocol-service;1"]
               .getService(Components.interfaces.nsIExternalProtocolService)
-              .loadUrl(Services.io.newURI(url, null, null));
+              .loadUrl(Services.io.newURI(url));
 
     // Make sure that any default click handlers don't do anything, we have taken
     // care of all processing
     if (event) {
         event.stopPropagation();
         event.preventDefault();
     }
 }
--- a/calendar/base/src/calTimezoneService.js
+++ b/calendar/base/src/calTimezoneService.js
@@ -71,17 +71,17 @@ calTimezoneService.prototype = {
     register: function() {},
 
     // calIStartupService:
     startup: function(aCompleteListener) {
         function fetchJSON(aURL) {
             cal.LOG("[calTimezoneService] Loading " + aURL);
 
             return new Promise((resolve, reject) => {
-                let uri = Services.io.newURI(aURL, null, null);
+                let uri = Services.io.newURI(aURL);
                 let channel = Services.io.newChannelFromURI2(uri,
                                                              null,
                                                              Services.scriptSecurityManager.getSystemPrincipal(),
                                                              null,
                                                              Components.interfaces.nsILoadInfo.SEC_REQUIRE_SAME_ORIGIN_DATA_INHERITS,
                                                              Components.interfaces.nsIContentPolicy.TYPE_OTHER);
 
                 NetUtil.asyncFetch(channel, (inputStream, status) => {
--- a/calendar/base/src/calUtils.js
+++ b/calendar/base/src/calUtils.js
@@ -398,17 +398,17 @@ function calPrint() {
 /**
  * Takes a string and returns an nsIURI
  *
  * @param aUriString  the string of the address to for the spec of the nsIURI
  *
  * @returns  an nsIURI whose spec is aUriString
  */
 function makeURL(aUriString) {
-    return Services.io.newURI(aUriString, null, null);
+    return Services.io.newURI(aUriString);
 }
 
 /**
  * Returns a calIDateTime that corresponds to the current time in the user's
  * default timezone.
  */
 function now() {
     let date = cal.jsDateToDateTime(new Date());
--- a/calendar/providers/gdata/components/calGoogleCalendar.js
+++ b/calendar/providers/gdata/components/calGoogleCalendar.js
@@ -141,17 +141,17 @@ calGoogleCalendar.prototype = {
             // Users that installed 1.0 had an issue where secondary calendars
             // were migrated to their own session. This code fixes that and
             // should be removed once 1.0.1 has been out for a while.
             let googleUser = Preferences.get("calendar.google.calPrefs." + fullUser + ".googleUser");
             if (googleUser && googleUser != fullUser) {
                 let newUri = "googleapi://" + googleUser + "/" + path;
                 cal.LOG("[calGoogleCalendar] Migrating url format from " + aUri.spec + " to " + newUri);
                 this.setProperty("uri", newUri);
-                this.mUri = Services.io.newURI(newUri, null, null);
+                this.mUri = Services.io.newURI(newUri);
             }
 
             // Unit tests will use a local uri, if the magic parameter is passed.
             let port = parameters.get("testport");
             if (port) {
                 cal.LOG("[calGoogleCalendar] Redirecting request to test port " + port);
                 API_BASE.EVENTS = "http://localhost:" + port + "/calendar/v3/";
                 API_BASE.TASKS = "http://localhost:" + port + "/tasks/v1/";
@@ -174,17 +174,17 @@ calGoogleCalendar.prototype = {
                 if (googleUser && googleUser == this.mCalendarName) {
                     this.mTasklistName = "@default";
                     newUri += "&tasks=%40default";
                 }
 
                 cal.LOG("[calGoogleCalendar] Migrating url format from " + aUri.spec +
                         " to " + newUri);
                 this.setProperty("uri", newUri);
-                this.mUri = Services.io.newURI(newUri, null, null);
+                this.mUri = Services.io.newURI(newUri);
             }
         }
 
         if (this.id && this.uri) {
             this.ensureSession();
         }
 
         return this.mUri;
--- a/calendar/providers/gdata/content/gdata-calendar-creation.js
+++ b/calendar/providers/gdata/content/gdata-calendar-creation.js
@@ -176,28 +176,28 @@ CuImport("resource://gre/modules/Promise
                     if ((match = spec.match(/tasks=([^&]*)/))) {
                         existing.add(decodeURIComponent(match[0]));
                     }
                 }
             }
 
             let taskcals = tasksLists.map(function(tasklist) {
                 let uri = "googleapi://" + session.id + "/?tasks=" + encodeURIComponent(tasklist.id);
-                let calendar = calMgr.createCalendar("gdata", Services.io.newURI(uri, null, null));
+                let calendar = calMgr.createCalendar("gdata", Services.io.newURI(uri));
                 calendar.id = cal.getUUID();
                 calendar.setProperty("color", cal.hashColor(tasklist.title));
                 calendar.name = tasklist.title;
                 if (existing.has("tasks=" + tasklist.id)) {
                     calendar.readOnly = true;
                 }
                 return calendar;
             });
             let calcals = calendarList.map(function(calendarEntry) {
                 let uri = "googleapi://" + session.id + "/?calendar=" + encodeURIComponent(calendarEntry.id);
-                let calendar = calMgr.createCalendar("gdata", Services.io.newURI(uri, null, null));
+                let calendar = calMgr.createCalendar("gdata", Services.io.newURI(uri));
                 calendar.name = calendarEntry.summary;
                 calendar.id = cal.getUUID();
                 calendar.setProperty("color", calendarEntry.backgroundColor);
                 if (existing.has("calendar=" + calendarEntry.id)) {
                     calendar.readOnly = true;
                 }
                 return calendar;
             });
--- a/calendar/providers/gdata/content/gdata-list-tree.xml
+++ b/calendar/providers/gdata/content/gdata-list-tree.xml
@@ -66,29 +66,29 @@
       <constructor><![CDATA[
         this.tree.view = this;
       ]]></constructor>
 
       <property name="mockCalendarHeader" readonly="true">
         <getter><![CDATA[
           let calmgr = cal.getCalendarManager();
           let uri = "dummy://calendar";
-          let mem = calmgr.createCalendar("memory", Services.io.newURI(uri, null, null));
+          let mem = calmgr.createCalendar("memory", Services.io.newURI(uri));
           mem.setProperty("disabled", true);
           mem.name = "Calendars";
           mem.id = cal.getUUID();
           return mem;
         ]]></getter>
       </property>
 
       <property name="mockTaskHeader" readonly="true">
         <getter><![CDATA[
           let calmgr = cal.getCalendarManager();
           let uri = "dummy://tasks";
-          let mem = calmgr.createCalendar("memory", Services.io.newURI(uri, null, null));
+          let mem = calmgr.createCalendar("memory", Services.io.newURI(uri));
           mem.setProperty("disabled", true);
           mem.name = "Task Lists";
           mem.id = cal.getUUID();
           return mem;
         ]]></getter>
       </property>
 
       <field name="mCalendarHeaderIndex">0</field>
--- a/calendar/providers/gdata/modules/gdataRequest.jsm
+++ b/calendar/providers/gdata/modules/gdataRequest.jsm
@@ -191,17 +191,17 @@ calGoogleRequest.prototype = {
                 let params = [];
 
                 // Using forEach is needed for backwards compatibility
                 this.mQueryParameters.forEach(function(v, k) {
                     params.push(k + "=" + encodeURIComponent(v));
                 });
                 uristring += "?" + params.join("&");
             }
-            let uri = Services.io.newURI(uristring, null, null);
+            let uri = Services.io.newURI(uristring);
             let channel;
             if ("newChannelFromURI2" in Services.io) {
                 // Lightning 4.3+
                 channel = Services.io.newChannelFromURI2(uri,
                                                          null,
                                                          Services.scriptSecurityManager.getSystemPrincipal(),
                                                          null,
                                                          Components.interfaces.nsILoadInfo.SEC_ALLOW_CROSS_ORIGIN_DATA_IS_NULL,
--- a/calendar/providers/gdata/modules/gdataSession.jsm
+++ b/calendar/providers/gdata/modules/gdataSession.jsm
@@ -190,17 +190,17 @@ calGoogleSession.prototype = {
             for (let perm in fixIterator(Services.perms.enumerator, Components.interfaces.nsIPermission)) {
                 if (perm.type == "cookie" && perm.host == "google.com") {
                     found = perm;
                     break;
                 }
             }
 
             if (!found || found.capability != nIPM.DENY_ACTION) {
-                let uri = Services.io.newURI("http://google.com", null, null);
+                let uri = Services.io.newURI("http://google.com");
                 if (Services.vc.compare(Services.appinfo.platformVersion, 42) >= 0) {
                     Services.perms.remove(uri, "cookie");
                 } else {
                     // Earlier versions take a string argument instead of nsIURI.
                     Services.perms.remove(uri.host, "cookie");
                 }
                 Services.perms.add(uri, "cookie", nIPM.ALLOW_ACTION, nIPM.EXPIRE_SESSION);
             }
--- a/calendar/providers/gdata/modules/gdataUtils.jsm
+++ b/calendar/providers/gdata/modules/gdataUtils.jsm
@@ -893,17 +893,17 @@ function JSONToTask(aEntry, aCalendar, a
             relation.relType = "PARENT";
             relation.relId = aEntry.parent;
             item.addRelation(relation);
         }
 
         if (aEntry.links) {
             for (let link of aEntry.links) {
                 let attach = cal.createAttachment();
-                attach.uri = Services.io.newURI(link.link, null, null);
+                attach.uri = Services.io.newURI(link.link);
                 attach.setParameter("FILENAME", link.description);
                 attach.setParameter("X-GOOGLE-TYPE", link.type);
                 item.addAttachment(attach);
             }
         }
 
         // updated (This must be set last!)
         item.setProperty("DTSTAMP", cal.fromRFC3339(aEntry.updated, calendarZone).getInTimezone(cal.UTC()));
--- a/calendar/providers/wcap/calWcapRequest.js
+++ b/calendar/providers/wcap/calWcapRequest.js
@@ -391,17 +391,17 @@ calWcapNetworkRequest.prototype = {
 };
 
 function issueNetworkRequest(parentRequest, respFunc, url, bLogging) {
     let netRequest = new calWcapNetworkRequest(url, respFunc, bLogging);
     if (parentRequest) {
         parentRequest.attachSubRequest(netRequest);
     }
     try {
-        let uri = Services.io.newURI(url, null, null);
+        let uri = Services.io.newURI(url);
         let channel = Services.io.newChannelFromURI2(uri,
                                                      null,
                                                      Services.scriptSecurityManager.getSystemPrincipal(),
                                                      null,
                                                      Components.interfaces.nsILoadInfo.SEC_ALLOW_CROSS_ORIGIN_DATA_IS_NULL,
                                                      Components.interfaces.nsIContentPolicy.TYPE_OTHER);
         netRequest.prepareChannel(channel);
         channel = channel.QueryInterface(Components.interfaces.nsIHttpChannel);
--- a/calendar/test/unit/test_alarmservice.js
+++ b/calendar/test/unit/test_alarmservice.js
@@ -384,17 +384,17 @@ function doAcknowledgeTest(aCalendar) {
     alarmObserver.expectResult(aCalendar, item2, alarm2, EXPECT_NONE);
     alarmObserver.checkExpected("doAcknowledgeTest, test dismiss alarm");
 }
 
 function doRunTest(aOnCalendarCreated, aOnAlarmsLoaded) {
     alarmObserver.clear();
 
     let calmgr = cal.getCalendarManager();
-    let memory = calmgr.createCalendar("memory", Services.io.newURI("moz-memory-calendar://", null, null));
+    let memory = calmgr.createCalendar("memory", Services.io.newURI("moz-memory-calendar://"));
     memory.id = cal.getUUID();
 
     if (aOnCalendarCreated) {
         aOnCalendarCreated.call(aOnCalendarCreated, memory);
     }
 
     calmgr.registerCalendar(memory);
 
--- a/calendar/test/unit/test_attachment.js
+++ b/calendar/test/unit/test_attachment.js
@@ -84,27 +84,27 @@ function test_binaryattach() {
     ok(!!propIcalString.match(/FMTTYPE=x-moz\/test2/));
     ok(!!propIcalString.match(/VALUE=BINARY/));
     ok(!!propIcalString.replace("\r\n ", "").match(/:aHR0cDovL2hlbGxvMg==/));
 }
 
 function test_serialize() {
     let attach = cal.createAttachment();
     attach.formatType = "x-moz/test2";
-    attach.uri = Services.io.newURI("data:text/plain,", null, null);
+    attach.uri = Services.io.newURI("data:text/plain,");
     equal(attach.icalString, "ATTACH;FMTTYPE=x-moz/test2:data:text/plain,\r\n");
 
     attach = cal.createAttachment();
     attach.encoding = "BASE64";
-    attach.uri = Services.io.newURI("data:text/plain,", null, null);
+    attach.uri = Services.io.newURI("data:text/plain,");
     equal(attach.icalString, "ATTACH;ENCODING=BASE64:data:text/plain,\r\n");
 
     throws(() => {
         attach.icalString = "X-STICKER:smiley";
     }, /Illegal value/);
 
     attach = cal.createAttachment();
-    attach.uri = Services.io.newURI("data:text/plain,", null, null);
+    attach.uri = Services.io.newURI("data:text/plain,");
     attach.setParameter("X-PROP", "VAL");
     equal(attach.icalString, "ATTACH;X-PROP=VAL:data:text/plain,\r\n");
     attach.setParameter("X-PROP", null);
     equal(attach.icalString, "ATTACH:data:text/plain,\r\n");
 }
--- a/calendar/test/unit/test_calmgr.js
+++ b/calendar/test/unit/test_calmgr.js
@@ -27,17 +27,17 @@ add_test(function test_registration() {
         deleted = false;
     }
 
     // Initially there should be no calendars
     let calmgr = cal.getCalendarManager();
     checkCalendarCount(0, 0, 0);
 
     // Create a local memory calendar, ths shouldn't register any calendars
-    let memory = calmgr.createCalendar("memory", Services.io.newURI("moz-memory-calendar://", null, null));
+    let memory = calmgr.createCalendar("memory", Services.io.newURI("moz-memory-calendar://"));
     checkCalendarCount(0, 0, 0);
 
     // Register an observer to test it.
     let registered = false, unregistered = false, deleted = false, readOnly = false;
     let mgrobs = cal.createAdapter(Components.interfaces.calICalendarManagerObserver, {
         onCalendarRegistered: function(aCalendar) {
             if (aCalendar.id == memory.id) {
                 registered = true;
@@ -122,18 +122,18 @@ add_test(function test_calobserver() {
     }
     function resetCounters() {
         calcounter = { addItem: 0, modifyItem: 0, deleteItem: 0 };
         allcounter = { addItem: 0, modifyItem: 0, deleteItem: 0 };
     }
 
     // First of all we need a local calendar to work on and some variables
     let calmgr = cal.getCalendarManager();
-    let memory = calmgr.createCalendar("memory", Services.io.newURI("moz-memory-calendar://", null, null));
-    let memory2 = calmgr.createCalendar("memory", Services.io.newURI("moz-memory-calendar://", null, null));
+    let memory = calmgr.createCalendar("memory", Services.io.newURI("moz-memory-calendar://"));
+    let memory2 = calmgr.createCalendar("memory", Services.io.newURI("moz-memory-calendar://"));
     let calcounter, allcounter;
 
     // These observers will end up counting calls which we will use later on
     let calobs = cal.createAdapter(Components.interfaces.calIObserver, {
         onAddItem: () => calcounter.addItem++,
         onModifyItem: () => calcounter.modifyItem++,
         onDeleteItem: () => calcounter.deleteItem++
     });
@@ -221,17 +221,17 @@ add_test(function test_removeModes() {
         };
     }
 
     // For better readability
     const SHOULD_DELETE = true, SHOULD_NOT_DELETE = false;
     const cICM = Components.interfaces.calICalendarManager;
 
     let calmgr = cal.getCalendarManager();
-    let memory = calmgr.createCalendar("memory", Services.io.newURI("moz-memory-calendar://", null, null));
+    let memory = calmgr.createCalendar("memory", Services.io.newURI("moz-memory-calendar://"));
     let baseCalendarCount = calmgr.calendarCount;
     let removeModes = null;
     let deleteCalled = false;
 
     mockCalendar(memory);
 
     checkCounts([], SHOULD_NOT_DELETE, 1);
     checkCounts(["unsubscribe"], SHOULD_NOT_DELETE, 0);
@@ -240,30 +240,30 @@ add_test(function test_removeModes() {
     checkCounts(["delete"], SHOULD_DELETE, 0);
 
     run_next_test();
 });
 
 add_test(function test_calprefs() {
     let prop;
     let calmgr = cal.getCalendarManager();
-    let memory = calmgr.createCalendar("memory", Services.io.newURI("moz-memory-calendar://", null, null));
+    let memory = calmgr.createCalendar("memory", Services.io.newURI("moz-memory-calendar://"));
     calmgr.registerCalendar(memory);
     let memid = memory.id;
 
     // First set a few values, one of each relevant type
     memory.setProperty("stringpref", "abc");
     memory.setProperty("boolpref", true);
     memory.setProperty("intpref", 123);
     memory.setProperty("bigintpref", 1394548721296);
     memory.setProperty("floatpref", 0.5);
 
     // Before checking the value, reinitialize the memory calendar with the
     // same id to make sure the pref value isn't just cached
-    memory = calmgr.createCalendar("memory", Services.io.newURI("moz-memory-calendar://", null, null));
+    memory = calmgr.createCalendar("memory", Services.io.newURI("moz-memory-calendar://"));
     memory.id = memid;
 
     // First test the standard types
     prop = memory.getProperty("stringpref");
     equal(typeof prop, "string");
     equal(prop, "abc");
 
     prop = memory.getProperty("boolpref");
@@ -280,27 +280,27 @@ add_test(function test_calprefs() {
     equal(prop, 1394548721296);
 
     prop = memory.getProperty("floatpref");
     equal(typeof prop, "number");
     equal(prop, 0.5);
 
     // Check if changing pref types works. We need to reset the calendar again
     // because retrieving the value just cached it again.
-    memory = calmgr.createCalendar("memory", Services.io.newURI("moz-memory-calendar://", null, null));
+    memory = calmgr.createCalendar("memory", Services.io.newURI("moz-memory-calendar://"));
     memory.id = memid;
 
     calmgr.setCalendarPref_(memory, "boolpref", "kinda true");
     prop = memory.getProperty("boolpref");
     equal(typeof prop, "string");
     equal(prop, "kinda true");
 
     // Check if unsetting a pref works
     memory.setProperty("intpref", null);
-    memory = calmgr.createCalendar("memory", Services.io.newURI("moz-memory-calendar://", null, null));
+    memory = calmgr.createCalendar("memory", Services.io.newURI("moz-memory-calendar://"));
     memory.id = memid;
     prop = memory.getProperty("intpref");
     ok(prop === null);
 
 
     // We are done now, start the next test
     run_next_test();
 });
--- a/calendar/test/unit/test_deleted_items.js
+++ b/calendar/test/unit/test_deleted_items.js
@@ -31,17 +31,17 @@ add_task(function* test_deleted_items() 
     // No items have been deleted, retrieving one should return null.
     equal(delmgr.getDeletedDate("random"), null);
     equal(delmgr.getDeletedDate("random", "random"), null);
 
     // Make sure the cache is initially flushed and that this doesn't throw an
     // error.
     yield check_delmgr_call(() => delmgr.flush());
 
-    let memory = calmgr.createCalendar("memory", Services.io.newURI("moz-storage-calendar://", null, null));
+    let memory = calmgr.createCalendar("memory", Services.io.newURI("moz-storage-calendar://"));
     calmgr.registerCalendar(memory);
 
     let item = cal.createEvent();
     item.id = "test-item-1";
     item.startDate = cal.now();
     item.endDate = cal.now();
 
     // Add the item, it still shouldn't be in the deleted database.
--- a/calendar/test/unit/test_gdata_provider.js
+++ b/calendar/test/unit/test_gdata_provider.js
@@ -191,17 +191,17 @@ GDataServer.prototype = {
     },
 
     getClient: function() {
         let uri = "googleapi://xpcshell/" +
                   "?testport=" + this.server.identity.primaryPort +
                   (this.calendarId ? "&calendar=" + encodeURIComponent(this.calendarId) : "") +
                   (this.tasksId ? "&tasks=" + encodeURIComponent(this.tasksId) : "");
         let calmgr = cal.getCalendarManager();
-        let client = calmgr.createCalendar("gdata", Services.io.newURI(uri, null, null));
+        let client = calmgr.createCalendar("gdata", Services.io.newURI(uri));
         let uclient = client.wrappedJSObject;
         client.name = "xpcshell";
 
         // Make sure we catch the last error message in case sync fails
         monkeyPatch(uclient, "replayChangesOn", (protofunc, aListener) => {
             protofunc({
                 onResult: function(operation, detail) {
                     uclient._lastStatus = operation.status;
@@ -507,17 +507,17 @@ function run_test() {
                 }
             });
         }
     });
 }
 
 add_task(function* test_migrate_cache() {
     let uriString = "googleapi://xpcshell/?calendar=xpcshell%40example.com";
-    let uri = Services.io.newURI(uriString, null, null);
+    let uri = Services.io.newURI(uriString);
     let client = cal.getCalendarManager().createCalendar("gdata", uri);
     let unwrapped = client.wrappedJSObject;
     let migrateStorageCache = unwrapped.migrateStorageCache.bind(unwrapped);
 
     monkeyPatch(unwrapped, "resetSync", (protofunc) => {
         return Promise.resolve();
     });
 
@@ -534,24 +534,24 @@ add_task(function* test_migrate_cache() 
     // Check migrate 2 -> 3 normal calendar
     unwrapped.CACHE_DB_VERSION = 3;
     client.setProperty("cache.version", 2);
     equal(yield migrateStorageCache(), false);
 
     // Check migrate 2 -> 3 birthday calendar
     unwrapped.CACHE_DB_VERSION = 3;
     uri = "googleapi://xpcshell/?calendar=%23contacts%40group.v.calendar.google.com";
-    unwrapped.uri = Services.io.newURI(uri, null, null);
+    unwrapped.uri = Services.io.newURI(uri);
     client.setProperty("cache.version", 2);
     equal(yield migrateStorageCache(), true);
 });
 
 add_test(function test_migrate_uri() {
     function checkMigrate(fromUri, session, calendarId, tasksId) {
-        let uri = Services.io.newURI(fromUri, null, null);
+        let uri = Services.io.newURI(fromUri);
         let client = cal.getCalendarManager().createCalendar("gdata", uri);
 
         if (session) {
             let target = ("googleapi://" + session + "/?" +
                          (calendarId ? "&calendar=" + encodeURIComponent(calendarId) : "") +
                          (tasksId ? "&tasks=" + encodeURIComponent(tasksId) : "")).replace("?&", "?");
             equal(client.getProperty("uri"), target);
         } else {
--- a/calendar/test/unit/test_webcal.js
+++ b/calendar/test/unit/test_webcal.js
@@ -22,17 +22,17 @@ function run_test() {
     // add_test(check_webcal_uri.bind(null, "webcals" + baseUri));
     add_test(() => httpserv.stop(run_next_test));
 
     // Now lets go...
     run_next_test();
 }
 
 function check_webcal_uri(aUri) {
-    let uri = Services.io.newURI(aUri, null, null);
+    let uri = Services.io.newURI(aUri);
 
     let channel = Services.io.newChannelFromURI2(uri,
                                                  null,
                                                  Services.scriptSecurityManager.getSystemPrincipal(),
                                                  null,
                                                  Components.interfaces.nsILoadInfo.SEC_ALLOW_CROSS_ORIGIN_DATA_IS_NULL,
                                                  Components.interfaces.nsIContentPolicy.TYPE_OTHER);
 
--- a/chat/components/src/smileProtocolHandler.js
+++ b/chat/components/src/smileProtocolHandler.js
@@ -26,17 +26,17 @@ smileProtocolHandler.prototype = {
     uri.mutable = false;
     return uri;
   },
   newChannel: function SPH_newChannel(aURI) {
     return this.newChannel2(aURI, null);
   },
   newChannel2: function SPH_newChannel2(aURI, aLoadInfo) {
     let smile = aURI.spec.replace(kSmileRegexp, "");
-    let uri = Services.io.newURI(getSmileRealURI(smile), null, null);
+    let uri = Services.io.newURI(getSmileRealURI(smile));
     let channel = Services.io.newChannelFromURIWithLoadInfo(uri, aLoadInfo);
     channel.originalURI = aURI;
     return channel;
   },
   allowPort: function SPH_allowPort(aPort, aScheme) { return false; },
 
   classDescription: "Smile Protocol Handler",
   classID: Components.ID("{04e58eae-dfbc-4c9e-8130-6d9ef19cbff4}"),
--- a/chat/content/convbrowser.xml
+++ b/chat/content/convbrowser.xml
@@ -1279,17 +1279,17 @@
           for (let elem = event.target; elem; elem = elem.parentNode) {
             if (elem instanceof HTMLAnchorElement) {
               url = elem.href;
               if (url)
                 break;
             }
           }
           if (url) {
-            let uri = Services.io.newURI(url, null, null);
+            let uri = Services.io.newURI(url);
 
             // http and https are the only schemes that are both
             // allowed by our IM filters and exposed.
             if (!uri.schemeIs("http") && !uri.schemeIs("https"))
               return;
 
             event.preventDefault();
             event.stopPropagation();
--- a/chat/modules/imThemes.jsm
+++ b/chat/modules/imThemes.jsm
@@ -222,25 +222,25 @@ function getCurrentTheme()
   }
 
   return gCurrentTheme;
 }
 
 function getDirectoryEntries(aDir)
 {
   let ios = Services.io;
-  let uri = ios.newURI(aDir, null, null);
+  let uri = ios.newURI(aDir);
   let cr = Components.classes["@mozilla.org/chrome/chrome-registry;1"]
                      .getService(Ci.nsIXULChromeRegistry);
   while (uri.scheme == "chrome")
     uri = cr.convertChromeURL(uri);
 
   // remove any trailing file name added by convertChromeURL
   let spec = uri.spec.replace(/[^\/]+$/, "");
-  uri = ios.newURI(spec, null, null);
+  uri = ios.newURI(spec);
 
   let results = [];
   if (uri.scheme == "jar") {
     uri.QueryInterface(Ci.nsIJARURI);
     let strEntry = uri.JAREntry;
     if (!strEntry)
       return [];
 
--- a/chat/modules/socket.jsm
+++ b/chat/modules/socket.jsm
@@ -172,17 +172,17 @@ var Socket = {
     else {
       try {
         // Attempt to get a default proxy from the proxy service.
         let proxyService = Cc["@mozilla.org/network/protocol-proxy-service;1"]
                               .getService(Ci.nsIProtocolProxyService);
 
         // Add a URI scheme since, by default, some protocols (i.e. IRC) don't
         // have a URI scheme before the host.
-        let uri = Services.io.newURI("http://" + this.host, null, null);
+        let uri = Services.io.newURI("http://" + this.host);
         // This will return null when the result is known immediately and
         // the callback will just be dispatched to the current thread.
         this._proxyCancel = proxyService.asyncResolve(uri, this.proxyFlags, this);
       } catch(e) {
         Cu.reportError(e);
         // We had some error getting the proxy service, just don't use one.
         this._createTransport(null);
       }
--- a/editor/ui/composer/content/ComposerCommands.js
+++ b/editor/ui/composer/content/ComposerCommands.js
@@ -745,17 +745,17 @@ function GetSuggestedFileName(aDocumentU
   if (extension)
     extension = "." + extension;
 
   // check for existing file name we can use
   if (aDocumentURLString && !IsUrlAboutBlank(aDocumentURLString))
   {
     try {
       let docURI = Services.io.newURI(aDocumentURLString,
-        GetCurrentEditor().documentCharacterSet, null);
+        GetCurrentEditor().documentCharacterSet);
       docURI = docURI.QueryInterface(Components.interfaces.nsIURL);
 
       // grab the file name
       let url = validateFileName(decodeURIComponent(docURI.fileBaseName));
       if (url)
         return url + extension;
     } catch(e) {}
   }
@@ -804,17 +804,17 @@ function PromptForSaveLocation(aDoSaveAs
 
   // set the file picker's current directory
   // assuming we have information needed (like prior saved location)
   try {
     var fileHandler = GetFileProtocolHandler();
 
     var isLocalFile = true;
     try {
-      let docURI = Services.io.newURI(aDocumentURLString, GetCurrentEditor().documentCharacterSet, null);
+      let docURI = Services.io.newURI(aDocumentURLString, GetCurrentEditor().documentCharacterSet);
       isLocalFile = docURI.schemeIs("file");
     }
     catch (e) {}
 
     var parentLocation = null;
     if (isLocalFile)
     {
       var fileLocation = fileHandler.getFileFromURLSpec(aDocumentURLString); // this asserts if url is not local
@@ -1164,17 +1164,17 @@ var gEditorOutputProgressListener =
 
         if (gPersistObj.result == 0)
         {
           // All files are finished and publishing succeeded (some images may have failed)
           try {
             // Make a new docURI from the "browse location" in case "publish location" was FTP
             // We need to set document uri before notifying listeners
             var docUrl = GetDocUrlFromPublishData(gPublishData);
-            SetDocumentURI(Services.io.newURI(docUrl, editor.documentCharacterSet, null));
+            SetDocumentURI(Services.io.newURI(docUrl, editor.documentCharacterSet));
 
             UpdateWindowTitle();
 
             // this should cause notification to listeners that doc has changed
             editor.resetModificationCount();
 
             // Set UI based on whether we're editing a remote or local url
             SetSaveAndPublishUI(urlstring);
@@ -1637,17 +1637,17 @@ function SaveDocument(aSaveAs, aSaveCopy
 
   var success = true;
   try {
     // if somehow we didn't get a local file but we did get a uri,
     // attempt to create the localfile if it's a "file" url
     var docURI;
     if (!tempLocalFile)
     {
-      docURI = Services.io.newURI(urlstring, editor.documentCharacterSet, null);
+      docURI = Services.io.newURI(urlstring, editor.documentCharacterSet);
 
       if (docURI.schemeIs("file"))
       {
         var fileHandler = GetFileProtocolHandler();
         tempLocalFile = fileHandler.getFileFromURLSpec(urlstring).QueryInterface(Components.interfaces.nsILocalFile);
       }
     }
 
@@ -1679,17 +1679,17 @@ function SaveDocument(aSaveAs, aSaveCopy
             relatedFilesDir = tempLocalFile.parent;
         }
         else
         {
           var lastSlash = urlstring.lastIndexOf("\/");
           if (lastSlash != -1)
           {
             var relatedFilesDirString = urlstring.slice(0, lastSlash + 1);  // include last slash
-            relatedFilesDir = Services.io.newURI(relatedFilesDirString, editor.documentCharacterSet, null);
+            relatedFilesDir = Services.io.newURI(relatedFilesDirString, editor.documentCharacterSet);
           }
         }
       } catch(e) { relatedFilesDir = null; }
     }
 
     let destinationLocation = tempLocalFile ? tempLocalFile : docURI;
 
     success = OutputFileWithPersistAPI(editorDoc, destinationLocation, relatedFilesDir, aMimeType);
@@ -1890,17 +1890,17 @@ function CreateURIFromPublishData(publis
   var URI;
   try {
     var spec = publishData.publishUrl;
     if (doDocUri)
       spec += FormatDirForPublishing(publishData.docDir) + publishData.filename;
     else
       spec += FormatDirForPublishing(publishData.otherDir);
 
-    URI = Services.io.newURI(spec, GetCurrentEditor().documentCharacterSet, null);
+    URI = Services.io.newURI(spec, GetCurrentEditor().documentCharacterSet);
 
     if (publishData.username)
       URI.username = publishData.username;
     if (publishData.password)
       URI.password = publishData.password;
   }
   catch (e) {}
 
--- a/editor/ui/composer/content/editorApplicationOverlay.js
+++ b/editor/ui/composer/content/editorApplicationOverlay.js
@@ -111,17 +111,17 @@ function editPage(url, aFileType)
       NewEditorWindow(url, charsetArg);
 
   } catch(e) {}
 }
 
 function createURI(urlstring)
 {
   try {
-    return Services.io.newURI(urlstring, null, null);
+    return Services.io.newURI(urlstring);
   } catch (e) {}
 
   return null;
 }
 
 function CheckOpenWindowForURIMatch(uri, win)
 {
   try {
--- a/editor/ui/composer/content/editorUtilities.js
+++ b/editor/ui/composer/content/editorUtilities.js
@@ -541,18 +541,18 @@ function MakeRelativeUrl(url)
   var docHost = GetHost(docUrl);
   var urlHost = GetHost(inputUrl);
   if (docHost != urlHost)
     return inputUrl;
 
 
   // Get just the file path part of the urls
   // XXX Should we use GetCurrentEditor().documentCharacterSet for 2nd param ?
-  let docPath = Services.io.newURI(docUrl, GetCurrentEditor().documentCharacterSet, null).path;
-  let urlPath = Services.io.newURI(inputUrl, GetCurrentEditor().documentCharacterSet, null).path;
+  let docPath = Services.io.newURI(docUrl, GetCurrentEditor().documentCharacterSet).path;
+  let urlPath = Services.io.newURI(inputUrl, GetCurrentEditor().documentCharacterSet).path;
 
   // We only return "urlPath", so we can convert
   //  the entire docPath for case-insensitive comparisons
   var os = GetOS();
   var doCaseInsensitive = (docScheme == "file" && os == gWin);
   if (doCaseInsensitive)
     docPath = docPath.toLowerCase();
 
@@ -654,17 +654,17 @@ function MakeAbsoluteUrl(url)
   let docScheme = GetScheme(docUrl);
 
   // Can't relativize if no doc scheme (page hasn't been saved)
   if (!docScheme)
     return resultUrl;
 
   // Make a URI object to use its "resolve" method
   let absoluteUrl = resultUrl;
-  let docUri = Services.io.newURI(docUrl, GetCurrentEditor().documentCharacterSet, null);
+  let docUri = Services.io.newURI(docUrl, GetCurrentEditor().documentCharacterSet);
 
   try {
     absoluteUrl = docUri.resolve(resultUrl);
     // This is deprecated and buggy!
     // If used, we must make it a path for the parent directory (remove filename)
     //absoluteUrl = IOService.resolveRelativePath(resultUrl, docUrl);
   } catch (e) {}
 
@@ -720,44 +720,44 @@ function GetScheme(urlspec)
 
 function GetHost(urlspec)
 {
   if (!urlspec)
     return "";
 
   var host = "";
   try {
-    host = Services.io.newURI(urlspec, null, null).host;
+    host = Services.io.newURI(urlspec).host;
    } catch (e) {}
 
   return host;
 }
 
 function GetUsername(urlspec)
 {
   if (!urlspec)
     return "";
 
   var username = "";
   try {
-    username = Services.io.newURI(urlspec, null, null).username;
+    username = Services.io.newURI(urlspec).username;
   } catch (e) {}
 
   return username;
 }
 
 function GetFilename(urlspec)
 {
   if (!urlspec || IsUrlAboutBlank(urlspec))
     return "";
 
   var filename;
 
   try {
-    let uri = Services.io.newURI(urlspec, null, null);
+    let uri = Services.io.newURI(urlspec);
     if (uri)
     {
       let url = uri.QueryInterface(Components.interfaces.nsIURL);
       if (url)
         filename = url.fileName;
     }
   } catch (e) {}
 
@@ -778,17 +778,17 @@ function StripUsernamePassword(urlspec, 
   if (passwordObj)
     passwordObj.value = "";
 
   // "@" must exist else we will never detect username or password
   var atIndex = urlspec.indexOf("@");
   if (atIndex > 0)
   {
     try {
-      let uri = Services.io.newURI(urlspec, null, null);
+      let uri = Services.io.newURI(urlspec);
       let username = uri.username;
       let password = uri.password;
 
       if (usernameObj && username)
         usernameObj.value = username;
       if (passwordObj && password)
         passwordObj.value = password;
       if (username)
@@ -811,17 +811,17 @@ function StripPassword(urlspec, password
   if (passwordObj)
     passwordObj.value = "";
 
   // "@" must exist else we will never detect password
   var atIndex = urlspec.indexOf("@");
   if (atIndex > 0)
   {
     try {
-      let password = Services.io.newURI(urlspec, null, null).password;
+      let password = Services.io.newURI(urlspec).password;
 
       if (passwordObj && password)
         passwordObj.value = password;
       if (password)
       {
         // Find last ":" before "@"
         let colon = urlspec.lastIndexOf(":", atIndex);
         if (colon != -1)
@@ -855,17 +855,17 @@ function StripUsernamePasswordFromURI(ur
 }
 
 function InsertUsernameIntoUrl(urlspec, username)
 {
   if (!urlspec || !username)
     return urlspec;
 
   try {
-    let URI = Services.io.newURI(urlspec, GetCurrentEditor().documentCharacterSet, null);
+    let URI = Services.io.newURI(urlspec, GetCurrentEditor().documentCharacterSet);
     URI.username = username;
     return URI.spec;
   } catch (e) {}
 
   return urlspec;
 }
 
 function GetOS()
--- a/editor/ui/composer/content/publishprefs.js
+++ b/editor/ui/composer/content/publishprefs.js
@@ -855,17 +855,17 @@ function SavePassword(publishData)
   return true;
 }
 
 function GetUrlForPasswordManager(publishData)
 {
   if (!publishData || !publishData.publishUrl)
     return false;
 
-  let url = Services.io.newURI(publishData.publishUrl, null, null);
+  let url = Services.io.newURI(publishData.publishUrl);
 
   if (url.scheme == "ftp" && publishData.username)
     // Include username in the URL so we can handle multiple users per server
     // in the password manager
     url = url.scheme + "://" + publishData.username + "@" + url.hostPort;
   else
     url = url.scheme + "://" + url.hostPort;
 
--- a/editor/ui/dialogs/content/EdImageOverlay.js
+++ b/editor/ui/dialogs/content/EdImageOverlay.js
@@ -333,17 +333,17 @@ function LoadPreviewImage()
     //  (if we don't do this, loads after the first will always use image cache
     //   and we won't see image edit changes or be able to get actual width and height)
 
     // We must have an absolute URL to preview it or remove it from the cache
     imageSrc = MakeAbsoluteUrl(imageSrc);
 
     if (GetScheme(imageSrc))
     {
-      let uri = Services.io.newURI(imageSrc, null, null);
+      let uri = Services.io.newURI(imageSrc);
       if (uri)
       {
         let imgCache = Components.classes["@mozilla.org/image/cache;1"]
                                  .getService(Components.interfaces.imgICache);
 
         // This returns error if image wasn't in the cache; ignore that
         imgCache.removeEntry(uri);
       }
--- a/editor/ui/dialogs/content/EdLinkChecker.js
+++ b/editor/ui/dialogs/content/EdLinkChecker.js
@@ -83,17 +83,17 @@ function Startup()
           gURIRefObjects[gNumLinksToCheck] = refobj;
 
           // Make a new nsIURIChecker
           gLinksBeingChecked[gNumLinksToCheck]
             = Components.classes["@mozilla.org/network/urichecker;1"]
                 .createInstance()
                   .QueryInterface(Components.interfaces.nsIURIChecker);
           // XXX uri creation needs to be localized
-          gLinksBeingChecked[gNumLinksToCheck].init(GetIOService().newURI(uri, null, null));
+          gLinksBeingChecked[gNumLinksToCheck].init(GetIOService().newURI(uri));
           gLinksBeingChecked[gNumLinksToCheck].asyncCheck(gRequestObserver, null);
 
           // Add item
           let linkChecker = gLinksBeingChecked[gNumLinksToCheck]
                             .QueryInterface(Components.interfaces.nsIURIChecker);
           SetItemStatus(linkChecker.name, "busy");
           dump(" *** Linkcount = "+gNumLinksToCheck+"\n");
           gNumLinksToCheck++;
--- a/im/content/aboutPanel.xml
+++ b/im/content/aboutPanel.xml
@@ -60,17 +60,17 @@
       <constructor>
       <![CDATA[
         this.browser.addEventListener("DOMTitleChanged", this.refreshTitle.bind(this));
         // The addon manager does its own link handling using window.open().
         // We need to override this method to open http links externally.
         let win = this.browser.contentWindow;
         let open = win.open;
         win.open = function(aUrl) {
-          let uri = Services.io.newURI(aUrl, null, null);
+          let uri = Services.io.newURI(aUrl);
           if (!uri.schemeIs("http") && !uri.schemeIs("https")) {
             open.apply(this, arguments);
           }
           else {
             Components.classes["@mozilla.org/uriloader/external-protocol-service;1"]
                       .getService(Components.interfaces.nsIExternalProtocolService).loadUrl(uri);
           }
         }
@@ -112,14 +112,14 @@
           // If we couldn't add a new tab, load the page in this one.
           this.showAboutPage(url);
           return;
         }
         // Otherwise open in default browser.
         // loadUrl can throw if the default browser is misconfigured.
         Components.classes["@mozilla.org/uriloader/external-protocol-service;1"]
                   .getService(Components.interfaces.nsIExternalProtocolService)
-                  .loadUrl(Services.io.newURI(url, null, null));
+                  .loadUrl(Services.io.newURI(url));
       ]]>
       </handler>
     </handlers>
   </binding>
 </bindings>
--- a/im/content/accountWizard.js
+++ b/im/content/accountWizard.js
@@ -471,17 +471,17 @@ var accountWizard = {
       catch (e) { }
     }
     getMore.hidden = !showGetMore;
   },
 
   openURL: function (aURL) {
     Components.classes["@mozilla.org/uriloader/external-protocol-service;1"]
               .getService(Components.interfaces.nsIExternalProtocolService)
-              .loadUrl(Services.io.newURI(aURL, null, null));
+              .loadUrl(Services.io.newURI(aURL));
   },
 
   advanceTopProtocolPage: function() {
     let selectedProtocol = document.getElementById("topprotolist").selectedItem;
     if (!selectedProtocol || selectedProtocol.id == "otherListItem")
       return true;
     accountWizard.selectProtocol();
     document.getElementById("accountWizard").goTo("accountusername");
--- a/im/content/engineManager.js
+++ b/im/content/engineManager.js
@@ -72,17 +72,17 @@ var gEngineManagerDialog = {
     this.onOK();
 
     var formatter = Cc["@mozilla.org/toolkit/URLFormatterService;1"].getService(Ci.nsIURLFormatter);
     var url = formatter.formatURLPref("browser.search.searchEnginesURL");
 
     var ios = Cc["@mozilla.org/network/io-service;1"].getService(Ci.nsIIOService);
     Components.classes["@mozilla.org/uriloader/external-protocol-service;1"]
               .getService(Ci.nsIExternalProtocolService)
-              .loadURI(ios.newURI(url, null, null), window);
+              .loadURI(ios.newURI(url), window);
 
     window.close();
   },
 
   remove: function engineManager_remove() {
     gEngineView._engineStore.removeEngine(gEngineView.selectedEngine);
     var index = gEngineView.selectedIndex;
     gEngineView.rowCountChanged(index, -1);
--- a/im/content/extensions-discover.js
+++ b/im/content/extensions-discover.js
@@ -3,17 +3,17 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 var {classes: Cc, interfaces: Ci, utils: Cu} = Components;
 
 Cu.import("resource://gre/modules/Services.jsm");
 
 var defaultOpen = window.open;
 window.open = function(aUrl) {
-  let uri = Services.io.newURI(aUrl, null, null);
+  let uri = Services.io.newURI(aUrl);
 
   // http and https are the only schemes that are exposed even
   // though we don't handle them internally.
   if (!uri.schemeIs("http") && !uri.schemeIs("https"))
     defaultOpen.apply(this, arguments);
   else {
     Cc["@mozilla.org/uriloader/external-protocol-service;1"]
       .getService(Ci.nsIExternalProtocolService).loadUrl(uri);
--- a/im/content/extensions.js
+++ b/im/content/extensions.js
@@ -15,17 +15,17 @@ var addonsRegister = {
     Services.obs.addObserver(addonsRegister, "addon-install-failed", false);
     Services.obs.addObserver(addonsRegister, "addon-install-complete", false);
 
     window.addEventListener("unload", addonsRegister.onunload, {once: true});
 
     let win = document.getElementById("dummychromebrowser").contentWindow;
     let open = win.open;
     win.open = function(aUrl) {
-      let uri = Services.io.newURI(aUrl, null, null);
+      let uri = Services.io.newURI(aUrl);
 
       // http and https are the only schemes that are exposed even
       // though we don't handle them internally.
       if (!uri.schemeIs("http") && !uri.schemeIs("https"))
         open.apply(this, arguments);
       else {
         Cc["@mozilla.org/uriloader/external-protocol-service;1"]
           .getService(Ci.nsIExternalProtocolService).loadUrl(uri);
--- a/im/content/nsContextMenu.js
+++ b/im/content/nsContextMenu.js
@@ -420,17 +420,17 @@ nsContextMenu.prototype = {
       throw "Empty href";
     }
 
     return makeURLAbsolute(this.link.baseURI, href);
   },
 
   getLinkURI: function() {
     try {
-      return Services.io.newURI(this.linkURL, null, null);
+      return Services.io.newURI(this.linkURL);
     }
     catch (ex) {
      // e.g. empty URL string
     }
 
     return null;
   },
 
--- a/im/content/preferences/applications.js
+++ b/im/content/preferences/applications.js
@@ -1072,17 +1072,17 @@ var gApplicationsPane = {
     var fph = Services.io.getProtocolHandler("file").
               QueryInterface(Ci.nsIFileProtocolHandler);
     var urlSpec = fph.getURLSpecFromFile(aFile);
 
     return "moz-icon://" + urlSpec + "?size=16";
   },
 
   _getIconURLForWebApp: function(aWebAppURITemplate) {
-    var uri = Services.io.newURI(aWebAppURITemplate, null, null);
+    var uri = Services.io.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/im/content/preferences/themes.js
+++ b/im/content/preferences/themes.js
@@ -88,17 +88,17 @@ var gThemePane = {
       if (!aItem.isActive || aItem.userDisabled)
         item.setAttribute("disabled", "true");
     });
   },
 
   openURL: function (aURL) {
     Components.classes["@mozilla.org/uriloader/external-protocol-service;1"]
               .getService(Components.interfaces.nsIExternalProtocolService)
-              .loadUrl(Services.io.newURI(aURL, null, null));
+              .loadUrl(Services.io.newURI(aURL));
   },
 
   // Getting the extension list is slow, return a cached copy of the list
   getExtensionList: function () {
     if (!this.extensionList)
       throw "The add-ons list should be loaded by now...";
     return this.extensionList;
   }
--- a/im/modules/ibCore.jsm
+++ b/im/modules/ibCore.jsm
@@ -101,17 +101,17 @@ var Core = {
       get helpString() { return self.bundle("aboutCommand.help"); },
       usageContext: Ci.imICommand.CMD_CONTEXT_ALL,
       priority: Ci.imICommand.CMD_PRIORITY_DEFAULT,
       run: function (aMsg, aConv) {
         let page = aMsg.replace(/^about:/, "");
         let url = "about:" + page;
         // If the page doesn't exist, we avoid opening a tab.
         try {
-          Services.io.newChannelFromURI(Services.io.newURI(url, null, null));
+          Services.io.newChannelFromURI(Services.io.newURI(url));
         } catch(e) {
           if (e.result == Components.results.NS_ERROR_MALFORMED_URI) {
             Services.conversations.getUIConversation(aConv).systemMessage(
               self.bundle("aboutCommand.invalidPageMessage", page));
             return true;
           }
           Components.utils.reportError(e); // Log unexpected errors.
           return false;
@@ -288,17 +288,17 @@ var Core = {
                              "chrome://chat/content/browserRequest.xul",
                              null, "chrome", aSubject);
       return;
     }
 
     if (aTopic == "handle-xul-text-link") {
       Cc["@mozilla.org/uriloader/external-protocol-service;1"]
         .getService(Ci.nsIExternalProtocolService)
-        .loadURI(Services.io.newURI(aData, null, null));
+        .loadURI(Services.io.newURI(aData));
       aSubject.QueryInterface(Ci.nsISupportsPRBool).data = true;
       return;
     }
 
     if (aTopic == "quit-application-requested") {
       this._onQuitRequest(aSubject, aData);
       return;
     }
--- a/ldap/xpcom/tests/unit/test_nsLDAPURL.js
+++ b/ldap/xpcom/tests/unit/test_nsLDAPURL.js
@@ -83,17 +83,17 @@ function run_test() {
                     .getService(Ci.nsIIOService);
 
   // Test - get and check urls.
 
   var part = 0;
   for (part = 0; part < ldapURLs.length; ++part)
   {
     dump("url: " + ldapURLs[part].url + "\n");
-    url = ioService.newURI(ldapURLs[part].url, null, null);
+    url = ioService.newURI(ldapURLs[part].url);
 
     do_check_eq(url.spec, ldapURLs[part].spec);
     do_check_eq(url.asciiSpec, ldapURLs[part].asciiSpec);
     do_check_eq(url.scheme, ldapURLs[part].scheme);
     do_check_eq(url.host, ldapURLs[part].host);
     do_check_eq(url.asciiHost, ldapURLs[part].asciiHost);
     do_check_eq(url.port, ldapURLs[part].port);
     do_check_eq(url.path, ldapURLs[part].path);
@@ -108,17 +108,17 @@ function run_test() {
   }
 
   // Test - Check changing ldap values
   dump("Other Tests\n");
 
   // Start off with a base url
   const kBaseURL = "ldap://localhost:389/dc=test,dc=abc??sub?(objectclass=*)";
 
-  url = ioService.newURI(kBaseURL, null, null)
+  url = ioService.newURI(kBaseURL)
                  .QueryInterface(Ci.nsILDAPURL);
 
   // Test - dn
 
   url.dn = "dc=short";
 
   do_check_eq(url.dn, "dc=short");
   do_check_eq(url.spec, "ldap://localhost" + portAdpt + "/dc=short??sub?(objectclass=*)");
@@ -180,17 +180,17 @@ function run_test() {
 
   url.options = 0;
 
   do_check_eq(url.options, 0);
   do_check_eq(url.spec, "ldap://localhost" + portAdpt + "/dc=short??one?(objectclass=*)");
 
   // Test - Equals
 
-  var url2 = ioService.newURI("ldap://localhost" + portAdpt + "/dc=short??one?(objectclass=*)", null, null)
+  var url2 = ioService.newURI("ldap://localhost" + portAdpt + "/dc=short??one?(objectclass=*)")
                       .QueryInterface(Ci.nsILDAPURL);
 
   do_check_true(url.equals(url2));
 
   url2.spec = "ldap://localhost:389/dc=short??sub?(objectclass=*)";
 
   do_check_false(url.equals(url2));
 
--- a/mail/base/content/contentAreaClick.js
+++ b/mail/base/content/contentAreaClick.js
@@ -169,17 +169,17 @@ function contentAreaClick(aEvent)
  * service settings.
  *
  * @param url  A url string or an nsIURI containing the url to open.
  */
 function openLinkExternally(url)
 {
   let uri = url;
   if (!(uri instanceof Components.interfaces.nsIURI))
-    uri = Services.io.newURI(url, null, null);
+    uri = Services.io.newURI(url);
 
   PlacesUtils.asyncHistory.updatePlaces({
     uri: uri,
     visits:  [{
       visitDate: Date.now() * 1000,
       transitionType: Components.interfaces.nsINavHistoryService.TRANSITION_LINK
     }]
   });
--- a/mail/base/content/mailCore.js
+++ b/mail/base/content/mailCore.js
@@ -579,17 +579,17 @@ function openSupportURL()
  *  browser.
  *
  *  @param aPrefName - name of the pref that holds the url we want to format and open
  */
 function openFormattedURL(aPrefName)
 {
   var urlToOpen = Services.urlFormatter.formatURLPref(aPrefName);
 
-  var uri = Services.io.newURI(urlToOpen, null, null);
+  var uri = Services.io.newURI(urlToOpen);
 
   var protocolSvc = Components.classes["@mozilla.org/uriloader/external-protocol-service;1"]
                               .getService(Components.interfaces.nsIExternalProtocolService);
   protocolSvc.loadURI(uri);
 }
 
 /**
  * Prompt the user to restart the browser in safe mode.
--- a/mail/base/content/mailWindow.js
+++ b/mail/base/content/mailWindow.js
@@ -682,17 +682,17 @@ nsBrowserAccess.prototype = {
     newWindow = newTab.browser.docShell
                       .QueryInterface(Components.interfaces.nsIInterfaceRequestor)
                       .getInterface(Components.interfaces.nsIDOMWindow);
     try {
       if (aURI) {
         let referrer = null;
         if (aOpener) {
           let location = aOpener.location;
-          referrer = Services.io.newURI(location, null, null);
+          referrer = Services.io.newURI(location);
         }
         newWindow.QueryInterface(Components.interfaces.nsIInterfaceRequestor)
                  .getInterface(Components.interfaces.nsIWebNavigation)
                  .loadURI(aURI.spec, loadflags, referrer, null, null);
       }
       if (needToFocusWin || (!loadInBackground && isExternal))
         newWindow.focus();
     } catch(e) {
--- a/mail/base/content/mailWindowOverlay.js
+++ b/mail/base/content/mailWindowOverlay.js
@@ -3195,17 +3195,17 @@ function onRemoteContentOptionsShowing(a
   let addresses = {};
   MailServices.headerParser.parseHeadersWithArray(
     gMessageDisplay.displayedMessage.author, addresses, {}, {});
   let adrCount = addresses.value[0] ? 1 : 0;
   // If there is an author's email, put it also in the menu.
   if (adrCount > 0) {
     let authorEmailAddress = addresses.value[0];
     let authorEmailAddressURI = Services.io.newURI(
-      "chrome://messenger/content/?email=" + authorEmailAddress, null, null);
+      "chrome://messenger/content/?email=" + authorEmailAddress);
     let mailPrincipal = Services.scriptSecurityManager
       .createCodebasePrincipal(authorEmailAddressURI, {});
     origins.push(mailPrincipal.origin);
   }
 
   let messengerBundle = document.getElementById("bundle_messenger");
 
   // Out with the old...
@@ -3245,17 +3245,17 @@ function onRemoteContentOptionsShowing(a
 
 /**
  * Add privileges to display remote content for the given uri.
  *
  * @param aUriSpec |String| uri for the site to add permissions for.
  * @param aReload  Reload the message display after allowing the URI.
  */
 function allowRemoteContentForURI(aUriSpec, aReload = true) {
-  let uri = Services.io.newURI(aUriSpec, null, null);
+  let uri = Services.io.newURI(aUriSpec);
   Services.perms.add(uri, "image", Services.perms.ALLOW_ACTION);
   if (aReload)
     ReloadMessage();
 }
 
 /**
  * Add privileges to display remote content for the given uri.
  *
--- a/mail/base/content/msgHdrViewOverlay.js
+++ b/mail/base/content/msgHdrViewOverlay.js
@@ -1773,17 +1773,17 @@ function CopyNewsgroupURL(newsgroupNode)
   } else {
     url = "snews://" + server.hostName;
     if (server.port != Components.interfaces.nsINntpUrl.DEFAULT_NNTPS_PORT)
       url += ":" + server.port;
     url += "/" + ng;
   }
 
   try {
-    let uri = Services.io.newURI(url, null, null);
+    let uri = Services.io.newURI(url);
     let clipboard = Components.classes["@mozilla.org/widget/clipboardhelper;1"]
                               .getService(Components.interfaces.nsIClipboardHelper);
     clipboard.copyString(decodeURI(uri.spec));
   } catch(e) {
      Components.utils.reportError("Invalid URL: "+ url);
   }
 }
 
@@ -1900,17 +1900,17 @@ AttachmentInfo.prototype = {
   /**
    * This method checks whether the attachment is empty or not.
    *
    * @return  true if the attachment is empty, false otherwise
    */
   get isEmpty()
   {
     // Create an input stream on the attachment url.
-    let url = Services.io.newURI(this.url, null, null);
+    let url = Services.io.newURI(this.url);
     let channel = Services.io.newChannelFromURI2(url,
                                                  null,
                                                  Services.scriptSecurityManager.getSystemPrincipal(),
                                                  null,
                                                  Components.interfaces.nsILoadInfo.SEC_ALLOW_CROSS_ORIGIN_DATA_IS_NULL,
                                                  Components.interfaces.nsIContentPolicy.TYPE_OTHER);
     let stream = channel.open();
 
--- a/mail/base/content/msgMail3PaneWindow.js
+++ b/mail/base/content/msgMail3PaneWindow.js
@@ -1469,17 +1469,17 @@ messageFlavorDataProvider.prototype = {
       return;
     }
     let fileUriPrimitive = {};
     let dataSize = {};
     aTransferable.getTransferData("application/x-moz-file-promise-url",
                                   fileUriPrimitive, dataSize);
 
     let fileUriStr = fileUriPrimitive.value.QueryInterface(Components.interfaces.nsISupportsString);
-    let fileUri = Services.io.newURI(fileUriStr.data, null, null);
+    let fileUri = Services.io.newURI(fileUriStr.data);
     let fileUrl = fileUri.QueryInterface(Components.interfaces.nsIURL);
     let fileName = fileUrl.fileName;
 
     let destDirPrimitive = {};
     aTransferable.getTransferData("application/x-moz-file-promise-dir",
                                   destDirPrimitive, dataSize);
     let destDirectory = destDirPrimitive.value.QueryInterface(Components.interfaces.nsILocalFile);
     let file = destDirectory.clone();
--- a/mail/base/content/nsContextMenu.js
+++ b/mail/base/content/nsContextMenu.js
@@ -791,17 +791,17 @@ nsContextMenu.prototype = {
   },
 
   /**
    * Generate a URI object from the linkURL spec
    * @return an nsIURI if possible, or null if not
    */
   getLinkURI: function CM_getLinkURI() {
     try {
-      return Services.io.newURI(this.linkURL, null, null);
+      return Services.io.newURI(this.linkURL);
     } catch (ex) {
       // e.g. empty URL string
     }
     return null;
   },
 
   /**
    * Get the scheme for the clicked-on linkURI, if present.
@@ -870,19 +870,19 @@ nsContextMenu.prototype = {
    * @param  aBase
    *         The URL string to use as the base
    * @param  aUrl
    *         The possibly-relative URL string
    * @return The string absolute URL
    */
   makeURLAbsolute : function CM_makeURLAbsolute(aBase, aUrl) {
     // Construct nsIURL.
-    var baseURI  = Services.io.newURI(aBase, null, null);
+    var baseURI  = Services.io.newURI(aBase);
 
-    return Services.io.newURI(baseURI.resolve(aUrl), null, null).spec;
+    return Services.io.newURI(baseURI.resolve(aUrl)).spec;
   },
 
   /**
    * Determine whether a DOM node is a text or password input, or a textarea.
    * @param  aNode
    *         The DOM node to check
    * @return true for textboxes, false for other elements
    */
@@ -942,17 +942,17 @@ nsContextMenu.prototype = {
           return;
       }
       sibling = sibling.previousSibling;
     }
   },
 
   openInBrowser: function CM_openInBrowser() {
     let uri = Services.io.newURI(this.target.ownerDocument.defaultView.
-                                 top.location.href, null, null);
+                                 top.location.href);
     PlacesUtils.asyncHistory.updatePlaces({
       uri: uri,
       visits:  [{
         visitDate: Date.now() * 1000,
         transitionType: Components.interfaces.nsINavHistoryService.TRANSITION_LINK
       }]
     });
     Components.classes["@mozilla.org/uriloader/external-protocol-service;1"]
--- a/mail/base/content/nsDragAndDrop.js
+++ b/mail/base/content/nsDragAndDrop.js
@@ -565,17 +565,17 @@ var nsDragAndDrop = {
       // to know if aDraggedText really is a URI.
 
       aDraggedText = aDraggedText.replace(/^\s*|\s*$/g, '');
 
       var uri;
       var ioService = Components.classes["@mozilla.org/network/io-service;1"]
                                 .getService(Components.interfaces.nsIIOService);
       try {
-        uri = ioService.newURI(aDraggedText, null, null);
+        uri = ioService.newURI(aDraggedText);
       } catch (e) {
       }
 
       if (!uri)
         return;
 
       // aDraggedText is a URI, do the security check.
       const nsIScriptSecurityManager = Components.interfaces
@@ -585,17 +585,17 @@ var nsDragAndDrop = {
 
       if (!aDragSession)
         aDragSession = this.mDragService.getCurrentSession();
 
       var sourceDoc = aDragSession.sourceDocument;
       // Use "file:///" as the default sourceURI so that drops of file:// URIs
       // are always allowed.
       var principal = sourceDoc ? sourceDoc.nodePrincipal
-                                : secMan.createCodebasePrincipal(ioService.newURI("file:///", null, null), {});
+                                : secMan.createCodebasePrincipal(ioService.newURI("file:///"), {});
 
       try {
         secMan.checkLoadURIStrWithPrincipal(principal, aDraggedText,
                                             nsIScriptSecurityManager.STANDARD);
       } catch (e) {
         // Stop event propagation right here.
         aEvent.stopPropagation();
 
--- a/mail/base/content/phishingDetector.js
+++ b/mail/base/content/phishingDetector.js
@@ -94,17 +94,17 @@ var gPhishingDetector = {
   analyzeUrl: function (aUrl, aLinkText)
   {
     if (!aUrl)
       return;
 
     var hrefURL;
     // make sure relative link urls don't make us bail out
     try {
-      hrefURL = Services.io.newURI(aUrl, null, null);
+      hrefURL = Services.io.newURI(aUrl);
     } catch(ex) { return; }
 
     // only check for phishing urls if the url is an http or https link.
     // this prevents us from flagging imap and other internally handled urls
     if (hrefURL.schemeIs('http') || hrefURL.schemeIs('https'))
     {
       // The link is not suspicious if the visible text is the same as the URL,
       // even if the URL is an IP address. URLs are commonly surrounded by
@@ -145,17 +145,17 @@ var gPhishingDetector = {
    * @param aPhishingURL the url we want to report back as a phishing attack
    */
    reportPhishingURL: function(aPhishingURL)
    {
      let reportUrl = Services.urlFormatter.formatURLPref(
        "browser.safebrowsing.reportPhishURL");
      reportUrl += "&url=" + encodeURIComponent(aPhishingURL);
 
-     let uri = Services.io.newURI(reportUrl, null, null);
+     let uri = Services.io.newURI(reportUrl);
      let protocolSvc = Components.classes["@mozilla.org/uriloader/external-protocol-service;1"]
                        .getService(Components.interfaces.nsIExternalProtocolService);
      protocolSvc.loadUrl(uri);
    },
 
   /**
    * Private helper method to determine if the link node contains a user visible
    * url with a host name that differs from the actual href the user would get
@@ -168,17 +168,17 @@ var gPhishingDetector = {
   {
     // gatherTextUnder puts a space between each piece of text it gathers,
     // so strip the spaces out (see bug 326082 for details).
     aLinkNodeText = aLinkNodeText.replace(/ /g, "");
 
     // Only worry about http: and https: urls.
     if (/^https?:/.test(aLinkNodeText))
     {
-      let linkTextURI = Services.io.newURI(aLinkNodeText, null, null);
+      let linkTextURI = Services.io.newURI(aLinkNodeText);
 
       // Compare the base domain of the href and the link text.
       try {
         return Services.eTLD.getBaseDomain(aHrefURL) !=
                Services.eTLD.getBaseDomain(linkTextURI);
       } catch (e) {
         // If we throw above, one of the URIs probably has no TLD (e.g.
         // http://localhost), so just check the entire host.
@@ -201,17 +201,17 @@ var gPhishingDetector = {
   {
     // If the loaded message has *not* been flagged as a scam...
     if (!gMessageNotificationBar.isShowingPhishingNotification())
       return true; // ...allow the link to load.
 
     var hrefURL;
     // make sure relative link urls don't make us bail out
     try {
-      hrefURL = Services.io.newURI(aUrl, null, null);
+      hrefURL = Services.io.newURI(aUrl);
     } catch(ex) { return false; }
 
     // only prompt for http and https urls
     if (hrefURL.schemeIs('http') || hrefURL.schemeIs('https'))
     {
       // unobscure the host name in case it's an encoded ip address..
       let unobscuredHostNameValue = this.isLegalIPAddress(hrefURL.host, true)
         || hrefURL.host;
--- a/mail/base/content/specialTabs.js
+++ b/mail/base/content/specialTabs.js
@@ -495,27 +495,27 @@ var specialTabs = {
    * dom <head>.
    *
    * @param  string aUrl          - a url from whose homepage to get a favicon.
    * @param  function aCallback   - callback.
    */
   getFaviconFromPage: function(aUrl, aCallback) {
     let url, uri;
     try {
-      url = Services.io.newURI(aUrl, null, null).prePath;
-      uri = Services.io.newURI(url, null, null);
+      url = Services.io.newURI(aUrl).prePath;
+      uri = Services.io.newURI(url);
     }
     catch (ex) {
       if (aCallback)
         aCallback("");
       return;
     }
 
     let onLoadSuccess = (aEvent => {
-      let iconUri = Services.io.newURI(aEvent.target.src, null, null);
+      let iconUri = Services.io.newURI(aEvent.target.src);
       specialTabs.mFaviconService.setAndFetchFaviconForPage(
         uri, iconUri, false,
         specialTabs.mFaviconService.FAVICON_LOAD_NON_PRIVATE,
         null, Services.scriptSecurityManager.getSystemPrincipal());
 
       if (aCallback)
         aCallback(iconUri.spec);
     });
@@ -533,17 +533,17 @@ var specialTabs = {
         return;
       }
 
       let iconUri;
       let linkNode = dom.head.querySelector('link[rel="shortcut icon"],' +
                                             'link[rel="icon"]');
       let href = linkNode ? linkNode.href : null;
       try {
-        iconUri = Services.io.newURI(href, null, null);
+        iconUri = Services.io.newURI(href);
       }
       catch (ex) {
         onDownloadError(aEvent);
         return;
       }
 
       specialTabs.loadFaviconImageNode(onLoadSuccess, onDownloadError,
                                        iconUri.spec);
--- a/mail/components/aboutRedirector.js
+++ b/mail/components/aboutRedirector.js
@@ -44,17 +44,17 @@ AboutRedirector.prototype = {
     return this._redirMap[name].flags;
   },
 
   newChannel: function(aURI, aLoadInfo) {
     let name = this._getModuleName(aURI);
     if (!(name in this._redirMap))
       throw Components.results.NS_ERROR_ILLEGAL_VALUE;
 
-    let newURI = Services.io.newURI(this._redirMap[name].url, null, null);
+    let newURI = Services.io.newURI(this._redirMap[name].url);
     let channel = Services.io.newChannelFromURIWithLoadInfo(newURI, aLoadInfo);
     channel.originalURI = aURI;
 
     if (this._redirMap[name].flags & Ci.nsIAboutModule.URI_SAFE_FOR_UNTRUSTED_CONTENT) {
       let principal = Services.scriptSecurityManager.getNoAppCodebasePrincipal(aURI);
       channel.owner = principal;
     }
 
--- a/mail/components/addrbook/content/abCardOverlay.js
+++ b/mail/components/addrbook/content/abCardOverlay.js
@@ -1079,17 +1079,17 @@ var genericPhotoHandler = {
   }
 }
 
 var filePhotoHandler = {
 
   onLoad: function(aCard, aDocument) {
     var photoURI = aCard.getProperty("PhotoURI", "");
     try {
-      var file = Services.io.newURI(photoURI, null, null)
+      var file = Services.io.newURI(photoURI)
                             .QueryInterface(Components.interfaces.nsIFileURL)
                             .file;
     } catch (e) {}
 
     if (!file)
       return false;
 
     aDocument.getElementById("PhotoFile").file = file;
--- a/mail/components/addrbook/content/abCardViewOverlay.js
+++ b/mail/components/addrbook/content/abCardViewOverlay.js
@@ -533,17 +533,17 @@ function HandleLink(node, label, value, 
 
   return visible;
 }
 
 function OpenURLWithHistory(url)
 {
   try {
     PlacesUtils.asyncHistory.updatePlaces({
-      uri: Services.io.newURI(url, null, null),
+      uri: Services.io.newURI(url),
       visits:  [{
         visitDate: Date.now() * 1000,
         transitionType: Components.interfaces.nsINavHistoryService.TRANSITION_LINK
       }]
     });
     var messenger = Components.classes["@mozilla.org/messenger;1"].createInstance();
     messenger = messenger.QueryInterface(Components.interfaces.nsIMessenger);
     messenger.launchExternalURL(url);
--- a/mail/components/addrbook/content/abCommon.js
+++ b/mail/components/addrbook/content/abCommon.js
@@ -852,17 +852,17 @@ function storePhoto(aUri)
 {
   if (!aUri)
     return false;
 
   // Get the photos directory and check that it exists
   let file = getPhotosDir();
 
   // Create a channel from the URI and open it as an input stream
-  let channel = Services.io.newChannelFromURI2(Services.io.newURI(aUri, null, null),
+  let channel = Services.io.newChannelFromURI2(Services.io.newURI(aUri),
                                                null,
                                                Services.scriptSecurityManager.getSystemPrincipal(),
                                                null,
                                                Components.interfaces.nsILoadInfo.SEC_ALLOW_CROSS_ORIGIN_DATA_IS_NULL,
                                                Components.interfaces.nsIContentPolicy.TYPE_OTHER);
   let istream = channel.open();
 
   // Get the photo file
--- a/mail/components/cloudfile/content/addAccountDialog.js
+++ b/mail/components/cloudfile/content/addAccountDialog.js
@@ -263,17 +263,17 @@ var addAccountDialog = {
 
     // Load up the correct XHTML page for this provider.
     this._settings.contentDocument.location.href = provider.settingsURL;
   },
 
   onClickLink: function AAD_onClickLink(e) {
     e.preventDefault();
     let href = e.target.getAttribute("href");
-    gProtocolService.loadUrl(Services.io.newURI(href, "UTF-8", null));
+    gProtocolService.loadUrl(Services.io.newURI(href, "UTF-8"));
   },
 
   onInput: function AAD_onInput() {
     // Let's see if we have everything we need to make OK enabled...
     if (this._accountType.selectedIndex == -1) {
       // We have the "Select a service provider" menuitem selected, so we
       // shouldn't be able to click "Set up account"
       this._accept.disabled = true;
--- a/mail/components/compose/content/MsgComposeCommands.js
+++ b/mail/components/compose/content/MsgComposeCommands.js
@@ -1920,17 +1920,17 @@ function ComposeFieldsReady()
 // checks if the passed in string is a mailto url, if it is, generates nsIMsgComposeParams
 // for the url and returns them.
 function handleMailtoArgs(mailtoUrl)
 {
   // see if the string is a mailto url....do this by checking the first 7 characters of the string
   if (mailtoUrl.toLowerCase().startsWith("mailto:"))
   {
     // if it is a mailto url, turn the mailto url into a MsgComposeParams object....
-    let uri = Services.io.newURI(mailtoUrl, null, null);
+    let uri = Services.io.newURI(mailtoUrl);
 
     if (uri) {
       return MailServices.compose.getParamsForMailto(uri);
     }
   }
 
   return null;
 }
@@ -4111,17 +4111,17 @@ function AddAttachments(aAttachments, aC
     else {
       // For local file urls, we are better off using the full file url because
       // moz-icon will actually resolve the file url and get the right icon from
       // the file url. All other urls, we should try to extract the file name from
       // them. This fixes issues where an icon wasn't showing up if you dragged a
       // web url that had a query or reference string after the file name and for
       // mailnews urls where the filename is hidden in the url as a &filename=
       // part.
-      let url = Services.io.newURI(attachment.url, null, null);
+      let url = Services.io.newURI(attachment.url);
       if (url instanceof Components.interfaces.nsIURL &&
           url.fileName && !url.schemeIs("file"))
         item.image = "moz-icon://" + url.fileName;
       else
         item.image = "moz-icon:" + attachment.url;
       }
 
     items.push(item);
@@ -4342,17 +4342,17 @@ function OpenSelectedAttachment()
       // we must be dealing with a forwarded attachment, treat this special
       let msgHdr = gMessenger.messageServiceFromURI(attachmentUrl).messageURIToMsgHdr(attachmentUrl);
       if (msgHdr)
         MailUtils.openMessageInNewWindow(msgHdr);
     }
     else
     {
       // Turn the URL into a nsIURI object then open it.
-      let uri = Services.io.newURI(attachmentUrl, null, null);
+      let uri = Services.io.newURI(attachmentUrl);
       if (uri)
       {
         let channel = Services.io.newChannelFromURI2(uri,
                                                      null,
                                                      Services.scriptSecurityManager.getSystemPrincipal(),
                                                      null,
                                                      Components.interfaces.nsILoadInfo.SEC_ALLOW_CROSS_ORIGIN_DATA_IS_NULL,
                                                      Components.interfaces.nsIContentPolicy.TYPE_OTHER);
@@ -5646,17 +5646,17 @@ function loadBlockedImage(aURL) {
   if (/^file:/i.test(aURL)) {
     filename = aURL.substr(aURL.lastIndexOf("/") + 1);
   }
   else {
     let fnMatch = /[?&;]filename=([^?&]+)/.exec(aURL);
     filename = (fnMatch && fnMatch[1]) || "";
   }
   filename = decodeURIComponent(filename);
-  let uri = Services.io.newURI(aURL, null, null);
+  let uri = Services.io.newURI(aURL);
   let contentType = Components.classes["@mozilla.org/mime;1"]
     .getService(Components.interfaces.nsIMIMEService)
     .getTypeFromURI(uri);
   if (!contentType.startsWith("image/")) {
     // Unsafe to unblock this. It would just be garbage either way.
     throw new Error("Won't unblock; URL=" + aURL +
                     ", contentType=" + contentType);
   }
--- a/mail/components/im/content/imAccountWizard.js
+++ b/mail/components/im/content/imAccountWizard.js
@@ -406,11 +406,11 @@ var accountWizard = {
       catch (e) { }
     }
     getMore.hidden = !showGetMore;
   },
 
   openURL: function (aURL) {
     Components.classes["@mozilla.org/uriloader/external-protocol-service;1"]
               .getService(Components.interfaces.nsIExternalProtocolService)
-              .loadUrl(Services.io.newURI(aURL, null, null));
+              .loadUrl(Services.io.newURI(aURL));
   }
 };
--- a/mail/components/im/content/imContextMenu.js
+++ b/mail/components/im/content/imContextMenu.js
@@ -243,17 +243,17 @@ imContextMenu.prototype = {
       throw "Empty href";
     }
 
     return makeURLAbsolute(this.link.baseURI, href);
   },
 
   getLinkURI: function() {
     try {
-      return Services.io.newURI(this.linkURL, null, null);
+      return Services.io.newURI(this.linkURL);
     }
     catch (ex) {
      // e.g. empty URL string
     }
 
     return null;
   },
 
--- a/mail/components/newmailaccount/content/accountProvisioner.js
+++ b/mail/components/newmailaccount/content/accountProvisioner.js
@@ -33,17 +33,17 @@ function isAccel (event) { return isOSX 
  *   mozilla/dom/tests/mochitest/localstorage/test_localStorageFromChrome.xhtml
  *
  * @param {String} page The page to get the localstorage for.
  * @return {nsIDOMStorage} The localstorage for this page.
  */
 function getLocalStorage(page) {
   var url = "chrome://content/messenger/accountProvisionerStorage/" + page;
 
-  var uri = Services.io.newURI(url, "", null);
+  var uri = Services.io.newURI(url, "");
   var principal = Services.scriptSecurityManager.getNoAppCodebasePrincipal(uri);
   return Services.domStorageManager.getLocalStorageForPrincipal(principal, url);
 }
 
 var MAX_SMALL_ADDRESSES = 2;
 
 var storedData = {};
 
@@ -223,17 +223,17 @@ var EmailAccountProvisioner = {
     // window itself, we open up the link in the default browser.
     let opener = Cc["@mozilla.org/uriloader/external-protocol-service;1"]
                            .getService(Ci.nsIExternalProtocolService);
     document.addEventListener("click", function(e) {
       if (e.target.tagName == "a" &&
           e.target.classList.contains("external")) {
         e.preventDefault();
         let uri = e.target.getAttribute("href");
-        opener.loadUrl(Services.io.newURI(uri, "UTF-8", null));
+        opener.loadUrl(Services.io.newURI(uri, "UTF-8"));
       }
     });
 
     // Throw the disclaimer into the window.  In the future, this should probably
     // be done in the actual XHTML page, instead of injected via JS.
     let commentary = document.querySelector(".commentary");
     commentary.innerHTML =
       commentary.innerHTML +
--- a/mail/components/preferences/applications.js
+++ b/mail/components/preferences/applications.js
@@ -1795,17 +1795,17 @@ var gApplicationsPane = {
     let urlSpec = Services.io.getProtocolHandler("file")
       .QueryInterface(Components.interfaces.nsIFileProtocolHandler)
       .getURLSpecFromFile(aFile);
 
     return "moz-icon://" + urlSpec + "?size=16";
   },
 
   _getIconURLForWebApp: function(aWebAppURITemplate) {
-    var uri = Services.io.newURI(aWebAppURITemplate, null, null);
+    var uri = Services.io.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/mail/components/preferences/chat.js
+++ b/mail/components/preferences/chat.js
@@ -63,17 +63,17 @@ var gChatPane = {
 
     // This should be in sync with the code in nsStatusBarBiffManager::PlayBiffSound.
     if (!soundLocation.startsWith("file://")) {
       if (Services.appinfo.OS == "Darwin") // OS X
         sound.beep();
       else
         sound.playEventSound(Ci.nsISound.EVENT_NEW_MAIL_RECEIVED);
     } else {
-      sound.play(Services.io.newURI(soundLocation, null, null));
+      sound.play(Services.io.newURI(soundLocation));
     }
   },
 
   browseForSoundFile: function ()
   {
     const nsIFilePicker = Ci.nsIFilePicker;
     let fp = Cc["@mozilla.org/filepicker;1"].createInstance(nsIFilePicker);
 
--- a/mail/components/preferences/general.js
+++ b/mail/components/preferences/general.js
@@ -115,17 +115,17 @@ var gGeneralPane = {
                      document.getElementById('soundType').value == 1) ?
                     document.getElementById('soundUrlLocation').value : "";
 
     if (!soundLocation.includes("file://")) {
       // User has not set any custom sound file to be played
       sound.playEventSound(Components.interfaces.nsISound.EVENT_NEW_MAIL_RECEIVED);
     } else {
       // User has set a custom audio file to be played along the alert.
-      sound.play(Services.io.newURI(soundLocation, null, null));
+      sound.play(Services.io.newURI(soundLocation));
     }
   },
 
   browseForSoundFile: function ()
   {
     const nsIFilePicker = Components.interfaces.nsIFilePicker;
     var fp = Components.classes["@mozilla.org/filepicker;1"].createInstance(nsIFilePicker);
 
--- a/mail/components/preferences/permissions.js
+++ b/mail/components/preferences/permissions.js
@@ -96,24 +96,24 @@ 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) {
         let scheme = (this._type != "image" || !input_url.includes("@")) ?
           "http://" : MAILURI_BASE;
-        uri = Services.io.newURI(scheme + input_url, null, null);
+        uri = Services.io.newURI(scheme + 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/mail/test/mozmill/content-policy/test-general-content-policy.js
+++ b/mail/test/mozmill/content-policy/test-general-content-policy.js
@@ -304,17 +304,17 @@ function checkAllowFeedMsg(test) {
 function checkAllowForSenderWithPerms(test) {
   let msgDbHdr = addToFolder(test.type + " priv sender test message " + gMsgNo,
                              msgBodyStart + test.body + msgBodyEnd, folder);
 
   let addresses = {};
   MailServices.headerParser.parseHeadersWithArray(msgDbHdr.author, addresses, {}, {});
   let authorEmailAddress = addresses.value[0];
 
-  let uri = Services.io.newURI("chrome://messenger/content/?email=" + authorEmailAddress, null, null);
+  let uri = Services.io.newURI("chrome://messenger/content/?email=" + authorEmailAddress);
   Services.perms.add(uri, "image", Services.perms.ALLOW_ACTION);
   assert_true(Services.perms.testPermission(uri, "image") ==
               Services.perms.ALLOW_ACTION);
 
   // select the newly created message
   let msgHdr = select_click_row(gMsgNo);
 
   assert_equals(msgDbHdr, msgHdr);
@@ -347,17 +347,17 @@ function checkAllowForHostsWithPerms(tes
   assert_selected_and_displayed(gMsgNo);
 
   let src = mozmill.getMail3PaneController().window.content.document
                    .getElementById("testelement").src;
 
   if (!src.startsWith("http"))
     return; // just test http in this test
 
-  let uri = Services.io.newURI(src, null, null);
+  let uri = Services.io.newURI(src);
   Services.perms.add(uri, "image", Services.perms.ALLOW_ACTION);
   assert_true(Services.perms.testPermission(uri, "image") ==
               Services.perms.ALLOW_ACTION);
 
   // Click back one msg, then the original again, which should now allow loading.
   select_click_row(gMsgNo - 1);
   // Select the newly created message.
   msgHdr = select_click_row(gMsgNo);
@@ -398,17 +398,17 @@ function test_generalContentPolicy() {
       if (i == 0) {
         // Now check that image is visible after site is whitelisted.
         // We do the first test which is the one with the image.
 
         // Add the site to the whitelist.
         let src = mozmill.getMail3PaneController().window.content.document
                          .getElementById("testelement").src;
 
-        let uri = Services.io.newURI(src, null, null);
+        let uri = Services.io.newURI(src);
         Services.perms.add(uri, "image", Services.perms.ALLOW_ACTION);
         assert_true(Services.perms.testPermission(uri, "image") ==
                     Services.perms.ALLOW_ACTION);
 
         // Check allowed in reply window
         checkComposeWindow(TESTS[i], true, true);
 
         // Check allowed in forward window
--- a/mail/test/mozmill/newmailaccount/test-newmailaccount.js
+++ b/mail/test/mozmill/newmailaccount/test-newmailaccount.js
@@ -1209,17 +1209,17 @@ function subtest_provider_language_wildc
  * Provisioner, and we have no search in the input.
  */
 function test_search_button_disabled_if_no_query_on_init() {
   // We have to do a little bit of gymnastics to access the local storage
   // for the accountProvisioner dialog...
   let url = "chrome://content/messenger/accountProvisionerStorage/accountProvisioner";
   let dsm = Services.domStorageManager;
 
-  let uri = Services.io.newURI(url, "", null);
+  let uri = Services.io.newURI(url, "");
   let principal = Services.scriptSecurityManager.getNoAppCodebasePrincipal(uri);
   let storage = dsm.getLocalStorageForPrincipal(principal, url);
 
   // Ok, got it. Now let's blank out the name.
   storage.setItem("name", "");
 
   plan_for_modal_dialog("AccountCreation",
                         subtest_search_button_enabled_state_on_init);
--- a/mail/test/mozmill/shared-modules/test-nntp-helpers.js
+++ b/mail/test/mozmill/shared-modules/test-nntp-helpers.js
@@ -139,17 +139,17 @@ function setupLocalServer(port) {
   _server = server;
 
   return server;
 }
 
 var URLCreator = MailServices.nntp.QueryInterface(Ci.nsIProtocolHandler);
 
 function create_post(baseURL, file) {
-  var url = URLCreator.newURI(baseURL, null, null);
+  var url = URLCreator.newURI(baseURL);
   url.QueryInterface(Ci.nsINntpUrl);
 
   var post = Cc["@mozilla.org/messenger/nntpnewsgrouppost;1"]
                .createInstance(Ci.nsINNTPNewsgroupPost);
   post.postMessageFile = do_get_file(file);
   url.messageToPost = post;
   return url;
 }
--- a/mail/test/resources/mozmill/mozmill/extension/resource/stdlib/httpd.js
+++ b/mail/test/resources/mozmill/mozmill/extension/resource/stdlib/httpd.js
@@ -1682,17 +1682,17 @@ RequestReader.prototype =
         dumpn("*** Metadata version too low");
         throw HTTP_400;
       }
 
       try
       {
         var uri = Cc["@mozilla.org/network/io-service;1"]
                     .getService(Ci.nsIIOService)
-                    .newURI(fullPath, null, null);
+                    .newURI(fullPath);
         fullPath = uri.path;
         scheme = uri.scheme;
         host = metadata._host = uri.asciiHost;
         port = uri.port;
         if (port === -1)
         {
           if (scheme === "http")
           {
--- a/mail/test/resources/mozmill/mozmill/extension/resource/stdlib/securable-module.js
+++ b/mail/test/resources/mozmill/mozmill/extension/resource/stdlib/securable-module.js
@@ -57,17 +57,17 @@
      if (principal == "system")
        return systemPrincipal;
      return principal;
    }
 
    // The base URI to we use when we're given relative URLs, if any.
    var baseURI = null;
    if (global.window)
-     baseURI = ios.newURI(global.location.href, null, null);
+     baseURI = ios.newURI(global.location.href);
    exports.baseURI = baseURI;
 
    // The "parent" chrome URI to use if we're loading code that
    // needs chrome privileges but may not have a filename that
    // matches any of SpiderMonkey's defined system filename prefixes.
    // The latter is needed so that wrappers can be automatically
    // made for the code. For more information on this, see
    // bug 418356:
@@ -309,17 +309,17 @@
    exports.LocalFileSystem.prototype = {
      resolveModule: function resolveModule(base, path) {
        path = path + ".js";
 
        var baseURI;
        if (!base)
          baseURI = this._rootURI;
        else
-         baseURI = ios.newURI(base, null, null);
+         baseURI = ios.newURI(base);
        var newURI = ios.newURI(path, null, baseURI);
        var channel = ios.newChannelFromURI2(newURI,
                                             null,
                                             scriptSecurityManager.getSystemPrincipal(),
                                             null,
                                             Ci.nsILoadInfo.SEC_ALLOW_CROSS_ORIGIN_DATA_IS_NULL,
                                             Ci.nsIContentPolicy.TYPE_OTHER);
        try {
--- a/mailnews/addrbook/prefs/content/pref-directory-add.js
+++ b/mailnews/addrbook/prefs/content/pref-directory-add.js
@@ -303,17 +303,17 @@ function onAccept()
     else if (port && hasCharacters(port))
       errorValue = "invalidPortNumber";
     else if (results && hasCharacters(results))
       errorValue = "invalidResults";
     if (!errorValue) {
       // XXX Due to the LDAP c-sdk pass a dummy url to the IO service, then
       // update the parts (bug 473351).
       let ldapUrl = Services.io.newURI(
-        (secure.checked ? "ldaps://" : "ldap://") + "localhost/dc=???", null, null)
+        (secure.checked ? "ldaps://" : "ldap://") + "localhost/dc=???")
         .QueryInterface(Components.interfaces.nsILDAPURL);
 
       ldapUrl.host = hostname;
       ldapUrl.port = port ? port :
                             (secure.checked ? kDefaultSecureLDAPPort :
                                               kDefaultLDAPPort);
       ldapUrl.dn = document.getElementById("basedn").value;
       ldapUrl.scope = document.getElementById("one").selected ?
--- a/mailnews/base/prefs/content/accountcreation/sanitizeDatatypes.js
+++ b/mailnews/base/prefs/content/accountcreation/sanitizeDatatypes.js
@@ -113,17 +113,17 @@ var sanitize =
   url : function (unchecked)
   {
     var str =  this.string(unchecked);
     if (!str.startsWith("http") && !str.startsWith("https"))
       throw new MalformedException("url_scheme.error", unchecked);
 
     var uri;
     try {
-      uri = Services.io.newURI(str, null, null);
+      uri = Services.io.newURI(str);
       uri = uri.QueryInterface(Ci.nsIURL);
     } catch (e) {
       throw new MalformedException("url_parsing.error", unchecked);
     }
 
     if (uri.scheme != "http" && uri.scheme != "https")
       throw new MalformedException("url_scheme.error", unchecked);
 
--- a/mailnews/base/prefs/content/accountcreation/util.js
+++ b/mailnews/base/prefs/content/accountcreation/util.js
@@ -47,17 +47,17 @@ function runAsync(func)
 
 
 /**
  * @param uriStr {String}
  * @result {nsIURI}
  */
 function makeNSIURI(uriStr)
 {
-  return Services.io.newURI(uriStr, null, null);
+  return Services.io.newURI(uriStr);
 }
 
 
 /**
  * Reads UTF8 data from a URL.
  *
  * @param uri {nsIURI}   what you want to read
  * @return {Array of String}   the contents of the file, one string per line
--- a/mailnews/base/src/nsMailNewsCommandLineHandler.js
+++ b/mailnews/base/src/nsMailNewsCommandLineHandler.js
@@ -69,17 +69,17 @@ var nsMailNewsCommandLineHandler =
           // message URI
           msgHdr = this._messenger.msgHdrFromURI(mailURL);
         }
       }
       else {
         // Necko URL, so convert it into a message header
         let neckoURL = null;
         try {
-          neckoURL = Services.io.newURI(mailURL, null, null);
+          neckoURL = Services.io.newURI(mailURL);
         }
         catch (e) {
           // We failed to convert the URI. Oh well.
         }
 
         if (neckoURL instanceof Ci.nsIMsgMessageUrl)
           msgHdr = neckoURL.messageHeader;
       }
--- a/mailnews/base/test/unit/test_accountMigration.js
+++ b/mailnews/base/test/unit/test_accountMigration.js
@@ -28,21 +28,21 @@ function run_test() {
                              "account1,account2");
 
   let testAB = do_get_file("data/remoteContent.mab");
 
   // Copy the file to the profile directory for a PAB.
   testAB.copyTo(do_get_profile(), kPABData.fileName);
 
   let uriAllowed = Services.io.newURI(
-    "chrome://messenger/content/?email=yes@test.invalid", null, null);
+    "chrome://messenger/content/?email=yes@test.invalid");
   let uriAllowed2 = Services.io.newURI(
-    "chrome://messenger/content/?email=yes2@test.invalid", null, null);
+    "chrome://messenger/content/?email=yes2@test.invalid");
   let uriDisallowed = Services.io.newURI(
-    "chrome://messenger/content/?email=no@test.invalid", null, null);
+    "chrome://messenger/content/?email=no@test.invalid");
 
   // Check that this email that according to the ab data has (had!)
   // remote content premissions, has no premissions pre migration.
   do_check_eq(Services.perms.testPermission(uriAllowed, "image"),
               Services.perms.UNKNOWN_ACTION);
   do_check_eq(Services.perms.testPermission(uriAllowed2, "image"),
               Services.perms.UNKNOWN_ACTION);
   do_check_eq(Services.perms.testPermission(uriDisallowed, "image"),
--- a/mailnews/base/test/unit/test_nsIMsgContentPolicy.js
+++ b/mailnews/base/test/unit/test_nsIMsgContentPolicy.js
@@ -2,17 +2,17 @@
 /*
  * Test suite for nsIMsgContentPolicy to check we could add/remove customized protocol to
  * nsMsgContentPolicy.
  */
 
 function makeURI(aURL) {
   var ioService = Cc["@mozilla.org/network/io-service;1"]
                     .getService(Ci.nsIIOService);
-  return ioService.newURI(aURL, null, null);
+  return ioService.newURI(aURL);
 }
 
 function run_test() {
   var content_policy = Cc["@mozilla.org/messenger/content-policy;1"]
                          .getService(Ci.nsIContentPolicy);
 
   Assert.ok(content_policy);
 
--- a/mailnews/base/test/unit/test_searchChaining.js
+++ b/mailnews/base/test/unit/test_searchChaining.js
@@ -20,18 +20,17 @@ function *setupFolder()
   // add a single message to the imap inbox.
   let messages = [];
   let messageGenerator = new MessageGenerator();
   messages = messages.concat(messageGenerator.makeMessage());
   let synthMessage = messages[0];
 
   let msgURI =
     Services.io.newURI("data:text/plain;base64," +
-                       btoa(synthMessage.toMessageString()),
-                       null, null);
+                       btoa(synthMessage.toMessageString()));
   let message = new imapMessage(msgURI.spec, IMAPPump.mailbox.uidnext++, []);
   IMAPPump.mailbox.addMessage(message);
 
   // update folder to download header.
   let listener = new PromiseTestUtils.PromiseUrlListener();
   IMAPPump.inbox.updateFolderWithListener(null, listener);
   yield listener.promise;
 }
--- a/mailnews/base/util/mailnewsMigrator.js
+++ b/mailnews/base/util/mailnewsMigrator.js
@@ -127,17 +127,17 @@ function MigrateABRemoteContentSettings(
     return;
 
   // Search through all of our local address books looking for a match.
   let enumerator = MailServices.ab.directories;
   while (enumerator.hasMoreElements())
   {
     let migrateAddress = function(aEmail) {
       let uri = Services.io.newURI(
-        "chrome://messenger/content/?email=" + aEmail, null, null);
+        "chrome://messenger/content/?email=" + aEmail);
       Services.perms.add(uri, "image", Services.perms.ALLOW_ACTION);
     }
 
     let addrbook = enumerator.getNext()
       .QueryInterface(Components.interfaces.nsIAbDirectory);
     try {
       // If it's a read-only book, don't try to find a card as we we could never
       // have set the AllowRemoteContent property.
--- a/mailnews/compose/test/unit/test_mailtoURL.js
+++ b/mailnews/compose/test/unit/test_mailtoURL.js
@@ -5,17 +5,17 @@ Components.utils.import("resource://gre/
 
 var nsIMailtoUrl = Components.interfaces.nsIMailtoUrl;
 var COMPOSE_HTML = Components.interfaces.nsIMsgCompFormat.HTML;
 var COMPOSE_DEFAULT = Components.interfaces.nsIMsgCompFormat.Default;
 
 function run_test() {
 
   function test(aTest) {
-    var uri = Services.io.newURI(aTest.url, null, null);
+    var uri = Services.io.newURI(aTest.url);
     uri = uri.QueryInterface(Components.interfaces.nsIMailtoUrl);
 
     var to = {}, cc = {}, bcc = {}, subject = {}, body = {}, html = {},
         reference = {}, newsgroup = {}, composeformat = {};
     uri.getMessageContents(to, cc, bcc, subject, body, html, reference,
                            newsgroup, composeformat);
     do_check_eq(aTest.to, to.value);
     do_check_eq(aTest.cc, cc.value);
@@ -34,17 +34,17 @@ function run_test() {
     do_check_eq(aTest.newshost, uri.newsHostPart);
     do_check_true(uri.equals(uri));
   }
 
   for (var i = 0; i < tests.length; i++)
     test(tests[i]);
 
   // Test cloning reparses the url by checking the to field.
-  let uriToClone = Services.io.newURI(tests[0].url, null, null);
+  let uriToClone = Services.io.newURI(tests[0].url);
   let clonedUrl = uriToClone.clone().QueryInterface(Components.interfaces.nsIMailtoUrl);
   var to = {}, cc = {}, bcc = {}, subject = {}, body = {}, html = {},
       reference = {}, newsgroup = {}, composeformat = {};
   clonedUrl.getMessageContents(to, cc, bcc, subject, body, html, reference,
                                newsgroup, composeformat);
   do_check_eq(to.value, tests[0].to);
 };
 
--- a/mailnews/compose/test/unit/test_smtpProtocols.js
+++ b/mailnews/compose/test/unit/test_smtpProtocols.js
@@ -32,17 +32,17 @@ function run_test() {
     do_check_eq(pH.defaultPort, protocols[part].defaultPort);
     do_check_eq(pH.protocolFlags, defaultProtocolFlags);
 
     // Whip through some of the ports to check we get the right results.
     for (let i = 0; i < 1024; ++i)
       do_check_eq(pH.allowPort(i, ""), (i == protocols[part].defaultPort));
 
     // Check we get a URI when we ask for one
-    var uri = pH.newURI(protocols[part].urlSpec, "", null);
+    var uri = pH.newURI(protocols[part].urlSpec, "");
 
     uri.QueryInterface(Ci.nsISmtpUrl);
 
     do_check_eq(uri.spec, protocols[part].urlSpec);
 
     try {
       // This call should throw NS_ERROR_NOT_IMPLEMENTED. If it doesn't,
       // then we should implement a new test for it.
--- a/mailnews/compose/test/unit/test_smtpURL.js
+++ b/mailnews/compose/test/unit/test_smtpURL.js
@@ -14,14 +14,14 @@ var smtpURLs =
       username: "user"
     } ];
 
 function run_test() {
   var url;
   for (var part = 0; part < smtpURLs.length; ++part) {
     print("url: " + smtpURLs[part].url);
 
-    url = Services.io.newURI(smtpURLs[part].url, null, null);
+    url = Services.io.newURI(smtpURLs[part].url);
 
     do_check_eq(url.spec, smtpURLs[part].spec);
     do_check_eq(url.username, smtpURLs[part].username);
   }
 }
--- a/mailnews/extensions/newsblog/content/Feed.js
+++ b/mailnews/extensions/newsblog/content/Feed.js
@@ -30,17 +30,17 @@ var FeedCache =
     if (index in this.mFeeds)
       delete this.mFeeds[index];
   },
 
   normalizeHost: function (aUrl)
   {
     try
     {
-      let normalizedUrl = Services.io.newURI(aUrl, null, null);
+      let normalizedUrl = Services.io.newURI(aUrl);
       normalizedUrl.host = normalizedUrl.host.toLowerCase();
       return normalizedUrl.spec
     }
     catch (ex)
     {
       return aUrl;
     }
   }
--- a/mailnews/extensions/newsblog/content/FeedItem.js
+++ b/mailnews/extensions/newsblog/content/FeedItem.js
@@ -45,17 +45,17 @@ FeedItem.prototype =
   {
     return this.mURL;
   },
 
   set url(aVal)
   {
     try
     {
-      this.mURL = Services.io.newURI(aVal, null, null).spec;
+      this.mURL = Services.io.newURI(aVal).spec;
     }
     catch(ex)
     {
       // The url as published or constructed can be a non url.  It's used as a
       // feeditem identifier in feeditems.rdf, as a messageId, and as an href
       // and for the content-base header.  Save as is; ensure not null.
       this.mURL = aVal ? aVal : "";
     }
@@ -449,17 +449,17 @@ function FeedEnclosure(aURL, aContentTyp
   this.mLength = aLength;
   this.mTitle = aTitle;
 
   // Generate a fileName from the URL.
   if (this.mURL)
   {
     try
     {
-      this.mFileName = Services.io.newURI(this.mURL, null, null).
+      this.mFileName = Services.io.newURI(this.mURL).
                                    QueryInterface(Ci.nsIURL).
                                    fileName;
     }
     catch(ex)
     {
       this.mFileName = this.mURL;
     }
   }
--- a/mailnews/extensions/newsblog/content/FeedUtils.jsm
+++ b/mailnews/extensions/newsblog/content/FeedUtils.jsm
@@ -632,17 +632,17 @@ var FeedUtils = {
     if (!Services.prefs.getBoolPref("browser.chrome.site_icons") ||
         !Services.prefs.getBoolPref("browser.chrome.favicons"))
       return useDefaultFavicon();
 
     if (aIconUrl != null)
       return aIconUrl;
 
     let onLoadSuccess = (aEvent => {
-      let iconUri = Services.io.newURI(aEvent.target.src, null, null);
+      let iconUri = Services.io.newURI(aEvent.target.src);
       aWindow.specialTabs.mFaviconService.setAndFetchFaviconForPage(
         uri, iconUri, false,
         aWindow.specialTabs.mFaviconService.FAVICON_LOAD_NON_PRIVATE,
         null, Services.scriptSecurityManager.getSystemPrincipal());
 
       if (aCallback)
         aCallback(iconUri.spec);
     });
@@ -674,18 +674,18 @@ var FeedUtils = {
       let feedLinkUrl = ds.GetTarget(resource, this.RSS_LINK, true);
       feedLinkUrl = feedLinkUrl ?
                       feedLinkUrl.QueryInterface(Ci.nsIRDFLiteral).Value : null;
       url = feedLinkUrl && feedLinkUrl.startsWith("http") ? feedLinkUrl : url;
     }
 
     let uri, iconUri;
     try {
-      uri = Services.io.newURI(url, null, null);
-      iconUri = Services.io.newURI(uri.prePath + "/favicon.ico", null, null);
+      uri = Services.io.newURI(url);
+      iconUri = Services.io.newURI(uri.prePath + "/favicon.ico");
     }
     catch (ex) {
       return useDefaultFavicon();
     }
 
     if (!aWindow)
       return iconUri.spec;
 
@@ -1301,17 +1301,17 @@ var FeedUtils = {
  *
  * @param  nsIURI aUri or string aUrl  - the Uri/Url.
  * @return boolean                     - true if a valid scheme, false if not.
  */
   _validSchemes: ["http", "https"],
   isValidScheme: function(aUri) {
     if (!(aUri instanceof Ci.nsIURI)) {
       try {
-        aUri = Services.io.newURI(aUri, null, null);
+        aUri = Services.io.newURI(aUri);
       }
       catch (ex) {
         return false;
       }
     }
 
     return (this._validSchemes.indexOf(aUri.scheme) != -1);
   },
@@ -1490,17 +1490,17 @@ var FeedUtils = {
           message = FeedUtils.strings.formatStringFromName(
                       "newsblog-networkError", [feed.url], 1);
           break;
         case FeedUtils.kNewsBlogFileError:
           message = FeedUtils.strings.GetStringFromName(
                       "subscribe-errorOpeningFile");
           break;
         case FeedUtils.kNewsBlogBadCertError:
-          let host = Services.io.newURI(feed.url, null, null).host;
+          let host = Services.io.newURI(feed.url).host;
           message = FeedUtils.strings.formatStringFromName(
                       "newsblog-badCertError", [host], 1);
           break;
         case FeedUtils.kNewsBlogNoAuthError:
           message = FeedUtils.strings.formatStringFromName(
                       "newsblog-noAuthError", [feed.url], 1);
           break;
       }
--- a/mailnews/extensions/newsblog/content/feed-parser.js
+++ b/mailnews/extensions/newsblog/content/feed-parser.js
@@ -162,17 +162,17 @@ FeedParser.prototype =
             guidNode.getAttribute("isPermaLink") == "true")
           isPermaLink = true;
         // If attribute isPermaLink is missing, it is good to check the validity
         // of <guid> value as an URL to avoid linking to non-URL strings.
         if (!guidNode.hasAttribute("isPermaLink"))
         {
           try
           {
-            Services.io.newURI(guid, null, null);
+            Services.io.newURI(guid);
             if (Services.io.extractScheme(guid) == "tag")
               isPermaLink = false;
           }
           catch (ex)
           {
             isPermaLink = false;
           }
         }
@@ -863,17 +863,17 @@ FeedParser.prototype =
           // If there's a link rel.
           ((alink.getAttribute("rel") && alink.getAttribute("rel") == linkRel) ||
            // If there isn't, assume 'alternate'.
            (!alink.getAttribute("rel") && (linkRel == "alternate"))) &&
           alink.getAttribute("href"))
       {
         // Atom links are interpreted relative to xml:base.
         try {
-          return Services.io.newURI(alink.baseURI, null, null).
+          return Services.io.newURI(alink.baseURI).
                              resolve(alink.getAttribute("href"));
         }
         catch (ex) {}
       }
     }
 
     return null;
   },
--- a/mailnews/extensions/newsblog/content/feed-subscriptions.js
+++ b/mailnews/extensions/newsblog/content/feed-subscriptions.js
@@ -1792,17 +1792,17 @@ var FeedSubscriptions = {
                       "subscribe-feedNotValid");
         if (aErrorCode == FeedUtils.kNewsBlogRequestFailure)
           message = FeedUtils.strings.GetStringFromName(
                       "subscribe-networkError");
         if (aErrorCode == FeedUtils.kNewsBlogFileError)
           message = FeedUtils.strings.GetStringFromName(
                       "subscribe-errorOpeningFile");
         if (aErrorCode == FeedUtils.kNewsBlogBadCertError) {
-          let host = Services.io.newURI(feed.url, null, null).host;
+          let host = Services.io.newURI(feed.url).host;
           message = FeedUtils.strings.formatStringFromName(
                       "newsblog-badCertError", [host], 1);
         }
         if (aErrorCode == FeedUtils.kNewsBlogNoAuthError)
           message = FeedUtils.strings.GetStringFromName(
                       "subscribe-noAuthError");
 
         if (win.mActionMode != win.kUpdateMode &&
--- a/mailnews/extensions/newsblog/content/newsblogOverlay.js
+++ b/mailnews/extensions/newsblog/content/newsblogOverlay.js
@@ -183,17 +183,17 @@ var FeedMessageHandler = {
       if (aMimeMsg && aMimeMsg.headers["content-base"] &&
           aMimeMsg.headers["content-base"][0]) {
         let url = aMimeMsg.headers["content-base"], uri;
         try {
           let converter = Cc["@mozilla.org/intl/scriptableunicodeconverter"]
                             .createInstance(Ci.nsIScriptableUnicodeConverter);
           converter.charset = "UTF-8";
           url = converter.ConvertToUnicode(url);
-          uri = Services.io.newURI(url, null, null);
+          uri = Services.io.newURI(url);
           url = uri.spec;
         }
         catch (ex) {
           FeedUtils.log.info("FeedMessageHandler.loadWebPage: " +
                              "invalid Content-Base header url - " + url);
           return;
         }
         if (aWhere.browser)
--- a/mailnews/extensions/smime/content/certFetchingStatus.js
+++ b/mailnews/extensions/smime/content/certFetchingStatus.js
@@ -49,17 +49,17 @@ function search()
   } catch (ex) {
     // if we don't have this pref, no big deal
   }
 
   try {
     let url = Services.prefs.getCharPref(gDirectoryPref + ".uri");
 
     gLdapServerURL = Services.io
-      .newURI(url, null, null).QueryInterface(Components.interfaces.nsILDAPURL);
+      .newURI(url).QueryInterface(Components.interfaces.nsILDAPURL);
 
     gLdapConnection = Components.classes["@mozilla.org/network/ldap-connection;1"]
       .createInstance().QueryInterface(Components.interfaces.nsILDAPConnection);
 
     gLdapConnection.init(gLdapServerURL, gLogin, new boundListener(),
       null, Components.interfaces.nsILDAPConnection.VERSION3);
 
   } catch (ex) {
--- a/mailnews/imap/test/unit/head_server.js
+++ b/mailnews/imap/test/unit/head_server.js
@@ -98,14 +98,13 @@ function do_check_transaction(fromServer
  * add a simple message to the IMAP pump mailbox
  */
 function addImapMessage()
 {
   let messages = [];
   let messageGenerator = new MessageGenerator();
   messages = messages.concat(messageGenerator.makeMessage());
   let dataUri = Services.io.newURI("data:text/plain;base64," +
-                  btoa(messages[0].toMessageString()),
-                  null, null);
+                  btoa(messages[0].toMessageString()));
   let imapMsg = new imapMessage(dataUri.spec, IMAPPump.mailbox.uidnext++, []);
   IMAPPump.mailbox.addMessage(imapMsg);
 }
 
--- a/mailnews/imap/test/unit/test_compactOfflineStore.js
+++ b/mailnews/imap/test/unit/test_compactOfflineStore.js
@@ -50,18 +50,17 @@ function addMessagesToServer(messages, m
 }
 
 function addGeneratedMessagesToServer(messages, mailbox)
 {
   // Create the imapMessages and store them on the mailbox
   messages.forEach(function (message)
   {
     let dataUri = Services.io.newURI("data:text/plain;base64," +
-                                     btoa(message.toMessageString()),
-                                     null, null);
+                                     btoa(message.toMessageString()));
     mailbox.addMessage(new imapMessage(dataUri.spec, mailbox.uidnext++, []));
   });
 }
 
 
 function checkOfflineStore(prevOfflineStoreSize) {
   dump("checking offline store\n");
   let offset = new Object;
--- a/mailnews/imap/test/unit/test_dontStatNoSelect.js
+++ b/mailnews/imap/test/unit/test_dontStatNoSelect.js
@@ -107,18 +107,17 @@ function* checkStatNoSelect() {
 function addMessageToFolder(mbox) {
   // make a couple messges
   let messages = [];
   let gMessageGenerator = new MessageGenerator();
   messages = messages.concat(gMessageGenerator.makeMessage());
 
   let msgURI =
     Services.io.newURI("data:text/plain;base64," +
-                       btoa(messages[0].toMessageString()),
-                       null, null);
+                       btoa(messages[0].toMessageString()));
   let message = new imapMessage(msgURI.spec, mbox.uidnext++);
   mbox.addMessage(message);
 }
 
 function* endTest()
 {
   do_check_eq(gFolder2.getNumUnread(false), 2);
   // Clean up the server in preparation
--- a/mailnews/imap/test/unit/test_downloadOffline.js
+++ b/mailnews/imap/test/unit/test_downloadOffline.js
@@ -28,18 +28,17 @@ function *setup() {
     Services.io.newFileURI(gMsgFile).QueryInterface(Ci.nsIFileURL);
 
   IMAPPump.mailbox.addMessage(new imapMessage(msgfileuri.spec, IMAPPump.mailbox.uidnext++, []));
 
   let messages = [];
   let gMessageGenerator = new MessageGenerator();
   messages = messages.concat(gMessageGenerator.makeMessage());
   let dataUri = Services.io.newURI("data:text/plain;base64," +
-                                   btoa(messages[0].toMessageString()),
-                                   null, null);
+                                   btoa(messages[0].toMessageString()));
   let imapMsg = new imapMessage(dataUri.spec, IMAPPump.mailbox.uidnext++, []);
   imapMsg.setSize(5000);
   IMAPPump.mailbox.addMessage(imapMsg);
   
   // ...and download for offline use.
   let promiseUrlListener = new PromiseTestUtils.PromiseUrlListener();
   IMAPPump.inbox.downloadAllForOffline(promiseUrlListener, null);
   yield promiseUrlListener.promise;
--- a/mailnews/imap/test/unit/test_imapAttachmentSaves.js
+++ b/mailnews/imap/test/unit/test_imapAttachmentSaves.js
@@ -41,18 +41,17 @@ function* loadImapMessage()
   let smsg = gMessageGenerator.makeMessage({
     attachments: [
       {filename: kAttachFileName, body: 'I like cheese!'}
     ],
   });
 
   let msgURI =
     Services.io.newURI("data:text/plain;base64," +
-                       btoa(smsg.toMessageString()),
-                       null, null);
+                       btoa(smsg.toMessageString()));
   let imapInbox = IMAPPump.daemon.getMailbox("INBOX");
   let message = new imapMessage(msgURI.spec, imapInbox.uidnext++, []);
   IMAPPump.mailbox.addMessage(message);
   IMAPPump.inbox.updateFolderWithListener(null, asyncUrlListener);
   yield false;
   do_check_eq(1, IMAPPump.inbox.getTotalMessages(false));
   let msgHdr = mailTestUtils.firstMsgHdr(IMAPPump.inbox);
   do_check_true(msgHdr instanceof Ci.nsIMsgDBHdr);
--- a/mailnews/imap/test/unit/test_imapAutoSync.js
+++ b/mailnews/imap/test/unit/test_imapAutoSync.js
@@ -270,17 +270,16 @@ var gAutoSyncListener =
 function addMessageToFolder(folder)
 {
   let messages = [];
   let gMessageGenerator = new MessageGenerator();
   messages = messages.concat(gMessageGenerator.makeMessage());
 
   let msgURI =
     Services.io.newURI("data:text/plain;base64," +
-                       btoa(messages[0].toMessageString()),
-                       null, null);
+                       btoa(messages[0].toMessageString()));
   let imapMailbox =  IMAPPump.daemon.getMailbox(folder.name);
   // We add messages with \Seen flag set so that we won't accidentally
   // trigger the code that updates imap folders that have unread messages moved
   // into them.
   let message = new imapMessage(msgURI.spec, imapMailbox.uidnext++, ["\\Seen"]);
   imapMailbox.addMessage(message);
 }
--- a/mailnews/imap/test/unit/test_imapContentLength.js
+++ b/mailnews/imap/test/unit/test_imapContentLength.js
@@ -57,30 +57,29 @@ function verifyContentLength() {
   let messageUri = IMAPPump.inbox.getUriForMsg(gMsgHdr);
   // Convert this to a URI that necko can run
   let messenger = Cc["@mozilla.org/messenger;1"].createInstance(Ci.nsIMessenger);
   let neckoURL = {};
   let messageService = messenger.messageServiceFromURI(messageUri);
   messageService.GetUrlForUri(messageUri, neckoURL, null);
   // Don't use the necko URL directly. Instead, get the spec and create a new
   // URL using the IO service
-  let urlToRun = Services.io.newURI(neckoURL.value.spec, null, null);
+  let urlToRun = Services.io.newURI(neckoURL.value.spec);
 
   // Get a channel from this URI, and check its content length
   let channel = Services.io.newChannelFromURI2(urlToRun,
                                                null,
                                                Services.scriptSecurityManager.getSystemPrincipal(),
                                                null,
                                                Ci.nsILoadInfo.SEC_ALLOW_CROSS_ORIGIN_DATA_IS_NULL,
                                                Ci.nsIContentPolicy.TYPE_OTHER);
   do_check_eq(channel.contentLength, gFile.fileSize);
 
   // Now try an attachment. &part=1.2
-  let attachmentURL = Services.io.newURI(neckoURL.value.spec + "&part=1.2",
-                                        null, null);
+  let attachmentURL = Services.io.newURI(neckoURL.value.spec + "&part=1.2");
   let attachmentChannel = Services.io.newChannelFromURI2(attachmentURL,
                                                          null,
                                                          Services.scriptSecurityManager.getSystemPrincipal(),
                                                          null,
                                                          Ci.nsILoadInfo.SEC_ALLOW_CROSS_ORIGIN_DATA_IS_NULL,
                                                          Ci.nsIContentPolicy.TYPE_OTHER);
   // Currently attachments have their content length set to the length of the
   // entire message
--- a/mailnews/imap/test/unit/test_imapCopyTimeout.js
+++ b/mailnews/imap/test/unit/test_imapCopyTimeout.js
@@ -65,18 +65,17 @@ function* createTargetFolder()
 function* loadImapMessage()
 {
   let messages = [];
   let gMessageGenerator = new MessageGenerator();
   messages = messages.concat(gMessageGenerator.makeMessage());
 
   let msgURI =
     Services.io.newURI("data:text/plain;base64," +
-                       btoa(messages[0].toMessageString()),
-                       null, null);
+                       btoa(messages[0].toMessageString()));
   let imapInbox = IMAPPump.daemon.getMailbox("INBOX");
   var gMessage = new imapMessage(msgURI.spec, imapInbox.uidnext++, []);
   IMAPPump.mailbox.addMessage(gMessage);
   IMAPPump.inbox.updateFolder(null);
   yield false;
   do_check_eq(1, IMAPPump.inbox.getTotalMessages(false));
   let msgHdr = mailTestUtils.firstMsgHdr(IMAPPump.inbox);
   do_check_true(msgHdr instanceof Ci.nsIMsgDBHdr);
--- a/mailnews/imap/test/unit/test_imapFlagChange.js
+++ b/mailnews/imap/test/unit/test_imapFlagChange.js
@@ -110,18 +110,17 @@ function* setup() {
   // build up a diverse list of messages
   let messages = [];
   let gMessageGenerator = new MessageGenerator();
   messages = messages.concat(gMessageGenerator.makeMessage());
   gSynthMessage = messages[0];
 
   let msgURI =
     Services.io.newURI("data:text/plain;base64," +
-                       btoa(gSynthMessage.toMessageString()),
-                       null, null);
+                       btoa(gSynthMessage.toMessageString()));
   gMessage = new imapMessage(msgURI.spec, IMAPPump.mailbox.uidnext++, []);
   IMAPPump.mailbox.addMessage(gMessage);
 
   // update folder to download header.
   IMAPPump.inbox.updateFolderWithListener(null, asyncUrlListener);
   yield false;
 }
 
--- a/mailnews/imap/test/unit/test_imapHdrChunking.js
+++ b/mailnews/imap/test/unit/test_imapHdrChunking.js
@@ -59,18 +59,17 @@ function* uploadImapMessages()
   messages = messages.concat(scenarioFactory.directReply(10));
 
   // Add 10 messages with uids 1-10.
   let imapInbox = IMAPPump.daemon.getMailbox("INBOX")
   // Create the imapMessages and store them on the mailbox
   messages.forEach(function (message)
   {
     let dataUri = Services.io.newURI("data:text/plain;base64," +
-                                     btoa(message.toMessageString()),
-                                     null, null);
+                                     btoa(message.toMessageString()));
     imapInbox.addMessage(new imapMessage(dataUri.spec, imapInbox.uidnext++, []));
   });
   // updateFolderWithListener with null for nsIMsgWindow makes biff notify.
   IMAPPump.inbox.updateFolderWithListener(null, asyncUrlListener);
   yield false;
 }
 
 function* testMessageFetched() {
--- a/mailnews/imap/test/unit/test_imapHighWater.js
+++ b/mailnews/imap/test/unit/test_imapHighWater.js
@@ -19,18 +19,17 @@ var gFolder1, gRootFolder;
 
 // Adds some messages directly to a mailbox (eg new mail)
 function addMessagesToServer(messages, mailbox)
 {
   // Create the imapMessages and store them on the mailbox
   messages.forEach(function (message)
   {
     let dataUri = Services.io.newURI("data:text/plain;base64," +
-                                      btoa(message.toMessageString()),
-                                     null, null);
+                                      btoa(message.toMessageString()));
     mailbox.addMessage(new imapMessage(dataUri.spec, mailbox.uidnext++, []));
   });
 }
 
 function run_test()
 {
   localAccountUtils.loadLocalMailAccount();
 
--- a/mailnews/imap/test/unit/test_imapProtocols.js
+++ b/mailnews/imap/test/unit/test_imapProtocols.js
@@ -40,15 +40,15 @@ function run_test() {
     do_check_eq(pH.protocolFlags, defaultProtocolFlags);
 
     // Whip through some of the ports to check we get the right results.
     // IMAP allows connecting to any port.
     for (let i = 0; i < 1024; ++i)
       do_check_true(pH.allowPort(i, ""));
 
     // Check we get a URI when we ask for one
-    var uri = pH.newURI(protocols[part].urlSpec, "", null);
+    var uri = pH.newURI(protocols[part].urlSpec, "");
 
     uri.QueryInterface(Ci.nsIImapUrl);
 
     do_check_eq(uri.spec, protocols[part].urlSpec);
   }
 }
--- a/mailnews/imap/test/unit/test_imapProxy.js
+++ b/mailnews/imap/test/unit/test_imapProxy.js
@@ -19,18 +19,17 @@ add_task(function* setup() {
 
   let daemon = new imapDaemon();
   server = makeServer(daemon, "");
 
   let messages = [];
   let messageGenerator = new MessageGenerator();
   messages = messages.concat(messageGenerator.makeMessage());
   let dataUri = Services.io.newURI("data:text/plain;base64," +
-                                   btoa(messages[0].toMessageString()),
-                                   null, null);
+                                   btoa(messages[0].toMessageString()));
   let imapMsg = new imapMessage(dataUri.spec, daemon.inbox.uidnext++, []);
   daemon.inbox.addMessage(imapMsg);
 
 
   NetworkTestUtils.configureProxy("imap.tinderbox.invalid", PORT, server.port);
 
   // Set up the basic accounts and folders
   incomingServer = createLocalIMAPServer(PORT, "imap.tinderbox.invalid");
--- a/mailnews/imap/test/unit/test_imapStoreMsgOffline.js
+++ b/mailnews/imap/test/unit/test_imapStoreMsgOffline.js
@@ -178,18 +178,17 @@ var tests = [
 
     gFirstNewMsg = mbox.uidnext;
     // need to account for x-mozilla-status, status2, and envelope.
     gFirstMsgSize = messages[0].toMessageString().length + 102;
 
     messages.forEach(function (message)
     {
       let dataUri = Services.io.newURI("data:text/plain;base64," +
-                                       btoa(message.toMessageString()),
-                                       null, null);
+                                       btoa(message.toMessageString()));
       mbox.addMessage(new imapMessage(dataUri.spec, mbox.uidnext++, []));
     });
     IMAPPump.inbox.updateFolderWithListener(null, asyncUrlListener);
     yield false;
   },
   function* testQueuedOfflineDownload()
   {
     // Make sure that streaming the same message and then trying to download
--- a/mailnews/imap/test/unit/test_largeOfflineStore.js
+++ b/mailnews/imap/test/unit/test_largeOfflineStore.js
@@ -58,24 +58,22 @@ function run_test() {
 function* setup() {
   // Create a couple test messages on the IMAP server.
   let messages = [];
   let messageGenerator = new MessageGenerator();
   let scenarioFactory = new MessageScenarioFactory(messageGenerator);
 
   messages = messages.concat(scenarioFactory.directReply(2));
   let dataUri = Services.io.newURI("data:text/plain;base64," +
-                                   btoa(messages[0].toMessageString()),
-                                   null, null);
+                                   btoa(messages[0].toMessageString()));
   let imapMsg = new imapMessage(dataUri.spec, IMAPPump.mailbox.uidnext++, []);
   IMAPPump.mailbox.addMessage(imapMsg);
 
   dataUri = Services.io.newURI("data:text/plain;base64," +
-                               btoa(messages[1].toMessageString()),
-                               null, null);
+                               btoa(messages[1].toMessageString()));
   imapMsg = new imapMessage(dataUri.spec, IMAPPump.mailbox.uidnext++, []);
   IMAPPump.mailbox.addMessage(imapMsg);
 
   // Extend local IMAP inbox to over 4 GiB.
   let outputStream = Cc["@mozilla.org/network/file-output-stream;1"]
                        .createInstance(Ci.nsIFileOutputStream)
                        .QueryInterface(Ci.nsISeekableStream);
   // Open in write-only mode, no truncate.
--- a/mailnews/imap/test/unit/test_offlinePlayback.js
+++ b/mailnews/imap/test/unit/test_offlinePlayback.js
@@ -113,25 +113,23 @@ function *setup() {
   let gMessageGenerator = new MessageGenerator();
   messages = messages.concat(gMessageGenerator.makeMessage());
   messages = messages.concat(gMessageGenerator.makeMessage());
   gSynthMessage1 = messages[0];
   gSynthMessage2 = messages[1];
 
   let msgURI =
     Services.io.newURI("data:text/plain;base64," +
-                       btoa(messages[0].toMessageString()),
-                       null, null);
+                       btoa(messages[0].toMessageString()));
   let imapInbox =  IMAPPump.daemon.getMailbox("INBOX")
   let message = new imapMessage(msgURI.spec, imapInbox.uidnext++, ["\\Seen"]);
   imapInbox.addMessage(message);
   msgURI =
     Services.io.newURI("data:text/plain;base64," +
-                       btoa(messages[1].toMessageString()),
-                       null, null);
+                       btoa(messages[1].toMessageString()));
   message = new imapMessage(msgURI.spec, imapInbox.uidnext++, ["\\Seen"]);
   imapInbox.addMessage(message);
 
   // update folder to download header.
   let promiseUrlListener = new PromiseTestUtils.PromiseUrlListener();
   IMAPPump.inbox.updateFolderWithListener(null, promiseUrlListener);
   yield promiseUrlListener.promise;
 }
--- a/mailnews/imap/test/unit/test_offlineStoreLocking.js
+++ b/mailnews/imap/test/unit/test_offlineStoreLocking.js
@@ -24,18 +24,17 @@ function alert(aDialogTitle, aText) {
 }
 
 function addGeneratedMessagesToServer(messages, mailbox)
 {
   // Create the imapMessages and store them on the mailbox
   messages.forEach(function (message)
   {
     let dataUri = Services.io.newURI("data:text/plain;base64," +
-                                     btoa(message.toMessageString()),
-                                     null, null);
+                                     btoa(message.toMessageString()));
     mailbox.addMessage(new imapMessage(dataUri.spec, mailbox.uidnext++, []));
   });
 }
 
 var gStreamedHdr = null;
 
 function checkOfflineStore(prevOfflineStoreSize) {
   dump("checking offline store\n");
--- a/mailnews/imap/test/unit/test_saveTemplate.js
+++ b/mailnews/imap/test/unit/test_saveTemplate.js
@@ -29,18 +29,17 @@ var tests = [
 function* loadImapMessage()
 {
   let gMessageGenerator = new MessageGenerator();
   // create a synthetic message with attachment
   let smsg = gMessageGenerator.makeMessage();
 
   let msgURI =
     Services.io.newURI("data:text/plain;base64," +
-                        btoa(smsg.toMessageString()),
-                        null, null);
+                        btoa(smsg.toMessageString()));
   let imapInbox =  IMAPPump.daemon.getMailbox("INBOX")
   let message = new imapMessage(msgURI.spec, imapInbox.uidnext++, []);
   IMAPPump.mailbox.addMessage(message);
   IMAPPump.inbox.updateFolderWithListener(null, asyncUrlListener);
   yield false;
   MailServices.mfn.addListener(mfnListener, MailServices.mfn.msgAdded);
   yield true;
 }
--- a/mailnews/imap/test/unit/test_stopMovingToLocalFolder.js
+++ b/mailnews/imap/test/unit/test_stopMovingToLocalFolder.js
@@ -41,18 +41,17 @@ var tests = [
   check_messages
 ];
 
 function* setup_messages() {
   Services.prefs.setBoolPref("mail.server.default.autosync_offline_stores", false);
 
   let messageGenerator = new MessageGenerator();
   let messageString = messageGenerator.makeMessage().toMessageString();
-  let dataUri = Services.io.newURI("data:text/plain;base64," + btoa(messageString),
-                                   null, null);
+  let dataUri = Services.io.newURI("data:text/plain;base64," + btoa(messageString));
   let imapMsg = new imapMessage(dataUri.spec, IMAPPump.mailbox.uidnext++, []);
   IMAPPump.mailbox.addMessage(imapMsg);
 
   IMAPPump.inbox.updateFolderWithListener(null, asyncUrlListener);
   yield false;
 }
 
 function* move_messages() {
--- a/mailnews/imap/test/unit/test_syncChanges.js
+++ b/mailnews/imap/test/unit/test_syncChanges.js
@@ -53,18 +53,17 @@ function* setup() {
 
   let messages = [];
   let gMessageGenerator = new MessageGenerator();
   messages = messages.concat(gMessageGenerator.makeMessage());
   gSynthMessage = messages[0];
 
   let msgURI =
     Services.io.newURI("data:text/plain;base64," +
-                       btoa(gSynthMessage.toMessageString()),
-                       null, null);
+                       btoa(gSynthMessage.toMessageString()));
   gMessage = new imapMessage(msgURI.spec, IMAPPump.mailbox.uidnext++, []);
   IMAPPump.mailbox.addMessage(gMessage);
 
   // update folder to download header.
   IMAPPump.inbox.updateFolderWithListener(null, asyncUrlListener);
   yield false;
 }
 
--- a/mailnews/local/test/unit/test_mailboxContentLength.js
+++ b/mailnews/local/test/unit/test_mailboxContentLength.js
@@ -28,30 +28,29 @@ function verifyContentLength(aMessageHea
   let messageUri = localAccountUtils.inboxFolder.getUriForMsg(msgHdr);
   // Convert this to a URI that necko can run
   let messenger = Cc["@mozilla.org/messenger;1"].createInstance(Ci.nsIMessenger);
   let neckoURL = {};
   let messageService = messenger.messageServiceFromURI(messageUri);
   messageService.GetUrlForUri(messageUri, neckoURL, null);
   // Don't use the necko URL directly. Instead, get the spec and create a new
   // URL using the IO service
-  let urlToRun = Services.io.newURI(neckoURL.value.spec, null, null);
+  let urlToRun = Services.io.newURI(neckoURL.value.spec);
 
   // Get a channel from this URI, and check its content length
   let channel = Services.io.newChannelFromURI2(urlToRun,
                                                null,
                                                Services.scriptSecurityManager.getSystemPrincipal(),
                                                null,
                                                Ci.nsILoadInfo.SEC_ALLOW_CROSS_ORIGIN_DATA_IS_NULL,
                                                Ci.nsIContentPolicy.TYPE_OTHER);
   do_check_eq(channel.contentLength, gFile.fileSize);
 
   // Now try an attachment. &part=1.2
-  let attachmentURL = Services.io.newURI(neckoURL.value.spec + "&part=1.2",
-                                         null, null);
+  let attachmentURL = Services.io.newURI(neckoURL.value.spec + "&part=1.2");
   let attachmentChannel = Services.io.newChannelFromURI2(attachmentURL,
                                                          null,
                                                          Services.scriptSecurityManager.getSystemPrincipal(),
                                                          null,
                                                          Ci.nsILoadInfo.SEC_ALLOW_CROSS_ORIGIN_DATA_IS_NULL,
                                                          Ci.nsIContentPolicy.TYPE_OTHER);
   // Currently attachments have their content length set to the length of the
   // entire message
--- a/mailnews/local/test/unit/test_mailboxProtocol.js
+++ b/mailnews/local/test/unit/test_mailboxProtocol.js
@@ -31,17 +31,17 @@ function run_test()
     do_check_eq(pH.defaultPort, protocols[part].defaultPort);
     do_check_eq(pH.protocolFlags, defaultProtocolFlags);
 
     // Whip through some of the ports to check we get the right results.
     for (let i = 0; i < 1024; ++i)
       do_check_eq(pH.allowPort(i, ""), false);
 
     // Check we get a URI when we ask for one
-    var uri = pH.newURI(protocols[part].urlSpec, "", null);
+    var uri = pH.newURI(protocols[part].urlSpec, "");
 
     uri.QueryInterface(Ci.nsIMailboxUrl);
 
     do_check_eq(uri.spec, protocols[part].urlSpec);
 
     // XXX This fails on Windows
     // do_check_neq(pH.newChannel(uri), null);
   }
--- a/mailnews/news/test/unit/head_server_setup.js
+++ b/mailnews/news/test/unit/head_server_setup.js
@@ -131,17 +131,17 @@ function setupLocalServer(port, host="lo
 var URLCreator = MailServices.nntp.QueryInterface(Ci.nsIProtocolHandler);
 
 // Sets up a protocol object and prepares to run the test for the news url
 function setupProtocolTest(port, newsUrl, incomingServer) {
   var url;
   if (newsUrl instanceof Ci.nsIMsgMailNewsUrl) {
     url = newsUrl;
   } else {
-    url = URLCreator.newURI(newsUrl, null, null);
+    url = URLCreator.newURI(newsUrl);
   }
 
   var newsServer = incomingServer;
   if (!newsServer)
     newsServer = setupLocalServer(port);
 
   var listener = {
     onStartRequest : function () {},
@@ -161,17 +161,17 @@ function setupProtocolTest(port, newsUrl
       throw Cr.NS_ERROR_NO_INTERFACE;
     }
   }
   listener.called = false;
   newsServer.loadNewsUrl(url, null, listener);
 }
 
 function create_post(baseURL, file) {
-  var url = URLCreator.newURI(baseURL, null, null);
+  var url = URLCreator.newURI(baseURL);
   url.QueryInterface(Ci.nsINntpUrl);
 
   var post = Cc["@mozilla.org/messenger/nntpnewsgrouppost;1"]
                .createInstance(Ci.nsINNTPNewsgroupPost);
   post.postMessageFile = do_get_file(file);
   url.messageToPost = post;
   return url;
 }
--- a/mailnews/news/test/unit/test_bug37465.js
+++ b/mailnews/news/test/unit/test_bug37465.js
@@ -5,18 +5,17 @@ Components.utils.import("resource://gre/
 
 function run_test() {
   var daemon = setupNNTPDaemon();
   var server = makeServer(NNTP_RFC2980_handler, daemon);
   server.start();
 
   // Correct URI?
   let uri = Services.io.newURI("news://localhost:" + server.port +
-                                 "/1@regular.invalid",
-                               null, null);
+                                 "/1@regular.invalid");
   let newsUri = uri.QueryInterface(Ci.nsINntpUrl)
                    .QueryInterface(Ci.nsIMsgMailNewsUrl);
   do_check_eq(uri.port, server.port);
   do_check_eq(newsUri.server, null);
   do_check_eq(newsUri.messageID, "1@regular.invalid");
   do_check_eq(newsUri.folder, null);
 
   // Run the URI and make sure we get the message
--- a/mailnews/news/test/unit/test_nntpContentLength.js
+++ b/mailnews/news/test/unit/test_nntpContentLength.js
@@ -40,31 +40,30 @@ function run_test() {
     let messageUri = folder.getUriForMsg(msgHdr);
     // Convert this to a URI that necko can run
     let messenger = Cc["@mozilla.org/messenger;1"].createInstance(Ci.nsIMessenger);
     let neckoURL = {};
     let messageService = messenger.messageServiceFromURI(messageUri);
     messageService.GetUrlForUri(messageUri, neckoURL, null);
     // Don't use the necko URL directly. Instead, get the spec and create a new
     // URL using the IO service
-    let urlToRun = Services.io.newURI(neckoURL.value.spec, null, null);
+    let urlToRun = Services.io.newURI(neckoURL.value.spec);
 
     // Get a channel from this URI, and check its content length
     let channel = Services.io.newChannelFromURI2(urlToRun,
                                                  null,
                                                  Services.scriptSecurityManager.getSystemPrincipal(),
                                                  null,
                                                  Ci.nsILoadInfo.SEC_ALLOW_CROSS_ORIGIN_DATA_IS_NULL,
                                                  Ci.nsIContentPolicy.TYPE_OTHER);
     do_check_eq(channel.contentLength, kSimpleNewsArticle.length);
 
     // Now try an attachment. &part=1.2
     // XXX the message doesn't really have an attachment
-    let attachmentURL = Services.io.newURI(neckoURL.value.spec + "&part=1.2",
-                                           null, null);
+    let attachmentURL = Services.io.newURI(neckoURL.value.spec + "&part=1.2");
     let attachmentChannel = Services.io.newChannelFromURI2(attachmentURL,
                                                            null,
                                                            Services.scriptSecurityManager.getSystemPrincipal(),
                                                            null,
                                                            Ci.nsILoadInfo.SEC_ALLOW_CROSS_ORIGIN_DATA_IS_NULL,
                                                            Ci.nsIContentPolicy.TYPE_OTHER);
     // Currently attachments have their content length set to the length of the
     // entire message
--- a/mailnews/news/test/unit/test_nntpProtocols.js
+++ b/mailnews/news/test/unit/test_nntpProtocols.js
@@ -36,15 +36,15 @@ function run_test() {
     do_check_eq(pH.protocolFlags, defaultProtocolFlags);
 
     // Whip through some of the ports to check we get the right results.
     // NEWS allows connecting to any port.
     for (let i = 0; i < 1024; ++i)
       do_check_true(pH.allowPort(i, ""));
 
     // Check we get a URI when we ask for one
-    var uri = pH.newURI(protocols[part].urlSpec, "", null);
+    var uri = pH.newURI(protocols[part].urlSpec, "");
 
     uri.QueryInterface(Ci.nsINntpUrl);
 
     do_check_eq(uri.spec, protocols[part].urlSpec);
   }
 }
--- a/mailnews/news/test/unit/test_nntpUrl.js
+++ b/mailnews/news/test/unit/test_nntpUrl.js
@@ -6,17 +6,17 @@
  *
  * ***** END LICENSE BLOCK ***** */
 
 Components.utils.import("resource:///modules/mailServices.js");
 
 function getMessageHeaderFromUrl(aUrl) {
   let msgUrl = MailServices.nntp
                 .QueryInterface(Ci.nsIProtocolHandler)
-                .newURI(aUrl, null, null)
+                .newURI(aUrl)
                 .QueryInterface(Ci.nsIMsgMessageUrl);
   return msgUrl.messageHeader;
 }
 
 function run_test() {
 
   // This is crash test for Bug 392729
   try {
--- a/mailnews/news/test/unit/test_server.js
+++ b/mailnews/news/test/unit/test_server.js
@@ -95,17 +95,17 @@ function testRFC977() {
 function testConnectionLimit() {
   var server = makeServer(NNTP_RFC977_handler, daemon);
   server.start(NNTP_PORT);
 
   var prefix = "news://localhost:"+NNTP_PORT+"/";
   var transaction;
 
   // To test make connections limit, we run two URIs simultaneously.
-  var url = URLCreator.newURI(prefix+"*", null, null);
+  var url = URLCreator.newURI(prefix+"*");
   _server.loadNewsUrl(url, null, null);
   setupProtocolTest(NNTP_PORT, prefix+"TSS1@nntp.invalid");
   server.performTest();
   // We should have length one... which means this must be a transaction object,
   // containing only us and them
   do_check_true('us' in server.playTransaction());
   server.stop();
 
@@ -127,17 +127,17 @@ function testReentrantClose() {
       let thread = gThreadManager.currentThread;
       while (thread.hasPendingEvents())
         thread.processNextEvent(true);
     }
   };
   // Nice multi-step command--we can close while executing this URL if we are
   // careful.
   var url = URLCreator.newURI("news://localhost:" + NNTP_PORT +
-    "/test.filter", null, null);
+    "/test.filter");
   url.QueryInterface(Ci.nsIMsgMailNewsUrl);
   url.RegisterListener(listener);
 
   _server.loadNewsUrl(url, null, null);
   server.performTest("GROUP");
   dump("Stopping server\n");
   gThreadManager.currentThread.dispatch(
     { run: function() { _server.closeCachedConnections(); } },
--- a/mailnews/news/test/unit/test_uriParser.js
+++ b/mailnews/news/test/unit/test_uriParser.js
@@ -140,30 +140,30 @@ var invalid_uris = [
 
 function run_test() {
   // We're not running the server, just setting it up
   localserver = setupLocalServer(119);
   let nntpService = Cc["@mozilla.org/messenger/nntpservice;1"]
                       .getService(Components.interfaces.nsIProtocolHandler);
   for (let test of tests) {
     dump("Checking URL " + test.uri + "\n");
-    let url = nntpService.newURI(test.uri, null, null);
+    let url = nntpService.newURI(test.uri);
     url.QueryInterface(Ci.nsIMsgMailNewsUrl);
     url.QueryInterface(Ci.nsINntpUrl);
     for (let prop in test) {
       if (prop == "uri")
         continue;
       do_check_eq(url[prop], test[prop]);
     }
   }
 
   for (let fail of invalid_uris) {
     try {
       dump("Checking URL " + fail + " for failure\n");
-      nntpService.newURI(fail, null, null);
+      nntpService.newURI(fail);
       do_check_true(false);
     } catch (e) {
       do_check_eq(e.result, Components.results.NS_ERROR_MALFORMED_URI);
     }
   }
 
   // The password migration is async, so trigger an event to prevent the logon
   // manager from trying to migrate after shutdown has started.
--- a/mailnews/test/resources/messageInjection.js
+++ b/mailnews/test/resources/messageInjection.js
@@ -745,18 +745,17 @@ function add_sets_to_folders(aMsgFolders
           if (iPerSet < messageSet.synMessages.length) {
             didSomething = true;
 
             let realFolder = mis.handleUriToRealFolder[folder.value];
             let fakeFolder = mis.handleUriToFakeFolder[folder.value];
             let synMsg = messageSet._trackMessageAddition(realFolder, iPerSet);
             let msgURI =
               Services.io.newURI("data:text/plain;base64," +
-                                 btoa(synMsg.toMessageString()),
-                                 null, null);
+                                 btoa(synMsg.toMessageString()));
             let imapMsg = new imapMessage(msgURI.spec, fakeFolder.uidnext++, []);
             // If the message's meta-state indicates it is junk, set that flag.
             // There is also a NotJunk flag, but we're not playing with that
             //  right now; as long as nothing is ever marked as junk, the junk
             //  classifier won't run, so it's moot for now.
             if (synMsg.metaState.junk)
               imapMsg.setFlag("Junk");
             if (synMsg.metaState.read)
--- a/suite/browser/mailNavigatorOverlay.js
+++ b/suite/browser/mailNavigatorOverlay.js
@@ -57,17 +57,17 @@ function openComposeWindow(url, title, a
 }
 
 function openExternalMailer(url, title) {
   var extProtocolSvc = Components.classes["@mozilla.org/uriloader/external-protocol-service;1"]
                                  .getService(Components.interfaces.nsIExternalProtocolService);
   var mailto = url ? "mailto:?body=" + encodeURIComponent(url)
                                      + "&subject="
                                      + encodeURIComponent(title) : "mailto:";
-  var uri = Services.io.newURI(mailto, null, null);
+  var uri = Services.io.newURI(mailto);
 
   extProtocolSvc.loadUrl(uri);
 }
 
 function openNewCardDialog()
 {
   window.openDialog("chrome://messenger/content/addressbook/abNewCardDialog.xul",
                     "", "chrome,modal,resizable=no,centerscreen");
--- a/suite/browser/navigator.js
+++ b/suite/browser/navigator.js
@@ -96,17 +96,17 @@ const gStatusBarPopupIconPrefListener =
 const gPopupPermListener = {
 
   observe: function(subject, topic, data) {
     if (topic == "popup-perm-close") {
       // close the window if we're a popup and our opener's URI matches
       // the URI in the notification
       var popupOpenerURI = maybeInitPopupContext();
       if (popupOpenerURI) {
-        closeURI = Services.io.newURI(data, null, null);
+        closeURI = Services.io.newURI(data);
         if (closeURI.host == popupOpenerURI.host)
           window.close();
       }
     }
   }
 };
 
 const gFormSubmitObserver = {
@@ -2440,17 +2440,17 @@ function maybeInitPopupContext()
                  .QueryInterface(CI.nsIInterfaceRequestor)
                  .getInterface(CI.nsIWebNavigation)
                  .QueryInterface(CI.nsIDocShellTreeItem).treeOwner
                  .QueryInterface(CI.nsIInterfaceRequestor)
                  .getInterface(CI.nsIXULWindow);
     if (xulwin.contextFlags &
         CI.nsIWindowCreator2.PARENT_IS_LOADING_OR_RUNNING_TIMEOUT) {
       // return our opener's URI
-      return Services.io.newURI(window.content.opener.location.href, null, null);
+      return Services.io.newURI(window.content.opener.location.href);
     }
   } catch(e) {
   }
   return null;
 }
 
 function WindowIsClosing()
 {
--- a/suite/browser/pageinfo/pageInfo.js
+++ b/suite/browser/pageinfo/pageInfo.js
@@ -498,17 +498,17 @@ function makeGeneralTab()
   // get the date of last modification
   var modifiedText = formatDate(gDocument.lastModified, gStrings.notSet);
   document.getElementById("modifiedtext").value = modifiedText;
 
   // get cache info
   setItemValue("sizetext", null);
   var cacheKey = url.replace(/#.*$/, "");
   try {
-    diskCacheStorage.asyncOpenURI(Services.io.newURI(cacheKey, null, null),
+    diskCacheStorage.asyncOpenURI(Services.io.newURI(cacheKey),
                                   null, OPEN_READONLY, cacheListener);
   }
   catch(ex) { }
 
   securityOnLoad();
 }
 
 //******** Generic Build-a-tab
@@ -621,17 +621,17 @@ imgCacheListener.prototype.onCacheEntryC
 function onCacheEntryCheck() {
   return ENTRY_WANTED;
 };
 
 function addImage(url, type, alt, elem, isBg)
 {
   if (url) try {
     var listener = new imgCacheListener(url, type, alt, elem, isBg);
-    diskCacheStorage.asyncOpenURI(Services.io.newURI(url, null, null),
+    diskCacheStorage.asyncOpenURI(Services.io.newURI(url),
                                   null, OPEN_READONLY, listener);
   }
   catch (ex) { }
 }
 
 function grabAll(elem)
 {
   // check for background images, any node may have multiple
--- a/suite/browser/tabbrowser.xml
+++ b/suite/browser/tabbrowser.xml
@@ -928,17 +928,17 @@
         <parameter name="aURI"/>
         <parameter name="aAttr"/>
         <parameter name="aElt"/>
         <parameter name="aLoadingPrincipal"/>
         <body>
           <![CDATA[
             var iconURL = this.buildFavIconString(aURI);
             if (this.mFaviconService) {
-              var iconURI = this.mIOService.newURI(iconURL, null, null);
+              var iconURI = this.mIOService.newURI(iconURL);
               var faviconFlags = this.usePrivateBrowsing ?
                   this.mFaviconService.FAVICON_LOAD_PRIVATE :
                   this.mFaviconService.FAVICON_LOAD_NON_PRIVATE;
               var loadingPrincipal = aLoadingPrincipal ||
                                      this.mSecMan.getSystemPrincipal();
 
               this.mFaviconService
                   .setAndFetchFaviconForPage(aURI, iconURI, false,
@@ -952,17 +952,17 @@
         </body>
       </method>
 
       <method name="addToMissedIconCache">
         <parameter name="aURI"/>
         <body>
           <![CDATA[
             if (this.mFaviconService) {
-              let uri = this.mIOService.newURI(aURI, null, null);
+              let uri = this.mIOService.newURI(aURI);
               this.mFaviconService.addFailedFavicon(uri);
             }
           ]]>
         </body>
       </method>
 
       <method name="getTitleForURI">
         <parameter name="aURI"/>
@@ -1279,17 +1279,17 @@
                          (/(?:^|\s)alternate(?:\s|$)/i.test(rel) &&
                           !/(?:^|\s)stylesheet(?:\s|$)/i.test(rel) &&
                           /^\s*application\/(?:atom|rss)\+xml\s*$/i.test(type));
 
             if (!isFeed)
               return;
 
             try {
-              var feedUri = this.mIOService.newURI(href, targetDoc.characterSet, null);
+              var feedUri = this.mIOService.newURI(href, targetDoc.characterSet);
               this.mSecMan.checkLoadURIWithPrincipal(targetDoc.nodePrincipal, feedUri,
                                                      this.mSecMan.DISALLOW_INHERIT_PRINCIPAL);
             } catch(e) {
               return;
             }
 
             this.mTabListeners[index].addFeed(link);
             if (this.browsers[index] == this.mCurrentBrowser) {
@@ -1309,17 +1309,17 @@
         </body>
       </method>
 
       <method name="getLinkIconURI">
         <parameter name="aLink"/>
         <body><![CDATA[
           var targetDoc = aLink.ownerDocument;
           // Make a URI out of our href.
-          var uri = this.mIOService.newURI(aLink.href, targetDoc.characterSet, null);
+          var uri = this.mIOService.newURI(aLink.href, targetDoc.characterSet);
 
           // Verify that the load of this icon is legal.
           // Some error or special pages can load their favicon.
           // To be on the safe side, only allow chrome:// favicons.
           const re = /^about:(neterror|certerror|blocked)\?/;
           var isAllowedPage = re.test(targetDoc.documentURI);
 
           if (!isAllowedPage || !uri.schemeIs("chrome")) {
--- a/suite/browser/test/browser/browser_bug413915.js
+++ b/suite/browser/test/browser/browser_bug413915.js
@@ -1,12 +1,12 @@
 function test() {
   var ioserv = Components.classes["@mozilla.org/network/io-service;1"].
                getService(Components.interfaces.nsIIOService);
-  var exampleUri = ioserv.newURI("http://example.com/", null, null);
+  var exampleUri = ioserv.newURI("http://example.com/");
   var secman = Components.classes["@mozilla.org/scriptsecuritymanager;1"].
                getService(Components.interfaces.nsIScriptSecurityManager);
   var principal = secman.createCodebasePrincipal(exampleUri, {});
 
   function testIsFeed(aTitle, aHref, aType, aKnown) {
     var link = { title: aTitle, href: aHref, type: aType };
     return isValidFeed(link, principal, aKnown);
   }
--- a/suite/browser/test/browser/browser_bug623155.js
+++ b/suite/browser/test/browser/browser_bug623155.js
@@ -2,22 +2,22 @@
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
 const REDIRECT_FROM = "https://example.com/browser/suite/browser/test/browser/" +
                       "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/redirect_bug623155.sjs#BG
--- a/suite/common/bindings/notification.xml
+++ b/suite/common/bindings/notification.xml
@@ -1161,17 +1161,17 @@
             var host = aURI.asciiHost;
             var usage = 0;
 
             var ioService = Components.classes["@mozilla.org/network/io-service;1"]
                                       .getService(Components.interfaces.nsIIOService);
             var cacheService = Components.classes["@mozilla.org/network/application-cache-service;1"]
                                          .getService(Components.interfaces.nsIApplicationCacheService);
             cacheService.getGroups().forEach(function(aGroup) {
-              var uri = ioService.newURI(aGroup, null, null);
+              var uri = ioService.newURI(aGroup);
               if (uri.asciiHost == host)
                 usage += cacheService.getActiveCache(aGroup).usage;
             });
             var warnQuota = this._prefs.getIntPref("offline-apps.quota.warn");
             if (usage < warnQuota * 1024)
               return;
 
             var message = this._stringBundle.formatStringFromName("offlineApps.quota", [host, warnQuota / 1024], 2);
--- a/suite/common/bookmarks/bookmarksManager.js
+++ b/suite/common/bookmarks/bookmarksManager.js
@@ -716,17 +716,17 @@ var PlacesOrganizer = {
     // Get the place: uri for the query.
     // If the advanced query builder is showing, use that.
     var options = this.getCurrentOptions();
     var queries = this.getCurrentQueries();
 
     var placeSpec = PlacesUtils.history.queriesToQueryString(queries,
                                                              queries.length,
                                                              options);
-    var placeURI = Services.io.newURI(placeSpec, null, null);
+    var placeURI = Services.io.newURI(placeSpec);
 
     // Prompt the user for a name for the query.
     // XXX - using prompt service for now; will need to make
     // a real dialog and localize when we're sure this is the UI we want.
     var title = PlacesUIUtils.getString("saveSearch.title");
     var inputLabel = PlacesUIUtils.getString("saveSearch.inputLabel");
     var defaultText = PlacesUIUtils.getString("saveSearch.inputDefaultText");
 
--- a/suite/common/bookmarks/editBookmarkOverlay.js
+++ b/suite/common/bookmarks/editBookmarkOverlay.js
@@ -913,17 +913,17 @@ var gEditItemOverlay = {
         namePicker.editor.transactionManager.clear();
       }
       break;
     case "uri":
       var locationField = this._element("locationField");
       if (locationField.value != aValue) {
         this._uri = Components.classes["@mozilla.org/network/io-service;1"]
                               .getService(Components.interfaces.nsIIOService)
-                              .newURI(aValue, null, null);
+                              .newURI(aValue);
         this._initTextField("locationField", this._uri.spec);
         this._initNamePicker();
         this._initTextField("tagsField",
                              PlacesUtils.tagging
                                         .getTagsForURI(this._uri).join(", "),
                             false);
         this._rebuildTagsSelectorList();
       }
--- a/suite/common/dataman/dataman.js
+++ b/suite/common/dataman/dataman.js
@@ -1402,17 +1402,17 @@ var gPerms = {
     // Maybe use
     // principal = Services.scriptSecurityManager.createCodebasePrincipal(uri, {})
     // but this might be undocumented?
     if (permElem.principal == null)
     {
       // This can currently fail for some schemes like 'file://'.
       // Maybe fix it later if needed.
       try {
-        let uri = Services.io.newURI(new URL(aOrigin), null, null);
+        let uri = Services.io.newURI(new URL(aOrigin));
         Services.perms.add(uri, aType, aValue);
       }
       catch (e) {
         gDataman.debugError("New Permission could not be added " +
                             permElem.origin + " " +
                             permElem.type
                            );
         }
@@ -2435,17 +2435,17 @@ var gStorage = {
 
   loadList: function storage_loadList() {
     this.storages = [];
 
     // Load appCache entries.
     let groups = gLocSvc.appcache.getGroups();
     gDataman.debugMsg("Loading " + groups.length + " appcache entries");
     for (let lGroup of groups) {
-      let uri = Services.io.newURI(lGroup, null, null);
+      let uri = Services.io.newURI(lGroup);
       let cache = gLocSvc.appcache.getActiveCache(lGroup);
       this.storages.push({host: uri.host,
                           rawHost: uri.host,
                           type: "appCache",
                           size: cache.usage,
                           groupID: lGroup});
     }
 
@@ -2534,17 +2534,17 @@ var gStorage = {
       let files = dir.directoryEntries
                      .QueryInterface(Components.interfaces.nsIDirectoryEnumerator);
       gDataman.debugMsg("Loading IndexedDB entries");
 
       while (files.hasMoreElements()) {
         let file = files.nextFile;
         // Convert directory name to a URI.
         let host = file.leafName.replace(/\+\+\+/, "://").replace(/\+(\d+)$/, ":$1");
-        let uri = Services.io.newURI(host, null, null);
+        let uri = Services.io.newURI(host);
         this.storages.push({host: host,
                             rawHost: uri.host,
                             type: "indexedDB",
                             size: 0,
                             path: file.path});
         // Get IndexedDB usage (DB size)
         // See http://mxr.mozilla.org/mozilla-central/source/dom/indexedDB/nsIIndexedDatabaseManager.idl?mark=39-52#39
         gLocSvc.idxdbmgr.getUsageForURI(uri,
@@ -2675,25 +2675,25 @@ var gStorage = {
     switch (aStorageItem.type) {
       case "appCache":
         gLocSvc.appcache.getActiveCache(aStorageItem.groupID).discard();
         break;
       case "localStorage":
         let testHost = aStorageItem.host;
         if (!/:/.test(testHost))
           testHost = "http://" + testHost;
-        let uri = Services.io.newURI(testHost, null, null);
+        let uri = Services.io.newURI(testHost);
         let principal = gLocSvc.ssm.getCodebasePrincipal(uri);
         let storage = gLocSvc.domstoremgr
                              .getLocalStorageForPrincipal(principal, "");
         storage.clear();
         break;
       case "indexedDB":
         gLocSvc.idxdbmgr.clearDatabasesForURI(
-            Services.io.newURI(aStorageItem.host, null, null));
+            Services.io.newURI(aStorageItem.host));
         break;
     }
   },
 
   updateContext: function storage_updateContext() {
     document.getElementById("storage-context-remove").disabled =
       this.removeButton.disabled;
     document.getElementById("storage-context-selectall").disabled =
--- a/suite/common/dataman/tests/browser_dataman_basics.js
+++ b/suite/common/dataman/tests/browser_dataman_basics.js
@@ -28,17 +28,17 @@ function test() {
   // xn--hxajbheg2az3al.xn--jxalpdlp
   // We should not touch those permissions so other tests can run, which means
   // we should avoid using those domains altogether as we can't remove them.
 
   let now_epoch = parseInt(Date.now() / 1000);
 
   // Add dummy permission for getpersonas.com, less work (compared to rewriting
   // the test to work without getpersonas.com)
-  Services.perms.add(Services.io.newURI("http://getpersonas.com/", null, null),
+  Services.perms.add(Services.io.newURI("http://getpersonas.com/"),
                      "install", Services.perms.ALLOW_ACTION);
 
   // Add cookie: not secure, non-HTTPOnly, session
   Services.cookies.add("bar.geckoisgecko.org", "", "name0", "value0",
                        false, false, true, now_epoch + 600, {});
   // Add cookie: not secure, HTTPOnly, session
   Services.cookies.add("foo.geckoisgecko.org", "", "name1", "value1",
                        false, true, true, now_epoch + 600, {});
@@ -317,39 +317,39 @@ function test_cookies_panel(aWin) {
 },
 
 function test_permissions_panel(aWin) {
   aWin.gDomains.tree.view.selection.select(8);
   is(aWin.gDomains.selectedDomain.title, "getpersonas.com",
      "For permissions tests, correct domain is selected");
   is(aWin.gTabs.activePanel, "permissionsPanel",
      "Permissions panel is selected");
-  Services.perms.add(Services.io.newURI("http://cookie.getpersonas.com/", null, null),
+  Services.perms.add(Services.io.newURI("http://cookie.getpersonas.com/"),
                      "cookie", Components.interfaces.nsICookiePermission.ACCESS_SESSION);
-  Services.perms.add(Services.io.newURI("http://cookie2.getpersonas.com/", null, null),
+  Services.perms.add(Services.io.newURI("http://cookie2.getpersonas.com/"),
                      "cookie", Services.perms.DENY_ACTION);
-  Services.perms.add(Services.io.newURI("http://geo.getpersonas.com/", null, null),
+  Services.perms.add(Services.io.newURI("http://geo.getpersonas.com/"),
                      "geo", Services.perms.ALLOW_ACTION);
-  Services.perms.add(Services.io.newURI("http://image.getpersonas.com/", null, null),
+  Services.perms.add(Services.io.newURI("http://image.getpersonas.com/"),
                      "image", Services.perms.DENY_ACTION);
-  Services.perms.add(Services.io.newURI("http://indexedDB.getpersonas.com/", null, null),
+  Services.perms.add(Services.io.newURI("http://indexedDB.getpersonas.com/"),
                      "indexedDB", Services.perms.ALLOW_ACTION);
-  Services.perms.add(Services.io.newURI("http://install.getpersonas.com/", null, null),
+  Services.perms.add(Services.io.newURI("http://install.getpersonas.com/"),
                      "install", Services.perms.ALLOW_ACTION);
-  Services.perms.add(Services.io.newURI("http://offline.getpersonas.com/", null, null),
+  Services.perms.add(Services.io.newURI("http://offline.getpersonas.com/"),
                      "offline-app", Services.perms.ALLOW_ACTION);
-  Services.perms.add(Services.io.newURI("http://popup.getpersonas.com/", null, null),
+  Services.perms.add(Services.io.newURI("http://popup.getpersonas.com/"),
                      "popup", Services.perms.ALLOW_ACTION);
-  Services.perms.add(Services.io.newURI("http://stsuse.getpersonas.com/", null, null),
+  Services.perms.add(Services.io.newURI("http://stsuse.getpersonas.com/"),
                      "sts/use", Services.perms.ALLOW_ACTION);
-  Services.perms.add(Services.io.newURI("http://stssubd.getpersonas.com/", null, null),
+  Services.perms.add(Services.io.newURI("http://stssubd.getpersonas.com/"),
                      "sts/subd", Services.perms.ALLOW_ACTION);
-  Services.perms.add(Services.io.newURI("http://test.getpersonas.com/", null, null),
+  Services.perms.add(Services.io.newURI("http://test.getpersonas.com/"),
                      "test", Services.perms.DENY_ACTION);
-  Services.perms.add(Services.io.newURI("http://xul.getpersonas.com/", null, null),
+  Services.perms.add(Services.io.newURI("http://xul.getpersonas.com/"),
                      "allowXULXBL", Services.perms.ALLOW_ACTION);
   Services.logins.setLoginSavingEnabled("password.getpersonas.com", false);
   is(aWin.gPerms.list.children.length, 14,
      "The correct number of permissions is displayed in the list");
   for (let i = 1; i < aWin.gPerms.list.children.length; i++) {
     let perm = aWin.gPerms.list.children[i];
     switch (perm.type) {
       case "allowXULXBL":
@@ -773,17 +773,17 @@ function test_idn(aWin) {
   is(aWin.gTabs.activePanel, "permissionsPanel",
      "After deleting, correctly switched back to permissions panel");
 
   Services.obs.notifyObservers(window, TEST_DONE, null);
 },
 
 function test_storage_load(aWin) {
   // Load the page that fills in several web storage entries.
-  Services.perms.add(Services.io.newURI("http://mochi.test:8888/", null, null),
+  Services.perms.add(Services.io.newURI("http://mochi.test:8888/"),
                      "offline-app", Services.perms.ALLOW_ACTION);
 
   // Get the http address from the current chrome test path
   let rootDir = getRootDirectory(gTestPath).replace("chrome://mochitests/content/", "http://mochi.test:8888/");
   let testURL = rootDir + "dataman_storage.html";
   let storagetab = gBrowser.addTab(testURL);
   let stWin = storagetab.linkedBrowser.contentWindow.wrappedJSObject;
   let dmStorageListener = {
--- a/suite/common/downloads/downloadmanager.js
+++ b/suite/common/downloads/downloadmanager.js
@@ -365,17 +365,17 @@ function handlePaste() {
     let data = {};
     trans.getAnyTransferData({}, data, {});
     let [url, name] = data.value.QueryInterface(Components.interfaces
                                 .nsISupportsString).data.split("\n");
 
     if (!url)
       return;
 
-    let uri = Services.io.newURI(url, null, null);
+    let uri = Services.io.newURI(url);
 
     saveURL(uri.spec, name || uri.spec, null, true, true, null, document);
   } catch (ex) {}
 }
 
 var gDownloadObserver = {
   observe: function(aSubject, aTopic, aData) {
     switch (aTopic) {
--- a/suite/common/history/history.js
+++ b/suite/common/history/history.js
@@ -53,17 +53,17 @@ function historyOnSelect()
   gLastDomain = null;
   var url = "";
 
   var selectedNode = gHistoryTree.selectedNode;
   if (selectedNode) {
     if (PlacesUtils.nodeIsURI(selectedNode)) {
       try {
         url = selectedNode.uri;
-        gLastHostname = Services.io.newURI(url, null, null).host;
+        gLastHostname = Services.io.newURI(url).host;
       } catch (e) {}
     } else if (PlacesUtils.nodeIsHost(selectedNode)) {
       gLastHostname = selectedNode.title;
     }
     if (gLastHostname) {
       try {
         gLastDomain = Services.eTLD.getBaseDomainFromHost(gLastHostname);
       } catch (e) {}
--- a/suite/common/nsContextMenu.js
+++ b/suite/common/nsContextMenu.js
@@ -278,17 +278,17 @@ nsContextMenu.prototype = {
     this.setItemAttr("context-viewbgimage", "disabled", this.hasBGImage ? null : "true");
 
     // Hide Block and Unblock menuitems.
     this.showItem("context-blockimage", false);
     this.showItem("context-unblockimage", false);
 
     // Block image depends on whether an image was clicked on.
     if (this.onImage) {
-      var uri = Services.io.newURI(this.mediaURL, null, null);
+      var uri = Services.io.newURI(this.mediaURL);
       if (uri instanceof Components.interfaces.nsIURL && uri.host) {
         var serverLabel = uri.host;
         // Limit length to max 15 characters.
         serverLabel = serverLabel.replace(/^www\./i, "");
         if (serverLabel.length > 15)
           serverLabel = serverLabel.substr(0, 15) + this.ellipsis;
 
         // Set label and accesskey for appropriate action and unhide menuitem.
@@ -830,17 +830,17 @@ nsContextMenu.prototype = {
   // Unblock popup windows
   allowPopupWindows: function() {
     Services.perms.addFromPrincipal(this.popupPrincipal, "popup",
                                     Services.perms.ALLOW_ACTION);
   },
 
   // Block/Unblock image from loading in the future.
   toggleImageBlocking: function(aBlock) {
-  const uri = Services.io.newURI(this.mediaURL, null, null);
+  const uri = Services.io.newURI(this.mediaURL);
   if (aBlock)
     Services.perms.add(uri, "image", Services.perms.DENY_ACTION);
   else
     Services.perms.remove(uri, "image");
   },
 
   // Open linked-to URL in a new tab.
   openLinkInTab: function(aEvent) {
--- a/suite/common/permissions/cookieViewer.js
+++ b/suite/common/permissions/cookieViewer.js
@@ -485,17 +485,17 @@ function setCookiePermissions(action) {
     window.alert(cookieBundle.getString("allowedURLSchemes"));
     return;
   }
 
   var ioService = Components.classes["@mozilla.org/network/io-service;1"]
                             .getService(Components.interfaces.nsIIOService);
 
   try {
-    var uri = ioService.newURI(url, null, null);
+    var uri = ioService.newURI(url);
   } catch (e) {
     // show an error if URI can not be constructed or adding it failed
     window.alert(cookieBundle.getString("errorAddPermission"));
     return;
   }
   // only allow a few schemes here
   // others like file:// would produce an invalid entry in the database
   if (uri.scheme != 'http'  &&
--- a/suite/common/permissions/permissionsManager.js
+++ b/suite/common/permissions/permissionsManager.js
@@ -212,17 +212,17 @@ function finalizeChanges() {
       permissionManager.remove(p.host, p.type);
     } catch(ex) {
     }
   }
 
   for (i in additions) {
     p = additions[i];
     try {
-      var uri = ioService.newURI("http://" + p.host, null, null);
+      var uri = ioService.newURI("http://" + p.host);
       permissionManager.add(uri, p.type, p.perm);
     } catch(ex) {
     }
   }
 }
 
 function handlePermissionKeyPress(e) {
   if (e.keyCode == 46) {
@@ -232,17 +232,17 @@ function handlePermissionKeyPress(e) {
 
 function addPermission(aPermission) {
   var textbox = document.getElementById("url");
   // trim any leading and trailing spaces and scheme
   var host = trimSpacesAndScheme(textbox.value);
   try {
     var ioService = Components.classes["@mozilla.org/network/io-service;1"]
                               .getService(Components.interfaces.nsIIOService);
-    var uri = ioService.newURI("http://" + host, null, null);
+    var uri = ioService.newURI("http://" + host);
     host = uri.host;
   } catch(ex) {
     var promptService = Components.classes["@mozilla.org/embedcomp/prompt-service;1"]
                                   .getService(Components.interfaces.nsIPromptService);
     var message = permissionsBundle.getFormattedString("alertInvalid", [host]);
     var title = permissionsBundle.getString("alertInvalidTitle");
     promptService.alert(window, title, message);
     textbox.value = "";
--- a/suite/common/pref/pref-applications.js
+++ b/suite/common/pref/pref-applications.js
@@ -1712,17 +1712,17 @@ var gApplicationsPane = {
     var fph = Services.io.getProtocolHandler("file")
                          .QueryInterface(Components.interfaces.nsIFileProtocolHandler);
     var urlSpec = fph.getURLSpecFromFile(aFile);
 
     return "moz-icon://" + urlSpec + "?size=16";
   },
 
   _getIconURLForWebApp: function(aWebAppURITemplate) {
-    var uri = Services.io.newURI(aWebAppURITemplate, null, null);
+    var uri = Services.io.newURI(aWebAppURITemplate);
 
     // Unfortunately we need to use favicon.ico here, but we don't know
     // about any other possibility to retrieve an icon for the web app/site
     // without loading a specific full URL and parsing it for a possible
     // shortcut icon.
 
     return /^https?/.test(uri.scheme) ? uri.resolve("/favicon.ico") : "";
   },
--- a/suite/common/pref/pref-offlineapps.js
+++ b/suite/common/pref/pref-offlineapps.js
@@ -94,17 +94,17 @@ function UpdateNotifyBox(aValue)
 function _getOfflineAppUsage(aPermission)
 {
   var appCache = Components.classes["@mozilla.org/network/application-cache-service;1"]
                            .getService(Components.interfaces.nsIApplicationCacheService);
   var groups = appCache.getGroups();
 
   var usage = 0;
   for (let i = 0; i < groups.length; i++) {
-    let uri = Services.io.newURI(groups[i], null, null);
+    let uri = Services.io.newURI(groups[i]);
     if (aPermission.matchesURI(uri, true))
       usage += appCache.getActiveCache(groups[i]).usage;
   }
   return usage;
 }
 
 /**
  * Updates the list of offline applications.
@@ -159,17 +159,17 @@ function RemoveOfflineApp()
                                 null, null, null, {}))
     return;
 
   // clear offline cache entries
   var appCache = Components.classes["@mozilla.org/network/application-cache-service;1"]
                            .getService(Components.interfaces.nsIApplicationCacheService);
   var groups = appCache.getGroups();
   for (let i = 0; i < groups.length; i++) {
-      var uri = Services.io.newURI(groups[i], null, null);
+      var uri = Services.io.newURI(groups[i]);
       if (uri.asciiHost == host)
           appCache.getActiveCache(groups[i]).discard();
   }
 
   // remove the permission
   // Services.perms.remove(host, "offline-app");
 
   UpdateOfflineApps();
--- a/suite/common/pref/pref-popups.js
+++ b/suite/common/pref/pref-popups.js
@@ -52,17 +52,17 @@ function SetLists()
     try
     {
       var whitelist = document.getElementById("privacy.popups.default_whitelist").value;
       var hosts = whitelist.split(",");
 
       for (var i in hosts)
       {
         var host = "http://" + hosts[i];
-        var uri = Services.io.newURI(host, null, null);
+        var uri = Services.io.newURI(host);
         permissionManager.add(uri, kPopupType, true);
       }
     }
     catch (ex) {}
 
     pref.value = false;
   }
 }
--- a/suite/common/pref/preferences.js
+++ b/suite/common/pref/preferences.js
@@ -80,14 +80,14 @@ function SelectSound(aSoundUrlPref)
 
 function PlaySound(aValue, aMail)
 {
   const nsISound = Components.interfaces.nsISound;
   var sound = Components.classes["@mozilla.org/sound;1"]
                         .createInstance(nsISound);
 
   if (aValue)
-    sound.play(Services.io.newURI(aValue, null, null));
+    sound.play(Services.io.newURI(aValue));
   else if (aMail && !/Mac/.test(navigator.platform))
     sound.playEventSound(nsISound.EVENT_NEW_MAIL_RECEIVED);
   else
     sound.beep();
 }
--- a/suite/common/src/nsAbout.js
+++ b/suite/common/src/nsAbout.js
@@ -41,17 +41,17 @@ About.prototype = {
   },
 
   getURIFlags: function(aURI) {
     return this[this.getModule(aURI) + "Flags"];
   },
 
   newChannel: function(aURI, aLoadInfo) {
     var module = this.getModule(aURI);
-    var newURI = Services.io.newURI(this[module + "URI"], null, null);
+    var newURI = Services.io.newURI(this[module + "URI"]);
     var channel = aLoadInfo ?
                   Services.io.newChannelFromURIWithLoadInfo(newURI, aLoadInfo) :
                   Services.io.newChannelFromURI2(newURI, null,
                                                  Services.scriptSecurityManager.getSystemPrincipal(),
                                                  null,
                                                  Components.interfaces.nsILoadInfo.SEC_NORMAL,
                                                  Components.interfaces.nsIContentPolicy.TYPE_OTHER);
     channel.originalURI = aURI;
--- a/suite/common/src/nsGopherProtocolStubHandler.js
+++ b/suite/common/src/nsGopherProtocolStubHandler.js
@@ -43,17 +43,17 @@ GopherProtocol.prototype = {
   },
 
   newChannel: function GP_newChannel(inputURI) {
     return this.newChannel2(inputURI, null);
   },
 
   newChannel2: function GP_newChannel2(inputURI, loadinfo) {
     var ios = Services.io;
-    var newURI = ios.newURI("chrome://communicator/content/gopherAddon.xhtml", null, null);
+    var newURI = ios.newURI("chrome://communicator/content/gopherAddon.xhtml");
     // Create a chrome channel, and de-chrome it, to our information page.
     var chan = loadinfo ? ios.newChannelFromURIWithLoadInfo(newURI, loadinfo) :
                           ios.newChannelFromURI2(newURI, null,
                                                  Services.scriptSecurityManager.getSystemPrincipal(),
                                                  null,
                                                  Components.interfaces.nsILoadInfo.SEC_NORMAL,
                                                  Components.interfaces.nsIContentPolicy.TYPE_OTHER);
     chan.originalURI = inputURI;
--- a/suite/common/src/nsSessionStore.js
+++ b/suite/common/src/nsSessionStore.js
@@ -2941,17 +2941,17 @@ SessionStoreService.prototype = {
 
     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) {
         Components.utils.reportError(e);
         continue;
       }
 
       let storageManager = aDocShell.QueryInterface(Components.interfaces.nsIDOMStorageManager);
       let window = aDocShell.QueryInterface(Components.interfaces.nsIInterfaceRequestor)
@@ -3498,17 +3498,17 @@ SessionStoreService.prototype = {
   },
 
   /**
    * Get nsIURI from string
    * @param string
    * @returns nsIURI
    */
   _getURIFromString: function sss_getURIFromString(aString) {
-    return Services.io.newURI(aString, null, null);
+    return Services.io.newURI(aString);
   },
 
   /**
    * Annotate a breakpad crash report with the currently selected tab's URL.
    */
   _updateCrashReportURL: function sss_updateCrashReportURL(aWindow) {
 #ifdef MOZ_CRASH_REPORTER
     try {
--- a/suite/common/src/nsSuiteGlue.js
+++ b/suite/common/src/nsSuiteGlue.js
@@ -672,17 +672,17 @@ SuiteGlue.prototype = {
   {
     if (Services.prefs.getBoolPref("browser.download.finished_download_sound")) {
       if (!this._sound)
         this._sound = Components.classes["@mozilla.org/sound;1"]
                                 .createInstance(Components.interfaces.nsISound);
       try {
         var url = Services.prefs.getComplexValue("browser.download.finished_sound_url",
                                                  Components.interfaces.nsISupportsString);
-        this._sound.play(Services.io.newURI(url.data, null, null));
+        this._sound.play(Services.io.newURI(url.data));
       } catch (e) {
         this._sound.beep();
       }
     }
   },
 
   _showPluginUpdatePage: function(aWindow) {
     Services.prefs.setBoolPref("plugins.update.notifyUser", false);
@@ -891,17 +891,17 @@ SuiteGlue.prototype = {
         smartBookmarksVersion = Services.prefs.getIntPref("browser.places.smartBookmarksVersion");
       } catch(ex) {}
       if (!autoExportHTML && smartBookmarksVersion != -1)
         Services.prefs.setIntPref("browser.places.smartBookmarksVersion", 0);
 
       var bookmarksURI = null;
       if (restoreDefaultBookmarks) {
         // User wants to restore bookmarks.html file from default profile folder.
-        bookmarksURI = Services.io.newURI("resource:///defaults/profile/bookmarks.html", null, null);
+        bookmarksURI = Services.io.newURI("resource:///defaults/profile/bookmarks.html");
       }
       else {
         // Get bookmarks.html file location.
         var bookmarksFile = Services.dirsvc.get("BMarks", Components.interfaces.nsILocalFile);
         if (bookmarksFile.exists())
           bookmarksURI = Services.io.newFileURI(bookmarksFile);
       }
 
--- a/suite/common/tests/browser/browser_491168.js
+++ b/suite/common/tests/browser/browser_491168.js
@@ -54,11 +54,11 @@ function test() {
         // clean up
         if (Services.prefs.prefHasUserValue("browser.tabs.max_tabs_undo"))
           Services.prefs.clearUserPref("browser.tabs.max_tabs_undo");
         finish();
       }, true);
     }, true);
   },true);
 
-  let referrerURI = Services.io.newURI(REFERRER1, null, null);
+  let referrerURI = Services.io.newURI(REFERRER1);
   browser.loadURI("http://example.org", referrerURI, null);
 }
--- a/suite/common/utilityOverlay.js
+++ b/suite/common/utilityOverlay.js
@@ -956,17 +956,17 @@ function isElementVisible(aElement)
   var bo = aElement.boxObject;
   return (bo.height > 0 && bo.width > 0);
 }
 
 function makeURLAbsolute(aBase, aUrl, aCharset)
 {
   // Construct nsIURL.
   return Services.io.newURI(aUrl, aCharset,
-                            Services.io.newURI(aBase, aCharset, null)).spec;
+                            Services.io.newURI(aBase, aCharset)).spec;
 }
 
 function openAsExternal(aURL)
 {
   var loadType = Services.prefs.getIntPref("browser.link.open_external");
   var loadInBackground = Services.prefs.getBoolPref("browser.tabs.loadDivertedInBackground");
   openNewTabWindowOrExistingWith(loadType, aURL, null, loadInBackground);
 }
@@ -1643,17 +1643,17 @@ function switchToTabHavingURI(aURI, aOpe
         return true;
       }
     }
     return false;
   }
 
   // This can be passed either nsIURI or a string.
   if (!(aURI instanceof Components.interfaces.nsIURI))
-    aURI = Services.io.newURI(aURI, null, null);
+    aURI = Services.io.newURI(aURI);
 
   // Prioritise this window.
   if (switchIfURIInWindow(window))
     return true;
 
   let winEnum = Services.wm.getEnumerator("navigator:browser");
   while (winEnum.hasMoreElements()) {
     let browserWin = winEnum.getNext();
--- a/suite/feeds/src/FeedConverter.js
+++ b/suite/feeds/src/FeedConverter.js
@@ -247,17 +247,17 @@ FeedConverter.prototype = {
       // preview page 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.
-        var chromeURI = Services.io.newURI(FEEDHANDLER_URI, null, null);
+        var chromeURI = Services.io.newURI(FEEDHANDLER_URI);
         chromeChannel = Services.io.newChannelFromURIWithLoadInfo(chromeURI, loadInfo);
         chromeChannel.owner = Services.scriptSecurityManager
                                       .getNoAppCodebasePrincipal(chromeURI);
         chromeChannel.originalURI = result.uri;
       }
       else
         chromeChannel = Services.io.newChannelFromURIWithLoadInfo(result.uri, loadInfo);
 
@@ -364,17 +364,17 @@ FeedResultService.prototype = {
 
       // For the benefit of applications that might know how to deal with more
       // URLs than just feeds, send feed: URLs in the following format:
       //
       // http urls: replace scheme with feed, e.g.
       // http://foo.com/index.rdf -> feed://foo.com/index.rdf
       // other urls: prepend feed: scheme, e.g.
       // https://foo.com/index.rdf -> feed:https://foo.com/index.rdf
-      var feedURI = Services.io.newURI(spec, null, null);
+      var feedURI = Services.io.newURI(spec);
       if (feedURI.schemeIs("http")) {
         feedURI.scheme = "feed";
         spec = feedURI.spec;
       }
       else
         spec = "feed:" + spec;
 
       // Retrieving the shell service might fail on some systems, most
--- a/suite/feeds/src/FeedWriter.js
+++ b/suite/feeds/src/FeedWriter.js
@@ -111,17 +111,17 @@ function safeGetCharPref(pref, defaultVa
 /**
  * Wrapper function for nsIIOService::newURI.
  * @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) {
   try {
-    return Services.io.newURI(aURLSpec, aCharset, null);
+    return Services.io.newURI(aURLSpec, aCharset);
   } catch (ex) {
   }
 
   return null;
 }
 
 /**
  * Converts a number of bytes to the appropriate unit that results in a
--- a/suite/mailnews/addrbook/abCardOverlay.js
+++ b/suite/mailnews/addrbook/abCardOverlay.js
@@ -1015,17 +1015,17 @@ var gGenericPhotoHandler =
 var gFilePhotoHandler =
 {
 
   onLoad: function(aCard, aDocument)
   {
     var photoURI = aCard.getProperty("PhotoURI", "");
     try
     {
-      var file = Services.io.newURI(photoURI, null, null)
+      var file = Services.io.newURI(photoURI)
                             .QueryInterface(Components.interfaces.nsIFileURL)
                             .file;
     } catch (e) {}
 
     if (!file)
       return false;
 
     aDocument.getElementById("PhotoFile").file = file;
--- a/suite/mailnews/addrbook/abCommon.js
+++ b/suite/mailnews/addrbook/abCommon.js
@@ -700,17 +700,17 @@ function getPhotoURI(aPhotoName) {
 function storePhoto(aUri) {
   if (!aUri)
     return false;
 
   // Get the photos directory and check that it exists
   var file = getPhotosDir();
 
   // Create a channel from the URI and open it as an input stream
-  var channel = Services.io.newChannelFromURI2(Services.io.newURI(aUri, null, null),
+  var channel = Services.io.newChannelFromURI2(Services.io.newURI(aUri),
                                          null,
                                          Services.scriptSecurityManager.getSystemPrincipal(),
                                          null,
                                          Components.interfaces.nsILoadInfo.SEC_NORMAL,
                                          Components.interfaces.nsIContentPolicy.TYPE_INTERNAL_IMAGE);
 
   var istream = channel.open();
 
--- a/suite/mailnews/compose/MsgComposeCommands.js
+++ b/suite/mailnews/compose/MsgComposeCommands.js
@@ -991,17 +991,17 @@ function ComposeFieldsReady()
 // checks if the passed in string is a mailto url, if it is, generates nsIMsgComposeParams
 // for the url and returns them.
 function handleMailtoArgs(mailtoUrl)
 {
   // see if the string is a mailto url....do this by checking the first 7 characters of the string
   if (/^mailto:/i.test(mailtoUrl))
   {
     // if it is a mailto url, turn the mailto url into a MsgComposeParams object....
-    var uri = Services.io.newURI(mailtoUrl, null, null);
+    var uri = Services.io.newURI(mailtoUrl);
 
     if (uri)
       return sMsgComposeService.getParamsForMailto(uri);
   }
 
   return null;
 }
 
--- a/suite/mailnews/mailWindowOverlay.js
+++ b/suite/mailnews/mailWindowOverlay.js
@@ -2757,17 +2757,17 @@ function onRemoteContentOptionsShowing(a
   var origins = [...gMessageNotificationBar.remoteOrigins];
 
   var addresses = {};
   MailServices.headerParser.parseHeadersWithArray(
     gMessageDisplay.displayedMessage.author, addresses, {}, {});
   var authorEmailAddress = addresses.value[0];
 
   var emailURI = Services.io.newURI(
-    "chrome://messenger/content/?email=" + authorEmailAddress, null, null);
+    "chrome://messenger/content/?email=" + authorEmailAddress);
   var principal = Services.scriptSecurityManager
                           .createCodebasePrincipal(emailURI, {});
   // Put author email first in the menu.
   origins.unshift(principal.origin);
 
   // Out with the old...
   let childNodes = aEvent.target.querySelectorAll(".allow-remote-uri");
   for (let child of childNodes)
@@ -2798,17 +2798,17 @@ function onRemoteContentOptionsShowing(a
 function allowRemoteContentForURI(aItem)
 {
 
   var origin = aItem.getAttribute("value");
 
   if (!origin)
     return;
 
-  let uri = Services.io.newURI(origin, null, null);
+  let uri = Services.io.newURI(origin);
   Services.perms.add(uri, "image", Services.perms.ALLOW_ACTION);
 
   ReloadMessage();
 }
 
 /**
  * Displays fine-grained, per-site permissions for remote content.
  */
--- a/suite/mailnews/msgHdrViewOverlay.js
+++ b/suite/mailnews/msgHdrViewOverlay.js
@@ -1386,17 +1386,17 @@ createNewAttachmentInfo.prototype.openAt
   {
     // As of bug 599119, isTypeSupported returns true for messages, but
     // attached messages don't open reliably in the browser, so pretend
     // they're not supported and open a message window for them instead.
     case "message/rfc822":
       var url = this.url + "&type=application/x-message-display";
       window.openDialog("chrome://messenger/content/messageWindow.xul",
                         "_blank", "all,dialog=no",
-                        Services.io.newURI(url, null, null));
+                        Services.io.newURI(url));
       return;
     case "text/x-moz-deleted":
       return;
   }
 
   var webNavigationInfo =
         Components.classes["@mozilla.org/webnavigation-info;1"]
                   .getService(Components.interfaces.nsIWebNavigationInfo);
--- a/suite/mailnews/nsDragAndDrop.js
+++ b/suite/mailnews/nsDragAndDrop.js
@@ -562,17 +562,17 @@ var nsDragAndDrop = {
       // to know if aDraggedText really is a URI.
 
       aDraggedText = aDraggedText.replace(/^\s*|\s*$/g, '');
 
       var uri;
       var ioService = Components.classes["@mozilla.org/network/io-service;1"]
                                 .getService(Components.interfaces.nsIIOService);
       try {
-        uri = ioService.newURI(aDraggedText, null, null);
+        uri = ioService.newURI(aDraggedText);
       } catch (e) {
       }
 
       if (!uri)
         return;
 
       // aDraggedText is a URI, do the security check.
       const nsIScriptSecurityManager = Components.interfaces
@@ -582,17 +582,17 @@ var nsDragAndDrop = {
 
       if (!aDragSession)
         aDragSession = this.mDragService.getCurrentSession();
 
       var sourceDoc = aDragSession.sourceDocument;
       // Use "file:///" as the default sourceURI so that drops of file:// URIs
       // are always allowed.
       var principal = sourceDoc ? sourceDoc.nodePrincipal
-                                : secMan.createCodebasePrincipal(ioService.newURI("file:///", null, null), {});
+                                : secMan.createCodebasePrincipal(ioService.newURI("file:///"), {});
 
       try {
         secMan.checkLoadURIStrWithPrincipal(principal, aDraggedText,
                                             nsIScriptSecurityManager.STANDARD);
       } catch (e) {
         // Stop event propagation right here.
         aEvent.stopPropagation();
 
--- a/suite/mailnews/phishingDetector.js
+++ b/suite/mailnews/phishingDetector.js
@@ -84,17 +84,17 @@ function isPhishingURL(aLinkNode, aSilen
   var phishingType = kPhishingNotSuspicious;
   var href = aHref || aLinkNode.href;
   if (!href)
     return false;
 
   var linkTextURL = {};
   var isPhishingURL = false;
 
-  var hrefURL = Services.io.newURI(href, null, null);
+  var hrefURL = Services.io.newURI(href);
 
   // only check for phishing urls if the url is an http or https link.
   // this prevents us from flagging imap and other internally handled urls
   if (hrefURL.schemeIs('http') || hrefURL.schemeIs('https'))
   {
     let ipAddress = isLegalIPAddress(hrefURL.host, true);
     if (ipAddress && !isLegalLocalIPAddress(ipAddress))
       phishingType = kPhishingWithIPAddress;
@@ -123,17 +123,17 @@ function misMatchedHostWithLinkText(aLin
   linkNodeText = linkNodeText.replace(/ /g, "");
 
   // only worry about http and https urls
   if (linkNodeText)
   {
     // does the link text look like a http url?
      if (linkNodeText.search(/(^http:|^https:)/) != -1)
      {
-       var linkTextURL  = Services.io.newURI(linkNodeText, null, null);
+       var linkTextURL  = Services.io.newURI(linkNodeText);
        aLinkTextURL.value = linkTextURL;
        // compare hosts, but ignore possible www. prefix
        return !(aHrefURL.host.replace(/^www\./, "") == aLinkTextURL.value.host.replace(/^www\./, ""));
      }
   }
 
   return false;
 }
--- a/suite/modules/WindowsJumpLists.jsm
+++ b/suite/modules/WindowsJumpLists.jsm
@@ -359,17 +359,17 @@ var 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, 2,
                                                faviconPageUri);
         items.appendElement(shortcut, false);
         this._frequentHashList.push(aResult.uri);
       },
       this
     );
   },
@@ -404,17 +404,17 @@ var 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, 2,
                                                faviconPageUri);
         items.appendElement(shortcut, false);
         count++;
       },
       this
     );
   },
--- a/suite/modules/test/unit/test_browser_sanitizer.js
+++ b/suite/modules/test/unit/test_browser_sanitizer.js
@@ -48,17 +48,17 @@ var sanTests = {
   },
 
   cookies: {
     desc: "Cookie",
     setup: function() {
       Services.prefs.setIntPref("network.cookie.cookieBehavior", 0);
       var ios = Components.classes["@mozilla.org/network/io-service;1"]
                           .getService(Components.interfaces.nsIIOService);
-      this.uri = ios.newURI("http://sanitizer.test/", null, null);
+      this.uri = ios.newURI("http://sanitizer.test/");
       this.cs = Components.classes["@mozilla.org/cookieService;1"]
                           .getService(Components.interfaces.nsICookieService);
       this.cs.setCookieString(this.uri, null, "Sanitizer!", null);
     },
 
     check: function(aShouldBeCleared) {
       if (aShouldBeCleared)
         do_check_neq(this.cs.getCookieString(this.uri, null), "Sanitizer!");
@@ -67,17 +67,17 @@ var sanTests = {
     }
   },
 
   history: {
     desc: "History",
     setup: function() {
       var ios = Components.classes["@mozilla.org/network/io-service;1"]
                           .getService(Components.interfaces.nsIIOService);
-      var uri = ios.newURI("http://sanitizer.test/", null, null);
+      var uri = ios.newURI("http://sanitizer.test/");
       yield promiseAddVisits({
         uri: uri,
         title: "Sanitizer!"
       });
     },
 
     check: function(aShouldBeCleared) {
       var rv = false;
@@ -172,17 +172,17 @@ var sanTests = {
     }
   },
 
   downloads: {
     desc: "Download",
     setup: function() {
       var ios = Components.classes["@mozilla.org/network/io-service;1"]
                           .getService(Components.interfaces.nsIIOService);
-      var uri = ios.newURI("http://sanitizer.test/", null, null);
+      var uri = ios.newURI("http://sanitizer.test/");
       var file = Components.classes["@mozilla.org/file/directory_service;1"]
                            .getService(Components.interfaces.nsIProperties)
                            .get("TmpD", Components.interfaces.nsIFile);
       file.append("sanitizer.file");
       file.createUnique(Components.interfaces.nsIFile.NORMAL_FILE_TYPE, parseInt("0666", 8));
       var dest = ios.newFileURI(file);
 
       this.dm = Components.classes["@mozilla.org/download-manager;1"]
--- a/suite/smile/src/smileApplication.js
+++ b/suite/smile/src/smileApplication.js
@@ -51,17 +51,17 @@ var Utilities = {
     return this.windowMediator;
   },
 
   makeURI: function smileutil_makeURI(aSpec) {
     if (!aSpec)
       return null;
     var ios = Components.classes["@mozilla.org/network/io-service;1"]
                         .getService(Components.interfaces.nsIIOService);
-    return ios.newURI(aSpec, null, null);
+    return ios.newURI(aSpec);
   },
 
   free: function smileutil_free() {
     delete this.bookmarks;
     delete this.bookmarksObserver;
     delete this.annotations;
     delete this.history;
     delete this.windowMediator;
--- a/suite/smile/test/browser_Bookmarks.js
+++ b/suite/smile/test/browser_Bookmarks.js
@@ -1,14 +1,14 @@
 var gLastFolderAction = "";
 var gLastBookmarkAction = "";
 var gLastRootAction = "";
 
 function url(spec) {
-  return Services.io.newURI(spec, null, null);
+  return Services.io.newURI(spec);
 }
 
 function test() {
   // Some very basic tests on the tags root
   var tags = Application.bookmarks.tags;
   ok(tags, "Check access to bookmark tags root");
   ok(!tags.parent, "Check tags parent (should be null)");