Closed Bug 1759579 Opened 2 years ago Closed 2 years ago

Improve performance of cookiesAllowedForDomainOrSubDomain check in Sanitizer.jsm

Categories

(Toolkit :: Data Sanitization, enhancement, P2)

enhancement

Tracking

()

RESOLVED FIXED
101 Branch
Tracking Status
firefox101 --- fixed

People

(Reporter: pbz, Assigned: h.sofie.p)

References

Details

Attachments

(2 files)

We're landing a simple performance optimization in Bug 1755190 by only querying "cookie" permissions from the permission manager, rather than all permissions.

This is bug is for optimizing this method further. Here are a few improvements we could make:

  1. Check if cookiesAllowedForDomainOrSubDomain gets passed duplicate principals. We can already do deduplication in the PrincipalsCollector
  2. Only get array of permissions via Services.perms.getByTypePrefix once from the permission manager and reuse the array in subsequent checks for the other principals.
  3. (Refactor to iterative rather than recursive approach)
Attachment #9268463 - Attachment description: WIP: Bug 1759579 - Improve performace of (sub)domain cookie permission check in sanitizeOnShutdown. r=pbz! → Bug 1759579 - Improve performace of (sub)domain cookie permission check in sanitizeOnShutdown. r=pbz!
Pushed by hpeuckmann@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/a54f17b63dbc
Improve performace of (sub)domain cookie permission check in sanitizeOnShutdown. r=pbz
https://hg.mozilla.org/integration/autoland/rev/d60011405047
Remove recursion from (sub)domain cookie check. r=pbz
Status: ASSIGNED → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 101 Branch
Regressions: 1766223
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: