Bug 1439315 - 3 - Don't use NetUtil.newURI. r=standard8
MozReview-Commit-ID: 58jYURt7EWF
--- 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;