Closed Bug 1644349 Opened 4 years ago Closed 4 years ago

Remove usage of windowIdToFrameIdMap in the Network observer

Categories

(Remote Protocol :: CDP, enhancement, P1)

enhancement

Tracking

(Fission Milestone:Future, firefox80 fixed)

RESOLVED FIXED
Firefox 80
Fission Milestone Future
Tracking Status
firefox80 --- fixed

People

(Reporter: whimboo, Assigned: whimboo)

Details

Attachments

(1 file)

Currently we use a Map to translate the inner window id to the browsing context id of the frame where the network activity takes place:

https://searchfox.org/mozilla-central/rev/35b97af64a55d1d30caa4d6e9fabc1a7fbabc509/remote/observers/NetworkObserver.jsm#57

As I just noticed this map is not necessary. Instead we can use the httpChannel.loadInfo.frameBrowsingContextID to identify the frame id for the sub requests.

(In reply to Henrik Skupin (:whimboo) [⌚️UTC+2] from comment #0)

As I just noticed this map is not necessary. Instead we can use the httpChannel.loadInfo.frameBrowsingContextID to identify the frame id for the sub requests.

IIUC, this is a cleanup bug and doesn't need to block shipping Fission MVP.

Fission Milestone: --- → Future

I had a quick check and it actually doesn't seem to be that trivial. I still see null objects for the frameBrowsingContext. So maybe it might not be possible. But further investigation needs to be done here.

Bug 1580764 just added support for the frameId to the ChannelWrapper interface. As such we should be able to get rid of our custom map.

Summary: Replace windowIdToFrameIdMap with frameBrowsingContextID in NetworkObserver.jsm → Replace windowIdToFrameIdMap with ChannelWrapper.frameId

Actually frameId will be 0 for the top-browsing context. It means that for resource requests/responses we won't have a valid number. But we can actually make use of the browsingContext and frameBrowsingContext properties on the httpChannel.loadInfo object.

Summary: Replace windowIdToFrameIdMap with ChannelWrapper.frameId → Remove usage of windowIdToFrameIdMap in Network domain
Assignee: nobody → hskupin
Status: NEW → ASSIGNED
Assignee: hskupin → nobody
Status: ASSIGNED → NEW
Summary: Remove usage of windowIdToFrameIdMap in Network domain → Remove usage of windowIdToFrameIdMap in the Network observer
Assignee: nobody → hskupin
Status: NEW → ASSIGNED
Priority: P3 → P1
Pushed by hskupin@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/9f5272f4fb43
[remote] Remove usage of windowIdToFrameIdMap in the Network observer. r=remote-protocol-reviewers,maja_zf
Status: ASSIGNED → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 80
Component: CDP: Network → CDP
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: