tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

commit 5db892a2175c8a347b3f0f4f5d1417e50da9f750
parent ac643c1f38b5b620fd8461f34ea242f03e0d82fb
Author: agoloman <agoloman@mozilla.com>
Date:   Tue, 30 Sep 2025 16:58:33 +0300

Revert "Bug 1990514: Promote Screen Available Resolution and Touch Points to Baseline FPP in Nightly r=timhuang" for causing build bustages @nsRFPService.cpp.

This reverts commit 0b7f4fdfe04395efacf2acbc8cc0274b3c88f77e.

Revert "Bug 1990514: Support Nightly ifdefs in RFPTargetDefaults.inc r=timhuang"

This reverts commit bfe8ed97fbf1f1ef63138fcda9e83c145c5603f3.

Diffstat:
Mtoolkit/components/resistfingerprinting/RFPTargetsDefault.inc | 3---
Mtoolkit/components/resistfingerprinting/RFPTargetsDefaultBaseline.inc | 14++------------
Mtoolkit/components/resistfingerprinting/extract_rfp_targets.py | 45++++++++-------------------------------------
Mtoolkit/components/resistfingerprinting/nsRFPService.cpp | 2+-
4 files changed, 11 insertions(+), 53 deletions(-)

diff --git a/toolkit/components/resistfingerprinting/RFPTargetsDefault.inc b/toolkit/components/resistfingerprinting/RFPTargetsDefault.inc @@ -3,9 +3,6 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ -// #ifdef NIGHTLY_BUILD is supported as a preprocessor macro. -// If any others are needed, update extract_rfp_targets.py - DESKTOP_DEFAULT(CanvasRandomization) DESKTOP_DEFAULT(FontVisibilityLangPack) DESKTOP_DEFAULT(JSMathFdlibm) diff --git a/toolkit/components/resistfingerprinting/RFPTargetsDefaultBaseline.inc b/toolkit/components/resistfingerprinting/RFPTargetsDefaultBaseline.inc @@ -3,15 +3,4 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ -// #ifdef NIGHTLY_BUILD is supported as a preprocessor macro. -// If any others are needed, update extract_rfp_targets.py - -#ifdef NIGHTLY_BUILD -DESKTOP_DEFAULT(ScreenAvailToResolution) -DESKTOP_DEFAULT(MaxTouchPointsCollapse) -#endif - -#ifdef NIGHTLY_BUILD -ANDROID_DEFAULT(ScreenAvailToResolution) -ANDROID_DEFAULT(MaxTouchPointsCollapse) -#endif +// So far, just a placeholder file. +\ No newline at end of file diff --git a/toolkit/components/resistfingerprinting/extract_rfp_targets.py b/toolkit/components/resistfingerprinting/extract_rfp_targets.py @@ -1,37 +1,19 @@ import re from collections import defaultdict -import buildconfig - -def parse_defaults(path, is_nightly: bool): +def parse_defaults(path): pattern = re.compile(r"(DESKTOP_DEFAULT|ANDROID_DEFAULT)\((.+)\)") + contents = "" with open(path) as f: contents = f.read() - defaults = defaultdict(list) - - inside_nightly = False - for line in contents.splitlines(): - line = line.strip() - - if line.startswith("#ifdef NIGHTLY_BUILD"): - inside_nightly = True - continue - if line.startswith("#endif"): - inside_nightly = False - continue - - # Skip lines inside NIGHTLY_BUILD block if not nightly - if inside_nightly and not is_nightly: - continue - - match = pattern.search(line) - if match: - platform = match.group(1) - target = match.group(2) - defaults[platform].append(target) + defaults = defaultdict(lambda: []) + for match in pattern.finditer(contents): + platform = match.group(1) + target = match.group(2) + defaults[platform].append(target) return defaults @@ -81,24 +63,13 @@ def write_targets(output, targets): def main(output, targets_path, defaults_base_path, defaults_fpp_path): - is_nightly = buildconfig.substs["MOZ_UPDATE_CHANNEL"] not in ( - "beta", - "release", - "esr", - ) output.write("// This is a generated file. Please do not edit.\n") output.write( f"// See extract_rfp_targets.py, {targets_path}, {defaults_base_path}, {defaults_fpp_path} files instead.\n" ) - output.write( - "// Update channel is %s, classified as%s nightly\n\n" - % (buildconfig.substs["MOZ_UPDATE_CHANNEL"], "" if is_nightly else " not") - ) write_targets(output, parse_targets(targets_path)) output.write("\n") write_defaults( - output, - parse_defaults(defaults_base_path, is_nightly), - parse_defaults(defaults_fpp_path, is_nightly), + output, parse_defaults(defaults_base_path), parse_defaults(defaults_fpp_path) ) diff --git a/toolkit/components/resistfingerprinting/nsRFPService.cpp b/toolkit/components/resistfingerprinting/nsRFPService.cpp @@ -148,7 +148,7 @@ static constexpr uint32_t kVideoDroppedRatio = 1; # define DESKTOP_DEFAULT(name) RFPTarget::name, #endif -MOZ_RUNINIT const RFPTargetSet kDefaultFingerprintingProtectionsBase = { +MOZ_CONSTINIT const RFPTargetSet kDefaultFingerprintingProtectionsBase = { #include "RFPTargetsDefaultBaseline.inc" };