Closed Bug 1641162 Opened 8 months ago Closed 8 months ago

TargetList getAllTargets should accept an array of types as argument

Categories

(DevTools :: General, task, P3)

task

Tracking

(firefox78 fixed)

RESOLVED FIXED
Firefox 78
Tracking Status
firefox78 --- fixed

People

(Reporter: jdescottes, Assigned: jdescottes)

Details

Attachments

(1 file)

See https://phabricator.services.mozilla.com/D65528#inline-444551

getAllTargets only takes a single resource type as argument, so if you want really all targets you need to iterate twice:

    for (const targetType of this.targetList.ALL_TYPES) {
      // XXX: May be expose a getReallyAllTarget() on TargetList?
      for (const target of this.targetList.getAllTargets(targetType)) {
        // do something with the target...
      }
    }

could be replaced with

for (const target of this.targetList.getAllTargets(this.targetList.ALL_TYPES)) {
  // do something with the target...
}
Pushed by jdescottes@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/d115cc66c9e8
Use an array of types as argument for TargetList::getAllTargets r=nchevobbe
Status: NEW → RESOLVED
Closed: 8 months ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 78
You need to log in before you can comment on or make changes to this bug.