Move request blocking outside of the NetworkEvent payload creation
Categories
(DevTools :: Netmonitor, task, P3)
Tracking
(firefox109 fixed)
| 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.
| Assignee | ||
Comment 1•3 years ago
|
||
Depends on D162195
| Assignee | ||
Comment 2•3 years ago
|
||
Depends on D162204
| Assignee | ||
Comment 3•3 years ago
|
||
This helper was duplicated in many tests.
Comment 5•3 years ago
|
||
| bugherder | ||
https://hg.mozilla.org/mozilla-central/rev/d9a7d7c2d92d
https://hg.mozilla.org/mozilla-central/rev/317936ce53ce
https://hg.mozilla.org/mozilla-central/rev/b048606f56cd
Description
•