Bug 1329182 - remove trailing newURI null parameters in devtools/, r=jaws.
authorFlorian Quèze <florian@queze.net>
Mon, 09 Jan 2017 20:27:26 +0100
changeset 328664 fca014f3f8aa
parent 328663 ae4a26954062
child 328665 d816f539d536
push id31182
push usercbook@mozilla.com
push dateTue, 10 Jan 2017 11:14:56 +0000
treeherdermozilla-central@7011ed1427de [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjaws
bugs1329182
milestone53.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1329182 - remove trailing newURI null parameters in devtools/, r=jaws.
devtools/client/aboutdebugging/test/head.js
devtools/client/debugger/new/bundle.js
devtools/client/debugger/test/mochitest/head.js
devtools/client/debugger/utils.js
devtools/client/framework/about-devtools-toolbox.js
devtools/client/inspector/shared/test/browser_styleinspector_csslogic-content-stylesheets.js
devtools/client/responsive.html/browser/tunnel.js
devtools/client/responsive.html/browser/web-navigation.js
devtools/client/responsivedesign/responsivedesign-child.js
devtools/client/shared/devtools-file-watcher.js
devtools/client/storage/test/head.js
devtools/client/styleeditor/StyleEditorUtil.jsm
devtools/client/webconsole/utils.js
devtools/client/webconsole/webconsole.js
devtools/client/webide/modules/app-manager.js
devtools/client/webide/modules/app-validator.js
devtools/server/actors/addon.js
devtools/server/actors/inspector.js
devtools/server/actors/source.js
devtools/server/actors/storage.js
devtools/server/actors/styleeditor.js
devtools/server/actors/stylesheets.js
devtools/server/actors/webextension.js
devtools/shared/DevToolsUtils.js
devtools/shared/fronts/actor-registry.js
devtools/shared/gcli/commands/inject.js
devtools/shared/gcli/commands/screenshot.js
devtools/shared/tests/unit/test_console_filtering.js
devtools/shared/touch/simulator-core.js
devtools/shared/webconsole/network-helper.js
--- a/devtools/client/aboutdebugging/test/head.js
+++ b/devtools/client/aboutdebugging/test/head.js
@@ -67,17 +67,17 @@ function openPanel(document, panelId) {
 function closeAboutDebugging(tab) {
   info("Closing about:debugging");
   return removeTab(tab);
 }
 
 function getSupportsFile(path) {
   let cr = Cc["@mozilla.org/chrome/chrome-registry;1"]
     .getService(Ci.nsIChromeRegistry);
-  let uri = Services.io.newURI(CHROME_URL_ROOT + path, null, null);
+  let uri = Services.io.newURI(CHROME_URL_ROOT + path);
   let fileurl = cr.convertChromeURL(uri);
   return fileurl.QueryInterface(Ci.nsIFileURL);
 }
 
 /**
  * Depending on whether there are addons installed, return either a target list
  * element or its container.
  * @param  {DOMDocument}  document   #addons section container document
--- a/devtools/client/debugger/new/bundle.js
+++ b/devtools/client/debugger/new/bundle.js
@@ -9979,17 +9979,17 @@ var Debugger =
 	   */
 	  nsIURL: function (aUrl) {
 	    var aStore = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : gNSURLStore;
 	
 	    if (aStore.has(aUrl)) {
 	      return aStore.get(aUrl);
 	    }
 	
-	    var uri = Services.io.newURI(aUrl, null, null).QueryInterface(Ci.nsIURL);
+	    var uri = Services.io.newURI(aUrl).QueryInterface(Ci.nsIURL);
 	    aStore.set(aUrl, uri);
 	    return uri;
 	  }
 	};
 	
 	for (var prop of Object.getOwnPropertyNames(NetworkHelper)) {
 	  exports[prop] = NetworkHelper[prop];
 	}
--- a/devtools/client/debugger/test/mochitest/head.js
+++ b/devtools/client/debugger/test/mochitest/head.js
@@ -24,17 +24,17 @@ var { Toolbox } = require("devtools/clie
 const chromeRegistry = Cc["@mozilla.org/chrome/chrome-registry;1"].getService(Ci.nsIChromeRegistry);
 
 // Override promise with deprecated-sync-thenables
 promise = Cu.import("resource://devtools/shared/deprecated-sync-thenables.js", {}).Promise;
 
 const EXAMPLE_URL = "http://example.com/browser/devtools/client/debugger/test/mochitest/";
 const FRAME_SCRIPT_URL = getRootDirectory(gTestPath) + "code_frame-script.js";
 const CHROME_URL = "chrome://mochitests/content/browser/devtools/client/debugger/test/mochitest/";
-const CHROME_URI = Services.io.newURI(CHROME_URL, null, null);
+const CHROME_URI = Services.io.newURI(CHROME_URL);
 
 Services.prefs.setBoolPref("devtools.debugger.new-debugger-frontend", false);
 
 registerCleanupFunction(function* () {
   Services.prefs.clearUserPref("devtools.debugger.new-debugger-frontend");
 
   info("finish() was called, cleaning up...");
   Services.prefs.setBoolPref("devtools.debugger.log", gEnableLogging);
--- a/devtools/client/debugger/utils.js
+++ b/devtools/client/debugger/utils.js
@@ -163,17 +163,17 @@ var SourceUtils = {
   getSourceGroup: function (aUrl) {
     let cachedGroup = this._groupsCache.get(aUrl);
     if (cachedGroup) {
       return cachedGroup;
     }
 
     try {
       // Use an nsIURL to parse all the url path parts.
-      var uri = Services.io.newURI(aUrl, null, null).QueryInterface(Ci.nsIURL);
+      var uri = Services.io.newURI(aUrl).QueryInterface(Ci.nsIURL);
     } catch (e) {
       // This doesn't look like a url, or nsIURL can't handle it.
       return "";
     }
 
     let groupLabel = uri.prePath;
 
     for (let name of Object.keys(KNOWN_SOURCE_GROUPS)) {
@@ -252,17 +252,17 @@ var SourceUtils = {
    *        The current iteration step.
    * @return string
    *         The resulting label at the final step.
    */
   trimUrl: function (aUrl, aLabel, aSeq) {
     if (!(aUrl instanceof Ci.nsIURL)) {
       try {
         // Use an nsIURL to parse all the url path parts.
-        aUrl = Services.io.newURI(aUrl, null, null).QueryInterface(Ci.nsIURL);
+        aUrl = Services.io.newURI(aUrl).QueryInterface(Ci.nsIURL);
       } catch (e) {
         // This doesn't look like a url, or nsIURL can't handle it.
         return aUrl;
       }
     }
     if (!aSeq) {
       let name = aUrl.fileName;
       if (name) {
--- a/devtools/client/framework/about-devtools-toolbox.js
+++ b/devtools/client/framework/about-devtools-toolbox.js
@@ -11,18 +11,17 @@ const { Ci, Cu, Cm, components } = requi
 const registrar = Cm.QueryInterface(Ci.nsIComponentRegistrar);
 const Services = require("Services");
 const { XPCOMUtils } = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {});
 const { nsIAboutModule } = Ci;
 
 function AboutURL() {}
 
 AboutURL.prototype = {
-  uri: Services.io.newURI("chrome://devtools/content/framework/toolbox.xul",
-                          null, null),
+  uri: Services.io.newURI("chrome://devtools/content/framework/toolbox.xul"),
   classDescription: "about:devtools-toolbox",
   classID: components.ID("11342911-3135-45a8-8d71-737a2b0ad469"),
   contractID: "@mozilla.org/network/protocol/about;1?what=devtools-toolbox",
 
   QueryInterface: XPCOMUtils.generateQI([nsIAboutModule]),
 
   newChannel: function (aURI, aLoadInfo) {
     let chan = Services.io.newChannelFromURIWithLoadInfo(this.uri, aLoadInfo);
--- a/devtools/client/inspector/shared/test/browser_styleinspector_csslogic-content-stylesheets.js
+++ b/devtools/client/inspector/shared/test/browser_styleinspector_csslogic-content-stylesheets.js
@@ -10,17 +10,17 @@
 // devtools/server/tests/mochitest/test_css-logic-...something...html
 // test
 
 const TEST_URI_HTML = TEST_URL_ROOT + "doc_content_stylesheet.html";
 const TEST_URI_AUTHOR = TEST_URL_ROOT + "doc_author-sheet.html";
 const TEST_URI_XUL = TEST_URL_ROOT + "doc_content_stylesheet.xul";
 const XUL_URI = Cc["@mozilla.org/network/io-service;1"]
                 .getService(Ci.nsIIOService)
-                .newURI(TEST_URI_XUL, null, null);
+                .newURI(TEST_URI_XUL);
 var ssm = Components.classes["@mozilla.org/scriptsecuritymanager;1"]
                             .getService(Ci.nsIScriptSecurityManager);
 const XUL_PRINCIPAL = ssm.createCodebasePrincipal(XUL_URI, {});
 
 add_task(function* () {
   requestLongerTimeout(2);
 
   info("Checking stylesheets on HTML document");
--- a/devtools/client/responsive.html/browser/tunnel.js
+++ b/devtools/client/responsive.html/browser/tunnel.js
@@ -233,17 +233,17 @@ function tunnelToInnerBrowser(outer, inn
       // least open them somewhere (in a new tab).  The following things are ignored:
       //   * Specific target names (everything treated as _blank)
       //   * Window features
       //   * window.opener
       // These things are deferred for now, since content which does depend on them seems
       // outside the main focus of RDM.
       let { detail } = event;
       event.preventDefault();
-      let uri = Services.io.newURI(detail.url, null, null);
+      let uri = Services.io.newURI(detail.url);
       // This API is used mainly because it's near the path used for <a target/> with
       // regular browser tabs (which calls `openURIInFrame`).  The more elaborate APIs
       // that support openers, window features, etc. didn't seem callable from JS and / or
       // this event doesn't give enough info to use them.
       browserWindow.browserDOMWindow
         .openURI(uri, null, Ci.nsIBrowserDOMWindow.OPEN_NEWTAB,
                  Ci.nsIBrowserDOMWindow.OPEN_NEW);
     },
--- a/devtools/client/responsive.html/browser/web-navigation.js
+++ b/devtools/client/responsive.html/browser/web-navigation.js
@@ -101,17 +101,17 @@ BrowserElementWebNavigation.prototype = 
 
   get document() {
     return this._browser.contentDocument;
   },
 
   _currentURI: null,
   get currentURI() {
     if (!this._currentURI) {
-      this._currentURI = Services.io.newURI("about:blank", null, null);
+      this._currentURI = Services.io.newURI("about:blank");
     }
     return this._currentURI;
   },
   set currentURI(uri) {
     this._browser.src = uri.spec;
   },
 
   referringURI: null,
--- a/devtools/client/responsivedesign/responsivedesign-child.js
+++ b/devtools/client/responsivedesign/responsivedesign-child.js
@@ -12,17 +12,17 @@ var global = this;
 // Guard against loading this frame script mutiple times
 (function () {
   if (global.responsiveFrameScriptLoaded) {
     return;
   }
 
   var Ci = Components.interfaces;
   const gDeviceSizeWasPageSize = docShell.deviceSizeIsPageSize;
-  const gFloatingScrollbarsStylesheet = Services.io.newURI("chrome://devtools/skin/floating-scrollbars-responsive-design.css", null, null);
+  const gFloatingScrollbarsStylesheet = Services.io.newURI("chrome://devtools/skin/floating-scrollbars-responsive-design.css");
   var gRequiresFloatingScrollbars;
 
   var active = false;
   var resizeNotifications = false;
 
   addMessageListener("ResponsiveMode:Start", startResponsiveMode);
   addMessageListener("ResponsiveMode:Stop", stopResponsiveMode);
   addMessageListener("ResponsiveMode:IsActive", isActive);
--- a/devtools/client/shared/devtools-file-watcher.js
+++ b/devtools/client/shared/devtools-file-watcher.js
@@ -9,17 +9,17 @@ const EventEmitter = require("devtools/s
 
 loader.lazyImporter(this, "OS", "resource://gre/modules/osfile.jsm");
 
 const HOTRELOAD_PREF = "devtools.loader.hotreload";
 
 function resolveResourcePath(uri) {
   const handler = Services.io.getProtocolHandler("resource")
         .QueryInterface(Ci.nsIResProtocolHandler);
-  const resolved = handler.resolveURI(Services.io.newURI(uri, null, null));
+  const resolved = handler.resolveURI(Services.io.newURI(uri));
   return resolved.replace(/file:\/\//, "");
 }
 
 function findSourceDir(path) {
   if (path === "" || path === "/") {
     return Promise.resolve(null);
   }
 
--- a/devtools/client/storage/test/head.js
+++ b/devtools/client/storage/test/head.js
@@ -883,17 +883,17 @@ function getCookieId(name, domain, path)
   return `${name}${SEPARATOR_GUID}${domain}${SEPARATOR_GUID}${path}`;
 }
 
 function setPermission(url, permission) {
   const nsIPermissionManager = Components.interfaces.nsIPermissionManager;
 
   let uri = Components.classes["@mozilla.org/network/io-service;1"]
                       .getService(Components.interfaces.nsIIOService)
-                      .newURI(url, null, null);
+                      .newURI(url);
   let ssm = Components.classes["@mozilla.org/scriptsecuritymanager;1"]
                       .getService(Ci.nsIScriptSecurityManager);
   let principal = ssm.createCodebasePrincipal(uri, {});
 
   Components.classes["@mozilla.org/permissionmanager;1"]
             .getService(nsIPermissionManager)
             .addFromPrincipal(principal, permission,
                               nsIPermissionManager.ALLOW_ACTION);
--- a/devtools/client/styleeditor/StyleEditorUtil.jsm
+++ b/devtools/client/styleeditor/StyleEditorUtil.jsm
@@ -180,17 +180,17 @@ function wire(root, selectorOrElement, d
  * @param AString suggestedFilename
  *        The suggested filename when toSave is true.
  */
 function showFilePicker(path, toSave, parentWindow, callback,
                         suggestedFilename) {
   if (typeof path == "string") {
     try {
       if (Services.io.extractScheme(path) == "file") {
-        let uri = Services.io.newURI(path, null, null);
+        let uri = Services.io.newURI(path);
         let file = uri.QueryInterface(Ci.nsIFileURL).file;
         callback(file);
         return;
       }
     } catch (ex) {
       callback(null);
       return;
     }
--- a/devtools/client/webconsole/utils.js
+++ b/devtools/client/webconsole/utils.js
@@ -156,18 +156,18 @@ var WebConsoleUtils = {
    *        Location of the requested content.
    * @param string location
    *        Location of the current page.
    * @return boolean
    *         True if the content is mixed, false if not.
    */
   isMixedHTTPSRequest: function (request, location) {
     try {
-      let requestURI = Services.io.newURI(request, null, null);
-      let contentURI = Services.io.newURI(location, null, null);
+      let requestURI = Services.io.newURI(request);
+      let contentURI = Services.io.newURI(location);
       return (contentURI.scheme == "https" && requestURI.scheme != "https");
     } catch (ex) {
       return false;
     }
   },
 
   /**
    * Helper function to deduce the name of the provided function.
--- a/devtools/client/webconsole/webconsole.js
+++ b/devtools/client/webconsole/webconsole.js
@@ -1493,18 +1493,18 @@ WebConsoleFrame.prototype = {
     }
 
     let displayOrigin = scriptError.sourceName;
 
     // TLS errors are related to the connection and not the resource; therefore
     // it makes sense to only display the protcol, host and port (prePath).
     // This also means messages are grouped for a single origin.
     if (scriptError.category && scriptError.category == "SHA-1 Signature") {
-      let sourceURI = Services.io.newURI(scriptError.sourceName, null, null)
-                      .QueryInterface(Ci.nsIURL);
+      let sourceURI = Services.io.newURI(scriptError.sourceName)
+                                 .QueryInterface(Ci.nsIURL);
       displayOrigin = sourceURI.prePath;
     }
 
     // Create a new message
     let msg = new Messages.Simple(errorMessage, {
       location: {
         url: displayOrigin,
         line: scriptError.lineNumber,
--- a/devtools/client/webide/modules/app-manager.js
+++ b/devtools/client/webide/modules/app-manager.js
@@ -657,18 +657,18 @@ var AppManager = exports.AppManager = {
         // If the packaged app specified a custom origin override,
         // we need to update the local project origin
         project.packagedAppOrigin = response.appId;
         // And ensure the indexed db on disk is also updated
         AppProjects.update(project);
       }
 
       if (project.type == "hosted") {
-        let manifestURLObject = Services.io.newURI(project.location, null, null);
-        let origin = Services.io.newURI(manifestURLObject.prePath, null, null);
+        let manifestURLObject = Services.io.newURI(project.location);
+        let origin = Services.io.newURI(manifestURLObject.prePath);
         let appId = origin.host;
         let metadata = {
           origin: origin.spec,
           manifestURL: project.location
         };
         response = yield self._appsFront.installHosted(appId,
                                             metadata,
                                             project.manifest);
@@ -728,18 +728,18 @@ var AppManager = exports.AppManager = {
           if (size) {
             iconPath = manifest.icons[size];
           }
         }
         if (!iconPath) {
           project.icon = AppManager.DEFAULT_PROJECT_ICON;
         } else {
           if (project.type == "hosted") {
-            let manifestURL = Services.io.newURI(project.location, null, null);
-            let origin = Services.io.newURI(manifestURL.prePath, null, null);
+            let manifestURL = Services.io.newURI(project.location);
+            let origin = Services.io.newURI(manifestURL.prePath);
             project.icon = Services.io.newURI(iconPath, null, origin).spec;
           } else if (project.type == "packaged") {
             let projectFolder = FileUtils.File(packageDir);
             let folderURI = Services.io.newFileURI(projectFolder).spec;
             project.icon = folderURI + iconPath.replace(/^\/|\\/, "");
           }
         }
         project.manifest = validation.manifest;
--- a/devtools/client/webide/modules/app-validator.js
+++ b/devtools/client/webide/modules/app-validator.js
@@ -102,17 +102,17 @@ AppValidator.checkManifest = function (m
     error = strings.formatStringFromName("validator.noAccessManifestURL", [e, manifestURL], 2);
     deferred.reject(error);
   }
 
   return deferred.promise;
 };
 
 AppValidator.findManifestAtOrigin = function (manifestURL) {
-  let fixedManifest = Services.io.newURI(manifestURL, null, null).prePath + "/manifest.webapp";
+  let fixedManifest = Services.io.newURI(manifestURL).prePath + "/manifest.webapp";
   return AppValidator.checkManifest(fixedManifest);
 };
 
 AppValidator.findManifestPath = function (manifestURL) {
   let deferred = promise.defer();
 
   if (manifestURL.endsWith("manifest.webapp")) {
     deferred.reject();
@@ -162,17 +162,17 @@ AppValidator.prototype._getManifest = fu
   let manifestURL;
   if (this.type == "packaged") {
     manifestURL = this._getPackagedManifestURL();
     if (!manifestURL)
       return promise.resolve(null);
   } else if (this.type == "hosted") {
     manifestURL = this.location;
     try {
-      Services.io.newURI(manifestURL, null, null);
+      Services.io.newURI(manifestURL);
     } catch (e) {
       this.error(strings.formatStringFromName("validator.invalidHostedManifestURL", [manifestURL, e.message], 2));
       return promise.resolve(null);
     }
   } else {
     this.error(strings.formatStringFromName("validator.invalidProjectType", [this.type], 1));
     return promise.resolve(null);
   }
@@ -188,20 +188,20 @@ AppValidator.prototype.validateManifest 
     this.warning(strings.GetStringFromName("validator.missIconsManifestProperty"));
   } else if (!manifest.icons["128"]) {
     this.warning(strings.GetStringFromName("validator.missIconMarketplace2"));
   }
 };
 
 AppValidator.prototype._getOriginURL = function () {
   if (this.type == "packaged") {
-    let manifestURL = Services.io.newURI(this.manifestURL, null, null);
+    let manifestURL = Services.io.newURI(this.manifestURL);
     return Services.io.newURI(".", null, manifestURL).spec;
   } else if (this.type == "hosted") {
-    return Services.io.newURI(this.location, null, null).prePath;
+    return Services.io.newURI(this.location).prePath;
   }
 };
 
 AppValidator.prototype.validateLaunchPath = function (manifest) {
   let deferred = promise.defer();
   // The launch_path field has to start with a `/`
   if (manifest.launch_path && manifest.launch_path[0] !== "/") {
     this.error(strings.formatStringFromName("validator.nonAbsoluteLaunchPath", [manifest.launch_path], 1));
@@ -212,17 +212,17 @@ AppValidator.prototype.validateLaunchPat
   let path;
   if (this.type == "packaged") {
     path = "." + (manifest.launch_path || "/index.html");
   } else if (this.type == "hosted") {
     path = manifest.launch_path || "/";
   }
   let indexURL;
   try {
-    indexURL = Services.io.newURI(path, null, Services.io.newURI(origin, null, null)).spec;
+    indexURL = Services.io.newURI(path, null, Services.io.newURI(origin)).spec;
   } catch (e) {
     this.error(strings.formatStringFromName("validator.accessFailedLaunchPath", [origin + path], 1));
     deferred.resolve();
     return deferred.promise;
   }
 
   let req = new XMLHttpRequest();
   req.overrideMimeType("text/plain");
--- a/devtools/server/actors/addon.js
+++ b/devtools/server/actors/addon.js
@@ -216,17 +216,17 @@ BrowserAddonActor.prototype = {
     }
 
     // Check the global for a __URI__ property and then try to map that to an
     // add-on
     let uridescriptor = aGlobal.getOwnPropertyDescriptor("__URI__");
     if (uridescriptor && "value" in uridescriptor && uridescriptor.value) {
       let uri;
       try {
-        uri = Services.io.newURI(uridescriptor.value, null, null);
+        uri = Services.io.newURI(uridescriptor.value);
       }
       catch (e) {
         DevToolsUtils.reportException(
           "BrowserAddonActor.prototype._shouldAddNewGlobalAsDebuggee",
           new Error("Invalid URI: " + uridescriptor.value)
         );
         return false;
       }
--- a/devtools/server/actors/inspector.js
+++ b/devtools/server/actors/inspector.js
@@ -2785,17 +2785,17 @@ exports.InspectorActor = protocol.ActorC
     let document = isNodeDead(node)
                    ? this.window.document
                    : nodeDocument(node.rawNode);
 
     if (!document) {
       return url;
     }
 
-    let baseURI = Services.io.newURI(document.location.href, null, null);
+    let baseURI = Services.io.newURI(document.location.href);
     return Services.io.newURI(url, null, baseURI).spec;
   },
 
   /**
    * Create an instance of the eye-dropper highlighter and store it on this._eyeDropper.
    * Note that for now, a new instance is created every time to deal with page navigation.
    */
   createEyeDropper: function () {
--- a/devtools/server/actors/source.js
+++ b/devtools/server/actors/source.js
@@ -89,17 +89,17 @@ function resolveURIToLocalPath(aURI) {
     case "chrome":
       resolved = Cc["@mozilla.org/chrome/chrome-registry;1"].
                  getService(Ci.nsIChromeRegistry).convertChromeURL(aURI);
       return resolveURIToLocalPath(resolved);
 
     case "resource":
       resolved = Cc["@mozilla.org/network/protocol;1?name=resource"].
                  getService(Ci.nsIResProtocolHandler).resolveURI(aURI);
-      aURI = Services.io.newURI(resolved, null, null);
+      aURI = Services.io.newURI(resolved);
       return resolveURIToLocalPath(aURI);
 
     default:
       return null;
   }
 }
 
 /**
@@ -229,17 +229,17 @@ let SourceActor = ActorClassWithSpec(sou
   destroy: function () {
     if (this.registeredPool && this.registeredPool.sourceActors) {
       delete this.registeredPool.sourceActors[this.actorID];
     }
   },
 
   _mapSourceToAddon: function () {
     try {
-      var nsuri = Services.io.newURI(this.url.split(" -> ").pop(), null, null);
+      var nsuri = Services.io.newURI(this.url.split(" -> ").pop());
     }
     catch (e) {
       // We can't do anything with an invalid URI
       return;
     }
 
     let localURI = resolveURIToLocalPath(nsuri);
     if (!localURI) {
--- a/devtools/server/actors/storage.js
+++ b/devtools/server/actors/storage.js
@@ -1146,17 +1146,17 @@ function getObjectForLocalOrSessionStora
       updateData[host] = [subject.key];
       return this.storageActor.update(action, type, updateData);
     },
 
     /**
      * Given a url, correctly determine its protocol + hostname part.
      */
     getSchemaAndHost(url) {
-      let uri = Services.io.newURI(url, null, null);
+      let uri = Services.io.newURI(url);
       if (!uri.host) {
         return uri.spec;
       }
       return uri.scheme + "://" + uri.hostPort;
     },
 
     toStoreObject(item) {
       if (!item) {
@@ -1186,17 +1186,17 @@ StorageActors.createActor({
   typeName: "sessionStorage",
   observationTopics: ["dom-storage2-changed", "dom-private-storage2-changed"]
 }, getObjectForLocalOrSessionStorage("sessionStorage"));
 
 StorageActors.createActor({
   typeName: "Cache"
 }, {
   getCachesForHost: Task.async(function* (host) {
-    let uri = Services.io.newURI(host, null, null);
+    let uri = Services.io.newURI(host);
     let principal =
       Services.scriptSecurityManager.getNoAppCodebasePrincipal(uri);
 
     // The first argument tells if you want to get |content| cache or |chrome|
     // cache.
     // The |content| cache is the cache explicitely named by the web content
     // (service worker or web page).
     // The |chrome| cache is the cache implicitely cached by the platform,
@@ -1305,17 +1305,17 @@ StorageActors.createActor({
   populateStoresForHosts() {
     this.hostVsStores = new Map();
   },
 
   /**
    * Given a url, correctly determine its protocol + hostname part.
    */
   getSchemaAndHost(url) {
-    let uri = Services.io.newURI(url, null, null);
+    let uri = Services.io.newURI(url);
     return uri.scheme + "://" + uri.hostPort;
   },
 
   toStoreObject(item) {
     return item;
   },
 
   removeItem: Task.async(function* (host, name) {
--- a/devtools/server/actors/styleeditor.js
+++ b/devtools/server/actors/styleeditor.js
@@ -509,20 +509,20 @@ XPCOMUtils.defineLazyGetter(this, "DOMUt
 });
 
 exports.StyleEditorActor = StyleEditorActor;
 
 /**
  * Normalize multiple relative paths towards the base paths on the right.
  */
 function normalize(...aURLs) {
-  let base = Services.io.newURI(aURLs.pop(), null, null);
+  let base = Services.io.newURI(aURLs.pop());
   let url;
   while ((url = aURLs.pop())) {
     base = Services.io.newURI(url, null, base);
   }
   return base.spec;
 }
 
 function dirname(aPath) {
   return Services.io.newURI(
-    ".", null, Services.io.newURI(aPath, null, null)).spec;
+    ".", null, Services.io.newURI(aPath)).spec;
 }
--- a/devtools/server/actors/stylesheets.js
+++ b/devtools/server/actors/stylesheets.js
@@ -985,20 +985,20 @@ var StyleSheetsActor = protocol.ActorCla
 });
 
 exports.StyleSheetsActor = StyleSheetsActor;
 
 /**
  * Normalize multiple relative paths towards the base paths on the right.
  */
 function normalize(...aURLs) {
-  let base = Services.io.newURI(aURLs.pop(), null, null);
+  let base = Services.io.newURI(aURLs.pop());
   let url;
   while ((url = aURLs.pop())) {
     base = Services.io.newURI(url, null, base);
   }
   return base.spec;
 }
 
 function dirname(aPath) {
   return Services.io.newURI(
-    ".", null, Services.io.newURI(aPath, null, null)).spec;
+    ".", null, Services.io.newURI(aPath)).spec;
 }
--- a/devtools/server/actors/webextension.js
+++ b/devtools/server/actors/webextension.js
@@ -287,17 +287,17 @@ WebExtensionActor.prototype._docShellsTo
 };
 
 /**
  * Return true if the given source is associated with this addon and should be
  * added to the visible sources (retrieved and used by the webbrowser actor module).
  */
 WebExtensionActor.prototype._allowSource = function (source) {
   try {
-    let uri = Services.io.newURI(source.url, null, null);
+    let uri = Services.io.newURI(source.url);
     let addonID = mapURIToAddonID(uri);
 
     return addonID == this.id;
   } catch (e) {
     return false;
   }
 };
 
--- a/devtools/shared/DevToolsUtils.js
+++ b/devtools/shared/DevToolsUtils.js
@@ -530,22 +530,22 @@ function mainThreadFetch(urlIn, aOptions
  * @param {Object} options - The options object passed to @method fetch.
  * @return {nsIChannel} - The newly created channel. Throws on failure.
  */
 function newChannelForURL(url, { policy, window, principal }) {
   let securityFlags = Ci.nsILoadInfo.SEC_ALLOW_CROSS_ORIGIN_DATA_IS_NULL;
 
   let uri;
   try {
-    uri = Services.io.newURI(url, null, null);
+    uri = Services.io.newURI(url);
   } catch (e) {
     // In the xpcshell tests, the script url is the absolute path of the test
     // file, which will make a malformed URI error be thrown. Add the file
     // scheme to see if it helps.
-    uri = Services.io.newURI("file://" + url, null, null);
+    uri = Services.io.newURI("file://" + url);
   }
   let channelOptions = {
     contentPolicyType: policy,
     securityFlags: securityFlags,
     uri: uri
   };
   let prin = principal;
   if (!prin) {
--- a/devtools/shared/fronts/actor-registry.js
+++ b/devtools/shared/fronts/actor-registry.js
@@ -17,17 +17,17 @@ const ActorActorFront = protocol.FrontCl
   }
 });
 
 exports.ActorActorFront = ActorActorFront;
 
 function request(uri) {
   return new Promise((resolve, reject) => {
     try {
-      uri = Services.io.newURI(uri, null, null);
+      uri = Services.io.newURI(uri);
     } catch (e) {
       reject(e);
     }
 
     NetUtil.asyncFetch({
       uri,
       loadUsingSystemPrincipal: true,
     }, (stream, status, req) => {
--- a/devtools/shared/gcli/commands/inject.js
+++ b/devtools/shared/gcli/commands/inject.js
@@ -62,17 +62,17 @@ exports.items = [
           library.selection.src : library.url;
 
       if (context.environment.window.location.protocol == "https:") {
         src = src.replace(/^http:/, "https:");
       }
 
       try {
         // Check if URI is valid
-        Services.io.newURI(src, null, null);
+        Services.io.newURI(src);
       } catch (e) {
         return l10n.lookupFormat("injectFailed", [name]);
       }
 
       let newSource = document.createElement("script");
       newSource.setAttribute("src", src);
 
       let loadPromise = listenOnce(newSource, "load");
--- a/devtools/shared/gcli/commands/screenshot.js
+++ b/devtools/shared/gcli/commands/screenshot.js
@@ -520,17 +520,17 @@ var saveToFile = Task.async(function* (c
   let downloadsDir = yield Downloads.getPreferredDownloadsDirectory();
   let downloadsDirExists = yield OS.File.exists(downloadsDir);
   if (downloadsDirExists) {
     // If filename is absolute, it will override the downloads directory and
     // still be applied as expected.
     reply.filename = OS.Path.join(downloadsDir, reply.filename);
   }
 
-  let sourceURI = Services.io.newURI(reply.data, null, null);
+  let sourceURI = Services.io.newURI(reply.data);
   let targetFile = new FileUtils.File(reply.filename);
   let targetFileURI = Services.io.newFileURI(targetFile);
 
   // Create download and track its progress.
   // This is adapted from saveURL in contentAreaUtils.js, but simplified greatly
   // and modified to allow saving to arbitrary paths on disk.  Using these
   // objects as opposed to just writing with OS.File allows us to tie into the
   // download manager to record a download entry and to get visual feedback from
--- a/devtools/shared/tests/unit/test_console_filtering.js
+++ b/devtools/shared/tests/unit/test_console_filtering.js
@@ -26,17 +26,17 @@ var callback = {
       do_check_eq(message.arguments[0], "Hello from default console");
       seenTypes |= 4;
     }
     seenMessages++;
   }
 };
 
 function createFakeAddonWindow({addonId} = {}) {
-  let baseURI = Services.io.newURI("about:blank", null, null);
+  let baseURI = Services.io.newURI("about:blank");
   let originAttributes = {addonId};
   let principal = Services.scriptSecurityManager
         .createCodebasePrincipal(baseURI, originAttributes);
   let chromeWebNav = Services.appShell.createWindowlessBrowser(true);
   let docShell = chromeWebNav.QueryInterface(Ci.nsIInterfaceRequestor)
                              .getInterface(Ci.nsIDocShell);
   docShell.createAboutBlankContentViewer(principal);
   let addonWindow = docShell.contentViewer.DOMDocument.defaultView;
--- a/devtools/shared/touch/simulator-core.js
+++ b/devtools/shared/touch/simulator-core.js
@@ -7,19 +7,19 @@
 "use strict";
 
 const { Ci, Cu } = require("chrome");
 const { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
 
 var systemAppOrigin = (function () {
   let systemOrigin = "_";
   try {
-    systemOrigin = Services.io.newURI(
-      Services.prefs.getCharPref("b2g.system_manifest_url"), null, null)
-      .prePath;
+    systemOrigin =
+      Services.io.newURI(Services.prefs.getCharPref("b2g.system_manifest_url"))
+                 .prePath;
   } catch (e) {
     // Fall back to default value
   }
   return systemOrigin;
 })();
 
 var threshold = 25;
 try {
--- a/devtools/shared/webconsole/network-helper.js
+++ b/devtools/shared/webconsole/network-helper.js
@@ -798,17 +798,17 @@ var NetworkHelper = {
   /**
    * Helper for getting an nsIURL instance out of a string.
    */
   nsIURL: function (url, store = gNSURLStore) {
     if (store.has(url)) {
       return store.get(url);
     }
 
-    let uri = Services.io.newURI(url, null, null).QueryInterface(Ci.nsIURL);
+    let uri = Services.io.newURI(url).QueryInterface(Ci.nsIURL);
     store.set(url, uri);
     return uri;
   }
 };
 
 for (let prop of Object.getOwnPropertyNames(NetworkHelper)) {
   exports[prop] = NetworkHelper[prop];
 }