Bug 1896372: Extract defaults to RFPTargetsDefault.inc. r=tjr

Differential Revision: https://phabricator.services.mozilla.com/D210167
This commit is contained in:
Fatih 2024-05-28 14:31:36 +00:00
parent 1941c91cd1
commit 652290b683
2 changed files with 22 additions and 4 deletions

View file

@ -0,0 +1,9 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
* 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/. */
DESKTOP_DEFAULT(CanvasRandomization)
DESKTOP_DEFAULT(FontVisibilityLangPack)
ANDROID_DEFAULT(CanvasRandomization)

View file

@ -126,13 +126,22 @@ static constexpr uint32_t kVideoDroppedRatio = 5;
// Fingerprinting protections that are enabled by default. This can be
// overridden using the privacy.fingerprintingProtection.overrides pref.
#if defined(MOZ_WIDGET_ANDROID)
const RFPTarget kDefaultFingerprintingProtections =
RFPTarget::CanvasRandomization;
// NOLINTNEXTLINE(bugprone-macro-parentheses)
# define ANDROID_DEFAULT(name) RFPTarget::name |
# define DESKTOP_DEFAULT(name)
#else
const RFPTarget kDefaultFingerprintingProtections =
RFPTarget::CanvasRandomization | RFPTarget::FontVisibilityLangPack;
# define ANDROID_DEFAULT(name)
// NOLINTNEXTLINE(bugprone-macro-parentheses)
# define DESKTOP_DEFAULT(name) RFPTarget::name |
#endif
const RFPTarget kDefaultFingerprintingProtections =
#include "RFPTargetsDefault.inc"
static_cast<RFPTarget>(0);
#undef ANDROID_DEFAULT
#undef DESKTOP_DEFAULT
static constexpr uint32_t kSuspiciousFingerprintingActivityThreshold = 1;
// ============================================================================