Bug 1439315 - 3 - Don't use NetUtil.newURI. r=standard8 draft
authorMarco Bonardo <mbonardo@mozilla.com>
Wed, 28 Feb 2018 12:28:54 +0100
changeset 761871 e215b0a8890b3dc2169d82fbf63ba2fba4e65b4f
parent 761870 7dacee00aecf5cfb00a6977a88ecea5334958022
child 761872 a78d1513e46f85375e4e75377550940d40c25b70
push id101023
push usermak77@bonardo.net
push dateThu, 01 Mar 2018 15:34:13 +0000
reviewersstandard8
bugs1439315
milestone60.0a1
Bug 1439315 - 3 - Don't use NetUtil.newURI. r=standard8 MozReview-Commit-ID: 58jYURt7EWF
browser/components/places/content/controller.js
--- a/browser/components/places/content/controller.js
+++ b/browser/components/places/content/controller.js
@@ -1,17 +1,15 @@
 /* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 ChromeUtils.defineModuleGetter(this, "ForgetAboutSite",
                                "resource://gre/modules/ForgetAboutSite.jsm");
-ChromeUtils.defineModuleGetter(this, "NetUtil",
-                               "resource://gre/modules/NetUtil.jsm");
 ChromeUtils.defineModuleGetter(this, "PrivateBrowsingUtils",
                                "resource://gre/modules/PrivateBrowsingUtils.jsm");
 
 /**
  * Represents an insertion point within a container where we can insert
  * items.
  * @param {object} an object containing the following properties:
  *   - parentId
@@ -225,17 +223,17 @@ PlacesController.prototype = {
       this.remove("Remove Selection").catch(Cu.reportError);
       break;
     case "placesCmd_deleteDataHost":
       var host;
       if (PlacesUtils.nodeIsHost(this._view.selectedNode)) {
         var queries = this._view.selectedNode.getQueries();
         host = queries[0].domain;
       } else
-        host = NetUtil.newURI(this._view.selectedNode.uri).host;
+        host = Services.io.newURI(this._view.selectedNode.uri).host;
       ForgetAboutSite.removeDataFromDomain(host)
                      .catch(Cu.reportError);
       break;
     case "cmd_selectAll":
       this.selectAll();
       break;
     case "placesCmd_open":
       PlacesUIUtils.openNodeIn(this._view.selectedNode, "current", this._view);
@@ -270,17 +268,17 @@ PlacesController.prototype = {
     case "placesCmd_createBookmark":
       let node = this._view.selectedNode;
       PlacesUIUtils.showBookmarkDialog({ action: "add",
                                          type: "bookmark",
                                          hiddenRows: [ "description",
                                                         "keyword",
                                                         "location",
                                                         "loadInSidebar" ],
-                                         uri: NetUtil.newURI(node.uri),
+                                         uri: Services.io.newURI(node.uri),
                                          title: node.title
                                        }, window.top);
       break;
     }
   },
 
   onEvent: function PC_onEvent(eventName) { },
 
@@ -423,17 +421,17 @@ PlacesController.prototype = {
         case Ci.nsINavHistoryResultNode.RESULT_TYPE_FOLDER_SHORTCUT:
           nodeData.folder = true;
           break;
         case Ci.nsINavHistoryResultNode.RESULT_TYPE_SEPARATOR:
           nodeData.separator = true;
           break;
         case Ci.nsINavHistoryResultNode.RESULT_TYPE_URI:
           nodeData.link = true;
-          uri = NetUtil.newURI(node.uri);
+          uri = Services.io.newURI(node.uri);
           if (PlacesUtils.nodeIsBookmark(node)) {
             nodeData.bookmark = true;
             var parentNode = node.parent;
             if (parentNode) {
               if (PlacesUtils.nodeIsTagQuery(parentNode))
                 nodeData.tagChild = true;
               else if (this.hasCachedLivemarkInfo(parentNode))
                 nodeData.livemarkChild = true;