author | Tom Ritter <tom@mozilla.com> |
Fri, 23 Aug 2019 07:33:48 +0000 | |
changeset 489593 | 79f74b10e771b8a1cdb8a12ee25e962423a52829 |
parent 489592 | bcf1874cde5435ef9ca8503b3319c3ead7740f5a |
child 489594 | a7a5fdf0f2cb673f06d71a801cdaba9209943069 |
push id | 93465 |
push user | tritter@mozilla.com |
push date | Fri, 23 Aug 2019 13:13:49 +0000 |
treeherder | autoland@a7a5fdf0f2cb [default view] [failures only] |
perfherder | [talos] [build metrics] [platform microbench] (compared to previous push) |
reviewers | timhuang |
bugs | 1575924 |
milestone | 70.0a1 |
first release with | nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
|
last release without | nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
|
toolkit/components/resistfingerprinting/nsRFPService.cpp | file | annotate | diff | comparison | revisions |
--- a/toolkit/components/resistfingerprinting/nsRFPService.cpp +++ b/toolkit/components/resistfingerprinting/nsRFPService.cpp @@ -529,17 +529,18 @@ double nsRFPService::ReduceTimePrecision // that comparing two clamped values that should be related by a constant // (e.g. 10s) that are across the zero barrier will no longer work. We need to // round consistently towards positive infinity or negative infinity (we chose // negative.) This can't be done with a truncation, it must be done with // floor. long long clamped = floor(double(timeAsInt) / resolutionAsInt) * resolutionAsInt; - long long midpoint = 0, clampedAndJittered = clamped; + long long midpoint = 0; + long long clampedAndJittered = clamped; if (!unconditionalClamping && StaticPrefs::privacy_resistFingerprinting_reduceTimerPrecision_jitter()) { if (!NS_FAILED(RandomMidpoint(clamped, resolutionAsInt, aContextMixin, &midpoint)) && timeAsInt >= clamped + midpoint) { clampedAndJittered += resolutionAsInt; } } @@ -620,17 +621,17 @@ uint32_t nsRFPService::GetSpoofedDropped // report a zero dropped rate for this case. if (targetRes >= aWidth * aHeight) { return 0; } double precision = TimerResolution() / 1000 / 1000; double time = floor(aTime / precision) * precision; // Bound the dropped ratio from 0 to 100. - uint32_t boundedDroppedRatio = min(kVideoDroppedRatio, 100u); + uint32_t boundedDroppedRatio = min(kVideoDroppedRatio, 100U); return NSToIntFloor(time * kVideoFramesPerSec * (boundedDroppedRatio / 100.0)); } /* static */ uint32_t nsRFPService::GetSpoofedPresentedFrames(double aTime, uint32_t aWidth, uint32_t aHeight) { @@ -641,17 +642,17 @@ uint32_t nsRFPService::GetSpoofedPresent // case, there will be no dropped frames, so we report total frames directly. if (targetRes >= aWidth * aHeight) { return GetSpoofedTotalFrames(aTime); } double precision = TimerResolution() / 1000 / 1000; double time = floor(aTime / precision) * precision; // Bound the dropped ratio from 0 to 100. - uint32_t boundedDroppedRatio = min(kVideoDroppedRatio, 100u); + uint32_t boundedDroppedRatio = min(kVideoDroppedRatio, 100U); return NSToIntFloor(time * kVideoFramesPerSec * ((100 - boundedDroppedRatio) / 100.0)); } static uint32_t GetSpoofedVersion() { // If we can't get the current Firefox version, use a hard-coded ESR version. const uint32_t kKnownEsrVersion = 60;