TrackingDBService previously only wrote to protections.sqlite when a
WindowGlobalParent was destroyed, so long-lived top-level tabs never
contributed their blocking events until the tab closed. Consumers like the
Protection Dashboard and milestone messaging saw stale data.
This change adds a flush-on-query barrier: before each read, TrackingDBService
forces every live top-level WindowGlobalParent to flush its in-memory log
to the database, then awaits the pending DeferredTask writes.
To keep repeated flushes from double-counting against the daily aggregated
counters, ContentBlockingLog::Stringify() gains a delta mode that emits
only entries added since the last MarkAsReported() call, and ReportLog()
skips the IPC round-trip when the delta is empty.
Gated behind browser.contentblocking.database.flushOnQuery.enabled (default
true). Preserves the existing private-browsing, out-of-process, and
top-level-content gates by routing both the teardown and query-time flushes
through a shared WindowGlobalParent::MaybeReportContentBlockingLog helper.
Differential Revision: https://phabricator.services.mozilla.com/D295196
This reverts commit eb884a9f65.
Revert "Bug 2020608 - Part 16: Use std::bit_ceil for RoundUpPow2. r=sergesanspaille"
This reverts commit 35a310aa8a.
Revert "Bug 2020608 - Part 15: Require unsigned integral types for CeilingLog2 and FindMostSignificantBit. r=sergesanspaille,nbp"
This reverts commit f682901ca2.
Revert "Bug 2020608 - Part 14: Remove mozilla::IsPowerOfTwo. r=sergesanspaille"
This reverts commit b998e4bd39.
Revert "Bug 2020608 - Part 13: Replace IsPowerOfTwo with std::has_single_bit in js/. r=sergesanspaille"
This reverts commit 00db5e1f32.
Revert "Bug 2020608 - Part 12: Replace IsPowerOfTwo with std::has_single_bit outside of js/. r=sergesanspaille,profiler-reviewers,win-reviewers,gstoll,canaltinova"
This reverts commit cec056f5d6.
Revert "Bug 2020608 - Part 11: Simplify PowerOfTwo. r=sergesanspaille,profiler-reviewers,canaltinova"
This reverts commit a2ee5b9053.
Revert "Bug 2020608 - Part 10: Prefer std::bit_width in MathAlgorithms.h. r=sergesanspaille"
This reverts commit 89d966bb97.
Revert "Bug 2020608 - Part 9: Prefer std::bit_width instead of std::countl_zero in js/src. r=sergesanspaille"
This reverts commit da9a43075a.
Revert "Bug 2020608 - Part 8: Replace CountTrailingZeroes with std::countr_zero. r=sergesanspaille"
This reverts commit d77ca273cb.
Revert "Bug 2020608 - Part 7: Replace CountLeadingZeroes32 with std::countl_zero or std::countl_one. r=sergesanspaille,nbp,profiler-reviewers,canaltinova"
This reverts commit 94929ae729.
Revert "Bug 2020608 - Part 6: Replace CountLeadingZeroes64 with std::countl_zero. r=sergesanspaille,profiler-reviewers,canaltinova"
This reverts commit 9b428168df.
Revert "Bug 2020608 - Part 5: Replace CountTrailingZeroes32 with std::countr_zero. r=sergesanspaille,manuel"
This reverts commit d3e77036b2.
Revert "Bug 2020608 - Part 4: Replace CountTrailingZeroes64 with std::countr_zero or std::countr_one. r=sergesanspaille"
This reverts commit 6a7bcee10e.
Revert "Bug 2020608 - Part 3: Replace CountPopulation32 with std::popcount. r=sergesanspaille"
This reverts commit e7b204177b.
Revert "Bug 2020608 - Part 2: Replace CountPopulation64 with std::popcount. r=sergesanspaille"
This reverts commit 1d6f98a622.
Revert "Bug 2020608 - Part 1: Add <bit> C++20 definitions to std.py. r=sergesanspaille"
This reverts commit 3ee4c6dcab.
We were also incrementing a metric multiple times if a fingerprinter
alias or known text was seen multiple times. This in theory would
tell us if a technique/script was used on a page multiple times
but in practice we had no reliable denominator because of the multiple
counting, so now we only record each possible combination once per page
resulting in a stable denominator.
Differential Revision: https://phabricator.services.mozilla.com/D279763
We were incrementing the telemetry metric once for the combined
source bitmask, and then once more for each individual bit. This
made it impossible to sum up the total rate of events for a single-bit
source because it was double counting.
Differential Revision: https://phabricator.services.mozilla.com/D279762
We were also incrementing a metric multiple times if a fingerprinter
alias or known text was seen multiple times. This in theory would
tell us if a technique/script was used on a page multiple times
but in practice we had no reliable denominator because of the multiple
counting, so now we only record each possible combination once per page
resulting in a stable denominator.
Differential Revision: https://phabricator.services.mozilla.com/D279763
We were incrementing the telemetry metric once for the combined
source bitmask, and then once more for each individual bit. This
made it impossible to sum up the total rate of events for a single-bit
source because it was double counting.
Differential Revision: https://phabricator.services.mozilla.com/D279762
Based on the fact that no other reporting mechanism cares about
the DATA_RECEIVED flag, and that it eliminates about 75% of the
reports we would have received, remove this argument and do not
change any behavior based on it
Differential Revision: https://phabricator.services.mozilla.com/D274959
Presently we use CheckSuspiciousFingerprintingActivity to see
if the number of fingerprinting activities exceed a theshold
and if so, we indicate that an entry has suspicious fingerprinting.
That threshold is 1. And we don't have any plans to adjust it.
So we can just remove the check altogether: if that function is
called, it is called immediately after creating or finding a log
of the two relevant types: Canvas or Font fingerprinting. So it
will _always_ return true.
SKIP_BMO_CHECK
Differential Revision: https://phabricator.services.mozilla.com/D273659
This reverts commit 7f3efcc656.
Revert "Bug 1873716: Add utilities for identifying canvas fingerprinters in an automated fashion (crawling) r=timhuang"
This reverts commit 0ca707cca5.
Revert "Bug 1873716: Remove the 'shouldReport' parameter r=timhuang"
This reverts commit 98b91beb72.
Revert "Bug 1873716: Update content blocking tests r=timhuang"
This reverts commit 65643858cf.
Revert "Bug 1873716: Handle about:blank iframes that do fingerprinting r=timhuang"
This reverts commit f876fc136a.
Revert "Bug 1873716: Update the heuristics used to identify different fingerprinters r=timhuang"
This reverts commit 76464d0857.
Revert "Bug 1873716: Adding more recording sites r=timhuang"
This reverts commit c83fe48d8f.
Revert "Bug 1873716: Finally change how we report telemetry r=timhuang"
This reverts commit 39accc7ebd.
Revert "Bug 1873716: Record (and separate activity) by source r=timhuang"
This reverts commit a59040a6b0.
Revert "Bug 1873716: Switch to using a bitmask for known text r=timhuang"
This reverts commit a66fab0931.
Revert "Bug 1873716: Move the identifier of a Fingerprinter from AntiTracking to RFP r=timhuang"
This reverts commit 8c90d9ae56.
Revert "Bug 1873716: Change the plumbing to use a CanvasFingerprintingEvent r=timhuang"
This reverts commit 34a426c6e3.
Revert "Bug 1873716: Create two new canvas fingerprinting metrics for the improved telemetry design r=timhuang"
This reverts commit b0fc603170.
Revert "Bug 1873716: Simplify the fingerprinting content blocking log logic r=timhuang"
This reverts commit 6f17ec54eb.
Based on the fact that no other reporting mechanism cares about
the DATA_RECEIVED flag, and that it eliminates about 75% of the
reports we would have received, remove this argument and do not
change any behavior based on it
Differential Revision: https://phabricator.services.mozilla.com/D274959
Presently we use CheckSuspiciousFingerprintingActivity to see
if the number of fingerprinting activities exceed a theshold
and if so, we indicate that an entry has suspicious fingerprinting.
That threshold is 1. And we don't have any plans to adjust it.
So we can just remove the check altogether: if that function is
called, it is called immediately after creating or finding a log
of the two relevant types: Canvas or Font fingerprinting. So it
will _always_ return true.
SKIP_BMO_CHECK
Differential Revision: https://phabricator.services.mozilla.com/D273659
It is replaced by a standard-conforming cast to (void) which is
understood the same by the compiler.
In some cases this could be replaced by `[[maybe_unused]]` but for
expression whose value is ignored, this requires storing to a temporary
variable first, so not going that way.
One notable change is that marking an object of type already_AddRefed as
unused used to implicitly leak memory. This is now made explicit.
Most of the heavy lifting was done through:
$ git grep -l '\<Unused\> <<' | xargs sed -i -e 's/Unused << /(void)/g'
$ git grep -l mozilla/Unused.h | xargs sed -i -e '/mozilla\/Unused.h/ d'
Differential Revision: https://phabricator.services.mozilla.com/D268706
It is replaced by a standard-conforming cast to (void) which is
understood the same by the compiler.
In some cases this could be replaced by `[[maybe_unused]]` but for
expression whose value is ignored, this requires storing to a temporary
variable first, so not going that way.
One notable change is that marking an object of type already_AddRefed as
unused used to implicitly leak memory. This is now made explicit.
Most of the heavy lifting was done through:
$ git grep -l '\<Unused\> <<' | xargs sed -i -e 's/Unused << /(void)/g'
$ git grep -l mozilla/Unused.h | xargs sed -i -e '/mozilla\/Unused.h/ d'
Differential Revision: https://phabricator.services.mozilla.com/D268706
It is replaced by a standard-conforming cast to (void) which is
understood the same by the compiler.
In some cases this could be replaced by `[[maybe_unused]]` but for
expression whose value is ignored, this requires storing to a temporary
variable first, so not going that way.
One notable change is that marking an object of type already_AddRefed as
unused used to implicitly leak memory. This is now made explicit.
Most of the heavy lifting was done through:
$ git grep -l '\<Unused\> <<' | xargs sed -i -e 's/Unused << /(void)/g'
$ git grep -l mozilla/Unused.h | xargs sed -i -e '/mozilla\/Unused.h/ d'
Differential Revision: https://phabricator.services.mozilla.com/D268706
It is replaced by a standard-conforming cast to (void) which is
understood the same by the compiler.
In some cases this could be replaced by `[[maybe_unused]]` but for
expression whose value is ignored, this requires storing to a temporary
variable first, so not going that way.
One notable change is that marking an object of type already_AddRefed as
unused used to implicitly leak memory. This is now made explicit.
Most of the heavy lifting was done through:
$ git grep -l '\<Unused\> <<' | xargs sed -i -e 's/Unused << /(void)/g'
$ git grep -l mozilla/Unused.h | xargs sed -i -e '/mozilla\/Unused.h/ d'
Differential Revision: https://phabricator.services.mozilla.com/D268706
To show the trackers who access partitioned cookies, we need to notify
the STATE_COOKIES_PARTITIONED_TRACKER content blocking event.
The patch changes the cookie service to nofity when accessing the
partitioned tracker cookies. And replace the
STATE_COOKIES_LOADED_TRACKER and
STATE_COOKIES_LOADED_SOCIALTRACKER events with the
STATE_COOKIES_PARTITIONED_TRACKER for the ContentBlockingNotifier.
Differential Revision: https://phabricator.services.mozilla.com/D229330
To record whether we have detected suspicious fingerprinting activities
to the ContentBlockingLog, we introduce a new ContentBlockingLog event
called STATE_BLOCKED_SUSPICIOUS_FINGERPRINTING.
Whenever a fingerprinting content blocking event gets recorded under an
origin, we check if this origin is conducting suspicious fingerprinting
activites. Then, we store this fact under the origin entry and notify
the STATE_BLOCKED_SUSPICIOUS_FINGERPRINTING event to indicate that there
is a suspicous fingerprinitng activity happening.
I need to move ContentBlockingLog::RecordLogInternal() from header to
cpp file to avoid include file dependency issue.
Differential Revision: https://phabricator.services.mozilla.com/D193454