diff --git a/dom/performance/Performance.cpp b/dom/performance/Performance.cpp index ea813ce9fd25..10523d7841a4 100644 --- a/dom/performance/Performance.cpp +++ b/dom/performance/Performance.cpp @@ -165,12 +165,6 @@ JSObject* Performance::WrapObject(JSContext* aCx, } void Performance::GetEntries(nsTArray>& aRetval) { - // We return an empty list when 'privacy.resistFingerprinting' is on. - if (nsContentUtils::ShouldResistFingerprinting()) { - aRetval.Clear(); - return; - } - aRetval = mResourceEntries.Clone(); aRetval.AppendElements(mUserEntries); aRetval.Sort(PerformanceEntryComparator()); @@ -178,12 +172,6 @@ void Performance::GetEntries(nsTArray>& aRetval) { void Performance::GetEntriesByType( const nsAString& aEntryType, nsTArray>& aRetval) { - // We return an empty list when 'privacy.resistFingerprinting' is on. - if (nsContentUtils::ShouldResistFingerprinting()) { - aRetval.Clear(); - return; - } - if (aEntryType.EqualsLiteral("resource")) { aRetval = mResourceEntries.Clone(); return; @@ -206,11 +194,6 @@ void Performance::GetEntriesByName( nsTArray>& aRetval) { aRetval.Clear(); - // We return an empty list when 'privacy.resistFingerprinting' is on. - if (nsContentUtils::ShouldResistFingerprinting()) { - return; - } - RefPtr name = NS_Atomize(aName); RefPtr entryType = aEntryType.WasPassed() ? NS_Atomize(aEntryType.Value()) : nullptr; @@ -367,17 +350,7 @@ already_AddRefed Performance::Mark( return nullptr; } - // To avoid fingerprinting in User Timing L2, we didn't add marks to the - // buffer so the user could not get timing data (which can be used to - // fingerprint) from the API. This may no longer be necessary (since - // performance.now() has reduced precision to protect against fingerprinting - // and performance.mark's primary fingerprinting issue is probably this timing - // data) but we need to do a more thorough reanalysis before we remove the - // fingerprinting protection. For now, we preserve the User Timing L2 behavior - // while supporting User Timing L3. - if (!nsContentUtils::ShouldResistFingerprinting()) { - InsertUserEntry(performanceMark); - } + InsertUserEntry(performanceMark); if (profiler_thread_is_being_profiled_for_markers()) { Maybe innerWindowId; @@ -597,19 +570,6 @@ already_AddRefed Performance::Measure( return nullptr; } - // When resisting fingerprinting, we don't add marks to the buffer. Since - // measure relies on relationships between marks in the buffer, this method - // will throw if we look for user-entered marks so we return a dummy measure - // instead of continuing. We could instead return real values for performance - // timing attributes and dummy values for user-entered marks but this adds - // complexity that doesn't seem worth the effort because these fingerprinting - // protections may not longer be necessary (since performance.now() already - // has reduced precision). - if (nsContentUtils::ShouldResistFingerprinting()) { - return do_AddRef(new PerformanceMeasure(GetParentObject(), aName, 0, 0, - JS::NullHandleValue)); - } - // Maybe is more readable than using the union type directly. Maybe options; if (aStartOrMeasureOptions.IsPerformanceMeasureOptions()) { @@ -852,10 +812,6 @@ MOZ_ALWAYS_INLINE bool Performance::CanAddResourceTimingEntry() { void Performance::InsertResourceEntry(PerformanceEntry* aEntry) { MOZ_ASSERT(aEntry); - if (nsContentUtils::ShouldResistFingerprinting()) { - return; - } - QueueEntry(aEntry); /* diff --git a/dom/performance/PerformanceMainThread.cpp b/dom/performance/PerformanceMainThread.cpp index 67f23a02ad05..7f6d4255f8a7 100644 --- a/dom/performance/PerformanceMainThread.cpp +++ b/dom/performance/PerformanceMainThread.cpp @@ -411,8 +411,7 @@ DOMHighResTimeStamp PerformanceMainThread::CreationTime() const { void PerformanceMainThread::CreateNavigationTimingEntry() { MOZ_ASSERT(!mDocEntry, "mDocEntry should be null."); - if (!StaticPrefs::dom_enable_performance_navigation_timing() || - StaticPrefs::privacy_resistFingerprinting()) { + if (!StaticPrefs::dom_enable_performance_navigation_timing()) { return; } @@ -463,12 +462,6 @@ EventCounts* PerformanceMainThread::EventCounts() { void PerformanceMainThread::GetEntries( nsTArray>& aRetval) { - // We return an empty list when 'privacy.resistFingerprinting' is on. - if (nsContentUtils::ShouldResistFingerprinting()) { - aRetval.Clear(); - return; - } - aRetval = mResourceEntries.Clone(); aRetval.AppendElements(mUserEntries); @@ -484,12 +477,6 @@ void PerformanceMainThread::GetEntries( void PerformanceMainThread::GetEntriesByType( const nsAString& aEntryType, nsTArray>& aRetval) { - // We return an empty list when 'privacy.resistFingerprinting' is on. - if (nsContentUtils::ShouldResistFingerprinting()) { - aRetval.Clear(); - return; - } - RefPtr type = NS_Atomize(aEntryType); if (type == nsGkAtoms::navigation) { aRetval.Clear(); @@ -526,12 +513,6 @@ void PerformanceMainThread::GetEntriesByTypeForObserver( void PerformanceMainThread::GetEntriesByName( const nsAString& aName, const Optional& aEntryType, nsTArray>& aRetval) { - // We return an empty list when 'privacy.resistFingerprinting' is on. - if (nsContentUtils::ShouldResistFingerprinting()) { - aRetval.Clear(); - return; - } - Performance::GetEntriesByName(aName, aEntryType, aRetval); if (mFCPTiming && mFCPTiming->GetName()->Equals(aName) && diff --git a/dom/performance/PerformanceNavigationTiming.cpp b/dom/performance/PerformanceNavigationTiming.cpp index b379d8111c37..909919624a1f 100644 --- a/dom/performance/PerformanceNavigationTiming.cpp +++ b/dom/performance/PerformanceNavigationTiming.cpp @@ -152,6 +152,5 @@ void PerformanceNavigationTiming::UpdatePropertiesFromHttpChannel( } bool PerformanceNavigationTiming::Enabled(JSContext* aCx, JSObject* aGlobal) { - return (StaticPrefs::dom_enable_performance_navigation_timing() && - !StaticPrefs::privacy_resistFingerprinting()); + return StaticPrefs::dom_enable_performance_navigation_timing(); } diff --git a/dom/performance/PerformanceTiming.cpp b/dom/performance/PerformanceTiming.cpp index ea1205f89f77..4f153e8f0789 100644 --- a/dom/performance/PerformanceTiming.cpp +++ b/dom/performance/PerformanceTiming.cpp @@ -112,8 +112,7 @@ PerformanceTimingData::PerformanceTimingData(nsITimedChannel* aChannel, mInitialized = !!aChannel; mZeroTime = aZeroTime; - if (!StaticPrefs::dom_enable_performance() || - nsContentUtils::ShouldResistFingerprinting()) { + if (!StaticPrefs::dom_enable_performance()) { mZeroTime = 0; } @@ -338,8 +337,7 @@ bool PerformanceTimingData::CheckAllowedOrigin(nsIHttpChannel* aResourceChannel, } uint8_t PerformanceTimingData::GetRedirectCount() const { - if (!StaticPrefs::dom_enable_performance() || !IsInitialized() || - nsContentUtils::ShouldResistFingerprinting()) { + if (!StaticPrefs::dom_enable_performance() || !IsInitialized()) { return 0; } if (!mAllRedirectsSameOrigin) { @@ -350,8 +348,7 @@ uint8_t PerformanceTimingData::GetRedirectCount() const { bool PerformanceTimingData::ShouldReportCrossOriginRedirect( bool aEnsureSameOriginAndIgnoreTAO) const { - if (!StaticPrefs::dom_enable_performance() || !IsInitialized() || - nsContentUtils::ShouldResistFingerprinting()) { + if (!StaticPrefs::dom_enable_performance() || !IsInitialized()) { return false; }