Closed Bug 1745758 Opened 2 years ago Closed 1 year ago

[DNR] Prototype of rule evaluation engine

Categories

(WebExtensions :: Request Handling, enhancement, P1)

enhancement
Points:
5

Tracking

(firefox108 fixed)

RESOLVED FIXED
108 Branch
Tracking Status
firefox108 --- fixed

People

(Reporter: robwu, Assigned: robwu)

References

(Blocks 3 open bugs)

Details

(Whiteboard: [mv3-m2])

Attachments

(2 files)

The declarativeNetRequest API specifies a set of rules (conditions + actions) to apply to network requests, but does not prescribe the exact algorithm. In order to enable experimentation of different algorithms, I'll start the patch stack with a non-optimized implementation of a rule evaluation engine and use that to implement the different parts of the DNR API at a functional level. With a functioning API, it will be easier to refactor the algorithm without major changes to unit tests or performance tests.

The evaluation engine takes a registered set of rules, evaluates the conditions and applies the relevant actions.

The matching algorithm of the prototype is not optimized and not final, and merely exists to prepare the other parts of the DNR API.

Flags: needinfo?(mdrahulkhan2021)
Flags: needinfo?(mdrahulkhan2021)
Points: --- → 5
Points: 5 → 8
Depends on: 1780747
Points: 8 → 5
Blocks: 1782685
Blocks: 1786059

This patch provides a rule evaluation engine for the DNR extension API,
using a naive linear API to evaluate rules for a given request.

The main purpose of this is to offer DNR functionality for relatively
simple use cases, as the more complex ones are likely going to use the
blocking webRequest API instead.

And added "TODO bug 1797376" to the hostname format in Schemas.jsm,
because the implementation does not match the name. Because of that,
this patch introduces the new "canonicalDomain" schema format.

Blocks: 1798225
Pushed by rob@robwu.nl:
https://hg.mozilla.org/integration/autoland/rev/588516a44335
Add DNR rule evaluation engine r=rpl
https://hg.mozilla.org/integration/autoland/rev/e0ceef9dd1ae
Add DNR domain condition validation + matching r=rpl

Backed out for causing xpc failures in toolkit/components/extensions/test/xpcshell/test_ext_dnr_testMatchOutcome.js

Backout link: https://hg.mozilla.org/integration/autoland/rev/dc344f30a13a1cdfb51232a67fff9284310609eb

Push with failures

Failure log

TEST-UNEXPECTED-TIMEOUT | xpcshell-remote.ini:toolkit/components/extensions/test/xpcshell/test_ext_dnr_testMatchOutcome.js | Test timed out
Flags: needinfo?(rob)
Flags: needinfo?(rob)
Pushed by rob@robwu.nl:
https://hg.mozilla.org/integration/autoland/rev/fd3dcd9ca329
Add DNR rule evaluation engine r=rpl
https://hg.mozilla.org/integration/autoland/rev/5e048345ff64
Add DNR domain condition validation + matching r=rpl
Status: ASSIGNED → RESOLVED
Closed: 1 year ago
Resolution: --- → FIXED
Target Milestone: --- → 108 Branch
You need to log in before you can comment on or make changes to this bug.