Closed Bug 1747805 Opened 4 years ago Closed 3 years ago

NETWORK_EVENT resources are always flagged with the top level target front/innerWindowId

Categories

(DevTools :: Netmonitor, defect)

defect

Tracking

(firefox97 fixed)

RESOLVED FIXED
97 Branch
Tracking Status
firefox97 --- fixed

People

(Reporter: ochameau, Assigned: ochameau)

References

Details

Attachments

(1 file)

All NETWORK_EVENT resources for iframe requests are flagged with the wrong innerWindowId because of the following typo:
https://searchfox.org/mozilla-central/rev/e74a8e2d1dedebfe47a6afb009ddabdeea12694b/devtools/server/actors/network-monitor/utils/network-utils.js#110

    return channel.loadInfo.innerWindowId;

Because nsILoadInfo exposes the id with this wording:
https://searchfox.org/mozilla-central/source/netwerk/base/nsILoadInfo.idl#759

 [infallible] readonly attribute unsigned long long innerWindowID;

Because of that the targetFront attribute of each iframe's NETWORK_EVENT was always the top level target front.
I'm not sure it translate into any user visible bug, but we weren't clearing requests of iframe when the iframe is removed:
https://searchfox.org/mozilla-central/rev/e74a8e2d1dedebfe47a6afb009ddabdeea12694b/devtools/server/actors/resources/network-events.js#177

        if (child.innerWindowId == innerWindowId) {

So fixing this we will start destroying the NetworkEventActor when iframes are removed, this can translate into blank sidebars in netmonitor when persist is OFF.
We may tune the NetworkEventActor cleanup code if we consider that's wrong.

This also fixes the targetFront attribute for NETWORK_EVENT resources of iframes.

Pushed by apoirot@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/4ea2e2e52761 [devtools] Fix NETWORK_EVENT's innerWindowID and clear requests of iframe when they get destroyed. r=nchevobbe
Status: NEW → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → 97 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: