Bug 1623664 - Remove unused Utils.serializeInputStream, Utils.shallowCopy. r=mikedeboer

Differential Revision: https://phabricator.services.mozilla.com/D67504

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Dão Gottwald 2020-03-20 14:31:44 +00:00
Родитель b256cfe15f
Коммит e4af8991af
1 изменённых файлов: 0 добавлений и 30 удалений

Просмотреть файл

@ -9,11 +9,6 @@ var EXPORTED_SYMBOLS = ["Utils"];
ChromeUtils.import("resource://gre/modules/Services.jsm", this);
ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm", this);
ChromeUtils.defineModuleGetter(
this,
"NetUtil",
"resource://gre/modules/NetUtil.jsm"
);
XPCOMUtils.defineLazyServiceGetter(
this,
"eTLDService",
@ -22,21 +17,6 @@ XPCOMUtils.defineLazyServiceGetter(
);
var Utils = Object.freeze({
serializeInputStream(aStream) {
let data = {
content: NetUtil.readInputStreamToString(aStream, aStream.available()),
};
if (aStream instanceof Ci.nsIMIMEInputStream) {
data.headers = new Map();
aStream.visitHeaders((name, value) => {
data.headers.set(name, value);
});
}
return data;
},
/**
* Returns true if the |url| passed in is part of the given root |domain|.
* For example, if |url| is "www.mozilla.org", and we pass in |domain| as
@ -56,16 +36,6 @@ var Utils = Object.freeze({
return eTLDService.hasRootDomain(host, domain);
},
shallowCopy(obj) {
let retval = {};
for (let key of Object.keys(obj)) {
retval[key] = obj[key];
}
return retval;
},
/**
* Restores frame tree |data|, starting at the given root |frame|. As the
* function recurses into descendant frames it will call cb(frame, data) for