Bug 1696374 - [devtools] Renamed TargetList occurences to TargetCommand. r=nchevobbe

Differential Revision: https://phabricator.services.mozilla.com/D110386
This commit is contained in:
Alexandre Poirot 2021-04-12 07:59:52 +00:00
parent 574ca1a76e
commit c3fb794451
10 changed files with 17 additions and 17 deletions

View File

@ -24,7 +24,7 @@ class BrowsingContextTargetFront extends TargetMixin(
// For other targets, _javascriptEnabled will be updated everytime
// `reconfigure` is called.
// Note: this property is marked as private but is accessed by the
// TargetList to provide the "isJavascriptEnabled" wrapper. It should NOT be
// TargetCommand to provide the "isJavascriptEnabled" wrapper. It should NOT be
// used anywhere else.
this._javascriptEnabled = null;

View File

@ -6,7 +6,7 @@
/**
* WalkerEventListener provides a mechanism to listen the walker event of the inspector
* while reflecting the updating of TargetList.
* while reflecting the updating of TargetCommand.
*/
class WalkerEventListener {
/**

View File

@ -133,7 +133,7 @@ async function navigateIframeTo(inspector, url) {
await inspector.markup._waitForChildren();
if (isFissionEnabled()) {
info("Wait until the new target has been processed by TargetList");
info("Wait until the new target has been processed by TargetCommand");
await onTargetProcessed;
}
@ -142,7 +142,7 @@ async function navigateIframeTo(inspector, url) {
}
/**
* Returns a promise that waits until the provided commands's TargetList has fully
* Returns a promise that waits until the provided commands's TargetCommand has fully
* processed a target with the provided URL.
* This will avoid navigating again before the new resource watchers have fully
* attached to the new target.

View File

@ -135,7 +135,7 @@ StyleEditorUI.prototype = {
},
/**
* Initiates the style editor ui creation, and start to track TargetList updates.
* Initiates the style editor ui creation, and start to track TargetCommand updates.
*/
async initialize() {
this.createUI();

View File

@ -77,7 +77,7 @@ class BrowserConsole extends WebConsole {
await super.init(false);
// Reports the console as created only after everything is done,
// including TargetList.startListening.
// including TargetCommand.startListening.
const id = Utils.supportsString(this.hudId);
Services.obs.notifyObservers(id, "web-console-created");
})();

View File

@ -148,7 +148,7 @@ class WebConsoleUI {
this._initializer = (async () => {
this._initUI();
// Bug 1605763: It's important to call _attachTargets once the UI is initialized, as
// TargetList.startListening will start fetching additional targets
// TargetCommand.startListening will start fetching additional targets
// and may overload the Browser Console.
await this._attachTargets();
@ -334,12 +334,12 @@ class WebConsoleUI {
if (this.isBrowserConsole) {
// Bug 1605763:
// TargetList.startListening will start fetching additional targets
// TargetCommand.startListening will start fetching additional targets
// and may overload the Browser Console with loads of targets and resources.
// We can call it from here, as `_attchTargets` is called after the UI is initialized.
// Bug 1642599:
// TargetList.startListening ought to be called before watching for resources,
// in order to set TargetList.watcherFront which is used by ResourceWatcher.watchResources.
// TargetCommand.startListening ought to be called before watching for resources,
// in order to set TargetCommand.watcherFront which is used by ResourceWatcher.watchResources.
await this.hud.commands.targetCommand.startListening();
}

View File

@ -169,7 +169,7 @@ exports.WatcherActor = protocol.ActorClassWithSpec(watcherSpec, {
[Resources.TYPES.WEBSOCKET]: hasBrowserElement,
},
// @backward-compat { version 85 } When removing this trait, consumers using
// the TargetList to retrieve the Breakpoints front should still be careful to check
// the TargetCommand to retrieve the Breakpoints front should still be careful to check
// that the Watcher is available
"set-breakpoints": true,
// @backward-compat { version 87 } Starting with FF87, if the watcher is

View File

@ -184,7 +184,7 @@ class LegacyServiceWorkersWatcher extends LegacyWorkersWatcher {
// if worker registrations are no longer available.
if (this.targetCommand.isTargetRegistered(target)) {
// Only emit onTargetDestroyed if it wasn't already done by
// onNavigate (ie the target is still tracked by TargetList)
// onNavigate (ie the target is still tracked by TargetCommand)
this.onTargetDestroyed(target);
}
// Here we only care about service workers which no longer match *any*

View File

@ -208,7 +208,7 @@ class LegacyWorkersWatcher {
// Cleanup the targetsByProcess/targetsListeners maps, and unsubscribe from
// all targetFronts. Process target fronts are either stored locally when
// watching service workers for the content toolbox, or can be retrieved via
// the TargetList API otherwise (see _getProcessTargets implementations).
// the TargetCommand API otherwise (see _getProcessTargets implementations).
if (this.target.isParentProcess || this._isServiceWorkerWatcher) {
for (const targetFront of this._getProcessTargets()) {
const listener = this.targetsListeners.get(targetFront);

View File

@ -267,7 +267,7 @@ class ResourceWatcher {
* Start watching for all already existing and future targets.
*
* We are using ALL_TYPES, but this won't force listening to all types.
* It will only listen for types which are defined by `TargetList.startListening`.
* It will only listen for types which are defined by `TargetCommand.startListening`.
*/
async _watchAllTargets() {
if (!this._watchTargetsPromise) {
@ -293,7 +293,7 @@ class ResourceWatcher {
}
/**
* Method called by the TargetList for each already existing or target which has just been created.
* Method called by the TargetCommand for each already existing or target which has just been created.
*
* @param {Front} targetFront
* The Front of the target that is available.
@ -354,7 +354,7 @@ class ResourceWatcher {
}
}
// Compared to the TargetList and Watcher.watchTargets,
// Compared to the TargetCommand and Watcher.watchTargets,
// We do call Watcher.watchResources, but the events are fired on the target.
// That's because the Watcher runs in the parent process/main thread, while resources
// are available from the target's process/thread.
@ -395,7 +395,7 @@ class ResourceWatcher {
}
/**
* Method called by the TargetList when a target has just been destroyed
* Method called by the TargetCommand when a target has just been destroyed
* See _onTargetAvailable for arguments, they are the same.
*/
_onTargetDestroyed({ targetFront }) {