Skip to content

Instantly share code, notes, and snippets.

@Trikolon
Created February 14, 2023 12:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Trikolon/bf998eabc5efe8ded7d69e3d9ef266f8 to your computer and use it in GitHub Desktop.
Save Trikolon/bf998eabc5efe8ded7d69e3d9ef266f8 to your computer and use it in GitHub Desktop.
# HG changeset patch
# User Paul Zuehlcke <pbz@mozilla.com>
# Date 1676375052 -3600
# Tue Feb 14 12:44:12 2023 +0100
# Node ID f9f9cdb9638775fb3f5f800faf2c75c860e717bd
# Parent f45ac8766b6167ecd4adc81490f8f9b927472200
Bug 1816279 - Fix range being ignored for data clearing. r=Gijs!
diff --git a/browser/modules/Sanitizer.sys.mjs b/browser/modules/Sanitizer.sys.mjs
--- a/browser/modules/Sanitizer.sys.mjs
+++ b/browser/modules/Sanitizer.sys.mjs
@@ -810,22 +810,29 @@ async function sanitizeInternal(items, a
for (let name of itemsToClear) {
progress[name] = "blocking";
let item = items[name];
+
+ let itemOptions = {
+ ...options,
+ progress: progress[name + "Progress"],
+ // Some cleaners use this field as a signal for shutdown clearing, only
+ // pass it if it's actually required by the cleaner.
+ principalsForShutdownClearing: item.shouldClearPerPrincipal(
+ progress.clearHonoringExceptions
+ )
+ ? options.principalsForShutdownClearing
+ : undefined,
+ };
try {
// Catch errors here, so later we can just loop through these.
handles.push({
name,
- promise: item
- .clear(
- range,
- Object.assign(options, { progress: progress[name + "Progress"] })
- )
- .then(
- () => {
- progress[name] = "cleared";
- delete progress[name + "Progress"];
- },
- ex => annotateError(name, ex)
- ),
+ promise: item.clear(range, itemOptions).then(
+ () => {
+ progress[name] = "cleared";
+ delete progress[name + "Progress"];
+ },
+ ex => annotateError(name, ex)
+ ),
});
} catch (ex) {
annotateError(name, ex);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment