Closed Bug 1750791 Opened 4 years ago Closed 4 years ago

Define a max capacity in UntrustedModulesBackupData

Categories

(Core :: DLL Services, enhancement)

Unspecified
Windows
enhancement

Tracking

()

RESOLVED FIXED
99 Branch
Tracking Status
firefox99 --- fixed

People

(Reporter: toshi, Assigned: toshi)

References

Details

Attachments

(4 files)

We should limit the number of loading events stored in UntrustedModulesBackupData, otherwise the process consumes high memory if a third-party application injects their modules repeatedly as we saw in Bug 1747980.

This patch chnages the type of UntrustedModulesData::mEvents from
Vector to AutoCleanLinkedList. The purpose of this is for
UntrustedModulesBackupService to splice data easier and to discard
old loading events, which will be implemented in a subsequent patch.

Depends on D137244

UntrustedModulesBackupService manages two UntrustedModulesBackupData
instances to hold third-party module loading events. We can simply have
two members instead of an array of two items, that makes the code more
readable.

Depends on D137245

We use third-party loading events data for two purposes. One is to
send it as the third-party-modules ping. The other is to display it
on about:third-party. Currently we keep all loading events in memory,
but it may consume too much memory if modules injection happens too
often intentionally or unintentionally.

This patch is to discard old loading events after telemetry submission,
and also drops stack information after telemetry submission because
about:third-party does not use stack information.

Depends on D137246

Pushed by tkikuchi@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/c08b55356c5a Part 1: Add LinkedList::mergeBack and LinkedList::splice. r=glandium https://hg.mozilla.org/integration/autoland/rev/43a5f02b1160 Part 2: Convert UntrustedModulesData::mEvents to a linked list. r=mhowell https://hg.mozilla.org/integration/autoland/rev/dd59fbaa406a Part 3: Simplify UntrustedModulesBackupService. r=mhowell https://hg.mozilla.org/integration/autoland/rev/a82e42146aed Part 4: Reduce backup data of module loading events. r=mhowell
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: