Bug 1826705 - Make destroy method of MessageHandler modules optional. r=jdescottes,webdriver-reviewers

Differential Revision: https://phabricator.services.mozilla.com/D176294
This commit is contained in:
anwar 2023-04-24 14:00:41 +00:00
parent 664b953b47
commit acb6cab567

View File

@ -8,12 +8,15 @@ const lazy = {};
ChromeUtils.defineESModuleGetters(lazy, {
error: "chrome://remote/content/shared/webdriver/Errors.sys.mjs",
Log: "chrome://remote/content/shared/Log.sys.mjs",
});
XPCOMUtils.defineLazyGetter(lazy, "disabledExperimentalAPI", () => {
return !Services.prefs.getBoolPref("remote.experimental.enabled");
});
XPCOMUtils.defineLazyGetter(lazy, "logger", () => lazy.Log.get());
export class Module {
#messageHandler;
@ -29,11 +32,11 @@ export class Module {
/**
* Clean-up the module instance.
*
* It's required to be implemented in the sub class.
*/
destroy() {
throw new Error("Not implemented");
lazy.logger.warn(
`Module ${this.constructor.name} is missing a destroy method`
);
}
/**