Backed out 5 changesets (bug 1940797, bug 1940800, bug 1940819, bug 1939881, bug 1939903) for causing build bustages in ContentChild.cpp CLOSED TREE
Backed out changeset f632ead9f4bd (bug 1939903) Backed out changeset 30e9f5c7c5b7 (bug 1940800) Backed out changeset 7ce4c97719aa (bug 1940797) Backed out changeset f994cb8875ff (bug 1939881) Backed out changeset ac7780c78455 (bug 1940819)
This commit is contained in:
@@ -14,6 +14,7 @@
|
||||
#include "mozilla/dom/Document.h"
|
||||
#include "mozilla/dom/UserActivationIPCUtils.h"
|
||||
#include "mozilla/PermissionDelegateIPCUtils.h"
|
||||
#include "mozilla/RFPTargetIPCUtils.h"
|
||||
#include "mozilla/StaticPrefs_dom.h"
|
||||
#include "mozilla/StaticPtr.h"
|
||||
#include "mozilla/ClearOnShutdown.h"
|
||||
@@ -21,7 +22,6 @@
|
||||
#include "nsIScriptError.h"
|
||||
#include "nsIWebProgressListener.h"
|
||||
#include "nsIXULRuntime.h"
|
||||
#include "nsRFPTargetSetIDL.h"
|
||||
#include "nsRefPtrHashtable.h"
|
||||
#include "nsContentUtils.h"
|
||||
|
||||
@@ -78,19 +78,6 @@ bool WindowContext::IsInBFCache() {
|
||||
return TopWindowContext()->GetWindowStateSaved();
|
||||
}
|
||||
|
||||
already_AddRefed<nsIRFPTargetSetIDL>
|
||||
WindowContext::GetOverriddenFingerprintingSettingsWebIDL() const {
|
||||
Maybe<RFPTargetSet> overriddenFingerprintingSettings =
|
||||
GetOverriddenFingerprintingSettings();
|
||||
if (overriddenFingerprintingSettings.isNothing()) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
nsCOMPtr<nsIRFPTargetSetIDL> protections =
|
||||
new nsRFPTargetSetIDL(overriddenFingerprintingSettings.ref());
|
||||
return protections.forget();
|
||||
}
|
||||
|
||||
nsGlobalWindowInner* WindowContext::GetInnerWindow() const {
|
||||
return mWindowGlobalChild ? mWindowGlobalChild->GetWindowGlobal() : nullptr;
|
||||
}
|
||||
@@ -254,7 +241,7 @@ bool WindowContext::CanSet(FieldIndex<IDX_ShouldResistFingerprinting>,
|
||||
}
|
||||
|
||||
bool WindowContext::CanSet(FieldIndex<IDX_OverriddenFingerprintingSettings>,
|
||||
const Maybe<RFPTargetSet>& aValue,
|
||||
const Maybe<RFPTarget>& aValue,
|
||||
ContentParent* aSource) {
|
||||
return CheckOnlyOwningProcessCanSet(aSource);
|
||||
}
|
||||
|
||||
@@ -23,7 +23,6 @@ class nsGlobalWindowInner;
|
||||
|
||||
namespace mozilla {
|
||||
class LogModule;
|
||||
class nsRFPTargetSetIDL;
|
||||
|
||||
namespace dom {
|
||||
|
||||
@@ -56,7 +55,7 @@ class BrowsingContextGroup;
|
||||
* the Storage Access API */ \
|
||||
FIELD(UsingStorageAccess, bool) \
|
||||
FIELD(ShouldResistFingerprinting, bool) \
|
||||
FIELD(OverriddenFingerprintingSettings, Maybe<RFPTargetSet>) \
|
||||
FIELD(OverriddenFingerprintingSettings, Maybe<RFPTarget>) \
|
||||
FIELD(IsSecureContext, bool) \
|
||||
FIELD(IsOriginalFrameSource, bool) \
|
||||
/* Mixed-Content: If the corresponding documentURI is https, \
|
||||
@@ -140,8 +139,15 @@ class WindowContext : public nsISupports, public nsWrapperCache {
|
||||
|
||||
bool UsingStorageAccess() const { return GetUsingStorageAccess(); }
|
||||
|
||||
already_AddRefed<nsIRFPTargetSetIDL>
|
||||
GetOverriddenFingerprintingSettingsWebIDL() const;
|
||||
Nullable<uint64_t> GetOverriddenFingerprintingSettingsWebIDL() const {
|
||||
Maybe<RFPTarget> overriddenFingerprintingSettings =
|
||||
GetOverriddenFingerprintingSettings();
|
||||
|
||||
return overriddenFingerprintingSettings.isSome()
|
||||
? Nullable<uint64_t>(
|
||||
uint64_t(overriddenFingerprintingSettings.ref()))
|
||||
: Nullable<uint64_t>();
|
||||
}
|
||||
|
||||
nsGlobalWindowInner* GetInnerWindow() const;
|
||||
Document* GetDocument() const;
|
||||
@@ -299,7 +305,7 @@ class WindowContext : public nsISupports, public nsWrapperCache {
|
||||
bool CanSet(FieldIndex<IDX_ShouldResistFingerprinting>,
|
||||
const bool& aShouldResistFingerprinting, ContentParent* aSource);
|
||||
bool CanSet(FieldIndex<IDX_OverriddenFingerprintingSettings>,
|
||||
const Maybe<RFPTargetSet>& aValue, ContentParent* aSource);
|
||||
const Maybe<RFPTarget>& aValue, ContentParent* aSource);
|
||||
bool CanSet(FieldIndex<IDX_IsSecureContext>, const bool& aIsSecureContext,
|
||||
ContentParent* aSource);
|
||||
bool CanSet(FieldIndex<IDX_IsOriginalFrameSource>,
|
||||
|
||||
@@ -60,7 +60,6 @@
|
||||
#include "mozilla/RemoteDecoderManagerChild.h"
|
||||
#include "mozilla/KeySystemConfig.h"
|
||||
#include "mozilla/WheelHandlingHelper.h"
|
||||
#include "nsIRFPTargetSetIDL.h"
|
||||
#include "nsContentSecurityUtils.h"
|
||||
#include "nsString.h"
|
||||
#include "nsNativeTheme.h"
|
||||
@@ -2445,7 +2444,7 @@ void ChromeUtils::GetAllPossibleUtilityActorNames(GlobalObject& aGlobal,
|
||||
/* static */
|
||||
bool ChromeUtils::ShouldResistFingerprinting(
|
||||
GlobalObject& aGlobal, JSRFPTarget aTarget,
|
||||
nsIRFPTargetSetIDL* aOverriddenFingerprintingSettings,
|
||||
const Nullable<uint64_t>& aOverriddenFingerprintingSettings,
|
||||
const Optional<bool>& aIsPBM) {
|
||||
RFPTarget target;
|
||||
switch (aTarget) {
|
||||
@@ -2479,16 +2478,10 @@ bool ChromeUtils::ShouldResistFingerprinting(
|
||||
}
|
||||
}
|
||||
|
||||
Maybe<RFPTargetSet> overriddenFingerprintingSettings;
|
||||
if (aOverriddenFingerprintingSettings) {
|
||||
uint64_t low, hi;
|
||||
aOverriddenFingerprintingSettings->GetLow(&low);
|
||||
aOverriddenFingerprintingSettings->GetHigh(&hi);
|
||||
std::bitset<128> bitset;
|
||||
bitset |= hi;
|
||||
bitset <<= 64;
|
||||
bitset |= low;
|
||||
overriddenFingerprintingSettings.emplace(RFPTargetSet(bitset));
|
||||
Maybe<RFPTarget> overriddenFingerprintingSettings;
|
||||
if (!aOverriddenFingerprintingSettings.IsNull()) {
|
||||
overriddenFingerprintingSettings.emplace(
|
||||
RFPTarget(aOverriddenFingerprintingSettings.Value()));
|
||||
}
|
||||
|
||||
// This global object appears to be the global window, not for individual
|
||||
|
||||
@@ -16,8 +16,6 @@
|
||||
#include "nsIDOMProcessChild.h"
|
||||
#include "nsIDOMProcessParent.h"
|
||||
|
||||
class nsIRFPTargetSetIDL;
|
||||
|
||||
namespace mozilla {
|
||||
|
||||
class ErrorResult;
|
||||
@@ -328,7 +326,7 @@ class ChromeUtils {
|
||||
|
||||
static bool ShouldResistFingerprinting(
|
||||
GlobalObject& aGlobal, JSRFPTarget aTarget,
|
||||
nsIRFPTargetSetIDL* aOverriddenFingerprintingSettings,
|
||||
const Nullable<uint64_t>& aOverriddenFingerprintingSettings,
|
||||
const Optional<bool>& aIsPBM);
|
||||
|
||||
static void SanitizeTelemetryFileURL(GlobalObject& aGlobal,
|
||||
|
||||
@@ -4200,7 +4200,7 @@ class Document : public nsINode,
|
||||
bool ShouldResistFingerprinting(RFPTarget aTarget) const;
|
||||
bool IsInPrivateBrowsing() const;
|
||||
|
||||
const Maybe<RFPTargetSet>& GetOverriddenFingerprintingSettings() const {
|
||||
const Maybe<RFPTarget>& GetOverriddenFingerprintingSettings() const {
|
||||
return mOverriddenFingerprintingSettings;
|
||||
}
|
||||
|
||||
@@ -4986,7 +4986,7 @@ class Document : public nsINode,
|
||||
// This will only get populated if these is one that comes from the local
|
||||
// fingerprinting protection override pref or WebCompat. Otherwise, a value of
|
||||
// Nothing() indicates no overrides are present for this document.
|
||||
Maybe<RFPTargetSet> mOverriddenFingerprintingSettings;
|
||||
Maybe<RFPTarget> mOverriddenFingerprintingSettings;
|
||||
|
||||
uint8_t mXMLDeclarationBits;
|
||||
|
||||
|
||||
@@ -2013,7 +2013,6 @@ addExternalIface('nsIScreen', nativeType='nsIScreen',
|
||||
headerFile='nsIScreen.h', notflattened=True)
|
||||
addExternalIface('InputStream',
|
||||
nativeType='nsIInputStream', notflattened=True)
|
||||
addExternalIface('nsIRFPTargetSetIDL', nativeType='nsIRFPTargetSetIDL')
|
||||
|
||||
# The TemplatedAttributes dictionary has the interface name where the template
|
||||
# should be generated as the key. The values are lists of dictionaries, where
|
||||
|
||||
@@ -7,7 +7,6 @@
|
||||
interface nsIDOMProcessChild;
|
||||
interface nsIDOMProcessParent;
|
||||
interface Principal;
|
||||
interface nsIRFPTargetSetIDL;
|
||||
|
||||
/**
|
||||
* An optimized QueryInterface method, generated by generateQI.
|
||||
@@ -790,7 +789,7 @@ partial namespace ChromeUtils {
|
||||
sequence<UTF8String> getAllPossibleUtilityActorNames();
|
||||
|
||||
boolean shouldResistFingerprinting(JSRFPTarget target,
|
||||
nsIRFPTargetSetIDL? overriddenFingerprintingSettings,
|
||||
unsigned long long? overriddenFingerprintingSettings,
|
||||
optional boolean isPBM);
|
||||
|
||||
FileNameTypeDetails sanitizeTelemetryFileURL(UTF8String url);
|
||||
|
||||
@@ -8,7 +8,6 @@ interface URI;
|
||||
interface nsIDocShell;
|
||||
interface RemoteTab;
|
||||
interface nsIDOMProcessParent;
|
||||
interface nsIRFPTargetSetIDL;
|
||||
|
||||
[Exposed=Window, ChromeOnly]
|
||||
interface WindowContext {
|
||||
@@ -44,7 +43,7 @@ interface WindowContext {
|
||||
// null, which means we are using default fingerprinting protection in the
|
||||
// context.
|
||||
[BinaryName="OverriddenFingerprintingSettingsWebIDL"]
|
||||
readonly attribute nsIRFPTargetSetIDL? overriddenFingerprintingSettings;
|
||||
readonly attribute unsigned long long? overriddenFingerprintingSettings;
|
||||
|
||||
/**
|
||||
* Partially determines whether script execution is allowed in this
|
||||
|
||||
@@ -553,8 +553,8 @@ nsresult ServiceWorkerPrivate::Initialize() {
|
||||
// it's a third-party service worker. So, the cookieJarSettings can directly
|
||||
// use the partitionKey from it. For first-party case, we can populate the
|
||||
// partitionKey from the principal URI.
|
||||
Maybe<RFPTargetSet> overriddenFingerprintingSettingsArg;
|
||||
Maybe<RFPTargetSet> overriddenFingerprintingSettings;
|
||||
Maybe<uint64_t> overriddenFingerprintingSettingsArg;
|
||||
Maybe<RFPTarget> overriddenFingerprintingSettings;
|
||||
nsCOMPtr<nsIURI> firstPartyURI;
|
||||
bool foreignByAncestorContext = false;
|
||||
bool isOn3PCBExceptionList = false;
|
||||
@@ -583,7 +583,7 @@ nsresult ServiceWorkerPrivate::Initialize() {
|
||||
firstPartyURI, uri);
|
||||
if (overriddenFingerprintingSettings.isSome()) {
|
||||
overriddenFingerprintingSettingsArg.emplace(
|
||||
overriddenFingerprintingSettings.ref());
|
||||
uint64_t(overriddenFingerprintingSettings.ref()));
|
||||
}
|
||||
|
||||
RefPtr<net::CookieService> csSingleton =
|
||||
@@ -626,7 +626,7 @@ nsresult ServiceWorkerPrivate::Initialize() {
|
||||
|
||||
if (overriddenFingerprintingSettings.isSome()) {
|
||||
overriddenFingerprintingSettingsArg.emplace(
|
||||
overriddenFingerprintingSettings.ref());
|
||||
uint64_t(overriddenFingerprintingSettings.ref()));
|
||||
}
|
||||
}
|
||||
} else {
|
||||
@@ -642,7 +642,7 @@ nsresult ServiceWorkerPrivate::Initialize() {
|
||||
|
||||
if (overriddenFingerprintingSettings.isSome()) {
|
||||
overriddenFingerprintingSettingsArg.emplace(
|
||||
overriddenFingerprintingSettings.ref());
|
||||
uint64_t(overriddenFingerprintingSettings.ref()));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -178,45 +178,6 @@ struct FeatureImplementationStatus {
|
||||
}
|
||||
};
|
||||
|
||||
double GetLimitDefault(Limit aLimit) {
|
||||
switch (aLimit) {
|
||||
// clang-format off
|
||||
case Limit::MaxTextureDimension1D: return 8192;
|
||||
case Limit::MaxTextureDimension2D: return 8192;
|
||||
case Limit::MaxTextureDimension3D: return 2048;
|
||||
case Limit::MaxTextureArrayLayers: return 256;
|
||||
case Limit::MaxBindGroups: return 4;
|
||||
case Limit::MaxBindGroupsPlusVertexBuffers: return 24;
|
||||
case Limit::MaxBindingsPerBindGroup: return 1000;
|
||||
case Limit::MaxDynamicUniformBuffersPerPipelineLayout: return 8;
|
||||
case Limit::MaxDynamicStorageBuffersPerPipelineLayout: return 4;
|
||||
case Limit::MaxSampledTexturesPerShaderStage: return 16;
|
||||
case Limit::MaxSamplersPerShaderStage: return 16;
|
||||
case Limit::MaxStorageBuffersPerShaderStage: return 8;
|
||||
case Limit::MaxStorageTexturesPerShaderStage: return 4;
|
||||
case Limit::MaxUniformBuffersPerShaderStage: return 12;
|
||||
case Limit::MaxUniformBufferBindingSize: return 65536;
|
||||
case Limit::MaxStorageBufferBindingSize: return 134217728;
|
||||
case Limit::MinUniformBufferOffsetAlignment: return 256;
|
||||
case Limit::MinStorageBufferOffsetAlignment: return 256;
|
||||
case Limit::MaxVertexBuffers: return 8;
|
||||
case Limit::MaxBufferSize: return 268435456;
|
||||
case Limit::MaxVertexAttributes: return 16;
|
||||
case Limit::MaxVertexBufferArrayStride: return 2048;
|
||||
case Limit::MaxInterStageShaderVariables: return 16;
|
||||
case Limit::MaxColorAttachments: return 8;
|
||||
case Limit::MaxColorAttachmentBytesPerSample: return 32;
|
||||
case Limit::MaxComputeWorkgroupStorageSize: return 16384;
|
||||
case Limit::MaxComputeInvocationsPerWorkgroup: return 256;
|
||||
case Limit::MaxComputeWorkgroupSizeX: return 256;
|
||||
case Limit::MaxComputeWorkgroupSizeY: return 256;
|
||||
case Limit::MaxComputeWorkgroupSizeZ: return 64;
|
||||
case Limit::MaxComputeWorkgroupsPerDimension: return 65535;
|
||||
// clang-format on
|
||||
}
|
||||
MOZ_CRASH("Bad Limit");
|
||||
}
|
||||
|
||||
Adapter::Adapter(Instance* const aParent, WebGPUChild* const aBridge,
|
||||
const std::shared_ptr<ffi::WGPUAdapterInformation>& aInfo)
|
||||
: ChildOf(aParent),
|
||||
@@ -273,15 +234,6 @@ Adapter::Adapter(Instance* const aParent, WebGPUChild* const aBridge,
|
||||
// feature.
|
||||
}
|
||||
}
|
||||
|
||||
// We clamp limits to defaults when requestDevice is called, but
|
||||
// we return the actual limits when only requestAdapter is called.
|
||||
// So, we should clamp the limits here too if we should RFP.
|
||||
if (GetParentObject()->ShouldResistFingerprinting(RFPTarget::WebGPULimits)) {
|
||||
for (const auto limit : MakeInclusiveEnumeratedRange(Limit::_LAST)) {
|
||||
SetLimit(mLimits->mFfi.get(), limit, GetLimitDefault(limit));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Adapter::~Adapter() { Cleanup(); }
|
||||
@@ -298,13 +250,6 @@ const RefPtr<SupportedLimits>& Adapter::Limits() const { return mLimits; }
|
||||
const RefPtr<AdapterInfo>& Adapter::Info() const { return mInfo; }
|
||||
|
||||
bool Adapter::IsFallbackAdapter() const {
|
||||
if (GetParentObject()->ShouldResistFingerprinting(
|
||||
RFPTarget::WebGPUIsFallbackAdapter)) {
|
||||
// Always report hardware support for WebGPU.
|
||||
// This behaviour matches with media capabilities API.
|
||||
return false;
|
||||
}
|
||||
|
||||
return mInfoInner->device_type == ffi::WGPUDeviceType::WGPUDeviceType_Cpu;
|
||||
}
|
||||
|
||||
@@ -380,37 +325,6 @@ static std::string_view ToJsKey(const Limit limit) {
|
||||
MOZ_CRASH("Bad Limit");
|
||||
}
|
||||
|
||||
uint64_t Adapter::MissingFeatures() const {
|
||||
uint64_t missingFeatures = 0;
|
||||
|
||||
// Turn on all implemented features.
|
||||
for (const auto feature :
|
||||
dom::MakeWebIDLEnumeratedRange<dom::GPUFeatureName>()) {
|
||||
const auto status = FeatureImplementationStatus::fromDomFeature(feature);
|
||||
switch (status.tag) {
|
||||
case FeatureImplementationStatusTag::Implemented:
|
||||
missingFeatures |= status.value.implemented.wgpuBit;
|
||||
break;
|
||||
case FeatureImplementationStatusTag::NotImplemented:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// Turn off features that are supported by the adapter.
|
||||
for (auto feature : mFeatures->Features()) {
|
||||
const auto status = FeatureImplementationStatus::fromDomFeature(feature);
|
||||
switch (status.tag) {
|
||||
case FeatureImplementationStatusTag::Implemented:
|
||||
missingFeatures &= ~status.value.implemented.wgpuBit;
|
||||
break;
|
||||
case FeatureImplementationStatusTag::NotImplemented:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return missingFeatures;
|
||||
}
|
||||
|
||||
// -
|
||||
// String helpers
|
||||
|
||||
@@ -428,7 +342,45 @@ already_AddRefed<dom::Promise> Adapter::RequestDevice(
|
||||
|
||||
ffi::WGPULimits deviceLimits = *mLimits->mFfi;
|
||||
for (const auto limit : MakeInclusiveEnumeratedRange(Limit::_LAST)) {
|
||||
SetLimit(&deviceLimits, limit, GetLimitDefault(limit));
|
||||
const auto defaultValue = [&]() -> double {
|
||||
switch (limit) {
|
||||
// clang-format off
|
||||
case Limit::MaxTextureDimension1D: return 8192;
|
||||
case Limit::MaxTextureDimension2D: return 8192;
|
||||
case Limit::MaxTextureDimension3D: return 2048;
|
||||
case Limit::MaxTextureArrayLayers: return 256;
|
||||
case Limit::MaxBindGroups: return 4;
|
||||
case Limit::MaxBindGroupsPlusVertexBuffers: return 24;
|
||||
case Limit::MaxBindingsPerBindGroup: return 1000;
|
||||
case Limit::MaxDynamicUniformBuffersPerPipelineLayout: return 8;
|
||||
case Limit::MaxDynamicStorageBuffersPerPipelineLayout: return 4;
|
||||
case Limit::MaxSampledTexturesPerShaderStage: return 16;
|
||||
case Limit::MaxSamplersPerShaderStage: return 16;
|
||||
case Limit::MaxStorageBuffersPerShaderStage: return 8;
|
||||
case Limit::MaxStorageTexturesPerShaderStage: return 4;
|
||||
case Limit::MaxUniformBuffersPerShaderStage: return 12;
|
||||
case Limit::MaxUniformBufferBindingSize: return 65536;
|
||||
case Limit::MaxStorageBufferBindingSize: return 134217728;
|
||||
case Limit::MinUniformBufferOffsetAlignment: return 256;
|
||||
case Limit::MinStorageBufferOffsetAlignment: return 256;
|
||||
case Limit::MaxVertexBuffers: return 8;
|
||||
case Limit::MaxBufferSize: return 268435456;
|
||||
case Limit::MaxVertexAttributes: return 16;
|
||||
case Limit::MaxVertexBufferArrayStride: return 2048;
|
||||
case Limit::MaxInterStageShaderVariables: return 16;
|
||||
case Limit::MaxColorAttachments: return 8;
|
||||
case Limit::MaxColorAttachmentBytesPerSample: return 32;
|
||||
case Limit::MaxComputeWorkgroupStorageSize: return 16384;
|
||||
case Limit::MaxComputeInvocationsPerWorkgroup: return 256;
|
||||
case Limit::MaxComputeWorkgroupSizeX: return 256;
|
||||
case Limit::MaxComputeWorkgroupSizeY: return 256;
|
||||
case Limit::MaxComputeWorkgroupSizeZ: return 64;
|
||||
case Limit::MaxComputeWorkgroupsPerDimension: return 65535;
|
||||
// clang-format on
|
||||
}
|
||||
MOZ_CRASH("Bad Limit");
|
||||
}();
|
||||
SetLimit(&deviceLimits, limit, defaultValue);
|
||||
}
|
||||
|
||||
// -
|
||||
@@ -539,9 +491,6 @@ already_AddRefed<dom::Promise> Adapter::RequestDevice(
|
||||
}
|
||||
}
|
||||
/// Clamp to default if higher than default
|
||||
/// Changing implementation in a way that increases fingerprinting
|
||||
/// surface? Please create a bug in [Core::Privacy: Anti
|
||||
/// Tracking](https://bugzilla.mozilla.org/enter_bug.cgi?product=Core&component=Privacy%3A%20Anti-Tracking)
|
||||
requestedValue =
|
||||
std::min(requestedValue, GetLimit(deviceLimits, limit));
|
||||
}
|
||||
|
||||
@@ -56,9 +56,6 @@ class AdapterInfo final : public nsWrapperCache, public ChildOf<Adapter> {
|
||||
const std::shared_ptr<ffi::WGPUAdapterInformation>& aAboutSupportInfo)
|
||||
: ChildOf(aParent), mAboutSupportInfo(aAboutSupportInfo) {}
|
||||
|
||||
/// Changing implementation in a way that increases fingerprinting
|
||||
/// surface? Please create a bug in [Core::Privacy: Anti
|
||||
/// Tracking](https://bugzilla.mozilla.org/enter_bug.cgi?product=Core&component=Privacy%3A%20Anti-Tracking)
|
||||
void GetVendor(nsString& s) const { s = nsString(); }
|
||||
void GetArchitecture(nsString& s) const { s = nsString(); }
|
||||
void GetDevice(nsString& s) const { s = nsString(); }
|
||||
@@ -105,7 +102,6 @@ class Adapter final : public ObjectBase, public ChildOf<Instance> {
|
||||
const RefPtr<AdapterInfo>& Info() const;
|
||||
bool IsFallbackAdapter() const;
|
||||
bool SupportExternalTextureInSwapChain() const;
|
||||
uint64_t MissingFeatures() const;
|
||||
|
||||
nsCString LabelOrId() const {
|
||||
nsCString ret = this->CLabel();
|
||||
|
||||
@@ -62,9 +62,6 @@ class Instance final : public nsWrapperCache {
|
||||
const dom::GPURequestAdapterOptions& aOptions, ErrorResult& aRv);
|
||||
|
||||
dom::GPUTextureFormat GetPreferredCanvasFormat() const {
|
||||
// Changing implementation in a way that increases fingerprinting surface?
|
||||
// Please create a bug in [Core::Privacy: Anti
|
||||
// Tracking](https://bugzilla.mozilla.org/enter_bug.cgi?product=Core&component=Privacy%3A%20Anti-Tracking)
|
||||
if (kIsAndroid) {
|
||||
return dom::GPUTextureFormat::Rgba8unorm;
|
||||
}
|
||||
|
||||
@@ -1,17 +0,0 @@
|
||||
[DEFAULT]
|
||||
subsuite = "webgpu"
|
||||
run-if = ["!release_or_beta"]
|
||||
skip-if = ["verify"] # `test-verify` jobs don't guarantee a GPU, so skip them.
|
||||
prefs = [
|
||||
"dom.webgpu.enabled=true",
|
||||
"dom.webgpu.workers.enabled=true",
|
||||
"privacy.fingerprintingProtection=true",
|
||||
"privacy.fingerprintingProtection.overrides='-AllTargets,+WebGPULimits'",
|
||||
]
|
||||
|
||||
# WebGPU is only available in secure contexts.
|
||||
#
|
||||
# See spec WebIDL, like this: https://www.w3.org/TR/webgpu/#navigatorgpu
|
||||
scheme = "https"
|
||||
|
||||
["test_rfp_clamp_limits_on.html"]
|
||||
@@ -55,8 +55,6 @@ scheme = "http"
|
||||
|
||||
["test_queue_write_invalid_device.html"]
|
||||
|
||||
["test_rfp_clamp_limits_off.html"]
|
||||
|
||||
["test_set_bind_group_null.html"]
|
||||
|
||||
["test_submit_compute_empty.html"]
|
||||
|
||||
@@ -1,40 +0,0 @@
|
||||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<script src="/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<link rel="stylesheet" href="/tests/SimpleTest/test.css" />
|
||||
</head>
|
||||
<body>
|
||||
<script>
|
||||
ok(
|
||||
SpecialPowers.getBoolPref("dom.webgpu.enabled"),
|
||||
"Pref should be enabled."
|
||||
);
|
||||
|
||||
const func = async function () {
|
||||
const adapter = await navigator.gpu.requestAdapter();
|
||||
const device = await adapter.requestDevice();
|
||||
|
||||
const limitKeys = Object.keys(device.limits.__proto__).filter(
|
||||
key => !["constructor"].includes(key)
|
||||
);
|
||||
const adapterLimits = limitKeys.map(key => adapter.limits[key]);
|
||||
const deviceLimits = limitKeys.map(key => device.limits[key]);
|
||||
|
||||
for (let i = 0; i < limitKeys.length; i++) {
|
||||
if (adapterLimits[i] !== deviceLimits[i]) {
|
||||
ok(true, "Adapter and device limits are different");
|
||||
return;
|
||||
}
|
||||
}
|
||||
ok(false, "Adapter and device limits are the same");
|
||||
};
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
func()
|
||||
.catch(e => ok(false, "Unhandled exception " + e))
|
||||
.finally(() => SimpleTest.finish());
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,40 +0,0 @@
|
||||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<script src="/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<link rel="stylesheet" href="/tests/SimpleTest/test.css" />
|
||||
</head>
|
||||
<body>
|
||||
<script>
|
||||
ok(
|
||||
SpecialPowers.getBoolPref("dom.webgpu.enabled"),
|
||||
"Pref should be enabled."
|
||||
);
|
||||
|
||||
const func = async function () {
|
||||
const adapter = await navigator.gpu.requestAdapter();
|
||||
const device = await adapter.requestDevice();
|
||||
|
||||
const limitKeys = Object.keys(device.limits.__proto__).filter(
|
||||
key => !["constructor"].includes(key)
|
||||
);
|
||||
const adapterLimits = limitKeys.map(key => adapter.limits[key]);
|
||||
const deviceLimits = limitKeys.map(key => device.limits[key]);
|
||||
|
||||
for (let i = 0; i < limitKeys.length; i++) {
|
||||
is(
|
||||
adapterLimits[i],
|
||||
deviceLimits[i],
|
||||
`Adapter and device limits should be the same for ${limitKeys[i]}`
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
func()
|
||||
.catch(e => ok(false, "Unhandled exception " + e))
|
||||
.finally(() => SimpleTest.finish());
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -9,7 +9,6 @@ with Files("**"):
|
||||
|
||||
MOCHITEST_MANIFESTS += [
|
||||
"mochitest/mochitest-no-pref.toml",
|
||||
"mochitest/mochitest-resistfingerprinting.toml",
|
||||
"mochitest/mochitest.toml",
|
||||
]
|
||||
|
||||
|
||||
@@ -120,9 +120,6 @@ interface GPUAdapter {
|
||||
|
||||
[Throws]
|
||||
Promise<GPUDevice> requestDevice(optional GPUDeviceDescriptor descriptor = {});
|
||||
|
||||
[Func="nsRFPService::IsSystemPrincipalOrAboutFingerprintingProtection"]
|
||||
readonly attribute unsigned long long missingFeatures;
|
||||
};
|
||||
|
||||
dictionary GPUDeviceDescriptor
|
||||
|
||||
@@ -146,7 +146,7 @@ struct WorkerLoadInfoData {
|
||||
bool mUsingStorageAccess;
|
||||
bool mServiceWorkersTestingInWindow;
|
||||
bool mShouldResistFingerprinting;
|
||||
Maybe<RFPTargetSet> mOverriddenFingerprintingSettings;
|
||||
Maybe<RFPTarget> mOverriddenFingerprintingSettings;
|
||||
OriginAttributes mOriginAttributes;
|
||||
bool mIsThirdPartyContext;
|
||||
bool mIsOn3PCBExceptionList;
|
||||
|
||||
@@ -1028,7 +1028,7 @@ class WorkerPrivate final
|
||||
|
||||
bool ShouldResistFingerprinting(RFPTarget aTarget) const;
|
||||
|
||||
const Maybe<RFPTargetSet>& GetOverriddenFingerprintingSettings() const {
|
||||
const Maybe<RFPTarget>& GetOverriddenFingerprintingSettings() const {
|
||||
return mLoadInfo.mOverriddenFingerprintingSettings;
|
||||
}
|
||||
|
||||
|
||||
@@ -280,10 +280,10 @@ nsresult RemoteWorkerChild::ExecWorkerOnMainThread(
|
||||
info.mOriginAttributes =
|
||||
BasePrincipal::Cast(principal)->OriginAttributesRef();
|
||||
info.mShouldResistFingerprinting = aData.shouldResistFingerprinting();
|
||||
Maybe<RFPTargetSet> overriddenFingerprintingSettings;
|
||||
Maybe<RFPTarget> overriddenFingerprintingSettings;
|
||||
if (aData.overriddenFingerprintingSettings().isSome()) {
|
||||
overriddenFingerprintingSettings.emplace(
|
||||
aData.overriddenFingerprintingSettings().ref());
|
||||
RFPTarget(aData.overriddenFingerprintingSettings().ref()));
|
||||
}
|
||||
info.mOverriddenFingerprintingSettings = overriddenFingerprintingSettings;
|
||||
net::CookieJarSettings::Deserialize(aData.cookieJarSettings(),
|
||||
|
||||
@@ -19,7 +19,6 @@ using struct mozilla::void_t from "mozilla/ipc/IPCCore.h";
|
||||
using mozilla::dom::WorkerOptions from "mozilla/dom/WorkerBinding.h";
|
||||
using mozilla::StorageAccess from "mozilla/StorageAccess.h";
|
||||
using mozilla::OriginTrials from "mozilla/OriginTrialsIPCUtils.h";
|
||||
using mozilla::RFPTargetSet from "nsRFPService.h";
|
||||
|
||||
namespace mozilla {
|
||||
namespace dom {
|
||||
@@ -86,7 +85,7 @@ struct RemoteWorkerData
|
||||
|
||||
bool shouldResistFingerprinting;
|
||||
|
||||
RFPTargetSet? overriddenFingerprintingSettings;
|
||||
uint64_t? overriddenFingerprintingSettings;
|
||||
|
||||
bool isOn3PCBExceptionList;
|
||||
|
||||
|
||||
@@ -253,10 +253,10 @@ already_AddRefed<SharedWorker> SharedWorker::Constructor(
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
Maybe<RFPTargetSet> overriddenFingerprintingSettingsArg;
|
||||
Maybe<uint64_t> overriddenFingerprintingSettingsArg;
|
||||
if (loadInfo.mOverriddenFingerprintingSettings.isSome()) {
|
||||
overriddenFingerprintingSettingsArg.emplace(
|
||||
loadInfo.mOverriddenFingerprintingSettings.ref());
|
||||
uint64_t(loadInfo.mOverriddenFingerprintingSettings.ref()));
|
||||
}
|
||||
|
||||
RemoteWorkerData remoteWorkerData(
|
||||
|
||||
@@ -128,7 +128,7 @@ class WorkletImpl {
|
||||
// This will only get populated if these is one that comes from the local
|
||||
// granular override pref or WebCompat. Otherwise, a value of Nothing()
|
||||
// indicates no granular overrides are present for this workerlet.
|
||||
Maybe<RFPTargetSet> mOverriddenFingerprintingSettings;
|
||||
Maybe<RFPTarget> mOverriddenFingerprintingSettings;
|
||||
|
||||
const OriginTrials mTrials;
|
||||
};
|
||||
|
||||
@@ -545,13 +545,13 @@ nsresult LoadInfoToLoadInfoArgs(nsILoadInfo* aLoadInfo,
|
||||
redirectChain, interceptionInfo->FromThirdParty()));
|
||||
}
|
||||
|
||||
Maybe<RFPTargetSet> overriddenFingerprintingSettingsArg;
|
||||
Maybe<RFPTargetSet> overriddenFingerprintingSettings =
|
||||
Maybe<uint64_t> overriddenFingerprintingSettingsArg;
|
||||
Maybe<RFPTarget> overriddenFingerprintingSettings =
|
||||
aLoadInfo->GetOverriddenFingerprintingSettings();
|
||||
|
||||
if (overriddenFingerprintingSettings) {
|
||||
overriddenFingerprintingSettingsArg =
|
||||
Some(overriddenFingerprintingSettings.ref());
|
||||
Some(uint64_t(overriddenFingerprintingSettings.ref()));
|
||||
}
|
||||
|
||||
*outLoadInfoArgs = LoadInfoArgs(
|
||||
@@ -790,10 +790,10 @@ nsresult LoadInfoArgsToLoadInfo(const LoadInfoArgs& loadInfoArgs,
|
||||
CookieJarSettings::Deserialize(loadInfoArgs.cookieJarSettings(),
|
||||
getter_AddRefs(cookieJarSettings));
|
||||
|
||||
Maybe<RFPTargetSet> overriddenFingerprintingSettings;
|
||||
Maybe<RFPTarget> overriddenFingerprintingSettings;
|
||||
if (loadInfoArgs.overriddenFingerprintingSettings().isSome()) {
|
||||
overriddenFingerprintingSettings.emplace(
|
||||
loadInfoArgs.overriddenFingerprintingSettings().ref());
|
||||
RFPTarget(loadInfoArgs.overriddenFingerprintingSettings().ref()));
|
||||
}
|
||||
|
||||
nsCOMPtr<nsIContentSecurityPolicy> cspToInherit;
|
||||
@@ -955,13 +955,13 @@ void LoadInfoToParentLoadInfoForwarder(
|
||||
aLoadInfo->GetIsThirdPartyContextToTopWindow());
|
||||
}
|
||||
|
||||
Maybe<RFPTargetSet> overriddenFingerprintingSettingsArg;
|
||||
Maybe<RFPTargetSet> overriddenFingerprintingSettings =
|
||||
Maybe<uint64_t> overriddenFingerprintingSettingsArg;
|
||||
Maybe<RFPTarget> overriddenFingerprintingSettings =
|
||||
aLoadInfo->GetOverriddenFingerprintingSettings();
|
||||
|
||||
if (overriddenFingerprintingSettings) {
|
||||
overriddenFingerprintingSettingsArg =
|
||||
Some(overriddenFingerprintingSettings.ref());
|
||||
Some(uint64_t(overriddenFingerprintingSettings.ref()));
|
||||
}
|
||||
|
||||
*aForwarderArgsOut = ParentLoadInfoForwarderArgs(
|
||||
@@ -1081,11 +1081,11 @@ nsresult MergeParentLoadInfoForwarder(
|
||||
rv = aLoadInfo->SetIsMetaRefresh(aForwarderArgs.isMetaRefresh());
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
const Maybe<RFPTargetSet> overriddenFingerprintingSettings =
|
||||
const Maybe<uint64_t> overriddenFingerprintingSettings =
|
||||
aForwarderArgs.overriddenFingerprintingSettings();
|
||||
if (overriddenFingerprintingSettings.isSome()) {
|
||||
aLoadInfo->SetOverriddenFingerprintingSettings(
|
||||
overriddenFingerprintingSettings.ref());
|
||||
RFPTarget(overriddenFingerprintingSettings.ref()));
|
||||
}
|
||||
|
||||
static_cast<LoadInfo*>(aLoadInfo)->ClearIsThirdPartyContextToTopWindow();
|
||||
|
||||
@@ -495,21 +495,14 @@ struct ParamTraits<mozilla::EnumSet<T, U>> {
|
||||
return false;
|
||||
}
|
||||
|
||||
static constexpr size_t kUnderlyingWidth = [] {
|
||||
if constexpr (std::numeric_limits<serializedType>::is_specialized) {
|
||||
return std::numeric_limits<serializedType>::digits;
|
||||
} else {
|
||||
return serializedType().size(); // for std::bitset<N>
|
||||
}
|
||||
}();
|
||||
|
||||
static constexpr serializedType AllEnumBits() {
|
||||
return ~serializedType(0) >>
|
||||
(kUnderlyingWidth - (mozilla::MaxEnumValue<T>::value + 1));
|
||||
return ~serializedType(0) >> (std::numeric_limits<serializedType>::digits -
|
||||
(mozilla::MaxEnumValue<T>::value + 1));
|
||||
}
|
||||
|
||||
static constexpr bool IsLegalValue(const serializedType value) {
|
||||
static_assert(mozilla::MaxEnumValue<T>::value < kUnderlyingWidth,
|
||||
static_assert(mozilla::MaxEnumValue<T>::value <
|
||||
std::numeric_limits<serializedType>::digits,
|
||||
"Enum max value is not in the range!");
|
||||
static_assert(
|
||||
std::is_unsigned<decltype(mozilla::MaxEnumValue<T>::value)>::value,
|
||||
@@ -854,29 +847,6 @@ struct ParamTraits<gfxPlatform::GlobalReflowFlags>
|
||||
gfxPlatform::GlobalReflowFlags::ALL_BITS> {
|
||||
};
|
||||
|
||||
template <size_t N>
|
||||
struct ParamTraits<std::bitset<N>> {
|
||||
typedef std::bitset<N> paramType;
|
||||
static void Write(MessageWriter* aWriter, const paramType& aParam) {
|
||||
paramType mask(UINT64_MAX);
|
||||
for (size_t i = 0; i < N; i += 64) {
|
||||
uint64_t value = ((aParam >> i) & mask).to_ullong();
|
||||
WriteParam(aWriter, value);
|
||||
}
|
||||
}
|
||||
|
||||
static bool Read(MessageReader* aReader, paramType* aResult) {
|
||||
for (size_t i = 0; i < N; i += 64) {
|
||||
uint64_t value = 0;
|
||||
if (!ReadParam(aReader, &value)) {
|
||||
return false;
|
||||
}
|
||||
*aResult |= std::bitset<N>(value) << i;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
} /* namespace IPC */
|
||||
|
||||
#endif /* __IPC_GLUE_IPCMESSAGEUTILSSPECIALIZATIONS_H__ */
|
||||
|
||||
@@ -56,7 +56,7 @@ class BitSet {
|
||||
return *this;
|
||||
}
|
||||
|
||||
MOZ_IMPLICIT operator bool() const { return mBitSet.test(mPos); }
|
||||
MOZ_IMPLICIT operator bool() const { return mBitSet.Test(mPos); }
|
||||
|
||||
private:
|
||||
BitSet<N, Word>& mBitSet;
|
||||
@@ -76,9 +76,9 @@ class BitSet {
|
||||
PodCopy(mStorage.begin(), aStorage.Elements(), kNumWords);
|
||||
}
|
||||
|
||||
static constexpr size_t size() { return N; }
|
||||
static constexpr size_t Size() { return N; }
|
||||
|
||||
constexpr bool test(size_t aPos) const {
|
||||
constexpr bool Test(size_t aPos) const {
|
||||
MOZ_ASSERT(aPos < N);
|
||||
return mStorage[aPos / kBitsPerWord] & (Word(1) << (aPos % kBitsPerWord));
|
||||
}
|
||||
@@ -94,7 +94,7 @@ class BitSet {
|
||||
|
||||
explicit constexpr operator bool() { return !IsEmpty(); }
|
||||
|
||||
constexpr bool operator[](size_t aPos) const { return test(aPos); }
|
||||
constexpr bool operator[](size_t aPos) const { return Test(aPos); }
|
||||
|
||||
Reference operator[](size_t aPos) {
|
||||
MOZ_ASSERT(aPos < N);
|
||||
@@ -193,7 +193,7 @@ class BitSet {
|
||||
return wordIndex * kBitsPerWord + pos;
|
||||
}
|
||||
|
||||
size_t FindLast() const { return FindPrev(size() - 1); }
|
||||
size_t FindLast() const { return FindPrev(Size() - 1); }
|
||||
|
||||
// Return the position of the previous bit set starting from |aFromPos|
|
||||
// inclusive, or SIZE_MAX if none.
|
||||
|
||||
@@ -52,8 +52,6 @@ class EnumSet {
|
||||
}
|
||||
}
|
||||
|
||||
constexpr explicit EnumSet(Serialized aValue) : mBitField(aValue) {}
|
||||
|
||||
#ifdef DEBUG
|
||||
constexpr EnumSet(const EnumSet& aEnumSet) : mBitField(aEnumSet.mBitField) {}
|
||||
|
||||
@@ -323,12 +321,7 @@ class EnumSet {
|
||||
}
|
||||
|
||||
constexpr bool HasBitAt(size_t aPos) const {
|
||||
if constexpr (std::is_unsigned_v<Serialized>) {
|
||||
return mBitField & BitAt(aPos);
|
||||
} else {
|
||||
// for std::bitset and mozilla::BitSet
|
||||
return mBitField.test(aPos);
|
||||
}
|
||||
return static_cast<bool>(mBitField & BitAt(aPos));
|
||||
}
|
||||
|
||||
constexpr void IncVersion() {
|
||||
@@ -341,7 +334,7 @@ class EnumSet {
|
||||
if constexpr (std::is_unsigned_v<Serialized>) {
|
||||
return sizeof(Serialized) * 8;
|
||||
} else {
|
||||
return Serialized().size();
|
||||
return Serialized::Size();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -67,28 +67,28 @@ class BitSetSuite {
|
||||
|
||||
void testSetBit() {
|
||||
TestBitSet<kBitsPerWord + 2> bitset;
|
||||
MOZ_RELEASE_ASSERT(!bitset.test(3));
|
||||
MOZ_RELEASE_ASSERT(!bitset.Test(3));
|
||||
MOZ_RELEASE_ASSERT(!bitset[3]);
|
||||
MOZ_RELEASE_ASSERT(!bitset.test(kBitsPerWord + 1));
|
||||
MOZ_RELEASE_ASSERT(!bitset.Test(kBitsPerWord + 1));
|
||||
MOZ_RELEASE_ASSERT(!bitset[kBitsPerWord + 1]);
|
||||
|
||||
bitset[3] = true;
|
||||
MOZ_RELEASE_ASSERT(bitset.test(3));
|
||||
MOZ_RELEASE_ASSERT(bitset.Test(3));
|
||||
MOZ_RELEASE_ASSERT(bitset[3]);
|
||||
|
||||
bitset[kBitsPerWord + 1] = true;
|
||||
MOZ_RELEASE_ASSERT(bitset.test(3));
|
||||
MOZ_RELEASE_ASSERT(bitset.Test(3));
|
||||
MOZ_RELEASE_ASSERT(bitset[3]);
|
||||
MOZ_RELEASE_ASSERT(bitset.test(kBitsPerWord + 1));
|
||||
MOZ_RELEASE_ASSERT(bitset.Test(kBitsPerWord + 1));
|
||||
MOZ_RELEASE_ASSERT(bitset[kBitsPerWord + 1]);
|
||||
|
||||
bitset.ResetAll();
|
||||
for (size_t i = 0; i < decltype(bitset)::size(); i++) {
|
||||
for (size_t i = 0; i < decltype(bitset)::Size(); i++) {
|
||||
MOZ_RELEASE_ASSERT(!bitset[i]);
|
||||
}
|
||||
|
||||
bitset.SetAll();
|
||||
for (size_t i = 0; i < decltype(bitset)::size(); i++) {
|
||||
for (size_t i = 0; i < decltype(bitset)::Size(); i++) {
|
||||
MOZ_RELEASE_ASSERT(bitset[i]);
|
||||
}
|
||||
|
||||
@@ -96,14 +96,14 @@ class BitSetSuite {
|
||||
MOZ_RELEASE_ASSERT(bitset.Storage()[1] == 3);
|
||||
|
||||
bitset.ResetAll();
|
||||
for (size_t i = 0; i < decltype(bitset)::size(); i++) {
|
||||
for (size_t i = 0; i < decltype(bitset)::Size(); i++) {
|
||||
MOZ_RELEASE_ASSERT(!bitset[i]);
|
||||
}
|
||||
}
|
||||
|
||||
void testFindBits() {
|
||||
TestBitSet<kBitsPerWord * 5 + 2> bitset;
|
||||
size_t size = bitset.size();
|
||||
size_t size = bitset.Size();
|
||||
MOZ_RELEASE_ASSERT(bitset.IsEmpty());
|
||||
MOZ_RELEASE_ASSERT(bitset.FindFirst() == SIZE_MAX);
|
||||
MOZ_RELEASE_ASSERT(bitset.FindLast() == SIZE_MAX);
|
||||
|
||||
@@ -740,7 +740,7 @@ LoadInfo::LoadInfo(
|
||||
bool aIsSameDocumentNavigation, bool aAllowDeprecatedSystemRequests,
|
||||
bool aIsInDevToolsContext, bool aParserCreatedScript,
|
||||
nsILoadInfo::StoragePermissionState aStoragePermission,
|
||||
const Maybe<RFPTargetSet>& aOverriddenFingerprintingSettings,
|
||||
const Maybe<RFPTarget>& aOverriddenFingerprintingSettings,
|
||||
bool aIsMetaRefresh, uint32_t aRequestBlockingReason,
|
||||
nsINode* aLoadingContext,
|
||||
nsILoadInfo::CrossOriginEmbedderPolicy aLoadingEmbedderPolicy,
|
||||
@@ -1228,7 +1228,7 @@ LoadInfo::SetStoragePermission(
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
const Maybe<RFPTargetSet>& LoadInfo::GetOverriddenFingerprintingSettings() {
|
||||
const Maybe<RFPTarget>& LoadInfo::GetOverriddenFingerprintingSettings() {
|
||||
#ifdef DEBUG
|
||||
RefPtr<BrowsingContext> browsingContext;
|
||||
GetTargetBrowsingContext(getter_AddRefs(browsingContext));
|
||||
@@ -1242,7 +1242,7 @@ const Maybe<RFPTargetSet>& LoadInfo::GetOverriddenFingerprintingSettings() {
|
||||
return mOverriddenFingerprintingSettings;
|
||||
}
|
||||
|
||||
void LoadInfo::SetOverriddenFingerprintingSettings(RFPTargetSet aTargets) {
|
||||
void LoadInfo::SetOverriddenFingerprintingSettings(RFPTarget aTargets) {
|
||||
mOverriddenFingerprintingSettings.reset();
|
||||
mOverriddenFingerprintingSettings.emplace(aTargets);
|
||||
}
|
||||
|
||||
@@ -254,7 +254,7 @@ class LoadInfo final : public nsILoadInfo {
|
||||
bool aIsSameDocumentNavigation, bool aAllowDeprecatedSystemRequests,
|
||||
bool aIsInDevToolsContext, bool aParserCreatedScript,
|
||||
nsILoadInfo::StoragePermissionState aStoragePermission,
|
||||
const Maybe<RFPTargetSet>& aOverriddenFingerprintingSettings,
|
||||
const Maybe<RFPTarget>& aOverriddenFingerprintingSettings,
|
||||
bool aIsMetaRefresh, uint32_t aRequestBlockingReason,
|
||||
nsINode* aLoadingContext,
|
||||
nsILoadInfo::CrossOriginEmbedderPolicy aLoadingEmbedderPolicy,
|
||||
@@ -382,7 +382,7 @@ class LoadInfo final : public nsILoadInfo {
|
||||
bool mParserCreatedScript = false;
|
||||
nsILoadInfo::StoragePermissionState mStoragePermission =
|
||||
nsILoadInfo::NoStoragePermission;
|
||||
Maybe<RFPTargetSet> mOverriddenFingerprintingSettings;
|
||||
Maybe<RFPTarget> mOverriddenFingerprintingSettings;
|
||||
#ifdef DEBUG
|
||||
// A boolean used to ensure the mOverriddenFingerprintingSettings is set
|
||||
// before use it.
|
||||
|
||||
@@ -208,11 +208,11 @@ TRRLoadInfo::SetStoragePermission(
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
const Maybe<RFPTargetSet>& TRRLoadInfo::GetOverriddenFingerprintingSettings() {
|
||||
const Maybe<RFPTarget>& TRRLoadInfo::GetOverriddenFingerprintingSettings() {
|
||||
return mOverriddenFingerprintingSettings;
|
||||
}
|
||||
|
||||
void TRRLoadInfo::SetOverriddenFingerprintingSettings(RFPTargetSet aTargets) {}
|
||||
void TRRLoadInfo::SetOverriddenFingerprintingSettings(RFPTarget aTargets) {}
|
||||
|
||||
NS_IMETHODIMP
|
||||
TRRLoadInfo::GetIsMetaRefresh(bool* aResult) {
|
||||
|
||||
@@ -45,7 +45,7 @@ class TRRLoadInfo final : public nsILoadInfo {
|
||||
Maybe<mozilla::dom::ClientInfo> mReservedClientInfo;
|
||||
Maybe<mozilla::dom::ClientInfo> mInitialClientInfo;
|
||||
Maybe<mozilla::dom::ServiceWorkerDescriptor> mController;
|
||||
Maybe<RFPTargetSet> mOverriddenFingerprintingSettings;
|
||||
Maybe<RFPTarget> mOverriddenFingerprintingSettings;
|
||||
};
|
||||
|
||||
} // namespace net
|
||||
|
||||
@@ -53,8 +53,8 @@ native OriginAttributes(mozilla::OriginAttributes);
|
||||
[ref] native const_MaybeClientInfoRef(const mozilla::Maybe<mozilla::dom::ClientInfo>);
|
||||
[ref] native const_ServiceWorkerDescriptorRef(const mozilla::dom::ServiceWorkerDescriptor);
|
||||
[ref] native const_MaybeServiceWorkerDescriptorRef(const mozilla::Maybe<mozilla::dom::ServiceWorkerDescriptor>);
|
||||
[ref] native const_MaybeRFPTargetSet(const mozilla::Maybe<mozilla::RFPTargetSet>);
|
||||
native RFPTargetSet(mozilla::RFPTargetSet);
|
||||
[ref] native const_MaybeRFPTarget(const mozilla::Maybe<mozilla::RFPTarget>);
|
||||
native RFPTarget(mozilla::RFPTarget);
|
||||
[ptr] native PerformanceStoragePtr(mozilla::dom::PerformanceStorage);
|
||||
native LoadTainting(mozilla::LoadTainting);
|
||||
native CSPRef(already_AddRefed<nsIContentSecurityPolicy>);
|
||||
@@ -651,13 +651,13 @@ interface nsILoadInfo : nsISupports
|
||||
* The RFPTarget defined in the RFPTargets.inc.
|
||||
*/
|
||||
[noscript, nostdcall, notxpcom]
|
||||
const_MaybeRFPTargetSet GetOverriddenFingerprintingSettings();
|
||||
const_MaybeRFPTarget GetOverriddenFingerprintingSettings();
|
||||
|
||||
/**
|
||||
* Set the granular overrides of fingerprinting protections for the channel.
|
||||
*/
|
||||
[noscript, nostdcall, notxpcom]
|
||||
void SetOverriddenFingerprintingSettings(in RFPTargetSet aTargets);
|
||||
void SetOverriddenFingerprintingSettings(in RFPTarget aTargets);
|
||||
|
||||
/**
|
||||
* True if the load was triggered by a meta refresh.
|
||||
|
||||
@@ -44,7 +44,6 @@ using mozilla::dom::FeaturePolicyInfo from "mozilla/dom/FeaturePolicy.h";
|
||||
using nsILoadInfo::HTTPSUpgradeTelemetryType from "nsILoadInfo.h";
|
||||
using nsILoadInfo::SchemelessInputType from "nsILoadInfo.h";
|
||||
using mozilla::dom::UserNavigationInvolvement from "mozilla/dom/UserNavigationInvolvement.h";
|
||||
using mozilla::RFPTargetSet from "nsRFPService.h";
|
||||
|
||||
namespace mozilla {
|
||||
namespace net {
|
||||
@@ -196,7 +195,7 @@ struct LoadInfoArgs
|
||||
uint32_t requestBlockingReason;
|
||||
CSPInfo? cspToInheritInfo;
|
||||
StoragePermissionState storagePermission;
|
||||
RFPTargetSet? overriddenFingerprintingSettings;
|
||||
uint64_t? overriddenFingerprintingSettings;
|
||||
bool isMetaRefresh;
|
||||
CrossOriginEmbedderPolicy loadingEmbedderPolicy;
|
||||
bool originTrialCoepCredentiallessEnabledForTopLevel;
|
||||
@@ -287,7 +286,7 @@ struct ParentLoadInfoForwarderArgs
|
||||
|
||||
StoragePermissionState storagePermission;
|
||||
|
||||
RFPTargetSet? overriddenFingerprintingSettings;
|
||||
uint64_t? overriddenFingerprintingSettings;
|
||||
|
||||
bool isMetaRefresh;
|
||||
|
||||
|
||||
@@ -1111,7 +1111,7 @@ void AntiTrackingUtils::UpdateAntiTrackingInfoForChannel(nsIChannel* aChannel) {
|
||||
// Note that we need to put this after computing the IsThirdPartyToTopWindow
|
||||
// flag because it will be used when getting the granular fingerprinting
|
||||
// protections.
|
||||
Maybe<RFPTargetSet> overriddenFingerprintingSettings =
|
||||
Maybe<RFPTarget> overriddenFingerprintingSettings =
|
||||
nsRFPService::GetOverriddenFingerprintingSettingsForChannel(aChannel);
|
||||
|
||||
if (overriddenFingerprintingSettings) {
|
||||
|
||||
23
toolkit/components/resistfingerprinting/RFPTargetIPCUtils.h
Normal file
23
toolkit/components/resistfingerprinting/RFPTargetIPCUtils.h
Normal file
@@ -0,0 +1,23 @@
|
||||
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
|
||||
/* 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/. */
|
||||
|
||||
#ifndef __RFPTargetIPCUtils_h__
|
||||
#define __RFPTargetIPCUtils_h__
|
||||
|
||||
#include "ipc/EnumSerializer.h"
|
||||
|
||||
#include "nsRFPService.h"
|
||||
|
||||
namespace IPC {
|
||||
|
||||
template <>
|
||||
struct ParamTraits<mozilla::RFPTarget>
|
||||
: BitFlagsEnumSerializer<mozilla::RFPTarget,
|
||||
mozilla::RFPTarget::AllTargets> {};
|
||||
|
||||
} // namespace IPC
|
||||
|
||||
#endif // __RFPTargetIPCUtils_h__
|
||||
@@ -5,97 +5,95 @@
|
||||
|
||||
// Names should not be re-used.
|
||||
|
||||
ITEM_VALUE(TouchEvents, 1)
|
||||
ITEM_VALUE(PointerEvents, 2)
|
||||
ITEM_VALUE(KeyboardEvents, 3)
|
||||
ITEM_VALUE(ScreenOrientation, 4)
|
||||
ITEM_VALUE(TouchEvents, 1llu << 0)
|
||||
ITEM_VALUE(PointerEvents, 1llu << 1)
|
||||
ITEM_VALUE(KeyboardEvents, 1llu << 2)
|
||||
ITEM_VALUE(ScreenOrientation, 1llu << 3)
|
||||
// SpeechSynthesis part of the Web Speech API
|
||||
ITEM_VALUE(SpeechSynthesis, 5)
|
||||
ITEM_VALUE(SpeechSynthesis, 1llu << 4)
|
||||
// `prefers-color-scheme` CSS media feature
|
||||
ITEM_VALUE(CSSPrefersColorScheme, 6)
|
||||
ITEM_VALUE(CSSPrefersColorScheme, 1llu << 5)
|
||||
// `prefers-reduced-motion` CSS media feature
|
||||
ITEM_VALUE(CSSPrefersReducedMotion, 7)
|
||||
ITEM_VALUE(CSSPrefersReducedMotion, 1llu << 6)
|
||||
// `prefers-contrast` CSS media feature
|
||||
ITEM_VALUE(CSSPrefersContrast, 8)
|
||||
ITEM_VALUE(CSSPrefersContrast, 1llu << 7)
|
||||
// Add random noises to image data extracted from canvas.
|
||||
ITEM_VALUE(CanvasRandomization, 9)
|
||||
ITEM_VALUE(CanvasRandomization, 1llu << 8)
|
||||
// Canvas targets: For unusual combinations of these, see comments
|
||||
// in IsImageExtractionAllowed
|
||||
ITEM_VALUE(CanvasImageExtractionPrompt, 10)
|
||||
ITEM_VALUE(CanvasExtractionFromThirdPartiesIsBlocked, 11)
|
||||
ITEM_VALUE(CanvasExtractionBeforeUserInputIsBlocked, 12)
|
||||
ITEM_VALUE(CanvasImageExtractionPrompt, 1llu << 9)
|
||||
ITEM_VALUE(CanvasExtractionFromThirdPartiesIsBlocked, 1llu << 10)
|
||||
ITEM_VALUE(CanvasExtractionBeforeUserInputIsBlocked, 1llu << 11)
|
||||
|
||||
ITEM_VALUE(JSLocale, 13)
|
||||
ITEM_VALUE(JSLocale, 1llu << 12)
|
||||
|
||||
// Various "client identification" values of the navigator object
|
||||
ITEM_VALUE(NavigatorAppVersion, 14)
|
||||
ITEM_VALUE(NavigatorBuildID, 15)
|
||||
ITEM_VALUE(NavigatorHWConcurrency, 16)
|
||||
ITEM_VALUE(NavigatorOscpu, 17)
|
||||
ITEM_VALUE(NavigatorPlatform, 18)
|
||||
ITEM_VALUE(NavigatorUserAgent, 19)
|
||||
ITEM_VALUE(PointerId, 20)
|
||||
ITEM_VALUE(StreamVideoFacingMode, 21)
|
||||
ITEM_VALUE(JSDateTimeUTC, 22)
|
||||
ITEM_VALUE(JSMathFdlibm, 23)
|
||||
ITEM_VALUE(Gamepad, 24)
|
||||
ITEM_VALUE(HttpUserAgent, 25)
|
||||
ITEM_VALUE(WindowOuterSize, 26)
|
||||
ITEM_VALUE(WindowScreenXY, 27)
|
||||
ITEM_VALUE(WindowInnerScreenXY, 28)
|
||||
ITEM_VALUE(ScreenPixelDepth, 29)
|
||||
ITEM_VALUE(ScreenRect, 30)
|
||||
ITEM_VALUE(ScreenAvailRect, 31)
|
||||
ITEM_VALUE(NavigatorAppVersion, 1llu << 13)
|
||||
ITEM_VALUE(NavigatorBuildID, 1llu << 14)
|
||||
ITEM_VALUE(NavigatorHWConcurrency, 1llu << 15)
|
||||
ITEM_VALUE(NavigatorOscpu, 1llu << 16)
|
||||
ITEM_VALUE(NavigatorPlatform, 1llu << 17)
|
||||
ITEM_VALUE(NavigatorUserAgent, 1llu << 18)
|
||||
ITEM_VALUE(PointerId, 1llu << 19)
|
||||
ITEM_VALUE(StreamVideoFacingMode, 1llu << 20)
|
||||
ITEM_VALUE(JSDateTimeUTC, 1llu << 21)
|
||||
ITEM_VALUE(JSMathFdlibm, 1llu << 22)
|
||||
ITEM_VALUE(Gamepad, 1llu << 23)
|
||||
ITEM_VALUE(HttpUserAgent, 1llu << 24)
|
||||
ITEM_VALUE(WindowOuterSize, 1llu << 25)
|
||||
ITEM_VALUE(WindowScreenXY, 1llu << 26)
|
||||
ITEM_VALUE(WindowInnerScreenXY, 1llu << 27)
|
||||
ITEM_VALUE(ScreenPixelDepth, 1llu << 28)
|
||||
ITEM_VALUE(ScreenRect, 1llu << 29)
|
||||
ITEM_VALUE(ScreenAvailRect, 1llu << 30)
|
||||
// HTMLVideoElement
|
||||
// mozParsedFrames, mozDecodedFrames, mozPresentedFrames, mozPaintedFrames
|
||||
ITEM_VALUE(VideoElementMozFrames, 32)
|
||||
ITEM_VALUE(VideoElementMozFrames, 1llu << 31)
|
||||
// mozFrameDelay
|
||||
ITEM_VALUE(VideoElementMozFrameDelay, 33)
|
||||
ITEM_VALUE(VideoElementMozFrameDelay, 1llu << 32)
|
||||
// getVideoPlaybackQuality()
|
||||
ITEM_VALUE(VideoElementPlaybackQuality, 34)
|
||||
ITEM_VALUE(VideoElementPlaybackQuality, 1llu << 33)
|
||||
// See also Reduce Timer Precision (RTP) Caller Type
|
||||
ITEM_VALUE(ReduceTimerPrecision, 35)
|
||||
ITEM_VALUE(ReduceTimerPrecision, 1llu << 34)
|
||||
// Hide keyboard and pointer WidgetEvents
|
||||
ITEM_VALUE(WidgetEvents, 36)
|
||||
ITEM_VALUE(MediaDevices, 37)
|
||||
ITEM_VALUE(MediaCapabilities, 38)
|
||||
ITEM_VALUE(AudioSampleRate, 39)
|
||||
ITEM_VALUE(NavigatorConnection, 40)
|
||||
ITEM_VALUE(WindowDevicePixelRatio, 41)
|
||||
ITEM_VALUE(MouseEventScreenPoint, 42)
|
||||
ITEM_VALUE(WidgetEvents, 1llu << 35)
|
||||
ITEM_VALUE(MediaDevices, 1llu << 36)
|
||||
ITEM_VALUE(MediaCapabilities, 1llu << 37)
|
||||
ITEM_VALUE(AudioSampleRate, 1llu << 38)
|
||||
ITEM_VALUE(NavigatorConnection, 1llu << 39)
|
||||
ITEM_VALUE(WindowDevicePixelRatio, 1llu << 40)
|
||||
ITEM_VALUE(MouseEventScreenPoint, 1llu << 41)
|
||||
// Visibility level of font families available to CSS font-matching
|
||||
ITEM_VALUE(FontVisibilityBaseSystem, 43)
|
||||
ITEM_VALUE(FontVisibilityLangPack, 44)
|
||||
ITEM_VALUE(DeviceSensors, 45)
|
||||
ITEM_VALUE(FrameRate, 46)
|
||||
ITEM_VALUE(RoundWindowSize, 47)
|
||||
ITEM_VALUE(UseStandinsForNativeColors, 48)
|
||||
ITEM_VALUE(AudioContext, 49)
|
||||
ITEM_VALUE(MediaError, 50)
|
||||
ITEM_VALUE(DOMStyleOsxFontSmoothing, 51)
|
||||
ITEM_VALUE(FontVisibilityBaseSystem, 1llu << 42)
|
||||
ITEM_VALUE(FontVisibilityLangPack, 1llu << 43)
|
||||
ITEM_VALUE(DeviceSensors, 1llu << 44)
|
||||
ITEM_VALUE(FrameRate, 1llu << 45)
|
||||
ITEM_VALUE(RoundWindowSize, 1llu << 46)
|
||||
ITEM_VALUE(UseStandinsForNativeColors, 1llu << 47)
|
||||
ITEM_VALUE(AudioContext, 1llu << 48)
|
||||
ITEM_VALUE(MediaError, 1llu << 49)
|
||||
ITEM_VALUE(DOMStyleOsxFontSmoothing, 1llu << 50)
|
||||
// `device-height`/`device-width` CSS media features
|
||||
ITEM_VALUE(CSSDeviceSize, 52)
|
||||
ITEM_VALUE(CSSDeviceSize, 1llu << 51)
|
||||
// `color`/`color-gamut` CSS media features
|
||||
ITEM_VALUE(CSSColorInfo, 53)
|
||||
ITEM_VALUE(CSSColorInfo, 1llu << 52)
|
||||
// `resolution` CSS media feature
|
||||
ITEM_VALUE(CSSResolution, 54)
|
||||
ITEM_VALUE(CSSResolution, 1llu << 53)
|
||||
// `prefers-reduced-transparency` CSS media feature
|
||||
ITEM_VALUE(CSSPrefersReducedTransparency, 55)
|
||||
ITEM_VALUE(CSSPrefersReducedTransparency, 1llu << 54)
|
||||
// `inverted-colors` CSS media feature
|
||||
ITEM_VALUE(CSSInvertedColors, 56)
|
||||
ITEM_VALUE(CSSInvertedColors, 1llu << 55)
|
||||
// `video-dynamic-range` CSS media feature
|
||||
ITEM_VALUE(CSSVideoDynamicRange, 57)
|
||||
ITEM_VALUE(CSSPointerCapabilities, 58)
|
||||
ITEM_VALUE(CSSVideoDynamicRange, 1llu << 56)
|
||||
ITEM_VALUE(CSSPointerCapabilities, 1llu << 57)
|
||||
// WebGL
|
||||
ITEM_VALUE(WebGLRenderCapability, 59)
|
||||
ITEM_VALUE(WebGLRenderInfo, 60)
|
||||
ITEM_VALUE(SiteSpecificZoom, 61)
|
||||
ITEM_VALUE(WebGLRenderCapability, 1llu << 58)
|
||||
ITEM_VALUE(WebGLRenderInfo, 1llu << 59)
|
||||
ITEM_VALUE(SiteSpecificZoom, 1llu << 60)
|
||||
// Are font visibility restrictions applied when resolving a CSS <generic-family>?
|
||||
// (This may block the fonts selected in Preferences from actually being used.)
|
||||
ITEM_VALUE(FontVisibilityRestrictGenerics, 62)
|
||||
ITEM_VALUE(WebVTT, 63)
|
||||
ITEM_VALUE(WebGPULimits, 64)
|
||||
ITEM_VALUE(WebGPUIsFallbackAdapter, 65)
|
||||
ITEM_VALUE(FontVisibilityRestrictGenerics, 1llu << 61)
|
||||
ITEM_VALUE(WebVTT, 1llu << 62)
|
||||
|
||||
// !!! Don't forget to update kDefaultFingerprintingProtections in nsRFPService.cpp
|
||||
// if necessary.
|
||||
@@ -105,7 +103,7 @@ ITEM_VALUE(WebGPUIsFallbackAdapter, 65)
|
||||
* (This saves us more computation and casting later.) This document will still
|
||||
* need to check whether an individual target is allowed, but the initial
|
||||
* question of "Does this document have any RFP applied to it ever?" can still
|
||||
* be precomputed. This enum value will always be included in FPP, so when a
|
||||
* be precomputed. This enum value will always be included in RFPLite, so when a
|
||||
* document asks if they might have RFP enabled, it will return true. (Putting
|
||||
* this value in the overrides pref is undefined behavior and may do anything.)
|
||||
*/
|
||||
@@ -121,4 +119,4 @@ ITEM_VALUE(IsAlwaysEnabledForPrecompute, 0)
|
||||
* +AllTargets,-CSSPrefersColorScheme
|
||||
* -AllTargets,+Gamepad
|
||||
*/
|
||||
ITEM_VALUE(AllTargets, 127)
|
||||
ITEM_VALUE(AllTargets, 0xFFFFFFFF'FFFFFFFF)
|
||||
|
||||
@@ -173,7 +173,6 @@ export class UserCharacteristicsPageService {
|
||||
[browser.ownerGlobal, browser.ownerDocument, true],
|
||||
],
|
||||
[this.populateCanvasData, []],
|
||||
[this.populateWebGPUProperties, [browser.ownerGlobal]],
|
||||
];
|
||||
// Bind them to the class and run them in parallel.
|
||||
// Timeout if any of them takes too long (5 minutes).
|
||||
@@ -502,106 +501,6 @@ export class UserCharacteristicsPageService {
|
||||
}
|
||||
}
|
||||
|
||||
async populateWebGPUProperties(window) {
|
||||
const adapter = await window.navigator.gpu.requestAdapter();
|
||||
if (!adapter) {
|
||||
return;
|
||||
}
|
||||
|
||||
Glean.characteristics.wgpuMissingFeatures.set(
|
||||
adapter.missingFeatures.toString()
|
||||
);
|
||||
Glean.characteristics.wgpuMaxtexturedimension1d.set(
|
||||
adapter.limits.maxTextureDimension1D
|
||||
);
|
||||
Glean.characteristics.wgpuMaxtexturedimension2d.set(
|
||||
adapter.limits.maxTextureDimension2D
|
||||
);
|
||||
Glean.characteristics.wgpuMaxtexturedimension3d.set(
|
||||
adapter.limits.maxTextureDimension3D
|
||||
);
|
||||
Glean.characteristics.wgpuMaxtexturearraylayers.set(
|
||||
adapter.limits.maxTextureArrayLayers
|
||||
);
|
||||
Glean.characteristics.wgpuMaxbindgroups.set(adapter.limits.maxBindGroups);
|
||||
Glean.characteristics.wgpuMaxbindgroupsplusvertexbuffers.set(
|
||||
adapter.limits.maxBindGroupsPlusVertexBuffers
|
||||
);
|
||||
Glean.characteristics.wgpuMaxbindingsperbindgroup.set(
|
||||
adapter.limits.maxBindingsPerBindGroup
|
||||
);
|
||||
Glean.characteristics.wgpuMaxdynamicuniformbuffersperpipelinelayout.set(
|
||||
adapter.limits.maxDynamicUniformBuffersPerPipelineLayout
|
||||
);
|
||||
Glean.characteristics.wgpuMaxdynamicstoragebuffersperpipelinelayout.set(
|
||||
adapter.limits.maxDynamicStorageBuffersPerPipelineLayout
|
||||
);
|
||||
Glean.characteristics.wgpuMaxsampledtexturespershaderstage.set(
|
||||
adapter.limits.maxSampledTexturesPerShaderStage
|
||||
);
|
||||
Glean.characteristics.wgpuMaxsamplerspershaderstage.set(
|
||||
adapter.limits.maxSamplersPerShaderStage
|
||||
);
|
||||
Glean.characteristics.wgpuMaxstoragebufferspershaderstage.set(
|
||||
adapter.limits.maxStorageBuffersPerShaderStage
|
||||
);
|
||||
Glean.characteristics.wgpuMaxstoragetexturespershaderstage.set(
|
||||
adapter.limits.maxStorageTexturesPerShaderStage
|
||||
);
|
||||
Glean.characteristics.wgpuMaxuniformbufferspershaderstage.set(
|
||||
adapter.limits.maxUniformBuffersPerShaderStage
|
||||
);
|
||||
Glean.characteristics.wgpuMaxuniformbufferbindingsize.set(
|
||||
adapter.limits.maxUniformBufferBindingSize
|
||||
);
|
||||
Glean.characteristics.wgpuMaxstoragebufferbindingsize.set(
|
||||
adapter.limits.maxStorageBufferBindingSize
|
||||
);
|
||||
Glean.characteristics.wgpuMinuniformbufferoffsetalignment.set(
|
||||
adapter.limits.minUniformBufferOffsetAlignment
|
||||
);
|
||||
Glean.characteristics.wgpuMinstoragebufferoffsetalignment.set(
|
||||
adapter.limits.minStorageBufferOffsetAlignment
|
||||
);
|
||||
Glean.characteristics.wgpuMaxvertexbuffers.set(
|
||||
adapter.limits.maxVertexBuffers
|
||||
);
|
||||
Glean.characteristics.wgpuMaxbuffersize.set(adapter.limits.maxBufferSize);
|
||||
Glean.characteristics.wgpuMaxvertexattributes.set(
|
||||
adapter.limits.maxVertexAttributes
|
||||
);
|
||||
Glean.characteristics.wgpuMaxvertexbufferarraystride.set(
|
||||
adapter.limits.maxVertexBufferArrayStride
|
||||
);
|
||||
Glean.characteristics.wgpuMaxinterstageshadervariables.set(
|
||||
adapter.limits.maxInterStageShaderVariables
|
||||
);
|
||||
Glean.characteristics.wgpuMaxcolorattachments.set(
|
||||
adapter.limits.maxColorAttachments
|
||||
);
|
||||
Glean.characteristics.wgpuMaxcolorattachmentbytespersample.set(
|
||||
adapter.limits.maxColorAttachmentBytesPerSample
|
||||
);
|
||||
Glean.characteristics.wgpuMaxcomputeworkgroupstoragesize.set(
|
||||
adapter.limits.maxComputeWorkgroupStorageSize
|
||||
);
|
||||
Glean.characteristics.wgpuMaxcomputeinvocationsperworkgroup.set(
|
||||
adapter.limits.maxComputeInvocationsPerWorkgroup
|
||||
);
|
||||
Glean.characteristics.wgpuMaxcomputeworkgroupsizex.set(
|
||||
adapter.limits.maxComputeWorkgroupSizeX
|
||||
);
|
||||
Glean.characteristics.wgpuMaxcomputeworkgroupsizey.set(
|
||||
adapter.limits.maxComputeWorkgroupSizeY
|
||||
);
|
||||
Glean.characteristics.wgpuMaxcomputeworkgroupsizez.set(
|
||||
adapter.limits.maxComputeWorkgroupSizeZ
|
||||
);
|
||||
Glean.characteristics.wgpuMaxcomputeworkgroupsperdimension.set(
|
||||
adapter.limits.maxComputeWorkgroupsPerDimension
|
||||
);
|
||||
}
|
||||
|
||||
async populateMappableData(data) {
|
||||
// We set data from usercharacteristics.js
|
||||
// We could do Object.keys(data), but this
|
||||
|
||||
@@ -41,10 +41,4 @@ Classes = [
|
||||
'constructor': 'UserCharacteristicsPageService',
|
||||
'processes': ProcessSelector.MAIN_PROCESS_ONLY,
|
||||
},
|
||||
{
|
||||
'cid': '{6c072f47-f25c-484f-add8-051b07789593}',
|
||||
'type': 'mozilla::nsRFPTargetSetIDL',
|
||||
'interfaces': ['nsIRFPTargetSetIDL'],
|
||||
'headers': ['/toolkit/components/resistfingerprinting/nsRFPTargetSetIDL.h'],
|
||||
},
|
||||
]
|
||||
|
||||
@@ -38,7 +38,8 @@ def parse_targets(path):
|
||||
targets = {}
|
||||
for match in pattern.finditer(contents):
|
||||
target = match.group(1)
|
||||
value = match.group(2)
|
||||
value = match.group(2).replace("llu", "").replace("'", "")
|
||||
value = value.split(" << ")
|
||||
targets[target] = value
|
||||
|
||||
return targets
|
||||
@@ -48,7 +49,15 @@ def write_targets(output, targets):
|
||||
output.write("export const Targets = {\n")
|
||||
for target, value in targets.items():
|
||||
target_w_padding = f'\t"{target}":'.ljust(45)
|
||||
output.write(f"{target_w_padding} {value},\n")
|
||||
if len(value) == 2:
|
||||
# value is in the format 1 << n = ["1", "n"]
|
||||
output.write(
|
||||
f"{target_w_padding} BigInt({value[0]}) << BigInt({value[1]}),\n"
|
||||
)
|
||||
else:
|
||||
# value is in the format 0xFFFF... = ["0xffff"]
|
||||
output.write(f'{target_w_padding} BigInt("{value[0]}"),\n')
|
||||
|
||||
output.write("}\n")
|
||||
|
||||
|
||||
|
||||
@@ -3851,578 +3851,3 @@ characteristics:
|
||||
expires: never
|
||||
data_sensitivity:
|
||||
- technical
|
||||
|
||||
wgpu_missing_features:
|
||||
type: string
|
||||
description: >
|
||||
Missing features of WebGPU as a bitset
|
||||
lifetime: application
|
||||
send_in_pings:
|
||||
- user-characteristics
|
||||
notification_emails:
|
||||
- tom@mozilla.com
|
||||
bugs:
|
||||
- https://bugzilla.mozilla.org/show_bug.cgi?id=1939903
|
||||
data_reviews:
|
||||
- https://bugzilla.mozilla.org/show_bug.cgi?id=1939903#c2
|
||||
expires: never
|
||||
data_sensitivity:
|
||||
- technical
|
||||
|
||||
wgpu_maxtexturedimension1d:
|
||||
type: quantity
|
||||
unit: uint
|
||||
description: >
|
||||
WebGPU limit maxTextureDimension1D
|
||||
lifetime: application
|
||||
send_in_pings:
|
||||
- user-characteristics
|
||||
notification_emails:
|
||||
- tom@mozilla.com
|
||||
bugs:
|
||||
- https://bugzilla.mozilla.org/show_bug.cgi?id=1939903
|
||||
data_reviews:
|
||||
- https://bugzilla.mozilla.org/show_bug.cgi?id=1939903#c3
|
||||
expires: never
|
||||
data_sensitivity:
|
||||
- technical
|
||||
|
||||
wgpu_maxtexturedimension2d:
|
||||
type: quantity
|
||||
unit: uint
|
||||
description: >
|
||||
WebGPU limit maxTextureDimension2D
|
||||
lifetime: application
|
||||
send_in_pings:
|
||||
- user-characteristics
|
||||
notification_emails:
|
||||
- tom@mozilla.com
|
||||
bugs:
|
||||
- https://bugzilla.mozilla.org/show_bug.cgi?id=1939903
|
||||
data_reviews:
|
||||
- https://bugzilla.mozilla.org/show_bug.cgi?id=1939903#c3
|
||||
expires: never
|
||||
data_sensitivity:
|
||||
- technical
|
||||
|
||||
wgpu_maxtexturedimension3d:
|
||||
type: quantity
|
||||
unit: uint
|
||||
description: >
|
||||
WebGPU limit maxTextureDimension3D
|
||||
lifetime: application
|
||||
send_in_pings:
|
||||
- user-characteristics
|
||||
notification_emails:
|
||||
- tom@mozilla.com
|
||||
bugs:
|
||||
- https://bugzilla.mozilla.org/show_bug.cgi?id=1939903
|
||||
data_reviews:
|
||||
- https://bugzilla.mozilla.org/show_bug.cgi?id=1939903#c3
|
||||
expires: never
|
||||
data_sensitivity:
|
||||
- technical
|
||||
|
||||
wgpu_maxtexturearraylayers:
|
||||
type: quantity
|
||||
unit: uint
|
||||
description: >
|
||||
WebGPU limit maxTextureArrayLayers
|
||||
lifetime: application
|
||||
send_in_pings:
|
||||
- user-characteristics
|
||||
notification_emails:
|
||||
- tom@mozilla.com
|
||||
bugs:
|
||||
- https://bugzilla.mozilla.org/show_bug.cgi?id=1939903
|
||||
data_reviews:
|
||||
- https://bugzilla.mozilla.org/show_bug.cgi?id=1939903#c3
|
||||
expires: never
|
||||
data_sensitivity:
|
||||
- technical
|
||||
|
||||
wgpu_maxbindgroups:
|
||||
type: quantity
|
||||
unit: uint
|
||||
description: >
|
||||
WebGPU limit maxBindGroups
|
||||
lifetime: application
|
||||
send_in_pings:
|
||||
- user-characteristics
|
||||
notification_emails:
|
||||
- tom@mozilla.com
|
||||
bugs:
|
||||
- https://bugzilla.mozilla.org/show_bug.cgi?id=1939903
|
||||
data_reviews:
|
||||
- https://bugzilla.mozilla.org/show_bug.cgi?id=1939903#c3
|
||||
expires: never
|
||||
data_sensitivity:
|
||||
- technical
|
||||
|
||||
wgpu_maxbindgroupsplusvertexbuffers:
|
||||
type: quantity
|
||||
unit: uint
|
||||
description: >
|
||||
WebGPU limit maxBindGroupsPlusVertexBuffers
|
||||
lifetime: application
|
||||
send_in_pings:
|
||||
- user-characteristics
|
||||
notification_emails:
|
||||
- tom@mozilla.com
|
||||
bugs:
|
||||
- https://bugzilla.mozilla.org/show_bug.cgi?id=1939903
|
||||
data_reviews:
|
||||
- https://bugzilla.mozilla.org/show_bug.cgi?id=1939903#c3
|
||||
expires: never
|
||||
data_sensitivity:
|
||||
- technical
|
||||
|
||||
wgpu_maxbindingsperbindgroup:
|
||||
type: quantity
|
||||
unit: uint
|
||||
description: >
|
||||
WebGPU limit maxBindingsPerBindGroup
|
||||
lifetime: application
|
||||
send_in_pings:
|
||||
- user-characteristics
|
||||
notification_emails:
|
||||
- tom@mozilla.com
|
||||
bugs:
|
||||
- https://bugzilla.mozilla.org/show_bug.cgi?id=1939903
|
||||
data_reviews:
|
||||
- https://bugzilla.mozilla.org/show_bug.cgi?id=1939903#c3
|
||||
expires: never
|
||||
data_sensitivity:
|
||||
- technical
|
||||
|
||||
wgpu_maxdynamicuniformbuffersperpipelinelayout:
|
||||
type: quantity
|
||||
unit: uint
|
||||
description: >
|
||||
WebGPU limit maxDynamicUniformBuffersPerPipelineLayout
|
||||
lifetime: application
|
||||
send_in_pings:
|
||||
- user-characteristics
|
||||
notification_emails:
|
||||
- tom@mozilla.com
|
||||
bugs:
|
||||
- https://bugzilla.mozilla.org/show_bug.cgi?id=1939903
|
||||
data_reviews:
|
||||
- https://bugzilla.mozilla.org/show_bug.cgi?id=1939903#c3
|
||||
expires: never
|
||||
data_sensitivity:
|
||||
- technical
|
||||
|
||||
wgpu_maxdynamicstoragebuffersperpipelinelayout:
|
||||
type: quantity
|
||||
unit: uint
|
||||
description: >
|
||||
WebGPU limit maxDynamicStorageBuffersPerPipelineLayout
|
||||
lifetime: application
|
||||
send_in_pings:
|
||||
- user-characteristics
|
||||
notification_emails:
|
||||
- tom@mozilla.com
|
||||
bugs:
|
||||
- https://bugzilla.mozilla.org/show_bug.cgi?id=1939903
|
||||
data_reviews:
|
||||
- https://bugzilla.mozilla.org/show_bug.cgi?id=1939903#c3
|
||||
expires: never
|
||||
data_sensitivity:
|
||||
- technical
|
||||
|
||||
wgpu_maxsampledtexturespershaderstage:
|
||||
type: quantity
|
||||
unit: uint
|
||||
description: >
|
||||
WebGPU limit maxSampledTexturesPerShaderStage
|
||||
lifetime: application
|
||||
send_in_pings:
|
||||
- user-characteristics
|
||||
notification_emails:
|
||||
- tom@mozilla.com
|
||||
bugs:
|
||||
- https://bugzilla.mozilla.org/show_bug.cgi?id=1939903
|
||||
data_reviews:
|
||||
- https://bugzilla.mozilla.org/show_bug.cgi?id=1939903#c3
|
||||
expires: never
|
||||
data_sensitivity:
|
||||
- technical
|
||||
|
||||
wgpu_maxsamplerspershaderstage:
|
||||
type: quantity
|
||||
unit: uint
|
||||
description: >
|
||||
WebGPU limit maxSamplersPerShaderStage
|
||||
lifetime: application
|
||||
send_in_pings:
|
||||
- user-characteristics
|
||||
notification_emails:
|
||||
- tom@mozilla.com
|
||||
bugs:
|
||||
- https://bugzilla.mozilla.org/show_bug.cgi?id=1939903
|
||||
data_reviews:
|
||||
- https://bugzilla.mozilla.org/show_bug.cgi?id=1939903#c3
|
||||
expires: never
|
||||
data_sensitivity:
|
||||
- technical
|
||||
|
||||
wgpu_maxstoragebufferspershaderstage:
|
||||
type: quantity
|
||||
unit: uint
|
||||
description: >
|
||||
WebGPU limit maxStorageBuffersPerShaderStage
|
||||
lifetime: application
|
||||
send_in_pings:
|
||||
- user-characteristics
|
||||
notification_emails:
|
||||
- tom@mozilla.com
|
||||
bugs:
|
||||
- https://bugzilla.mozilla.org/show_bug.cgi?id=1939903
|
||||
data_reviews:
|
||||
- https://bugzilla.mozilla.org/show_bug.cgi?id=1939903#c3
|
||||
expires: never
|
||||
data_sensitivity:
|
||||
- technical
|
||||
|
||||
wgpu_maxstoragetexturespershaderstage:
|
||||
type: quantity
|
||||
unit: uint
|
||||
description: >
|
||||
WebGPU limit maxStorageTexturesPerShaderStage
|
||||
lifetime: application
|
||||
send_in_pings:
|
||||
- user-characteristics
|
||||
notification_emails:
|
||||
- tom@mozilla.com
|
||||
bugs:
|
||||
- https://bugzilla.mozilla.org/show_bug.cgi?id=1939903
|
||||
data_reviews:
|
||||
- https://bugzilla.mozilla.org/show_bug.cgi?id=1939903#c3
|
||||
expires: never
|
||||
data_sensitivity:
|
||||
- technical
|
||||
|
||||
wgpu_maxuniformbufferspershaderstage:
|
||||
type: quantity
|
||||
unit: uint
|
||||
description: >
|
||||
WebGPU limit maxUniformBuffersPerShaderStage
|
||||
lifetime: application
|
||||
send_in_pings:
|
||||
- user-characteristics
|
||||
notification_emails:
|
||||
- tom@mozilla.com
|
||||
bugs:
|
||||
- https://bugzilla.mozilla.org/show_bug.cgi?id=1939903
|
||||
data_reviews:
|
||||
- https://bugzilla.mozilla.org/show_bug.cgi?id=1939903#c3
|
||||
expires: never
|
||||
data_sensitivity:
|
||||
- technical
|
||||
|
||||
wgpu_maxuniformbufferbindingsize:
|
||||
type: quantity
|
||||
unit: uint
|
||||
description: >
|
||||
WebGPU limit maxUniformBufferBindingSize
|
||||
lifetime: application
|
||||
send_in_pings:
|
||||
- user-characteristics
|
||||
notification_emails:
|
||||
- tom@mozilla.com
|
||||
bugs:
|
||||
- https://bugzilla.mozilla.org/show_bug.cgi?id=1939903
|
||||
data_reviews:
|
||||
- https://bugzilla.mozilla.org/show_bug.cgi?id=1939903#c3
|
||||
expires: never
|
||||
data_sensitivity:
|
||||
- technical
|
||||
|
||||
wgpu_maxstoragebufferbindingsize:
|
||||
type: quantity
|
||||
unit: uint
|
||||
description: >
|
||||
WebGPU limit maxStorageBufferBindingSize
|
||||
lifetime: application
|
||||
send_in_pings:
|
||||
- user-characteristics
|
||||
notification_emails:
|
||||
- tom@mozilla.com
|
||||
bugs:
|
||||
- https://bugzilla.mozilla.org/show_bug.cgi?id=1939903
|
||||
data_reviews:
|
||||
- https://bugzilla.mozilla.org/show_bug.cgi?id=1939903#c3
|
||||
expires: never
|
||||
data_sensitivity:
|
||||
- technical
|
||||
|
||||
wgpu_minuniformbufferoffsetalignment:
|
||||
type: quantity
|
||||
unit: uint
|
||||
description: >
|
||||
WebGPU limit minUniformBufferOffsetAlignment
|
||||
lifetime: application
|
||||
send_in_pings:
|
||||
- user-characteristics
|
||||
notification_emails:
|
||||
- tom@mozilla.com
|
||||
bugs:
|
||||
- https://bugzilla.mozilla.org/show_bug.cgi?id=1939903
|
||||
data_reviews:
|
||||
- https://bugzilla.mozilla.org/show_bug.cgi?id=1939903#c3
|
||||
expires: never
|
||||
data_sensitivity:
|
||||
- technical
|
||||
|
||||
wgpu_minstoragebufferoffsetalignment:
|
||||
type: quantity
|
||||
unit: uint
|
||||
description: >
|
||||
WebGPU limit minStorageBufferOffsetAlignment
|
||||
lifetime: application
|
||||
send_in_pings:
|
||||
- user-characteristics
|
||||
notification_emails:
|
||||
- tom@mozilla.com
|
||||
bugs:
|
||||
- https://bugzilla.mozilla.org/show_bug.cgi?id=1939903
|
||||
data_reviews:
|
||||
- https://bugzilla.mozilla.org/show_bug.cgi?id=1939903#c3
|
||||
expires: never
|
||||
data_sensitivity:
|
||||
- technical
|
||||
|
||||
wgpu_maxvertexbuffers:
|
||||
type: quantity
|
||||
unit: uint
|
||||
description: >
|
||||
WebGPU limit maxVertexBuffers
|
||||
lifetime: application
|
||||
send_in_pings:
|
||||
- user-characteristics
|
||||
notification_emails:
|
||||
- tom@mozilla.com
|
||||
bugs:
|
||||
- https://bugzilla.mozilla.org/show_bug.cgi?id=1939903
|
||||
data_reviews:
|
||||
- https://bugzilla.mozilla.org/show_bug.cgi?id=1939903#c3
|
||||
expires: never
|
||||
data_sensitivity:
|
||||
- technical
|
||||
|
||||
wgpu_maxbuffersize:
|
||||
type: quantity
|
||||
unit: uint
|
||||
description: >
|
||||
WebGPU limit maxBufferSize
|
||||
lifetime: application
|
||||
send_in_pings:
|
||||
- user-characteristics
|
||||
notification_emails:
|
||||
- tom@mozilla.com
|
||||
bugs:
|
||||
- https://bugzilla.mozilla.org/show_bug.cgi?id=1939903
|
||||
data_reviews:
|
||||
- https://bugzilla.mozilla.org/show_bug.cgi?id=1939903#c3
|
||||
expires: never
|
||||
data_sensitivity:
|
||||
- technical
|
||||
|
||||
wgpu_maxvertexattributes:
|
||||
type: quantity
|
||||
unit: uint
|
||||
description: >
|
||||
WebGPU limit maxVertexAttributes
|
||||
lifetime: application
|
||||
send_in_pings:
|
||||
- user-characteristics
|
||||
notification_emails:
|
||||
- tom@mozilla.com
|
||||
bugs:
|
||||
- https://bugzilla.mozilla.org/show_bug.cgi?id=1939903
|
||||
data_reviews:
|
||||
- https://bugzilla.mozilla.org/show_bug.cgi?id=1939903#c3
|
||||
expires: never
|
||||
data_sensitivity:
|
||||
- technical
|
||||
|
||||
wgpu_maxvertexbufferarraystride:
|
||||
type: quantity
|
||||
unit: uint
|
||||
description: >
|
||||
WebGPU limit maxVertexBufferArrayStride
|
||||
lifetime: application
|
||||
send_in_pings:
|
||||
- user-characteristics
|
||||
notification_emails:
|
||||
- tom@mozilla.com
|
||||
bugs:
|
||||
- https://bugzilla.mozilla.org/show_bug.cgi?id=1939903
|
||||
data_reviews:
|
||||
- https://bugzilla.mozilla.org/show_bug.cgi?id=1939903#c3
|
||||
expires: never
|
||||
data_sensitivity:
|
||||
- technical
|
||||
|
||||
wgpu_maxinterstageshadervariables:
|
||||
type: quantity
|
||||
unit: uint
|
||||
description: >
|
||||
WebGPU limit maxInterStageShaderVariables
|
||||
lifetime: application
|
||||
send_in_pings:
|
||||
- user-characteristics
|
||||
notification_emails:
|
||||
- tom@mozilla.com
|
||||
bugs:
|
||||
- https://bugzilla.mozilla.org/show_bug.cgi?id=1939903
|
||||
data_reviews:
|
||||
- https://bugzilla.mozilla.org/show_bug.cgi?id=1939903#c3
|
||||
expires: never
|
||||
data_sensitivity:
|
||||
- technical
|
||||
|
||||
wgpu_maxcolorattachments:
|
||||
type: quantity
|
||||
unit: uint
|
||||
description: >
|
||||
WebGPU limit maxColorAttachments
|
||||
lifetime: application
|
||||
send_in_pings:
|
||||
- user-characteristics
|
||||
notification_emails:
|
||||
- tom@mozilla.com
|
||||
bugs:
|
||||
- https://bugzilla.mozilla.org/show_bug.cgi?id=1939903
|
||||
data_reviews:
|
||||
- https://bugzilla.mozilla.org/show_bug.cgi?id=1939903#c3
|
||||
expires: never
|
||||
data_sensitivity:
|
||||
- technical
|
||||
|
||||
wgpu_maxcolorattachmentbytespersample:
|
||||
type: quantity
|
||||
unit: uint
|
||||
description: >
|
||||
WebGPU limit maxColorAttachmentBytesPerSample
|
||||
lifetime: application
|
||||
send_in_pings:
|
||||
- user-characteristics
|
||||
notification_emails:
|
||||
- tom@mozilla.com
|
||||
bugs:
|
||||
- https://bugzilla.mozilla.org/show_bug.cgi?id=1939903
|
||||
data_reviews:
|
||||
- https://bugzilla.mozilla.org/show_bug.cgi?id=1939903#c3
|
||||
expires: never
|
||||
data_sensitivity:
|
||||
- technical
|
||||
|
||||
wgpu_maxcomputeworkgroupstoragesize:
|
||||
type: quantity
|
||||
unit: uint
|
||||
description: >
|
||||
WebGPU limit maxComputeWorkgroupStorageSize
|
||||
lifetime: application
|
||||
send_in_pings:
|
||||
- user-characteristics
|
||||
notification_emails:
|
||||
- tom@mozilla.com
|
||||
bugs:
|
||||
- https://bugzilla.mozilla.org/show_bug.cgi?id=1939903
|
||||
data_reviews:
|
||||
- https://bugzilla.mozilla.org/show_bug.cgi?id=1939903#c3
|
||||
expires: never
|
||||
data_sensitivity:
|
||||
- technical
|
||||
|
||||
wgpu_maxcomputeinvocationsperworkgroup:
|
||||
type: quantity
|
||||
unit: uint
|
||||
description: >
|
||||
WebGPU limit maxComputeInvocationsPerWorkgroup
|
||||
lifetime: application
|
||||
send_in_pings:
|
||||
- user-characteristics
|
||||
notification_emails:
|
||||
- tom@mozilla.com
|
||||
bugs:
|
||||
- https://bugzilla.mozilla.org/show_bug.cgi?id=1939903
|
||||
data_reviews:
|
||||
- https://bugzilla.mozilla.org/show_bug.cgi?id=1939903#c3
|
||||
expires: never
|
||||
data_sensitivity:
|
||||
- technical
|
||||
|
||||
wgpu_maxcomputeworkgroupsizex:
|
||||
type: quantity
|
||||
unit: uint
|
||||
description: >
|
||||
WebGPU limit maxComputeWorkgroupSizeX
|
||||
lifetime: application
|
||||
send_in_pings:
|
||||
- user-characteristics
|
||||
notification_emails:
|
||||
- tom@mozilla.com
|
||||
bugs:
|
||||
- https://bugzilla.mozilla.org/show_bug.cgi?id=1939903
|
||||
data_reviews:
|
||||
- https://bugzilla.mozilla.org/show_bug.cgi?id=1939903#c3
|
||||
expires: never
|
||||
data_sensitivity:
|
||||
- technical
|
||||
|
||||
wgpu_maxcomputeworkgroupsizey:
|
||||
type: quantity
|
||||
unit: uint
|
||||
description: >
|
||||
WebGPU limit maxComputeWorkgroupSizeY
|
||||
lifetime: application
|
||||
send_in_pings:
|
||||
- user-characteristics
|
||||
notification_emails:
|
||||
- tom@mozilla.com
|
||||
bugs:
|
||||
- https://bugzilla.mozilla.org/show_bug.cgi?id=1939903
|
||||
data_reviews:
|
||||
- https://bugzilla.mozilla.org/show_bug.cgi?id=1939903#c3
|
||||
expires: never
|
||||
data_sensitivity:
|
||||
- technical
|
||||
|
||||
wgpu_maxcomputeworkgroupsizez:
|
||||
type: quantity
|
||||
unit: uint
|
||||
description: >
|
||||
WebGPU limit maxComputeWorkgroupSizeZ
|
||||
lifetime: application
|
||||
send_in_pings:
|
||||
- user-characteristics
|
||||
notification_emails:
|
||||
- tom@mozilla.com
|
||||
bugs:
|
||||
- https://bugzilla.mozilla.org/show_bug.cgi?id=1939903
|
||||
data_reviews:
|
||||
- https://bugzilla.mozilla.org/show_bug.cgi?id=1939903#c3
|
||||
expires: never
|
||||
data_sensitivity:
|
||||
- technical
|
||||
|
||||
wgpu_maxcomputeworkgroupsperdimension:
|
||||
type: quantity
|
||||
unit: uint
|
||||
description: >
|
||||
WebGPU limit maxComputeWorkgroupsPerDimension
|
||||
lifetime: application
|
||||
send_in_pings:
|
||||
- user-characteristics
|
||||
notification_emails:
|
||||
- tom@mozilla.com
|
||||
bugs:
|
||||
- https://bugzilla.mozilla.org/show_bug.cgi?id=1939903
|
||||
data_reviews:
|
||||
- https://bugzilla.mozilla.org/show_bug.cgi?id=1939903#c3
|
||||
expires: never
|
||||
data_sensitivity:
|
||||
- technical
|
||||
|
||||
@@ -13,7 +13,6 @@ JAR_MANIFESTS += ["jar.mn"]
|
||||
|
||||
UNIFIED_SOURCES += [
|
||||
"nsRFPService.cpp",
|
||||
"nsRFPTargetSetIDL.cpp",
|
||||
"RelativeTimeline.cpp",
|
||||
]
|
||||
# Because nsUserCharacteristics doesn't `use namespace mozilla` (because we're going to wind
|
||||
@@ -32,14 +31,10 @@ SPHINX_TREES["resistfingerprinting"] = "docs"
|
||||
|
||||
FINAL_LIBRARY = "xul"
|
||||
|
||||
EXPORTS += [
|
||||
"nsRFPService.h",
|
||||
"nsRFPTargetSetIDL.h",
|
||||
"nsUserCharacteristics.h",
|
||||
"RFPTargets.inc",
|
||||
]
|
||||
EXPORTS += ["nsRFPService.h", "nsUserCharacteristics.h", "RFPTargets.inc"]
|
||||
EXPORTS.mozilla += [
|
||||
"RelativeTimeline.h",
|
||||
"RFPTargetIPCUtils.h",
|
||||
]
|
||||
EXPORTS.mozilla.gtest += ["nsUserCharacteristics.h"]
|
||||
|
||||
@@ -59,7 +54,6 @@ XPCOM_MANIFESTS += [
|
||||
XPIDL_SOURCES += [
|
||||
"nsIFingerprintingWebCompatService.idl",
|
||||
"nsIRFPService.idl",
|
||||
"nsIRFPTargetSetIDL.idl",
|
||||
"nsIUserCharacteristicsPageService.idl",
|
||||
]
|
||||
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
|
||||
#include "nsISupports.idl"
|
||||
#include "nsIFingerprintingWebCompatService.idl"
|
||||
#include "nsIRFPTargetSetIDL.idl"
|
||||
|
||||
interface nsIPrincipal;
|
||||
interface nsIChannel;
|
||||
@@ -33,7 +32,7 @@ interface nsIRFPService : nsISupports
|
||||
* scope. 0 if the overridden scope doesn't exist.
|
||||
*
|
||||
*/
|
||||
nsIRFPTargetSetIDL getFingerprintingOverrides(in ACString aDomainKey);
|
||||
uint64_t getFingerprintingOverrides(in ACString aDomainKey);
|
||||
|
||||
/**
|
||||
* Clean all overrides. This is for testing purpose.
|
||||
@@ -43,7 +42,7 @@ interface nsIRFPService : nsISupports
|
||||
/**
|
||||
* The bitfield of the default enabled RFP Targets.
|
||||
*/
|
||||
readonly attribute nsIRFPTargetSetIDL enabledFingerprintingProtections;
|
||||
readonly attribute uint64_t enabledFingerprintingProtections;
|
||||
|
||||
/**
|
||||
* Clean all fingerprinting randomization keys.
|
||||
|
||||
@@ -1,15 +0,0 @@
|
||||
/* 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 http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
#include "nsISupports.idl"
|
||||
|
||||
/**
|
||||
* Used to represent active RFPTargets.
|
||||
* We used to use uint64_t, but we ran out of bits.
|
||||
*/
|
||||
[scriptable, uuid(6c072f47-f25c-484f-add8-051b07789593)]
|
||||
interface nsIRFPTargetSetIDL : nsISupports {
|
||||
attribute uint64_t low;
|
||||
attribute uint64_t high;
|
||||
};
|
||||
@@ -77,7 +77,6 @@
|
||||
#include "nsTStringRepr.h"
|
||||
#include "nsUserCharacteristics.h"
|
||||
#include "nsXPCOM.h"
|
||||
#include "nsRFPTargetSetIDL.h"
|
||||
|
||||
#include "nsICookieJarSettings.h"
|
||||
#include "nsICryptoHash.h"
|
||||
@@ -129,22 +128,22 @@ static constexpr uint32_t kVideoDroppedRatio = 1;
|
||||
|
||||
// Fingerprinting protections that are enabled by default. This can be
|
||||
// overridden using the privacy.fingerprintingProtection.overrides pref.
|
||||
// NOLINTBEGIN(bugprone-macro-parentheses)
|
||||
#if defined(MOZ_WIDGET_ANDROID)
|
||||
# define ANDROID_DEFAULT(name) RFPTarget::name,
|
||||
// NOLINTNEXTLINE(bugprone-macro-parentheses)
|
||||
# define ANDROID_DEFAULT(name) RFPTarget::name |
|
||||
# define DESKTOP_DEFAULT(name)
|
||||
#else
|
||||
# define ANDROID_DEFAULT(name)
|
||||
# define DESKTOP_DEFAULT(name) RFPTarget::name,
|
||||
// NOLINTNEXTLINE(bugprone-macro-parentheses)
|
||||
# define DESKTOP_DEFAULT(name) RFPTarget::name |
|
||||
#endif
|
||||
|
||||
MOZ_RUNINIT const RFPTargetSet kDefaultFingerprintingProtections = {
|
||||
const RFPTarget kDefaultFingerprintingProtections =
|
||||
#include "RFPTargetsDefault.inc"
|
||||
};
|
||||
static_cast<RFPTarget>(0);
|
||||
|
||||
#undef ANDROID_DEFAULT
|
||||
#undef DESKTOP_DEFAULT
|
||||
// NOLINTEND(bugprone-macro-parentheses)
|
||||
|
||||
static constexpr uint32_t kSuspiciousFingerprintingActivityThreshold = 1;
|
||||
|
||||
@@ -159,9 +158,7 @@ static StaticRefPtr<nsRFPService> sRFPService;
|
||||
static bool sInitialized = false;
|
||||
|
||||
// Actually enabled fingerprinting protections.
|
||||
static StaticMutex sEnabledFingerprintingProtectionsMutex;
|
||||
MOZ_CONSTINIT static RFPTargetSet sEnabledFingerprintingProtections
|
||||
MOZ_GUARDED_BY(sEnabledFingerprintingProtectionsMutex);
|
||||
static Atomic<RFPTarget> sEnabledFingerprintingProtections;
|
||||
|
||||
/* static */
|
||||
already_AddRefed<nsRFPService> nsRFPService::GetOrCreate() {
|
||||
@@ -302,7 +299,7 @@ bool IsJSContextCurrentlyChromePrivileged() {
|
||||
/* static */
|
||||
bool nsRFPService::IsRFPEnabledFor(
|
||||
bool aIsPrivateMode, RFPTarget aTarget,
|
||||
const Maybe<RFPTargetSet>& aOverriddenFingerprintingSettings,
|
||||
const Maybe<RFPTarget>& aOverriddenFingerprintingSettings,
|
||||
bool aSkipChromePrincipalCheck /* = false */) {
|
||||
MOZ_ASSERT(aTarget != RFPTarget::AllTargets);
|
||||
|
||||
@@ -334,11 +331,10 @@ bool nsRFPService::IsRFPEnabledFor(
|
||||
}
|
||||
|
||||
if (aOverriddenFingerprintingSettings) {
|
||||
return aOverriddenFingerprintingSettings.ref().contains(aTarget);
|
||||
return bool(aOverriddenFingerprintingSettings.ref() & aTarget);
|
||||
}
|
||||
|
||||
StaticMutexAutoLock lock(sEnabledFingerprintingProtectionsMutex);
|
||||
return sEnabledFingerprintingProtections.contains(aTarget);
|
||||
return bool(sEnabledFingerprintingProtections & aTarget);
|
||||
}
|
||||
|
||||
return false;
|
||||
@@ -354,10 +350,9 @@ void nsRFPService::UpdateFPPOverrideList() {
|
||||
return;
|
||||
}
|
||||
|
||||
RFPTargetSet enabled = CreateOverridesFromText(
|
||||
RFPTarget enabled = CreateOverridesFromText(
|
||||
targetOverrides, kDefaultFingerprintingProtections);
|
||||
|
||||
StaticMutexAutoLock lock(sEnabledFingerprintingProtectionsMutex);
|
||||
sEnabledFingerprintingProtections = enabled;
|
||||
}
|
||||
|
||||
@@ -2085,50 +2080,44 @@ nsresult nsRFPService::CreateOverrideDomainKey(
|
||||
}
|
||||
|
||||
/* static */
|
||||
RFPTargetSet nsRFPService::CreateOverridesFromText(
|
||||
const nsString& aOverridesText, RFPTargetSet aBaseOverrides) {
|
||||
RFPTargetSet result = aBaseOverrides;
|
||||
RFPTarget nsRFPService::CreateOverridesFromText(const nsString& aOverridesText,
|
||||
RFPTarget aBaseOverrides) {
|
||||
RFPTarget result = aBaseOverrides;
|
||||
|
||||
for (const nsAString& each : aOverridesText.Split(',')) {
|
||||
Maybe<RFPTarget> mappedValue =
|
||||
nsRFPService::TextToRFPTarget(Substring(each, 1, each.Length() - 1));
|
||||
if (mappedValue.isNothing()) {
|
||||
MOZ_LOG(gResistFingerprintingLog, LogLevel::Warning,
|
||||
("Could not map the value %s to an RFPTarget Enum",
|
||||
NS_ConvertUTF16toUTF8(each).get()));
|
||||
continue;
|
||||
}
|
||||
if (mappedValue.isSome()) {
|
||||
RFPTarget target = mappedValue.value();
|
||||
RFPTargetSet targetSet = RFPTargetSet(target);
|
||||
if (target == RFPTarget::AllTargets) {
|
||||
std::bitset<128> allTargets;
|
||||
allTargets.set();
|
||||
targetSet = RFPTargetSet(allTargets);
|
||||
}
|
||||
if (target == RFPTarget::IsAlwaysEnabledForPrecompute) {
|
||||
MOZ_LOG(gResistFingerprintingLog, LogLevel::Warning,
|
||||
("RFPTarget::%s is not a valid value",
|
||||
NS_ConvertUTF16toUTF8(each).get()));
|
||||
} else if (each[0] == '+') {
|
||||
result += targetSet;
|
||||
MOZ_LOG(
|
||||
gResistFingerprintingLog, LogLevel::Warning,
|
||||
("Mapped value %s (0x%" PRIx64 "), to an addition, now we have %s",
|
||||
result |= target;
|
||||
MOZ_LOG(gResistFingerprintingLog, LogLevel::Warning,
|
||||
("Mapped value %s (0x%" PRIx64
|
||||
"), to an addition, now we have 0x%" PRIx64,
|
||||
NS_ConvertUTF16toUTF8(each).get(), uint64_t(target),
|
||||
result.serialize().to_string().c_str()));
|
||||
uint64_t(result)));
|
||||
} else if (each[0] == '-') {
|
||||
result -= targetSet;
|
||||
MOZ_LOG(
|
||||
gResistFingerprintingLog, LogLevel::Warning,
|
||||
("Mapped value %s (0x%" PRIx64 ") to a subtraction, now we have %s",
|
||||
result &= ~target;
|
||||
MOZ_LOG(gResistFingerprintingLog, LogLevel::Warning,
|
||||
("Mapped value %s (0x%" PRIx64
|
||||
") to a subtraction, now we have 0x%" PRIx64,
|
||||
NS_ConvertUTF16toUTF8(each).get(), uint64_t(target),
|
||||
result.serialize().to_string().c_str()));
|
||||
uint64_t(result)));
|
||||
} else {
|
||||
MOZ_LOG(gResistFingerprintingLog, LogLevel::Warning,
|
||||
("Mapped value %s (0x%" PRIx64
|
||||
") to an RFPTarget Enum, but the first "
|
||||
"character wasn't + or -",
|
||||
NS_ConvertUTF16toUTF8(each).get(), target));
|
||||
NS_ConvertUTF16toUTF8(each).get(), uint64_t(target)));
|
||||
}
|
||||
} else {
|
||||
MOZ_LOG(gResistFingerprintingLog, LogLevel::Warning,
|
||||
("Could not map the value %s to an RFPTarget Enum",
|
||||
NS_ConvertUTF16toUTF8(each).get()));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2155,8 +2144,7 @@ nsRFPService::SetFingerprintingOverrides(
|
||||
rv = fpOverride->GetOverrides(overridesText);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
StaticMutexAutoLock lock(sEnabledFingerprintingProtectionsMutex);
|
||||
RFPTargetSet targets = nsRFPService::CreateOverridesFromText(
|
||||
RFPTarget targets = nsRFPService::CreateOverridesFromText(
|
||||
NS_ConvertUTF8toUTF16(overridesText),
|
||||
mFingerprintingOverrides.Contains(domainKey)
|
||||
? mFingerprintingOverrides.Get(domainKey)
|
||||
@@ -2179,32 +2167,25 @@ nsRFPService::SetFingerprintingOverrides(
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsRFPService::GetEnabledFingerprintingProtections(
|
||||
nsIRFPTargetSetIDL** aProtections) {
|
||||
StaticMutexAutoLock lock(sEnabledFingerprintingProtectionsMutex);
|
||||
RFPTargetSet enabled = sEnabledFingerprintingProtections;
|
||||
|
||||
nsCOMPtr<nsIRFPTargetSetIDL> protections = new nsRFPTargetSetIDL(enabled);
|
||||
protections.forget(aProtections);
|
||||
nsRFPService::GetEnabledFingerprintingProtections(uint64_t* aProtections) {
|
||||
RFPTarget enabled = sEnabledFingerprintingProtections;
|
||||
|
||||
*aProtections = uint64_t(enabled);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsRFPService::GetFingerprintingOverrides(const nsACString& aDomainKey,
|
||||
nsIRFPTargetSetIDL** aOverrides) {
|
||||
uint64_t* aOverrides) {
|
||||
MOZ_ASSERT(XRE_IsParentProcess());
|
||||
|
||||
Maybe<RFPTargetSet> overrides = mFingerprintingOverrides.MaybeGet(aDomainKey);
|
||||
Maybe<RFPTarget> overrides = mFingerprintingOverrides.MaybeGet(aDomainKey);
|
||||
|
||||
if (!overrides) {
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
nsCOMPtr<nsIRFPTargetSetIDL> protections =
|
||||
new nsRFPTargetSetIDL(overrides.ref());
|
||||
protections.forget(aOverrides);
|
||||
|
||||
*aOverrides = uint64_t(overrides.ref());
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
@@ -2216,7 +2197,7 @@ nsRFPService::CleanAllOverrides() {
|
||||
}
|
||||
|
||||
/* static */
|
||||
Maybe<RFPTargetSet> nsRFPService::GetOverriddenFingerprintingSettingsForChannel(
|
||||
Maybe<RFPTarget> nsRFPService::GetOverriddenFingerprintingSettingsForChannel(
|
||||
nsIChannel* aChannel) {
|
||||
MOZ_ASSERT(aChannel);
|
||||
MOZ_ASSERT(XRE_IsParentProcess());
|
||||
@@ -2348,7 +2329,7 @@ Maybe<RFPTargetSet> nsRFPService::GetOverriddenFingerprintingSettingsForChannel(
|
||||
}
|
||||
|
||||
/* static */
|
||||
Maybe<RFPTargetSet> nsRFPService::GetOverriddenFingerprintingSettingsForURI(
|
||||
Maybe<RFPTarget> nsRFPService::GetOverriddenFingerprintingSettingsForURI(
|
||||
nsIURI* aFirstPartyURI, nsIURI* aThirdPartyURI) {
|
||||
MOZ_ASSERT(aFirstPartyURI);
|
||||
MOZ_ASSERT(XRE_IsParentProcess());
|
||||
@@ -2364,8 +2345,7 @@ Maybe<RFPTargetSet> nsRFPService::GetOverriddenFingerprintingSettingsForURI(
|
||||
// scope.
|
||||
|
||||
// First, we get the overrides that applies to every context.
|
||||
Maybe<RFPTargetSet> result =
|
||||
service->mFingerprintingOverrides.MaybeGet("*"_ns);
|
||||
Maybe<RFPTarget> result = service->mFingerprintingOverrides.MaybeGet("*"_ns);
|
||||
|
||||
RefPtr<nsEffectiveTLDService> eTLDService =
|
||||
nsEffectiveTLDService::GetInstance();
|
||||
@@ -2393,7 +2373,7 @@ Maybe<RFPTargetSet> nsRFPService::GetOverriddenFingerprintingSettingsForURI(
|
||||
key.Append(FP_OVERRIDES_DOMAIN_KEY_DELIMITER);
|
||||
key.Append("*");
|
||||
|
||||
Maybe<RFPTargetSet> fpOverrides =
|
||||
Maybe<RFPTarget> fpOverrides =
|
||||
service->mFingerprintingOverrides.MaybeGet(key);
|
||||
if (fpOverrides) {
|
||||
result = fpOverrides;
|
||||
@@ -2428,7 +2408,7 @@ Maybe<RFPTargetSet> nsRFPService::GetOverriddenFingerprintingSettingsForURI(
|
||||
key.Assign(firstPartyDomain);
|
||||
key.Append(FP_OVERRIDES_DOMAIN_KEY_DELIMITER);
|
||||
key.Append("*");
|
||||
Maybe<RFPTargetSet> fpOverrides =
|
||||
Maybe<RFPTarget> fpOverrides =
|
||||
service->mFingerprintingOverrides.MaybeGet(key);
|
||||
if (fpOverrides) {
|
||||
result = fpOverrides;
|
||||
|
||||
@@ -8,7 +8,6 @@
|
||||
|
||||
#include <cstdint>
|
||||
#include <tuple>
|
||||
#include <bitset>
|
||||
#include "ErrorList.h"
|
||||
#include "PLDHashTable.h"
|
||||
#include "mozilla/BasicEvents.h"
|
||||
@@ -203,12 +202,7 @@ enum class RFPTarget : uint64_t {
|
||||
|
||||
#undef ITEM_VALUE
|
||||
|
||||
using RFPTargetSet = EnumSet<RFPTarget, std::bitset<128>>;
|
||||
|
||||
template <>
|
||||
struct MaxEnumValue<RFPTarget> {
|
||||
static constexpr unsigned int value = 127;
|
||||
};
|
||||
MOZ_MAKE_ENUM_CLASS_BITWISE_OPERATORS(RFPTarget);
|
||||
|
||||
// ============================================================================
|
||||
|
||||
@@ -227,7 +221,7 @@ class nsRFPService final : public nsIObserver, public nsIRFPService {
|
||||
|
||||
static bool IsRFPEnabledFor(
|
||||
bool aIsPrivateMode, RFPTarget aTarget,
|
||||
const Maybe<RFPTargetSet>& aOverriddenFingerprintingSettings,
|
||||
const Maybe<RFPTarget>& aOverriddenFingerprintingSettings,
|
||||
bool aSkipChromePrincipalCheck = false);
|
||||
|
||||
static bool IsSystemPrincipalOrAboutFingerprintingProtection(JSContext*,
|
||||
@@ -355,7 +349,7 @@ class nsRFPService final : public nsIObserver, public nsIRFPService {
|
||||
// overrides to replace default enabled RFPTargets for the context of the
|
||||
// channel. The method will return Nothing() to indicate using the default
|
||||
// RFPTargets
|
||||
static Maybe<RFPTargetSet> GetOverriddenFingerprintingSettingsForChannel(
|
||||
static Maybe<RFPTarget> GetOverriddenFingerprintingSettingsForChannel(
|
||||
nsIChannel* aChannel);
|
||||
|
||||
// The method for getting the granular fingerprinting protection override of
|
||||
@@ -363,7 +357,7 @@ class nsRFPService final : public nsIObserver, public nsIRFPService {
|
||||
// overrides if there is one defined for the context of the first-party URI
|
||||
// and third-party URI. Otherwise, it will return Nothing() to indicate using
|
||||
// the default RFPTargets.
|
||||
static Maybe<RFPTargetSet> GetOverriddenFingerprintingSettingsForURI(
|
||||
static Maybe<RFPTarget> GetOverriddenFingerprintingSettingsForURI(
|
||||
nsIURI* aFirstPartyURI, nsIURI* aThirdPartyURI);
|
||||
|
||||
// --------------------------------------------------------------------------
|
||||
@@ -480,7 +474,7 @@ class nsRFPService final : public nsIObserver, public nsIRFPService {
|
||||
nsTHashMap<nsCStringHashKey, nsID> mBrowsingSessionKeys;
|
||||
|
||||
nsCOMPtr<nsIFingerprintingWebCompatService> mWebCompatService;
|
||||
nsTHashMap<nsCStringHashKey, RFPTargetSet> mFingerprintingOverrides;
|
||||
nsTHashMap<nsCStringHashKey, RFPTarget> mFingerprintingOverrides;
|
||||
|
||||
// A helper function to create the domain key for the fingerprinting
|
||||
// overrides. The key can be in the following five formats.
|
||||
@@ -499,9 +493,8 @@ class nsRFPService final : public nsIObserver, public nsIRFPService {
|
||||
// overrides text and the based overrides bitfield. The function will parse
|
||||
// the text and update the based overrides bitfield accordingly. Then, it will
|
||||
// return the updated bitfield.
|
||||
static RFPTargetSet CreateOverridesFromText(
|
||||
const nsString& aOverridesText,
|
||||
RFPTargetSet aBaseOverrides = RFPTargetSet());
|
||||
static RFPTarget CreateOverridesFromText(
|
||||
const nsString& aOverridesText, RFPTarget aBaseOverrides = RFPTarget(0));
|
||||
};
|
||||
|
||||
} // namespace mozilla
|
||||
|
||||
@@ -1,46 +0,0 @@
|
||||
/* 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 http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
#include "nsRFPTargetSetIDL.h"
|
||||
|
||||
namespace mozilla {
|
||||
|
||||
NS_IMPL_ISUPPORTS(nsRFPTargetSetIDL, nsIRFPTargetSetIDL)
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsRFPTargetSetIDL::GetLow(uint64_t* aLow) {
|
||||
std::bitset<128> bitset = mBits.serialize();
|
||||
std::bitset<128> mask = std::bitset<128>(0xFFFFFFFFFFFFFFFF);
|
||||
*aLow = (bitset & mask).to_ullong();
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsRFPTargetSetIDL::GetHigh(uint64_t* aHigh) {
|
||||
std::bitset<128> bitset = mBits.serialize();
|
||||
std::bitset<128> mask = std::bitset<128>(0xFFFFFFFFFFFFFFFF);
|
||||
*aHigh = ((bitset >> 64) & mask).to_ullong();
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsRFPTargetSetIDL::SetLow(uint64_t aLow) {
|
||||
std::bitset<128> bitset = mBits.serialize();
|
||||
bitset |= aLow;
|
||||
mBits.deserialize(bitset);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsRFPTargetSetIDL::SetHigh(uint64_t aHigh) {
|
||||
std::bitset<128> bitset = mBits.serialize();
|
||||
std::bitset<128> mask = std::bitset<128>(0xFFFFFFFFFFFFFFFF);
|
||||
uint64_t low = (bitset & mask).to_ullong();
|
||||
bitset = aHigh;
|
||||
bitset <<= 64;
|
||||
bitset |= low;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
} // namespace mozilla
|
||||
@@ -1,28 +0,0 @@
|
||||
/* 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/. */
|
||||
|
||||
#ifndef mozilla_RFPTargetSetIDL_h__
|
||||
#define mozilla_RFPTargetSetIDL_h__
|
||||
|
||||
#include "nsIRFPTargetSetIDL.h"
|
||||
#include "nsRFPService.h"
|
||||
|
||||
namespace mozilla {
|
||||
|
||||
class nsRFPTargetSetIDL final : public nsIRFPTargetSetIDL {
|
||||
NS_DECL_ISUPPORTS
|
||||
NS_DECL_NSIRFPTARGETSETIDL
|
||||
|
||||
public:
|
||||
nsRFPTargetSetIDL() = default;
|
||||
explicit nsRFPTargetSetIDL(RFPTargetSet& aBits) : mBits(aBits) {};
|
||||
|
||||
private:
|
||||
~nsRFPTargetSetIDL() = default;
|
||||
|
||||
RFPTargetSet mBits;
|
||||
};
|
||||
} // namespace mozilla
|
||||
|
||||
#endif // mozilla_RFPTargetSetIDL_h__
|
||||
@@ -13,12 +13,12 @@ const COLLECTION_NAME = "fingerprinting-protection-overrides";
|
||||
// The javascript bitwise operator only support 32bits. So, we only test
|
||||
// RFPTargets that is under low 32 bits.
|
||||
const TARGET_DEFAULT = extractLow32Bits(
|
||||
Services.rfp.enabledFingerprintingProtections.low
|
||||
Services.rfp.enabledFingerprintingProtections
|
||||
);
|
||||
const TARGET_PointerEvents = 1 << 2;
|
||||
const TARGET_CanvasRandomization = 1 << 9;
|
||||
const TARGET_WindowOuterSize = 1 << 26;
|
||||
const TARGET_Gamepad = 1 << 24;
|
||||
const TARGET_PointerEvents = 0x00000002;
|
||||
const TARGET_CanvasRandomization = 0x000000100;
|
||||
const TARGET_WindowOuterSize = 0x002000000;
|
||||
const TARGET_Gamepad = 0x00800000;
|
||||
|
||||
const TEST_PAGE =
|
||||
getRootDirectory(gTestPath).replace(
|
||||
@@ -309,7 +309,7 @@ add_task(async function test_remote_settings() {
|
||||
// Get the addition and subtraction flags for the domain.
|
||||
try {
|
||||
let overrides = extractLow32Bits(
|
||||
Services.rfp.getFingerprintingOverrides(expect.domain).low
|
||||
Services.rfp.getFingerprintingOverrides(expect.domain)
|
||||
);
|
||||
|
||||
// Verify if the flags are matching to expected values.
|
||||
@@ -354,7 +354,7 @@ add_task(async function test_remote_settings_pref() {
|
||||
for (let expect of test.expects) {
|
||||
try {
|
||||
// Check for the existance of RFP overrides
|
||||
Services.rfp.getFingerprintingOverrides(expect.domain).low;
|
||||
Services.rfp.getFingerprintingOverrides(expect.domain);
|
||||
ok(
|
||||
false,
|
||||
"This line should never run as the override should not exist and the previous line would throw an exception"
|
||||
@@ -392,7 +392,7 @@ add_task(async function test_pref() {
|
||||
try {
|
||||
// Get the addition and subtraction flags for the domain.
|
||||
let overrides = extractLow32Bits(
|
||||
Services.rfp.getFingerprintingOverrides(expect.domain).low
|
||||
Services.rfp.getFingerprintingOverrides(expect.domain)
|
||||
);
|
||||
|
||||
// Verify if the flags are matching to expected values.
|
||||
@@ -447,7 +447,7 @@ add_task(async function test_pref_override_remote_settings() {
|
||||
|
||||
// Get the addition and subtraction flags for the domain.
|
||||
let overrides = extractLow32Bits(
|
||||
Services.rfp.getFingerprintingOverrides("example.org").low
|
||||
Services.rfp.getFingerprintingOverrides("example.org")
|
||||
);
|
||||
|
||||
// Verify if the flags are matching to the pref settings.
|
||||
|
||||
Reference in New Issue
Block a user