Closed Bug 1800838 Opened 3 years ago Closed 3 years ago

Move request blocking outside of the NetworkEvent payload creation

Categories

(DevTools :: Netmonitor, task, P3)

task

Tracking

(firefox109 fixed)

RESOLVED FIXED
109 Branch
Tracking Status
firefox109 --- fixed

People

(Reporter: jdescottes, Assigned: jdescottes)

References

(Blocks 1 open bug)

Details

Attachments

(3 files)

At the moment, the actual call to nsIChannel.cancel for blocked requests happens in the middle of NetworkUtils' createNetworkEvent. Other than this, this method is purely dedicated to building an event payload (mostly renaming and aggregating properties from the Channel), so it's very unexpected to perform the call to cancel here.

At the very least this should move to NetworkObserver, who owns the list of blocked URLs, and preferably it should be handled at specific points of the request's lifecycle, not in a generic event creation method.

Also note that we rebuild URL pattern regexps each and every time we need to check for request blocking. We should probably build the regexps once, when a blocked URL is added.

This helper was duplicated in many tests.

Pushed by jdescottes@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/d9a7d7c2d92d [devtools] Add shared helper for typing in netmonitor r=bomsy https://hg.mozilla.org/integration/autoland/rev/317936ce53ce [devtools] Request blocking should not be handled in the middle of NetworkEvent payload creation r=bomsy https://hg.mozilla.org/integration/autoland/rev/b048606f56cd [devtools] Do not create new request blocking regexp for each and every channel 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: