diff --git a/remote/cdp/CDP.jsm b/remote/cdp/CDP.jsm index 88d5fb489850..25720b5fb768 100644 --- a/remote/cdp/CDP.jsm +++ b/remote/cdp/CDP.jsm @@ -18,9 +18,8 @@ XPCOMUtils.defineLazyModuleGetters(this, { TargetList: "chrome://remote/content/cdp/targets/TargetList.jsm", }); -XPCOMUtils.defineLazyGetter(this, "textEncoder", () => new TextEncoder()); - XPCOMUtils.defineLazyGetter(this, "logger", () => Log.get(Log.TYPES.CDP)); +XPCOMUtils.defineLazyGetter(this, "textEncoder", () => new TextEncoder()); // Map of CDP-specific preferences that should be set via // RecommendedPreferences. @@ -55,7 +54,7 @@ class CDP { this.targetList = null; this._running = false; - this._devToolsActivePortPath; + this._activePortPath; } get address() { @@ -97,23 +96,15 @@ class CDP { Cu.printStderr(`DevTools listening on ${this.address}\n`); - // Write connection details to DevToolsActivePort file within the profile + // Write connection details to DevToolsActivePort file within the profile. const profileDir = await PathUtils.getProfileDir(); - this._devToolsActivePortPath = PathUtils.join( - profileDir, - "DevToolsActivePort" - ); + this._activePortPath = PathUtils.join(profileDir, "DevToolsActivePort"); const data = `${this.agent.port}\n${this.mainTargetPath}`; try { - await IOUtils.write( - this._devToolsActivePortPath, - textEncoder.encode(data) - ); + await IOUtils.write(this._activePortPath, textEncoder.encode(data)); } catch (e) { - logger.warn( - `Failed to create ${this._devToolsActivePortPath} (${e.message})` - ); + logger.warn(`Failed to create ${this._activePortPath} (${e.message})`); } } @@ -127,11 +118,9 @@ class CDP { try { try { - await IOUtils.remove(this._devToolsActivePortPath); + await IOUtils.remove(this._activePortPath); } catch (e) { - logger.warn( - `Failed to remove ${this._devToolsActivePortPath} (${e.message})` - ); + logger.warn(`Failed to remove ${this._activePortPath} (${e.message})`); } this.targetList?.destructor(); diff --git a/remote/components/Marionette.jsm b/remote/components/Marionette.jsm index dad7e57c354a..788896a6b18a 100644 --- a/remote/components/Marionette.jsm +++ b/remote/components/Marionette.jsm @@ -70,7 +70,7 @@ const isRemote = class MarionetteParentProcess { constructor() { this.server = null; - this._marionetteActivePortPath; + this._activePortPath; this.classID = Components.ID("{786a1369-dca5-4adc-8486-33d23c88010a}"); this.helpInfo = " --marionette Enable remote control server.\n"; @@ -298,21 +298,13 @@ class MarionetteParentProcess { // Write Marionette port to MarionetteActivePort file within the profile. const profileDir = await PathUtils.getProfileDir(); - this._marionetteActivePortPath = PathUtils.join( - profileDir, - "MarionetteActivePort" - ); + this._activePortPath = PathUtils.join(profileDir, "MarionetteActivePort"); const data = `${this.server.port}`; try { - await IOUtils.write( - this._marionetteActivePortPath, - textEncoder.encode(data) - ); + await IOUtils.write(this._activePortPath, textEncoder.encode(data)); } catch (e) { - logger.warn( - `Failed to create ${this._marionetteActivePortPath} (${e.message})` - ); + logger.warn(`Failed to create ${this._activePortPath} (${e.message})`); } }); } @@ -324,11 +316,9 @@ class MarionetteParentProcess { logger.debug("Marionette stopped listening"); try { - await IOUtils.remove(this._marionetteActivePortPath); + await IOUtils.remove(this._activePortPath); } catch (e) { - logger.warn( - `Failed to remove ${this._marionetteActivePortPath} (${e.message})` - ); + logger.warn(`Failed to remove ${this._activePortPath} (${e.message})`); } } }