Bug 1933428 - Part 3: Recompute partitionKey for top-level documents if required. r=bvandersloot,smaug

The principal of a document might be changed during loading in certain
situation, e.g. a sandboxed document. In this case, we need to recompute
the partitionKey of the document to reflect the change on the principal.

Differential Revision: https://phabricator.services.mozilla.com/D230819
This commit is contained in:
Tim Huang
2025-01-07 10:39:57 +00:00
parent 2726d6d18a
commit 254411e25e
3 changed files with 69 additions and 2 deletions

View File

@@ -4208,6 +4208,12 @@ class Document : public nsINode,
// the state was changed.
bool RecomputeResistFingerprinting();
// Recompute the partitionKey for this document if needed. This is for
// handling the case where the principal of the document is changed during the
// loading, e.g. a sandboxed document. We only need to recompute for the
// top-level content document.
void MaybeRecomputePartitionKey();
void RecordCanvasUsage(CanvasUsage& aUsage);
void RecordFontFingerprinting();