Closed Bug 1800833 Opened 3 years ago Closed 3 years ago

Simplify NetworkObserver handling of response cookies and headers

Categories

(DevTools :: Netmonitor, task)

task

Tracking

(firefox109 fixed)

RESOLVED FIXED
109 Branch
Tracking Status
firefox109 --- fixed

People

(Reporter: jdescottes, Assigned: jdescottes)

References

(Blocks 1 open bug)

Details

Attachments

(2 files)

At the moment, response cookies and headers are a shared responsibility between NetworkObserver and NetworkResponseListener, and require a lot of boilerplate to work.

First of all we have the #openResponses property of NetworkObserver which is a ChannelMap instance containing "response" objects. Those "response" seem to contain a lot of information (id, channel, httpVersion, status, statusText, cookies and headers) but only cookies and headers are actually used. So we could simplify the object.

Then the main issue is that #openResponses are owned and filled by NetworkObserver, but the NetworkResponseListener is responsible for reading it and notifying the consumer about potential response cookies and headers. Ideally, we should move that responsibility back to NetworkObserver, it's not clear why we can't simply notify consumers when we collect the response cookies and headers, which consistently happens in NetworkObserver:#httpResponseExaminer

Status: NEW → ASSIGNED
Pushed by jdescottes@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/05df30e6f7e9 [devtools] Clarify the content of networkObserver's openResponses r=bomsy https://hg.mozilla.org/integration/autoland/rev/a548d0e36104 [devtools] Notify about response cookies and headers from NetworkObserver directly r=bomsy
Status: ASSIGNED → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → 109 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: