Bug 1667455 - Part 22: Make httpd.js compatible both with patched and unpatched binary (hostutils). r=kmag,necko-reviewers,dragana

Differential Revision: https://phabricator.services.mozilla.com/D150913
This commit is contained in:
Tooru Fujisawa 2022-07-11 12:41:57 +00:00
Родитель 9fe5b851ea
Коммит 601a003c2c
1 изменённых файлов: 6 добавлений и 1 удалений

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

@ -49,7 +49,12 @@ var DEBUG = false; // non-const *only* so tweakable in server tests
/** True if debugging output should be timestamped. */
var DEBUG_TIMESTAMP = false; // non-const so tweakable in server tests
const { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
// httpd.js is loaded by Android hostutils that's not up to date.
// Fallback to Services.jsm if `Services` global variable isn't yet available.
const Services =
globalThis.Services ||
ChromeUtils.import("resource://gre/modules/Services.jsm").Services;
const { AppConstants } = ChromeUtils.import(
"resource://gre/modules/AppConstants.jsm"
);