Open Bug 1720732 Opened 3 years ago Updated 3 years ago

Fix out of order resources

Categories

(DevTools :: Framework, enhancement)

enhancement

Tracking

(Not tracked)

People

(Reporter: ochameau, Assigned: ochameau, NeedInfo)

References

Details

Attachments

(1 file)

https://searchfox.org/mozilla-central/source/devtools/shared/commands/resource/resource-command.js#571-573

  async _onResourceAvailable({ targetFront, watcherFront }, resources) {
    [...]
    for (let resource of resources) {
      [...]
      if (watcherFront) {
        targetFront = await this._getTargetForWatcherResource(resource);
      }

This async call to _getTargetForWatcherResource may potentialy delay some resources, introducing some unwanted delay between resource reception by ResourceCommand, and their addition to the throttling queue.
Because of this resources having some async delay here may be added out of order in the throttling queue.
This was something we identified in bug 1717050 and was quite puzzling.

This helps ResourceCommand immediately throttle parent process resources.
Without this, when we don't have server side target switching enabled,
and still create the top level target via the TabDescriptor, we are still
asynchronous and this can be confusing from ResourceCommand.onResourceAvailable.

May be we could have two versions of this function?
One synchronous for ResourceCommand and another, more powerful but async
for inspector codebase (which should also work for BC ids of same-process iframes).

There's a r+ patch which didn't land and no activity in this bug for 2 weeks.
:ochameau, could you have a look please?
For more information, please visit auto_nag documentation.

Flags: needinfo?(poirot.alex)
Flags: needinfo?(jdescottes)
Flags: needinfo?(jdescottes)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: